Last change
on this file since 42 was
42,
checked in by rosiere, 17 years ago
|
Modification des classes d'encapsulation des interfaces :
- gère les signaux à écrire dans le vhdl
- les traces pour le testbench
- la génération des vhdl structurelles
-> test sur la Pattern History Table
|
File size:
1.4 KB
|
Rev | Line | |
---|
[29] | 1 | /* |
---|
| 2 | * $Id$ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/include/Interface.h" |
---|
| 9 | |
---|
| 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | |
---|
| 14 | string Interface::get_signal (void) |
---|
| 15 | { |
---|
[38] | 16 | log_printf(FUNC,Behavioural,"get_signal","Begin"); |
---|
[40] | 17 | |
---|
[29] | 18 | uint32_t depth = 0; |
---|
| 19 | string separator = ",\n"; |
---|
| 20 | bool last_separator = false; |
---|
| 21 | |
---|
| 22 | |
---|
[38] | 23 | list<Signal*>::iterator i = _list_signal->begin(); |
---|
[31] | 24 | bool empty = _list_signal->empty(); |
---|
[29] | 25 | |
---|
| 26 | string tab = string(depth,'\t'); |
---|
| 27 | ostringstream text; |
---|
| 28 | |
---|
| 29 | if (not empty) |
---|
| 30 | { |
---|
| 31 | // First |
---|
[31] | 32 | if (i != _list_signal->end()) |
---|
[29] | 33 | { |
---|
[38] | 34 | text << tab << **i; |
---|
[29] | 35 | ++i; |
---|
| 36 | } |
---|
| 37 | |
---|
[31] | 38 | while (i != _list_signal->end()) |
---|
[29] | 39 | { |
---|
| 40 | text << separator; |
---|
[38] | 41 | text << tab << **i; |
---|
[29] | 42 | ++i; |
---|
| 43 | } |
---|
| 44 | if (last_separator) |
---|
| 45 | text << separator; |
---|
| 46 | } |
---|
| 47 | |
---|
[38] | 48 | log_printf(FUNC,Behavioural,"get_signal","End"); |
---|
| 49 | |
---|
[29] | 50 | return text.str(); |
---|
| 51 | }; |
---|
| 52 | |
---|
[41] | 53 | #ifdef VHDL |
---|
| 54 | # ifdef VHDL_TESTBENCH |
---|
| 55 | void Interface::get_signal (list<string> * & list_signal) |
---|
| 56 | { |
---|
| 57 | if (not _list_signal->empty()) |
---|
| 58 | { |
---|
| 59 | list<Signal*>::iterator i = _list_signal->begin(); |
---|
| 60 | |
---|
| 61 | while (i != _list_signal->end()) |
---|
| 62 | { |
---|
| 63 | (*i)->get_name_vhdl (list_signal); |
---|
| 64 | ++i; |
---|
| 65 | } |
---|
| 66 | } |
---|
| 67 | }; |
---|
| 68 | # endif |
---|
| 69 | #endif |
---|
| 70 | |
---|
[42] | 71 | list<Signal *> * Interface::get_signal_list (void) |
---|
| 72 | { |
---|
| 73 | return _list_signal; |
---|
| 74 | } |
---|
| 75 | |
---|
[29] | 76 | }; // end namespace behavioural |
---|
| 77 | }; // end namespace morpheo |
---|
Note: See
TracBrowser
for help on using the repository browser.