Last change
on this file since 134 was
113,
checked in by rosiere, 15 years ago
|
1) Add modelsim simulation systemC
2) Modelsim cosimulation systemC / VHDL is not finish !!!! (cf execute_queue and write_unit)
3) Add multi architecture
5) Add template for comparator, multiplier and divider
6) Change Message
Warning) Various test macro have change, many selftest can't compile
|
-
Property svn:keywords set to
Id
|
File size:
1.4 KB
|
Rev | Line | |
---|
[41] | 1 | #ifdef VHDL_TESTBENCH |
---|
| 2 | /* |
---|
| 3 | * $Id: Signal_testbench_body.cpp 113 2009-04-14 18:39:12Z rosiere $ |
---|
| 4 | * |
---|
| 5 | * [ Description ] |
---|
| 6 | * |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "Behavioural/include/Signal.h" |
---|
| 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | |
---|
| 14 | void Signal::testbench_body (Vhdl * & vhdl, |
---|
[75] | 15 | std::string counter_name, |
---|
| 16 | std::string reset_name ) |
---|
[41] | 17 | { |
---|
| 18 | log_printf(FUNC,Behavioural,"testbench_body","Begin"); |
---|
| 19 | |
---|
| 20 | // _list_value is empty if we don't trace |
---|
| 21 | |
---|
[42] | 22 | if ((_presence_port == PORT_VHDL_YES_TESTBENCH_YES) or |
---|
| 23 | (_presence_port == PORT_VHDL_NO_TESTBENCH_YES )) |
---|
| 24 | if (_list_value->empty()== false) |
---|
| 25 | { |
---|
[75] | 26 | std::string separator; |
---|
[113] | 27 | if (get_size() == 1) |
---|
[42] | 28 | separator = "\'"; |
---|
| 29 | else |
---|
| 30 | separator = "\""; |
---|
| 31 | |
---|
[75] | 32 | std::string signame = (_direction==OUT)?(_name+"_test"):_name; |
---|
[42] | 33 | |
---|
| 34 | vhdl->set_body (""); |
---|
| 35 | vhdl->set_body ("with "+counter_name+" select"); |
---|
| 36 | vhdl->set_body ("\t"+signame+" <="); |
---|
| 37 | |
---|
| 38 | uint32_t cpt = 0; |
---|
[75] | 39 | std::list<std::string>::iterator i = _list_value->begin(); |
---|
[42] | 40 | |
---|
| 41 | while (i != _list_value->end()) |
---|
| 42 | { |
---|
[75] | 43 | std::list<std::string>::iterator j = i; |
---|
[42] | 44 | |
---|
| 45 | ++i; |
---|
| 46 | |
---|
[41] | 47 | vhdl->set_body ("\t"+separator+*j+separator+" when "+toString(cpt++)+","); |
---|
[42] | 48 | } |
---|
| 49 | |
---|
[113] | 50 | if (get_size() == 1) |
---|
[42] | 51 | vhdl->set_body ("\t'0' when others;"); |
---|
| 52 | else |
---|
| 53 | vhdl->set_body ("\t(others => '0') when others;"); |
---|
| 54 | } |
---|
| 55 | |
---|
[41] | 56 | log_printf(FUNC,Behavioural,"testbench_body","End"); |
---|
| 57 | }; |
---|
| 58 | |
---|
| 59 | }; // end namespace behavioural |
---|
| 60 | }; // end namespace morpheo |
---|
| 61 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.