Last change
on this file since 41 was
41,
checked in by rosiere, 17 years ago
|
Vhdl_Testbench : Modification du testbench. Maintenant complétement encapsuler dans la classe "Interfaces".
Suppression de la class Vhdl_Testbench dans un avenir proche :D
Suppression du répertoire Configuration.old
|
File size:
1.2 KB
|
Rev | Line | |
---|
[41] | 1 | #ifdef VHDL_TESTBENCH |
---|
| 2 | /* |
---|
| 3 | * $Id$ |
---|
| 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, |
---|
| 15 | string counter_name) |
---|
| 16 | { |
---|
| 17 | log_printf(FUNC,Behavioural,"testbench_body","Begin"); |
---|
| 18 | |
---|
| 19 | // _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 | else |
---|
| 26 | separator = "\""; |
---|
| 27 | |
---|
| 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()) |
---|
| 44 | 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 | |
---|
| 50 | log_printf(FUNC,Behavioural,"testbench_body","End"); |
---|
| 51 | }; |
---|
| 52 | |
---|
| 53 | }; // end namespace behavioural |
---|
| 54 | }; // end namespace morpheo |
---|
| 55 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.