[29] | 1 | /* |
---|
| 2 | * $Id: Interface.cpp 113 2009-04-14 18:39:12Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/include/Interface.h" |
---|
| 9 | |
---|
| 10 | namespace morpheo { |
---|
| 11 | namespace behavioural { |
---|
| 12 | |
---|
[75] | 13 | Interface::Interface (std::string name |
---|
[42] | 14 | #ifdef POSITION |
---|
| 15 | ,direction_t direction |
---|
| 16 | ,localisation_t localisation |
---|
| 17 | #endif |
---|
[57] | 18 | ,Tusage_t usage |
---|
[42] | 19 | ): |
---|
| 20 | _name (name ) |
---|
| 21 | #ifdef POSITION |
---|
| 22 | ,_direction (direction ) |
---|
| 23 | ,_localisation (localisation) |
---|
| 24 | #endif |
---|
[57] | 25 | ,_usage (usage) |
---|
[29] | 26 | { |
---|
[38] | 27 | log_printf(FUNC,Behavioural,"Interface","Begin"); |
---|
| 28 | |
---|
[75] | 29 | _list_signal = new (std::list<Signal*>); |
---|
[38] | 30 | |
---|
[31] | 31 | #ifdef POSITION |
---|
[42] | 32 | _comment = ""; |
---|
[40] | 33 | _is_map = false; |
---|
| 34 | _entity_map = NULL; |
---|
| 35 | _interface_map = NULL; |
---|
[31] | 36 | #endif |
---|
[38] | 37 | |
---|
[40] | 38 | #ifdef VHDL_TESTBENCH |
---|
[41] | 39 | _nb_cycle = 0; |
---|
[40] | 40 | #endif |
---|
| 41 | |
---|
[38] | 42 | log_printf(FUNC,Behavioural,"Interface","End"); |
---|
[29] | 43 | }; |
---|
[31] | 44 | |
---|
| 45 | Interface::Interface (const Interface & interface): |
---|
[42] | 46 | _name (interface._name ) |
---|
| 47 | #ifdef POSITION |
---|
| 48 | ,_direction (interface._direction ) |
---|
| 49 | ,_localisation (interface._localisation) |
---|
| 50 | #endif |
---|
[57] | 51 | ,_usage (interface._usage) |
---|
[31] | 52 | { |
---|
[38] | 53 | log_printf(FUNC,Behavioural,"Interface (copy)","Begin"); |
---|
| 54 | _list_signal = interface._list_signal; |
---|
[31] | 55 | #ifdef POSITION |
---|
[42] | 56 | _comment = interface._comment ; |
---|
[38] | 57 | _is_map = interface._is_map ; |
---|
| 58 | _entity_map = interface._entity_map ; |
---|
| 59 | _interface_map = interface._interface_map; |
---|
[31] | 60 | #endif |
---|
[40] | 61 | #ifdef VHDL_TESTBENCH |
---|
[41] | 62 | _nb_cycle = interface._nb_cycle; |
---|
[40] | 63 | #endif |
---|
| 64 | |
---|
[38] | 65 | log_printf(FUNC,Behavioural,"Interface (copy)","End"); |
---|
[31] | 66 | }; |
---|
[29] | 67 | |
---|
| 68 | Interface::~Interface () |
---|
| 69 | { |
---|
[38] | 70 | log_printf(FUNC,Behavioural,"~Interface","Begin"); |
---|
| 71 | |
---|
[112] | 72 | for (std::list<Signal*>::iterator it = _list_signal->begin(); |
---|
| 73 | it != _list_signal->end(); |
---|
| 74 | ++it) |
---|
[113] | 75 | { |
---|
| 76 | if ((_usage & USE_SYSTEMC) and |
---|
| 77 | ((*it)->get_direction() == INTERNAL)) |
---|
| 78 | delete (*it)->get_sc_signal(); |
---|
| 79 | delete (*it); |
---|
| 80 | } |
---|
[112] | 81 | |
---|
[31] | 82 | delete _list_signal; |
---|
[40] | 83 | |
---|
[38] | 84 | log_printf(FUNC,Behavioural,"~Interface","End"); |
---|
[29] | 85 | }; |
---|
| 86 | |
---|
| 87 | |
---|
| 88 | }; // end namespace behavioural |
---|
| 89 | }; // end namespace morpheo |
---|