|
degate 0.1.1
|
#include <VerilogTBCodeTemplateGenerator.h>#include <boost/format.hpp>#include <boost/foreach.hpp>#include <boost/algorithm/string/join.hpp>Go to the source code of this file.
Functions | |
| bool | increment (std::vector< int > &assignment, size_t pos=0) |
| Recursive implementation of an increment function. | |
| bool increment | ( | std::vector< int > & | assignment, |
| size_t | pos = 0 |
||
| ) |
Recursive implementation of an increment function.
Starts with MSB and increments until position right to LSB is reached.
Definition at line 150 of file VerilogTBCodeTemplateGenerator.cc.
Referenced by degate::VerilogTBCodeTemplateGenerator::generate_all_assignments().
{
if(assignment.size() == 0) return false;
// toggle lsb
if(assignment[pos] == 0) {
assignment[pos] = 1;
return true;
}
else {
assignment[pos] = 0;
if(pos + 1 == assignment.size()) return false;
else return increment(assignment, pos + 1);
}
}

1.7.4