Last change
on this file since 39 was
38,
checked in by rosiere, 17 years ago
|
Interface et vhdl_testbench : l'appel aux fonction add_input et add_ouput est maintenant réalisé par la classe Interface (et autre).
2 remarques :
- tester avec des sous composants (en particulier les sorties d'un est directement relié au sortie d'un autre)
- Signal_testbench.cpp -> l'optimisé (par exemple pointeur de fonction afin d'éviter le test et le switch)
|
File size:
1.0 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"); |
---|
[29] | 17 | uint32_t depth = 0; |
---|
| 18 | string separator = ",\n"; |
---|
| 19 | bool last_separator = false; |
---|
| 20 | |
---|
| 21 | |
---|
[38] | 22 | list<Signal*>::iterator i = _list_signal->begin(); |
---|
[31] | 23 | bool empty = _list_signal->empty(); |
---|
[29] | 24 | |
---|
| 25 | string tab = string(depth,'\t'); |
---|
| 26 | ostringstream text; |
---|
| 27 | |
---|
| 28 | if (not empty) |
---|
| 29 | { |
---|
| 30 | // First |
---|
[31] | 31 | if (i != _list_signal->end()) |
---|
[29] | 32 | { |
---|
[38] | 33 | text << tab << **i; |
---|
[29] | 34 | ++i; |
---|
| 35 | } |
---|
| 36 | |
---|
[31] | 37 | while (i != _list_signal->end()) |
---|
[29] | 38 | { |
---|
| 39 | text << separator; |
---|
[38] | 40 | text << tab << **i; |
---|
[29] | 41 | ++i; |
---|
| 42 | } |
---|
| 43 | if (last_separator) |
---|
| 44 | text << separator; |
---|
| 45 | } |
---|
| 46 | |
---|
[38] | 47 | log_printf(FUNC,Behavioural,"get_signal","End"); |
---|
| 48 | |
---|
[29] | 49 | return text.str(); |
---|
| 50 | }; |
---|
| 51 | |
---|
| 52 | }; // end namespace behavioural |
---|
| 53 | }; // end namespace morpheo |
---|
Note: See
TracBrowser
for help on using the repository browser.