1 | /* |
---|
2 | * $Id: Dependency_checking_unit.cpp 81 2008-04-15 18:40:01Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Dependency_checking_unit/include/Dependency_checking_unit.h" |
---|
9 | |
---|
10 | namespace morpheo { |
---|
11 | namespace behavioural { |
---|
12 | namespace core { |
---|
13 | namespace multi_ooo_engine { |
---|
14 | namespace ooo_engine { |
---|
15 | namespace rename_unit { |
---|
16 | namespace register_translation_unit { |
---|
17 | namespace dependency_checking_unit { |
---|
18 | |
---|
19 | |
---|
20 | #undef FUNCTION |
---|
21 | #define FUNCTION "Dependency_checking_unit::Dependency_checking_unit" |
---|
22 | Dependency_checking_unit::Dependency_checking_unit |
---|
23 | ( |
---|
24 | #ifdef SYSTEMC |
---|
25 | sc_module_name name, |
---|
26 | #else |
---|
27 | string name, |
---|
28 | #endif |
---|
29 | #ifdef STATISTICS |
---|
30 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
31 | #endif |
---|
32 | morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::dependency_checking_unit::Parameters * param, |
---|
33 | morpheo::behavioural::Tusage_t usage |
---|
34 | ): |
---|
35 | _name (name) |
---|
36 | ,_param (param) |
---|
37 | ,_usage (usage) |
---|
38 | { |
---|
39 | log_printf(FUNC,Dependency_checking_unit,FUNCTION,"Begin"); |
---|
40 | |
---|
41 | log_printf(INFO,Dependency_checking_unit,FUNCTION,"Allocation"); |
---|
42 | |
---|
43 | allocation ( |
---|
44 | #ifdef STATISTICS |
---|
45 | param_statistics |
---|
46 | #endif |
---|
47 | ); |
---|
48 | |
---|
49 | #ifdef STATISTICS |
---|
50 | if (_usage & USE_STATISTICS) |
---|
51 | { |
---|
52 | log_printf(INFO,Dependency_checking_unit,FUNCTION,"Allocation of statistics"); |
---|
53 | |
---|
54 | statistics_declaration(param_statistics); |
---|
55 | } |
---|
56 | #endif |
---|
57 | |
---|
58 | #ifdef VHDL |
---|
59 | if (_usage & USE_VHDL) |
---|
60 | { |
---|
61 | // generate the vhdl |
---|
62 | log_printf(INFO,Dependency_checking_unit,FUNCTION,"Generate the vhdl"); |
---|
63 | |
---|
64 | vhdl(); |
---|
65 | } |
---|
66 | #endif |
---|
67 | |
---|
68 | #ifdef SYSTEMC |
---|
69 | if (_usage & USE_SYSTEMC) |
---|
70 | { |
---|
71 | # if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
72 | |
---|
73 | log_printf(INFO,Dependency_checking_unit,FUNCTION,"Method - transition"); |
---|
74 | |
---|
75 | SC_METHOD (transition); |
---|
76 | dont_initialize (); |
---|
77 | sensitive << (*(in_CLOCK)).pos(); |
---|
78 | |
---|
79 | # ifdef SYSTEMCASS_SPECIFIC |
---|
80 | // List dependency information |
---|
81 | # endif |
---|
82 | # endif |
---|
83 | |
---|
84 | log_printf(INFO,Dependency_checking_unit,FUNCTION,"Method - genMealy"); |
---|
85 | |
---|
86 | SC_METHOD (genMealy); |
---|
87 | dont_initialize (); |
---|
88 | sensitive << (*(in_CLOCK)).neg(); |
---|
89 | for (uint32_t i=0;i<_param->_nb_inst_insert; i++) |
---|
90 | { |
---|
91 | sensitive // << (*(in_RENAME_IN_VAL [i])) |
---|
92 | // << (*(in_RENAME_OUT_ACK [i])) |
---|
93 | << (*(in_RENAME_IN_READ_RA [i])) |
---|
94 | << (*(in_RENAME_IN_NUM_REG_RA_LOG [i])) |
---|
95 | << (*(in_RENAME_IN_NUM_REG_RA_PHY [i])) |
---|
96 | << (*(in_RENAME_IN_READ_RB [i])) |
---|
97 | << (*(in_RENAME_IN_NUM_REG_RB_LOG [i])) |
---|
98 | << (*(in_RENAME_IN_NUM_REG_RB_PHY [i])) |
---|
99 | << (*(in_RENAME_IN_READ_RC [i])) |
---|
100 | << (*(in_RENAME_IN_NUM_REG_RC_LOG [i])) |
---|
101 | << (*(in_RENAME_IN_NUM_REG_RC_PHY [i])) |
---|
102 | << (*(in_RENAME_IN_WRITE_RD [i])) |
---|
103 | << (*(in_RENAME_IN_NUM_REG_RD_LOG [i])) |
---|
104 | << (*(in_RENAME_IN_NUM_REG_RD_PHY_OLD [i])) |
---|
105 | << (*(in_RENAME_IN_NUM_REG_RD_PHY_NEW [i])) |
---|
106 | << (*(in_RENAME_IN_WRITE_RE [i])) |
---|
107 | << (*(in_RENAME_IN_NUM_REG_RE_LOG [i])) |
---|
108 | << (*(in_RENAME_IN_NUM_REG_RE_PHY_OLD [i])) |
---|
109 | << (*(in_RENAME_IN_NUM_REG_RE_PHY_NEW [i])); |
---|
110 | if (_param->_have_port_front_end_id) |
---|
111 | sensitive << (*(in_RENAME_IN_FRONT_END_ID [i])); |
---|
112 | if (_param->_have_port_context_id) |
---|
113 | sensitive << (*(in_RENAME_IN_CONTEXT_ID [i])); |
---|
114 | } |
---|
115 | |
---|
116 | # ifdef SYSTEMCASS_SPECIFIC |
---|
117 | // List dependency information |
---|
118 | for (uint32_t i=0;i<_param->_nb_inst_insert; i++) |
---|
119 | { |
---|
120 | // (*(out_RENAME_OUT_VAL [i])) (*(in_RENAME_IN_VAL [i])); |
---|
121 | // (*(out_RENAME_IN_ACK [i])) (*(in_RENAME_OUT_ACK [i])); |
---|
122 | if (_param->_have_port_front_end_id) |
---|
123 | (*(out_RENAME_OUT_FRONT_END_ID [i])) (*(in_RENAME_IN_FRONT_END_ID [i])); |
---|
124 | if (_param->_have_port_context_id) |
---|
125 | (*(out_RENAME_OUT_CONTEXT_ID [i])) (*(in_RENAME_IN_CONTEXT_ID [i])); |
---|
126 | (*(out_RENAME_OUT_READ_RA [i])) (*(in_RENAME_IN_READ_RA [i])); |
---|
127 | (*(out_RENAME_OUT_NUM_REG_RA_LOG [i])) (*(in_RENAME_IN_NUM_REG_RA_LOG [i])); |
---|
128 | (*(out_RENAME_OUT_READ_RB [i])) (*(in_RENAME_IN_READ_RB [i])); |
---|
129 | (*(out_RENAME_OUT_NUM_REG_RB_LOG [i])) (*(in_RENAME_IN_NUM_REG_RB_LOG [i])); |
---|
130 | (*(out_RENAME_OUT_READ_RC [i])) (*(in_RENAME_IN_READ_RC [i])); |
---|
131 | (*(out_RENAME_OUT_NUM_REG_RC_LOG [i])) (*(in_RENAME_IN_NUM_REG_RC_LOG [i])); |
---|
132 | (*(out_RENAME_OUT_WRITE_RD [i])) (*(in_RENAME_IN_WRITE_RD [i])); |
---|
133 | (*(out_RENAME_OUT_NUM_REG_RD_LOG [i])) (*(in_RENAME_IN_NUM_REG_RD_LOG [i])); |
---|
134 | (*(out_RENAME_OUT_NUM_REG_RD_PHY_NEW [i])) (*(in_RENAME_IN_NUM_REG_RD_PHY_NEW [i])); |
---|
135 | (*(out_RENAME_OUT_WRITE_RE [i])) (*(in_RENAME_IN_WRITE_RE [i])); |
---|
136 | (*(out_RENAME_OUT_NUM_REG_RE_LOG [i])) (*(in_RENAME_IN_NUM_REG_RE_LOG [i])); |
---|
137 | (*(out_RENAME_OUT_NUM_REG_RE_PHY_NEW [i])) (*(in_RENAME_IN_NUM_REG_RE_PHY_NEW [i])); |
---|
138 | |
---|
139 | (*(out_RENAME_OUT_NUM_REG_RD_PHY_OLD [i])) (*(in_RENAME_IN_NUM_REG_RD_PHY_OLD [i])); |
---|
140 | (*(out_RENAME_OUT_NUM_REG_RD_PHY_OLD [i])) (*(in_RENAME_IN_WRITE_RD [i])); |
---|
141 | (*(out_RENAME_OUT_NUM_REG_RD_PHY_OLD [i])) (*(in_RENAME_IN_NUM_REG_RD_LOG [i])); |
---|
142 | for (int32_t j=i-1; j>=0; j--) |
---|
143 | { |
---|
144 | if (_param->_have_port_front_end_id) |
---|
145 | (*(out_RENAME_OUT_NUM_REG_RD_PHY_OLD [i])) (*(in_RENAME_IN_FRONT_END_ID [j])); |
---|
146 | if (_param->_have_port_context_id) |
---|
147 | (*(out_RENAME_OUT_NUM_REG_RD_PHY_OLD [i])) (*(in_RENAME_IN_CONTEXT_ID [j])); |
---|
148 | (*(out_RENAME_OUT_NUM_REG_RD_PHY_OLD [i])) (*(in_RENAME_IN_WRITE_RD [j])); |
---|
149 | (*(out_RENAME_OUT_NUM_REG_RD_PHY_OLD [i])) (*(in_RENAME_IN_NUM_REG_RD_LOG [j])); |
---|
150 | (*(out_RENAME_OUT_NUM_REG_RD_PHY_OLD [i])) (*(in_RENAME_IN_NUM_REG_RD_PHY_NEW [j])); |
---|
151 | } |
---|
152 | |
---|
153 | (*(out_RENAME_OUT_NUM_REG_RE_PHY_OLD [i])) (*(in_RENAME_IN_NUM_REG_RE_PHY_OLD [i])); |
---|
154 | (*(out_RENAME_OUT_NUM_REG_RE_PHY_OLD [i])) (*(in_RENAME_IN_WRITE_RE [i])); |
---|
155 | (*(out_RENAME_OUT_NUM_REG_RE_PHY_OLD [i])) (*(in_RENAME_IN_NUM_REG_RE_LOG [i])); |
---|
156 | for (int32_t j=i-1; j>=0; j--) |
---|
157 | { |
---|
158 | if (_param->_have_port_front_end_id) |
---|
159 | (*(out_RENAME_OUT_NUM_REG_RE_PHY_OLD [i])) (*(in_RENAME_IN_FRONT_END_ID [j])); |
---|
160 | if (_param->_have_port_context_id) |
---|
161 | (*(out_RENAME_OUT_NUM_REG_RE_PHY_OLD [i])) (*(in_RENAME_IN_CONTEXT_ID [j])); |
---|
162 | (*(out_RENAME_OUT_NUM_REG_RE_PHY_OLD [i])) (*(in_RENAME_IN_WRITE_RE [j])); |
---|
163 | (*(out_RENAME_OUT_NUM_REG_RE_PHY_OLD [i])) (*(in_RENAME_IN_NUM_REG_RE_LOG [j])); |
---|
164 | (*(out_RENAME_OUT_NUM_REG_RE_PHY_OLD [i])) (*(in_RENAME_IN_NUM_REG_RE_PHY_NEW [j])); |
---|
165 | } |
---|
166 | |
---|
167 | (*(out_RENAME_OUT_NUM_REG_RA_PHY [i])) (*(in_RENAME_IN_NUM_REG_RA_PHY [i])); |
---|
168 | (*(out_RENAME_OUT_NUM_REG_RA_PHY [i])) (*(in_RENAME_IN_READ_RA [i])); |
---|
169 | (*(out_RENAME_OUT_NUM_REG_RA_PHY [i])) (*(in_RENAME_IN_NUM_REG_RA_LOG [i])); |
---|
170 | for (int32_t j=i-1; j>=0; j--) |
---|
171 | { |
---|
172 | if (_param->_have_port_front_end_id) |
---|
173 | (*(out_RENAME_OUT_NUM_REG_RA_PHY [i])) (*(in_RENAME_IN_FRONT_END_ID [j])); |
---|
174 | if (_param->_have_port_context_id) |
---|
175 | (*(out_RENAME_OUT_NUM_REG_RA_PHY [i])) (*(in_RENAME_IN_CONTEXT_ID [j])); |
---|
176 | (*(out_RENAME_OUT_NUM_REG_RA_PHY [i])) (*(in_RENAME_IN_WRITE_RD [j])); |
---|
177 | (*(out_RENAME_OUT_NUM_REG_RA_PHY [i])) (*(in_RENAME_IN_NUM_REG_RD_LOG [j])); |
---|
178 | (*(out_RENAME_OUT_NUM_REG_RA_PHY [i])) (*(in_RENAME_IN_NUM_REG_RD_PHY_NEW [j])); |
---|
179 | } |
---|
180 | |
---|
181 | (*(out_RENAME_OUT_NUM_REG_RB_PHY [i])) (*(in_RENAME_IN_NUM_REG_RB_PHY [i])); |
---|
182 | (*(out_RENAME_OUT_NUM_REG_RB_PHY [i])) (*(in_RENAME_IN_READ_RB [i])); |
---|
183 | (*(out_RENAME_OUT_NUM_REG_RB_PHY [i])) (*(in_RENAME_IN_NUM_REG_RB_LOG [i])); |
---|
184 | for (int32_t j=i-1; j>=0; j--) |
---|
185 | { |
---|
186 | if (_param->_have_port_front_end_id) |
---|
187 | (*(out_RENAME_OUT_NUM_REG_RB_PHY [i])) (*(in_RENAME_IN_FRONT_END_ID [j])); |
---|
188 | if (_param->_have_port_context_id) |
---|
189 | (*(out_RENAME_OUT_NUM_REG_RB_PHY [i])) (*(in_RENAME_IN_CONTEXT_ID [j])); |
---|
190 | (*(out_RENAME_OUT_NUM_REG_RB_PHY [i])) (*(in_RENAME_IN_WRITE_RD [j])); |
---|
191 | (*(out_RENAME_OUT_NUM_REG_RB_PHY [i])) (*(in_RENAME_IN_NUM_REG_RD_LOG [j])); |
---|
192 | (*(out_RENAME_OUT_NUM_REG_RB_PHY [i])) (*(in_RENAME_IN_NUM_REG_RD_PHY_NEW [j])); |
---|
193 | } |
---|
194 | |
---|
195 | (*(out_RENAME_OUT_NUM_REG_RC_PHY [i])) (*(in_RENAME_IN_NUM_REG_RC_PHY [i])); |
---|
196 | (*(out_RENAME_OUT_NUM_REG_RC_PHY [i])) (*(in_RENAME_IN_READ_RC [i])); |
---|
197 | (*(out_RENAME_OUT_NUM_REG_RC_PHY [i])) (*(in_RENAME_IN_NUM_REG_RC_LOG [i])); |
---|
198 | for (int32_t j=i-1; j>=0; j--) |
---|
199 | { |
---|
200 | if (_param->_have_port_front_end_id) |
---|
201 | (*(out_RENAME_OUT_NUM_REG_RC_PHY [i])) (*(in_RENAME_IN_FRONT_END_ID [j])); |
---|
202 | if (_param->_have_port_context_id) |
---|
203 | (*(out_RENAME_OUT_NUM_REG_RC_PHY [i])) (*(in_RENAME_IN_CONTEXT_ID [j])); |
---|
204 | (*(out_RENAME_OUT_NUM_REG_RC_PHY [i])) (*(in_RENAME_IN_WRITE_RE [j])); |
---|
205 | (*(out_RENAME_OUT_NUM_REG_RC_PHY [i])) (*(in_RENAME_IN_NUM_REG_RE_LOG [j])); |
---|
206 | (*(out_RENAME_OUT_NUM_REG_RC_PHY [i])) (*(in_RENAME_IN_NUM_REG_RE_PHY_NEW [j])); |
---|
207 | } |
---|
208 | } |
---|
209 | # endif |
---|
210 | |
---|
211 | } |
---|
212 | #endif |
---|
213 | log_printf(FUNC,Dependency_checking_unit,FUNCTION,"End"); |
---|
214 | }; |
---|
215 | |
---|
216 | #undef FUNCTION |
---|
217 | #define FUNCTION "Dependency_checking_unit::~Dependency_checking_unit" |
---|
218 | Dependency_checking_unit::~Dependency_checking_unit (void) |
---|
219 | { |
---|
220 | log_printf(FUNC,Dependency_checking_unit,FUNCTION,"Begin"); |
---|
221 | |
---|
222 | #ifdef STATISTICS |
---|
223 | if (_usage & USE_STATISTICS) |
---|
224 | { |
---|
225 | log_printf(INFO,Dependency_checking_unit,FUNCTION,"Generate Statistics file"); |
---|
226 | |
---|
227 | delete _stat; |
---|
228 | } |
---|
229 | #endif |
---|
230 | |
---|
231 | log_printf(INFO,Dependency_checking_unit,FUNCTION,"Deallocation"); |
---|
232 | deallocation (); |
---|
233 | |
---|
234 | log_printf(FUNC,Dependency_checking_unit,FUNCTION,"End"); |
---|
235 | }; |
---|
236 | |
---|
237 | }; // end namespace dependency_checking_unit |
---|
238 | }; // end namespace register_translation_unit |
---|
239 | }; // end namespace rename_unit |
---|
240 | }; // end namespace ooo_engine |
---|
241 | }; // end namespace multi_ooo_engine |
---|
242 | }; // end namespace core |
---|
243 | |
---|
244 | }; // end namespace behavioural |
---|
245 | }; // end namespace morpheo |
---|