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