1 | /* |
---|
2 | * $Id: test.cpp 128 2009-06-26 08:43:23Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | * Test |
---|
7 | */ |
---|
8 | |
---|
9 | #include "Behavioural/Core/Dcache_Access/SelfTest/include/test.h" |
---|
10 | #include "Behavioural/include/Allocation.h" |
---|
11 | |
---|
12 | typedef struct |
---|
13 | { |
---|
14 | uint32_t execute_loop ; |
---|
15 | uint32_t load_store_unit; |
---|
16 | uint32_t cache_access ; |
---|
17 | } thread_id_t; |
---|
18 | |
---|
19 | void test (string name, |
---|
20 | morpheo::behavioural::core::dcache_access::Parameters * _param) |
---|
21 | { |
---|
22 | msg(_("<%s> : Simulation SystemC.\n"),name.c_str()); |
---|
23 | |
---|
24 | #ifdef STATISTICS |
---|
25 | morpheo::behavioural::Parameters_Statistics * _parameters_statistics = new morpheo::behavioural::Parameters_Statistics (5,CYCLE_MAX); |
---|
26 | #endif |
---|
27 | |
---|
28 | Tusage_t _usage = USE_ALL; |
---|
29 | |
---|
30 | // _usage = usage_unset(_usage,USE_SYSTEMC ); |
---|
31 | // _usage = usage_unset(_usage,USE_VHDL ); |
---|
32 | // _usage = usage_unset(_usage,USE_VHDL_TESTBENCH ); |
---|
33 | // _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT); |
---|
34 | // _usage = usage_unset(_usage,USE_POSITION ); |
---|
35 | // _usage = usage_unset(_usage,USE_STATISTICS ); |
---|
36 | // _usage = usage_unset(_usage,USE_INFORMATION ); |
---|
37 | |
---|
38 | Dcache_Access * _Dcache_Access = new Dcache_Access |
---|
39 | (name.c_str(), |
---|
40 | #ifdef STATISTICS |
---|
41 | _parameters_statistics, |
---|
42 | #endif |
---|
43 | _param, |
---|
44 | _usage); |
---|
45 | |
---|
46 | #ifdef SYSTEMC |
---|
47 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
48 | { |
---|
49 | /********************************************************************* |
---|
50 | * Déclarations des signaux |
---|
51 | *********************************************************************/ |
---|
52 | string rename; |
---|
53 | |
---|
54 | sc_clock * in_CLOCK = new sc_clock ("clock", 1.0, 0.5); |
---|
55 | sc_signal<Tcontrol_t> * in_NRESET = new sc_signal<Tcontrol_t> ("NRESET"); |
---|
56 | |
---|
57 | sc_signal<Tcontrol_t > ** out_DCACHE_REQ_VAL ; |
---|
58 | sc_signal<Tcontrol_t > ** in_DCACHE_REQ_ACK ; |
---|
59 | sc_signal<Tcontext_t > ** out_DCACHE_REQ_THREAD_ID ; |
---|
60 | sc_signal<Tpacket_t > ** out_DCACHE_REQ_PACKET_ID ; |
---|
61 | sc_signal<Tdcache_address_t > ** out_DCACHE_REQ_ADDRESS ; |
---|
62 | sc_signal<Tdcache_data_t > ** out_DCACHE_REQ_WDATA ; |
---|
63 | sc_signal<Tdcache_type_t > ** out_DCACHE_REQ_TYPE ; |
---|
64 | |
---|
65 | sc_signal<Tcontrol_t > ** in_DCACHE_RSP_VAL ; |
---|
66 | sc_signal<Tcontrol_t > ** out_DCACHE_RSP_ACK ; |
---|
67 | sc_signal<Tcontext_t > ** in_DCACHE_RSP_THREAD_ID ; |
---|
68 | sc_signal<Tpacket_t > ** in_DCACHE_RSP_PACKET_ID ; |
---|
69 | sc_signal<Tdcache_data_t > ** in_DCACHE_RSP_RDATA ; |
---|
70 | sc_signal<Tdcache_error_t > ** in_DCACHE_RSP_ERROR ; |
---|
71 | |
---|
72 | sc_signal<Tcontrol_t > **** in_LSQ_REQ_VAL ; |
---|
73 | sc_signal<Tcontrol_t > **** out_LSQ_REQ_ACK ; |
---|
74 | sc_signal<Tcontext_t > **** in_LSQ_REQ_THREAD_ID ; |
---|
75 | sc_signal<Tpacket_t > **** in_LSQ_REQ_PACKET_ID ; |
---|
76 | sc_signal<Tdcache_address_t > **** in_LSQ_REQ_ADDRESS ; |
---|
77 | sc_signal<Tdcache_data_t > **** in_LSQ_REQ_WDATA ; |
---|
78 | sc_signal<Tdcache_type_t > **** in_LSQ_REQ_TYPE ; |
---|
79 | |
---|
80 | sc_signal<Tcontrol_t > **** out_LSQ_RSP_VAL ; |
---|
81 | sc_signal<Tcontrol_t > **** in_LSQ_RSP_ACK ; |
---|
82 | sc_signal<Tcontext_t > **** out_LSQ_RSP_THREAD_ID ; |
---|
83 | sc_signal<Tpacket_t > **** out_LSQ_RSP_PACKET_ID ; |
---|
84 | sc_signal<Tdcache_data_t > **** out_LSQ_RSP_RDATA ; |
---|
85 | sc_signal<Tdcache_error_t > **** out_LSQ_RSP_ERROR ; |
---|
86 | |
---|
87 | ALLOC1_SC_SIGNAL(out_DCACHE_REQ_VAL ,"out_DCACHE_REQ_VAL ",Tcontrol_t ,_param->_nb_dcache_port); |
---|
88 | ALLOC1_SC_SIGNAL( in_DCACHE_REQ_ACK ," in_DCACHE_REQ_ACK ",Tcontrol_t ,_param->_nb_dcache_port); |
---|
89 | ALLOC1_SC_SIGNAL(out_DCACHE_REQ_THREAD_ID ,"out_DCACHE_REQ_THREAD_ID",Tcontext_t ,_param->_nb_dcache_port); |
---|
90 | ALLOC1_SC_SIGNAL(out_DCACHE_REQ_PACKET_ID ,"out_DCACHE_REQ_PACKET_ID",Tpacket_t ,_param->_nb_dcache_port); |
---|
91 | ALLOC1_SC_SIGNAL(out_DCACHE_REQ_ADDRESS ,"out_DCACHE_REQ_ADDRESS ",Tdcache_address_t ,_param->_nb_dcache_port); |
---|
92 | ALLOC1_SC_SIGNAL(out_DCACHE_REQ_WDATA ,"out_DCACHE_REQ_WDATA ",Tdcache_data_t ,_param->_nb_dcache_port); |
---|
93 | ALLOC1_SC_SIGNAL(out_DCACHE_REQ_TYPE ,"out_DCACHE_REQ_TYPE ",Tdcache_type_t ,_param->_nb_dcache_port); |
---|
94 | |
---|
95 | ALLOC1_SC_SIGNAL( in_DCACHE_RSP_VAL ," in_DCACHE_RSP_VAL ",Tcontrol_t ,_param->_nb_dcache_port); |
---|
96 | ALLOC1_SC_SIGNAL(out_DCACHE_RSP_ACK ,"out_DCACHE_RSP_ACK ",Tcontrol_t ,_param->_nb_dcache_port); |
---|
97 | ALLOC1_SC_SIGNAL( in_DCACHE_RSP_THREAD_ID ," in_DCACHE_RSP_THREAD_ID",Tcontext_t ,_param->_nb_dcache_port); |
---|
98 | ALLOC1_SC_SIGNAL( in_DCACHE_RSP_PACKET_ID ," in_DCACHE_RSP_PACKET_ID",Tpacket_t ,_param->_nb_dcache_port); |
---|
99 | ALLOC1_SC_SIGNAL( in_DCACHE_RSP_RDATA ," in_DCACHE_RSP_RDATA ",Tdcache_data_t ,_param->_nb_dcache_port); |
---|
100 | ALLOC1_SC_SIGNAL( in_DCACHE_RSP_ERROR ," in_DCACHE_RSP_ERROR ",Tdcache_error_t ,_param->_nb_dcache_port); |
---|
101 | |
---|
102 | ALLOC3_SC_SIGNAL( in_LSQ_REQ_VAL ," in_LSQ_REQ_VAL ",Tcontrol_t ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
103 | ALLOC3_SC_SIGNAL(out_LSQ_REQ_ACK ,"out_LSQ_REQ_ACK ",Tcontrol_t ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
104 | ALLOC3_SC_SIGNAL( in_LSQ_REQ_THREAD_ID ," in_LSQ_REQ_THREAD_ID ",Tcontext_t ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
105 | ALLOC3_SC_SIGNAL( in_LSQ_REQ_PACKET_ID ," in_LSQ_REQ_PACKET_ID ",Tpacket_t ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
106 | ALLOC3_SC_SIGNAL( in_LSQ_REQ_ADDRESS ," in_LSQ_REQ_ADDRESS ",Tdcache_address_t ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
107 | ALLOC3_SC_SIGNAL( in_LSQ_REQ_WDATA ," in_LSQ_REQ_WDATA ",Tdcache_data_t ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
108 | ALLOC3_SC_SIGNAL( in_LSQ_REQ_TYPE ," in_LSQ_REQ_TYPE ",Tdcache_type_t ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
109 | |
---|
110 | ALLOC3_SC_SIGNAL(out_LSQ_RSP_VAL ,"out_LSQ_RSP_VAL ",Tcontrol_t ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
111 | ALLOC3_SC_SIGNAL( in_LSQ_RSP_ACK ," in_LSQ_RSP_ACK ",Tcontrol_t ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
112 | ALLOC3_SC_SIGNAL(out_LSQ_RSP_THREAD_ID ,"out_LSQ_RSP_THREAD_ID ",Tcontext_t ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
113 | ALLOC3_SC_SIGNAL(out_LSQ_RSP_PACKET_ID ,"out_LSQ_RSP_PACKET_ID ",Tpacket_t ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
114 | ALLOC3_SC_SIGNAL(out_LSQ_RSP_RDATA ,"out_LSQ_RSP_RDATA ",Tdcache_data_t ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
115 | ALLOC3_SC_SIGNAL(out_LSQ_RSP_ERROR ,"out_LSQ_RSP_ERROR ",Tdcache_error_t ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
116 | |
---|
117 | /******************************************************** |
---|
118 | * Instanciation |
---|
119 | ********************************************************/ |
---|
120 | |
---|
121 | msg(_("<%s> : Instanciation of _Dcache_Access.\n"),name.c_str()); |
---|
122 | |
---|
123 | (*(_Dcache_Access->in_CLOCK)) (*(in_CLOCK)); |
---|
124 | (*(_Dcache_Access->in_NRESET)) (*(in_NRESET)); |
---|
125 | |
---|
126 | INSTANCE1_SC_SIGNAL(_Dcache_Access,out_DCACHE_REQ_VAL ,_param->_nb_dcache_port); |
---|
127 | INSTANCE1_SC_SIGNAL(_Dcache_Access, in_DCACHE_REQ_ACK ,_param->_nb_dcache_port); |
---|
128 | if (_param->_have_port_dcache_thread_id) |
---|
129 | INSTANCE1_SC_SIGNAL(_Dcache_Access,out_DCACHE_REQ_THREAD_ID ,_param->_nb_dcache_port); |
---|
130 | if (_param->_have_port_dcache_packet_id) |
---|
131 | INSTANCE1_SC_SIGNAL(_Dcache_Access,out_DCACHE_REQ_PACKET_ID ,_param->_nb_dcache_port); |
---|
132 | INSTANCE1_SC_SIGNAL(_Dcache_Access,out_DCACHE_REQ_ADDRESS ,_param->_nb_dcache_port); |
---|
133 | INSTANCE1_SC_SIGNAL(_Dcache_Access,out_DCACHE_REQ_WDATA ,_param->_nb_dcache_port); |
---|
134 | INSTANCE1_SC_SIGNAL(_Dcache_Access,out_DCACHE_REQ_TYPE ,_param->_nb_dcache_port); |
---|
135 | |
---|
136 | INSTANCE1_SC_SIGNAL(_Dcache_Access, in_DCACHE_RSP_VAL ,_param->_nb_dcache_port); |
---|
137 | INSTANCE1_SC_SIGNAL(_Dcache_Access,out_DCACHE_RSP_ACK ,_param->_nb_dcache_port); |
---|
138 | if (_param->_have_port_dcache_thread_id) |
---|
139 | INSTANCE1_SC_SIGNAL(_Dcache_Access, in_DCACHE_RSP_THREAD_ID ,_param->_nb_dcache_port); |
---|
140 | if (_param->_have_port_dcache_packet_id) |
---|
141 | INSTANCE1_SC_SIGNAL(_Dcache_Access, in_DCACHE_RSP_PACKET_ID ,_param->_nb_dcache_port); |
---|
142 | INSTANCE1_SC_SIGNAL(_Dcache_Access, in_DCACHE_RSP_RDATA ,_param->_nb_dcache_port); |
---|
143 | INSTANCE1_SC_SIGNAL(_Dcache_Access, in_DCACHE_RSP_ERROR ,_param->_nb_dcache_port); |
---|
144 | |
---|
145 | INSTANCE3_SC_SIGNAL(_Dcache_Access, in_LSQ_REQ_VAL ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
146 | INSTANCE3_SC_SIGNAL(_Dcache_Access,out_LSQ_REQ_ACK ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
147 | INSTANCE3_SC_SIGNAL(_Dcache_Access, in_LSQ_REQ_ADDRESS ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
148 | INSTANCE3_SC_SIGNAL(_Dcache_Access, in_LSQ_REQ_WDATA ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
149 | INSTANCE3_SC_SIGNAL(_Dcache_Access, in_LSQ_REQ_TYPE ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
150 | |
---|
151 | INSTANCE3_SC_SIGNAL(_Dcache_Access,out_LSQ_RSP_VAL ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
152 | INSTANCE3_SC_SIGNAL(_Dcache_Access, in_LSQ_RSP_ACK ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
153 | INSTANCE3_SC_SIGNAL(_Dcache_Access,out_LSQ_RSP_RDATA ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
154 | INSTANCE3_SC_SIGNAL(_Dcache_Access,out_LSQ_RSP_ERROR ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
155 | |
---|
156 | for (uint32_t i=0; i<_param->_nb_execute_loop; i++) |
---|
157 | for (uint32_t j=0; j<_param->_nb_load_store_unit[i]; j++) |
---|
158 | { |
---|
159 | if (_param->_have_port_lsq_thread_id [i][j]) |
---|
160 | { |
---|
161 | INSTANCE1_SC_SIGNAL(_Dcache_Access, in_LSQ_REQ_THREAD_ID [i][j], _param->_nb_cache_access[i][j]); |
---|
162 | INSTANCE1_SC_SIGNAL(_Dcache_Access,out_LSQ_RSP_THREAD_ID [i][j], _param->_nb_cache_access[i][j]); |
---|
163 | } |
---|
164 | if (_param->_have_port_lsq_packet_id [i][j]) |
---|
165 | { |
---|
166 | INSTANCE1_SC_SIGNAL(_Dcache_Access, in_LSQ_REQ_PACKET_ID [i][j], _param->_nb_cache_access[i][j]); |
---|
167 | INSTANCE1_SC_SIGNAL(_Dcache_Access,out_LSQ_RSP_PACKET_ID [i][j], _param->_nb_cache_access[i][j]); |
---|
168 | } |
---|
169 | } |
---|
170 | |
---|
171 | msg(_("<%s> : Start Simulation ............\n"),name.c_str()); |
---|
172 | |
---|
173 | Time * _time = new Time(); |
---|
174 | |
---|
175 | /******************************************************** |
---|
176 | * Simulation - Begin |
---|
177 | ********************************************************/ |
---|
178 | |
---|
179 | // Initialisation |
---|
180 | |
---|
181 | const uint32_t seed = 0; |
---|
182 | //const uint32_t seed = static_cast<uint32_t>(time(NULL)); |
---|
183 | |
---|
184 | srand(seed); |
---|
185 | |
---|
186 | const int32_t percent_transaction_req = 75; |
---|
187 | const int32_t percent_transaction_rsp = 75; |
---|
188 | |
---|
189 | thread_id_t link_cache_rsp [_param->_nb_dcache_port][_param->_nb_execute_loop*_param->_max_nb_load_store_unit*_param->_max_nb_cache_access]; |
---|
190 | uint32_t nb_link_cache_rsp [_param->_nb_dcache_port]; |
---|
191 | |
---|
192 | for (uint32_t i=0; i<_param->_nb_dcache_port; i++) |
---|
193 | nb_link_cache_rsp [i] = 0; |
---|
194 | |
---|
195 | for (uint32_t i=0; i<_param->_nb_execute_loop; i++) |
---|
196 | for (uint32_t j=0; j<_param->_nb_load_store_unit [i]; j++) |
---|
197 | for (uint32_t k=0; k<_param->_nb_cache_access [i][j]; ++k) |
---|
198 | { |
---|
199 | uint32_t x = _param->_table_routing [i][j][k]; |
---|
200 | |
---|
201 | link_cache_rsp [x][nb_link_cache_rsp[x]].execute_loop = i; |
---|
202 | link_cache_rsp [x][nb_link_cache_rsp[x]].load_store_unit = j; |
---|
203 | link_cache_rsp [x][nb_link_cache_rsp[x]].cache_access = k; |
---|
204 | nb_link_cache_rsp[x] ++; |
---|
205 | } |
---|
206 | |
---|
207 | SC_START(0); |
---|
208 | LABEL("Initialisation"); |
---|
209 | |
---|
210 | LABEL("Reset"); |
---|
211 | in_NRESET->write(0); |
---|
212 | SC_START(5); |
---|
213 | in_NRESET->write(1); |
---|
214 | |
---|
215 | #ifdef SELFTEST |
---|
216 | LABEL("Loop of Test"); |
---|
217 | |
---|
218 | for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++) |
---|
219 | { |
---|
220 | LABEL("Iteration %d",iteration); |
---|
221 | |
---|
222 | for (uint32_t i=0; i<_param->_nb_dcache_port; i++) |
---|
223 | { |
---|
224 | in_DCACHE_REQ_ACK [i]->write((rand()%100)<percent_transaction_req); |
---|
225 | |
---|
226 | uint32_t z = rand()%nb_link_cache_rsp[i]; |
---|
227 | uint32_t a = link_cache_rsp[i][z].execute_loop; |
---|
228 | uint32_t b = link_cache_rsp[i][z].load_store_unit ; |
---|
229 | uint32_t c = link_cache_rsp[i][z].cache_access ; |
---|
230 | |
---|
231 | in_DCACHE_RSP_VAL [i]->write((rand()%100)<percent_transaction_rsp); |
---|
232 | in_DCACHE_RSP_THREAD_ID [i]->write(_param->_translate_load_store_unit_to_thread[a][b][0]); |
---|
233 | in_DCACHE_RSP_PACKET_ID [i]->write((c << _param->_shift_num_cache_access)); |
---|
234 | in_DCACHE_RSP_RDATA [i]->write(0); |
---|
235 | in_DCACHE_RSP_ERROR [i]->write(0); |
---|
236 | } |
---|
237 | |
---|
238 | for (uint32_t i=0; i<_param->_nb_execute_loop; i++) |
---|
239 | for (uint32_t j=0; j<_param->_nb_load_store_unit [i]; j++) |
---|
240 | for (uint32_t k=0; k<_param->_nb_cache_access [i][j]; ++k) |
---|
241 | { |
---|
242 | in_LSQ_REQ_VAL [i][j][k]->write((rand()%100)<percent_transaction_req); |
---|
243 | in_LSQ_REQ_ADDRESS [i][j][k]->write(0); |
---|
244 | in_LSQ_REQ_THREAD_ID [i][j][k]->write(0); |
---|
245 | in_LSQ_REQ_PACKET_ID [i][j][k]->write(0); |
---|
246 | in_LSQ_REQ_ADDRESS [i][j][k]->write(0); |
---|
247 | in_LSQ_REQ_WDATA [i][j][k]->write(0); |
---|
248 | in_LSQ_REQ_TYPE [i][j][k]->write(0); |
---|
249 | |
---|
250 | in_LSQ_RSP_ACK [i][j][k]->write((rand()%100)<percent_transaction_rsp); |
---|
251 | } |
---|
252 | |
---|
253 | SC_START(0); |
---|
254 | |
---|
255 | int32_t nb_request = 0; |
---|
256 | int32_t nb_respons = 0; |
---|
257 | |
---|
258 | for (uint32_t i=0; i<_param->_nb_dcache_port; i++) |
---|
259 | { |
---|
260 | if (out_DCACHE_REQ_VAL [i]->read() and in_DCACHE_REQ_ACK [i]->read()) |
---|
261 | { |
---|
262 | LABEL("DCACHE_REQ [%d] - Transaction Accepted.",i); |
---|
263 | |
---|
264 | nb_request ++; |
---|
265 | } |
---|
266 | if ( in_DCACHE_RSP_VAL [i]->read() and out_DCACHE_RSP_ACK [i]->read()) |
---|
267 | { |
---|
268 | LABEL("DCACHE_RSP [%d] - Transaction Accepted.",i); |
---|
269 | |
---|
270 | nb_respons ++; |
---|
271 | } |
---|
272 | } |
---|
273 | |
---|
274 | for (uint32_t i=0; i<_param->_nb_execute_loop; i++) |
---|
275 | for (uint32_t j=0; j<_param->_nb_load_store_unit [i]; j++) |
---|
276 | for (uint32_t k=0; k<_param->_nb_cache_access [i][j]; ++k) |
---|
277 | { |
---|
278 | if (in_LSQ_REQ_VAL [i][j][k]->read() and out_LSQ_REQ_ACK [i][j][k]->read()) |
---|
279 | { |
---|
280 | LABEL("LSQ_REQ [%d][%d][%d] - Transaction Accepted.",i,j,k); |
---|
281 | |
---|
282 | uint32_t x=_param->_table_routing[i][j][k]; |
---|
283 | |
---|
284 | TEST(Tcontrol_t,out_DCACHE_REQ_VAL[x]->read(), 1); |
---|
285 | TEST(Tcontrol_t, in_DCACHE_REQ_ACK[x]->read(), 1); |
---|
286 | |
---|
287 | TEST(Tcontext_t ,out_DCACHE_REQ_THREAD_ID [x]->read(), _param->_translate_load_store_unit_to_thread [i][j][0]); |
---|
288 | TEST(Tpacket_t ,out_DCACHE_REQ_PACKET_ID [x]->read(), (k << _param->_shift_num_cache_access)); |
---|
289 | TEST(Tdcache_address_t,out_DCACHE_REQ_ADDRESS [x]->read(), 0); |
---|
290 | TEST(Tdcache_address_t,out_DCACHE_REQ_WDATA [x]->read(), 0); |
---|
291 | TEST(Tdcache_type_t ,out_DCACHE_REQ_TYPE [x]->read(), 0); |
---|
292 | |
---|
293 | nb_request --; |
---|
294 | } |
---|
295 | |
---|
296 | if (out_LSQ_RSP_VAL [i][j][k]->read() and in_LSQ_RSP_ACK [i][j][k]->read()) |
---|
297 | { |
---|
298 | LABEL("LSQ_RSP [%d][%d][%d] - Transaction Accepted.",i,j,k); |
---|
299 | |
---|
300 | // public : SC_OUT(Tcontext_t ) **** out_LSQ_RSP_THREAD_ID ;//[nb_execute_loop][nb_load_store_unit][nb_cache_access] |
---|
301 | // public : SC_OUT(Tpacket_t ) **** out_LSQ_RSP_PACKET_ID ;//[nb_execute_loop][nb_load_store_unit][nb_cache_access] |
---|
302 | // public : SC_OUT(Tdcache_data_t ) **** out_LSQ_RSP_RDATA ;//[nb_execute_loop][nb_load_store_unit][nb_cache_access] |
---|
303 | // public : SC_OUT(Tdcache_error_t ) **** out_LSQ_RSP_ERROR ;//[nb_execute_loop][nb_load_store_unit][nb_cache_access] |
---|
304 | nb_respons --; |
---|
305 | } |
---|
306 | } |
---|
307 | |
---|
308 | TEST(int32_t, nb_request, 0); |
---|
309 | TEST(int32_t, nb_respons, 0); |
---|
310 | |
---|
311 | SC_START(1); |
---|
312 | } |
---|
313 | #else |
---|
314 | SC_START(5); |
---|
315 | #endif |
---|
316 | |
---|
317 | /******************************************************** |
---|
318 | * Simulation - End |
---|
319 | ********************************************************/ |
---|
320 | |
---|
321 | TEST_OK ("End of Simulation"); |
---|
322 | delete _time; |
---|
323 | |
---|
324 | msg(_("<%s> : ............ Stop Simulation\n"),name.c_str()); |
---|
325 | |
---|
326 | delete in_CLOCK; |
---|
327 | delete in_NRESET; |
---|
328 | |
---|
329 | DELETE1_SC_SIGNAL(out_DCACHE_REQ_VAL ,_param->_nb_dcache_port); |
---|
330 | DELETE1_SC_SIGNAL( in_DCACHE_REQ_ACK ,_param->_nb_dcache_port); |
---|
331 | DELETE1_SC_SIGNAL(out_DCACHE_REQ_THREAD_ID ,_param->_nb_dcache_port); |
---|
332 | DELETE1_SC_SIGNAL(out_DCACHE_REQ_PACKET_ID ,_param->_nb_dcache_port); |
---|
333 | DELETE1_SC_SIGNAL(out_DCACHE_REQ_ADDRESS ,_param->_nb_dcache_port); |
---|
334 | DELETE1_SC_SIGNAL(out_DCACHE_REQ_WDATA ,_param->_nb_dcache_port); |
---|
335 | DELETE1_SC_SIGNAL(out_DCACHE_REQ_TYPE ,_param->_nb_dcache_port); |
---|
336 | |
---|
337 | DELETE1_SC_SIGNAL( in_DCACHE_RSP_VAL ,_param->_nb_dcache_port); |
---|
338 | DELETE1_SC_SIGNAL(out_DCACHE_RSP_ACK ,_param->_nb_dcache_port); |
---|
339 | DELETE1_SC_SIGNAL( in_DCACHE_RSP_THREAD_ID ,_param->_nb_dcache_port); |
---|
340 | DELETE1_SC_SIGNAL( in_DCACHE_RSP_PACKET_ID ,_param->_nb_dcache_port); |
---|
341 | DELETE1_SC_SIGNAL( in_DCACHE_RSP_RDATA ,_param->_nb_dcache_port); |
---|
342 | DELETE1_SC_SIGNAL( in_DCACHE_RSP_ERROR ,_param->_nb_dcache_port); |
---|
343 | |
---|
344 | DELETE3_SC_SIGNAL( in_LSQ_REQ_VAL ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
345 | DELETE3_SC_SIGNAL(out_LSQ_REQ_ACK ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
346 | DELETE3_SC_SIGNAL( in_LSQ_REQ_THREAD_ID ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
347 | DELETE3_SC_SIGNAL( in_LSQ_REQ_PACKET_ID ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
348 | DELETE3_SC_SIGNAL( in_LSQ_REQ_ADDRESS ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
349 | DELETE3_SC_SIGNAL( in_LSQ_REQ_WDATA ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
350 | DELETE3_SC_SIGNAL( in_LSQ_REQ_TYPE ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
351 | |
---|
352 | DELETE3_SC_SIGNAL(out_LSQ_RSP_VAL ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
353 | DELETE3_SC_SIGNAL( in_LSQ_RSP_ACK ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
354 | DELETE3_SC_SIGNAL(out_LSQ_RSP_THREAD_ID ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
355 | DELETE3_SC_SIGNAL(out_LSQ_RSP_PACKET_ID ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
356 | DELETE3_SC_SIGNAL(out_LSQ_RSP_RDATA ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
357 | DELETE3_SC_SIGNAL(out_LSQ_RSP_ERROR ,_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]); |
---|
358 | } |
---|
359 | #endif |
---|
360 | |
---|
361 | delete _Dcache_Access; |
---|
362 | #ifdef STATISTICS |
---|
363 | delete _parameters_statistics; |
---|
364 | #endif |
---|
365 | } |
---|