Rev | Line | |
---|
[2] | 1 | #ifdef VHDL_TESTBENCH |
---|
| 2 | |
---|
| 3 | /* |
---|
| 4 | * $Id$ |
---|
| 5 | * |
---|
| 6 | * [ Description ] |
---|
| 7 | * |
---|
| 8 | */ |
---|
| 9 | |
---|
| 10 | #include "Behavioural/include/Vhdl_Testbench.h" |
---|
| 11 | |
---|
| 12 | #include <sstream> |
---|
| 13 | using namespace std; |
---|
| 14 | |
---|
| 15 | namespace morpheo { |
---|
| 16 | namespace behavioural { |
---|
| 17 | |
---|
| 18 | uint32_t Vhdl_Testbench::get_input (void) |
---|
| 19 | { |
---|
| 20 | list<string>::iterator i = _list_input.begin(); |
---|
| 21 | |
---|
| 22 | uint32_t counter = 0; |
---|
| 23 | |
---|
| 24 | if (i != _list_input.end()) |
---|
| 25 | { |
---|
| 26 | _vhdl->set_body (""); |
---|
| 27 | _vhdl->set_body ("with testbench_counter select"); |
---|
| 28 | _vhdl->set_body ("\ttestbench_input <="); |
---|
| 29 | |
---|
| 30 | while (i != _list_input.end()) |
---|
| 31 | { |
---|
| 32 | list<string>::iterator j = i; |
---|
| 33 | ++i; |
---|
| 34 | |
---|
| 35 | if (i != _list_input.end()) |
---|
| 36 | _vhdl->set_body ("\t\""+*j+"\" when "+toString(counter++)+","); |
---|
| 37 | else |
---|
| 38 | _vhdl->set_body ("\t\""+*j+"\" when others;"); |
---|
| 39 | } |
---|
| 40 | } |
---|
| 41 | |
---|
| 42 | return counter; |
---|
| 43 | }; |
---|
| 44 | |
---|
| 45 | }; // end namespace behavioural |
---|
| 46 | }; // end namespace morpheo |
---|
| 47 | |
---|
| 48 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.