- Timestamp:
- Jul 5, 2007, 5:50:19 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_testbench_body.cpp
r41 r42 13 13 14 14 void Signal::testbench_body (Vhdl * & vhdl, 15 string counter_name) 15 string counter_name, 16 string reset_name ) 16 17 { 17 18 log_printf(FUNC,Behavioural,"testbench_body","Begin"); 18 19 19 20 // _list_value is empty if we don't trace 20 if (_list_value->empty()== false)21 {22 string separator;23 if (_size == 1)24 separator = "\'";25 else26 separator = "\"";27 21 28 string signame = (_direction==OUT)?(_name+"_test"):_name; 29 30 vhdl->set_body (""); 31 vhdl->set_body ("with "+counter_name+" select"); 32 vhdl->set_body ("\t"+signame+" <="); 33 34 uint32_t cpt = 0; 35 list<string>::iterator i = _list_value->begin(); 36 37 while (i != _list_value->end()) 38 { 39 list<string>::iterator j = i; 40 41 ++i; 42 43 if (i != _list_value->end()) 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 { 26 string separator; 27 if (_size == 1) 28 separator = "\'"; 29 else 30 separator = "\""; 31 32 string signame = (_direction==OUT)?(_name+"_test"):_name; 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; 39 list<string>::iterator i = _list_value->begin(); 40 41 while (i != _list_value->end()) 42 { 43 list<string>::iterator j = i; 44 45 ++i; 46 44 47 vhdl->set_body ("\t"+separator+*j+separator+" when "+toString(cpt++)+","); 45 else 46 vhdl->set_body ("\t"+separator+*j+separator+" when others;"); 47 } 48 } 49 48 } 49 50 if (_size == 1) 51 vhdl->set_body ("\t'0' when others;"); 52 else 53 vhdl->set_body ("\t(others => '0') when others;"); 54 } 55 50 56 log_printf(FUNC,Behavioural,"testbench_body","End"); 51 57 };
Note: See TracChangeset
for help on using the changeset viewer.