[41] | 1 | #ifdef VHDL_TESTBENCH |
---|
| 2 | /* |
---|
| 3 | * $Id: Interfaces_testbench_body.cpp 81 2008-04-15 18:40:01Z rosiere $ |
---|
| 4 | * |
---|
| 5 | * [ Description ] |
---|
| 6 | * |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "Behavioural/include/Interfaces.h" |
---|
| 10 | #include "Behavioural/include/Entity.h" |
---|
| 11 | |
---|
| 12 | namespace morpheo { |
---|
| 13 | namespace behavioural { |
---|
| 14 | |
---|
[75] | 15 | std::string Interfaces::testbench_body (Vhdl * & vhdl, |
---|
| 16 | std::string counter_name, |
---|
| 17 | std::string reset_name ) |
---|
[41] | 18 | { |
---|
| 19 | log_printf(FUNC,Behavioural,"testbench_body","Begin"); |
---|
| 20 | |
---|
[75] | 21 | std::string test = "'1'"; |
---|
| 22 | std::string test_name = "test"; |
---|
[41] | 23 | vhdl->set_signal(test_name,1); |
---|
| 24 | |
---|
| 25 | if (_list_interface->empty()== false) |
---|
| 26 | { |
---|
[75] | 27 | std::list<Interface_fifo*>::iterator i = _list_interface->begin(); |
---|
[41] | 28 | |
---|
| 29 | while (i != _list_interface->end()) |
---|
| 30 | { |
---|
[42] | 31 | (*i)->testbench_body(vhdl, counter_name, reset_name); |
---|
[75] | 32 | std::string str = (*i)->testbench_test(vhdl, counter_name, reset_name); |
---|
[41] | 33 | |
---|
| 34 | test += " and "+str; |
---|
| 35 | ++i; |
---|
| 36 | } |
---|
| 37 | } |
---|
| 38 | |
---|
| 39 | vhdl->set_body(""); |
---|
| 40 | vhdl->set_body("------------------------------------------------------"); |
---|
| 41 | vhdl->set_body("-- Test"); |
---|
| 42 | vhdl->set_body("------------------------------------------------------"); |
---|
| 43 | vhdl->set_body(""); |
---|
| 44 | vhdl->set_body(test_name + " <= "+test+";"); |
---|
| 45 | vhdl->set_body(""); |
---|
| 46 | |
---|
| 47 | log_printf(FUNC,Behavioural,"testbench_body","End"); |
---|
| 48 | |
---|
| 49 | return test_name; |
---|
| 50 | }; |
---|
| 51 | |
---|
| 52 | }; // end namespace behavioural |
---|
| 53 | }; // end namespace morpheo |
---|
| 54 | #endif |
---|