1 | |
---|
2 | #include <stdint.h> |
---|
3 | #include <systemc> |
---|
4 | #include <sys/time.h> |
---|
5 | #include <iostream> |
---|
6 | #include <cstdlib> |
---|
7 | #include <cstdarg> |
---|
8 | |
---|
9 | #include "arithmetics.h" |
---|
10 | #include "mapping_table.h" |
---|
11 | #include "alloc_elems.h" |
---|
12 | #include "vci_simple_ram.h" |
---|
13 | #include "vci_local_ring_fast.h" |
---|
14 | #include "virtual_dspin_router.h" |
---|
15 | #include "vci_synthetic_initiator.h" |
---|
16 | |
---|
17 | // MESH SIZE |
---|
18 | #define X_MAX 2 |
---|
19 | #define Y_MAX 2 |
---|
20 | #define N_CLUSTERS X_MAX*Y_MAX |
---|
21 | // FLIT_WIDTH |
---|
22 | #define WIDTH_CMD 40 |
---|
23 | #define WIDTH_RSP 33 |
---|
24 | // Face of each DSPIN Router |
---|
25 | #define NORTH 0 |
---|
26 | #define SOUTH 1 |
---|
27 | #define EAST 2 |
---|
28 | #define WEST 3 |
---|
29 | #define LOCAL 4 |
---|
30 | // VCI parameters |
---|
31 | #define cell_width 4 |
---|
32 | #define plen_width 8 |
---|
33 | #define address_width 32 |
---|
34 | #define error_width 1 |
---|
35 | #define clen_width 1 |
---|
36 | #define rflag_width 1 |
---|
37 | #define srcid_width 11 |
---|
38 | #define pktid_width 4 |
---|
39 | #define trdid_width 4 |
---|
40 | #define wrplen_width 1 |
---|
41 | // Adress of targets |
---|
42 | #define TARGET_ADDR 0x00000000 |
---|
43 | #define TARGET_SIZE 0x400 |
---|
44 | // FIFO depth in the gateways |
---|
45 | #define DEPTH 4 |
---|
46 | // LENGTH of packets |
---|
47 | #define PACKET_LENGTH 2 |
---|
48 | // FIFO depth in the routers |
---|
49 | #define DSPIN_FIFO 4 |
---|
50 | // DEBUG MODE : 0 OFF, 1 only the initiators and the targets, 2 only network |
---|
51 | #define DEBUG 0 |
---|
52 | // LOAD wanted |
---|
53 | #define LOAD 450 |
---|
54 | |
---|
55 | |
---|
56 | int _main(int argc, char *argv[]) |
---|
57 | { |
---|
58 | using namespace sc_core; |
---|
59 | // Avoid repeating these everywhere |
---|
60 | using soclib::common::IntTab; |
---|
61 | using soclib::common::Segment; |
---|
62 | |
---|
63 | using soclib::common::uint32_log2; |
---|
64 | |
---|
65 | int ncycles; |
---|
66 | uint32_t rho_a; |
---|
67 | uint32_t rho_b; |
---|
68 | |
---|
69 | if(argc == 4){ |
---|
70 | ncycles = std::atoi(argv[1]); |
---|
71 | rho_a = std::atoi(argv[2]); |
---|
72 | rho_b = std::atoi(argv[3]); |
---|
73 | } else { |
---|
74 | std::cout << "Usage : simulation_cycles packet_rate broadcast_period" << std::endl; |
---|
75 | exit(1); |
---|
76 | } |
---|
77 | // Define VCI parameters |
---|
78 | typedef soclib::caba::VciParams<cell_width, |
---|
79 | plen_width, |
---|
80 | address_width, |
---|
81 | error_width, |
---|
82 | clen_width, |
---|
83 | rflag_width, |
---|
84 | srcid_width, |
---|
85 | pktid_width, |
---|
86 | trdid_width, |
---|
87 | wrplen_width> vci_param; |
---|
88 | |
---|
89 | // Mapping table primary network |
---|
90 | soclib::common::MappingTable maptab0(address_width, IntTab(soclib::common::uint32_log2(X_MAX)+soclib::common::uint32_log2(Y_MAX) ,srcid_width-soclib::common::uint32_log2(X_MAX)-soclib::common::uint32_log2(Y_MAX)), |
---|
91 | IntTab(soclib::common::uint32_log2(X_MAX)+soclib::common::uint32_log2(Y_MAX) ,srcid_width-soclib::common::uint32_log2(X_MAX)-soclib::common::uint32_log2(Y_MAX)), 0xFFC0000); |
---|
92 | soclib::common::MappingTable maptab1(address_width, IntTab(soclib::common::uint32_log2(X_MAX)+soclib::common::uint32_log2(Y_MAX) ,srcid_width-soclib::common::uint32_log2(X_MAX)-soclib::common::uint32_log2(Y_MAX)), |
---|
93 | IntTab(soclib::common::uint32_log2(X_MAX)+soclib::common::uint32_log2(Y_MAX) ,srcid_width-soclib::common::uint32_log2(X_MAX)-soclib::common::uint32_log2(Y_MAX)), 0xFFC0000); |
---|
94 | for(int i = 0 ; i < Y_MAX ; i++){ |
---|
95 | for(int j = 0 ; j < X_MAX ; j++){ |
---|
96 | std::ostringstream str0; |
---|
97 | std::ostringstream str1; |
---|
98 | str0 << "Target_c0_" << (i*Y_MAX+j) ; |
---|
99 | str1 << "Target_c1_" << (i*Y_MAX+j) ; |
---|
100 | maptab0.add(Segment(str0.str(), TARGET_ADDR + ((i*Y_MAX+j) << (address_width-soclib::common::uint32_log2(X_MAX)-soclib::common::uint32_log2(Y_MAX))), TARGET_SIZE, IntTab((i*X_MAX+j),0), false)); |
---|
101 | maptab1.add(Segment(str1.str(), TARGET_ADDR + ((i*Y_MAX+j) << (address_width-soclib::common::uint32_log2(X_MAX)-soclib::common::uint32_log2(Y_MAX))), TARGET_SIZE, IntTab((i*X_MAX+j),0), false)); |
---|
102 | } |
---|
103 | } |
---|
104 | |
---|
105 | |
---|
106 | sc_clock signal_clk("clk"); |
---|
107 | sc_signal<bool> signal_resetn("resetn"); |
---|
108 | |
---|
109 | soclib::caba::VciSignals<vci_param> ** signal_vci_ini_synth_c0 = soclib::common::alloc_elems<soclib::caba::VciSignals<vci_param> >("signal_vci_ini_synth_c0", 2, N_CLUSTERS); |
---|
110 | soclib::caba::VciSignals<vci_param> ** signal_vci_ini_synth_c1 = soclib::common::alloc_elems<soclib::caba::VciSignals<vci_param> >("signal_vci_ini_synth_c1", 2, N_CLUSTERS); |
---|
111 | /////////////////////////////////////////////////////////////// |
---|
112 | // VDSPIN Signals : one level for in and out, one level for X length in the mesh, |
---|
113 | // one level for Y length in the mesh, last level for each port of the router |
---|
114 | /////////////////////////////////////////////////////////////// |
---|
115 | soclib::caba::DspinSignals<WIDTH_CMD> **** dspin_signals_cmd_c0 = soclib::common::alloc_elems<soclib::caba::DspinSignals<WIDTH_CMD> >("Dspin_cmd_signals_channel_0", 2, X_MAX, Y_MAX, 5 ); |
---|
116 | soclib::caba::DspinSignals<WIDTH_CMD> **** dspin_signals_cmd_c1 = soclib::common::alloc_elems<soclib::caba::DspinSignals<WIDTH_CMD> >("Dspin_cmd_signals_channel_1", 2, X_MAX, Y_MAX, 5 ); |
---|
117 | soclib::caba::DspinSignals<WIDTH_RSP> **** dspin_signals_rsp_c0 = soclib::common::alloc_elems<soclib::caba::DspinSignals<WIDTH_RSP> >("Dspin_rsp_signals_channel_0", 2, X_MAX, Y_MAX, 5 ); |
---|
118 | soclib::caba::DspinSignals<WIDTH_RSP> **** dspin_signals_rsp_c1 = soclib::common::alloc_elems<soclib::caba::DspinSignals<WIDTH_RSP> >("Dspin_rsp_signals_channel_2", 2, X_MAX, Y_MAX, 5 ); |
---|
119 | |
---|
120 | |
---|
121 | // N_CLUSTERS ring. |
---|
122 | soclib::caba::VciLocalRingFast<vci_param, WIDTH_CMD, WIDTH_RSP> * local_ring_c0 = (soclib::caba::VciLocalRingFast<vci_param, WIDTH_CMD, WIDTH_RSP> *) malloc(sizeof(soclib::caba::VciLocalRingFast<vci_param, WIDTH_CMD, WIDTH_RSP> ) * N_CLUSTERS) ; |
---|
123 | soclib::caba::VciLocalRingFast<vci_param, WIDTH_CMD, WIDTH_RSP> * local_ring_c1 = (soclib::caba::VciLocalRingFast<vci_param, WIDTH_CMD, WIDTH_RSP> *) malloc(sizeof(soclib::caba::VciLocalRingFast<vci_param, WIDTH_CMD, WIDTH_RSP> ) * N_CLUSTERS) ; |
---|
124 | for(int i = 0 ; i < N_CLUSTERS ; i++){ // ringid, fifo, fifo, nb_init, nb_tgt |
---|
125 | std::ostringstream str0; |
---|
126 | std::ostringstream str1; |
---|
127 | str0 << "cluster_c0_" << i ; |
---|
128 | str1 << "cluster_c1_" << i ; |
---|
129 | new(&local_ring_c0[i]) soclib::caba::VciLocalRingFast<vci_param, WIDTH_CMD, WIDTH_RSP> (str0.str().c_str(), |
---|
130 | maptab0, |
---|
131 | IntTab(i), |
---|
132 | 2, |
---|
133 | DEPTH, |
---|
134 | 1, |
---|
135 | 1); |
---|
136 | new(&local_ring_c1[i]) soclib::caba::VciLocalRingFast<vci_param, WIDTH_CMD, WIDTH_RSP> (str1.str().c_str(), |
---|
137 | maptab1, |
---|
138 | IntTab(i), |
---|
139 | 2, |
---|
140 | DEPTH, |
---|
141 | 1, |
---|
142 | 1); |
---|
143 | } |
---|
144 | |
---|
145 | // Virtual dspin routers |
---|
146 | soclib::caba::VirtualDspinRouter<WIDTH_CMD> ** routers_cmd = (soclib::caba::VirtualDspinRouter<WIDTH_CMD> **) malloc(sizeof(soclib::caba::VirtualDspinRouter<WIDTH_CMD> *) * X_MAX); |
---|
147 | soclib::caba::VirtualDspinRouter<WIDTH_RSP> ** routers_rsp = (soclib::caba::VirtualDspinRouter<WIDTH_RSP> **) malloc(sizeof(soclib::caba::VirtualDspinRouter<WIDTH_RSP> *) * X_MAX); |
---|
148 | |
---|
149 | for(int i = 0; i < X_MAX; i++ ){ |
---|
150 | routers_cmd[i] = (soclib::caba::VirtualDspinRouter<WIDTH_CMD> * ) malloc(sizeof(soclib::caba::VirtualDspinRouter<WIDTH_CMD>) * Y_MAX); |
---|
151 | routers_rsp[i] = (soclib::caba::VirtualDspinRouter<WIDTH_RSP> * ) malloc(sizeof(soclib::caba::VirtualDspinRouter<WIDTH_RSP>) * Y_MAX); |
---|
152 | for(int j = 0; j < Y_MAX; j++){ |
---|
153 | std::ostringstream str0; |
---|
154 | std::ostringstream str1; |
---|
155 | str0 << "VDspinRouterCMD" << i << j; |
---|
156 | str1 << "VDspinRouterRSP" << i << j; |
---|
157 | new(&routers_cmd[i][j]) soclib::caba::VirtualDspinRouter<WIDTH_CMD> (str0.str().c_str(), i, j, soclib::common::uint32_log2(X_MAX), soclib::common::uint32_log2(Y_MAX), DSPIN_FIFO, DSPIN_FIFO); |
---|
158 | new(&routers_rsp[i][j]) soclib::caba::VirtualDspinRouter<WIDTH_RSP> (str1.str().c_str(), i, j, soclib::common::uint32_log2(X_MAX), soclib::common::uint32_log2(Y_MAX), DSPIN_FIFO, DSPIN_FIFO); |
---|
159 | } |
---|
160 | } |
---|
161 | |
---|
162 | |
---|
163 | /////////////////////////////////////////////////////////////// |
---|
164 | // Components |
---|
165 | /////////////////////////////////////////////////////////////// |
---|
166 | |
---|
167 | // N_CLUSTERS VCI Synthetic Initiator (1 initiator per cluster/network) |
---|
168 | soclib::caba::VciSyntheticInitiator<vci_param> * initiator_c0 = (soclib::caba::VciSyntheticInitiator<vci_param> *) malloc(sizeof(soclib::caba::VciSyntheticInitiator<vci_param> )* N_CLUSTERS); |
---|
169 | soclib::caba::VciSyntheticInitiator<vci_param> * initiator_c1 = (soclib::caba::VciSyntheticInitiator<vci_param> *) malloc(sizeof(soclib::caba::VciSyntheticInitiator<vci_param> )* N_CLUSTERS); |
---|
170 | for(int i = 0 ; i < X_MAX; i++) |
---|
171 | for(int j = 0 ; j < Y_MAX ; j++){ |
---|
172 | std::ostringstream str0; |
---|
173 | std::ostringstream str1; |
---|
174 | str0 << "Initiator_c0_" << i << "_" << j ; |
---|
175 | str1 << "Initiator_c1_" << i << "_" << j ; |
---|
176 | new(&initiator_c0[Y_MAX*i+j]) soclib::caba::VciSyntheticInitiator<vci_param> (str0.str().c_str() , maptab0, IntTab((i*Y_MAX+j) ,0), PACKET_LENGTH, 0, 100, X_MAX, Y_MAX); |
---|
177 | new(&initiator_c1[Y_MAX*i+j]) soclib::caba::VciSyntheticInitiator<vci_param> (str1.str().c_str() , maptab1, IntTab((i*Y_MAX+j) ,0), PACKET_LENGTH, rho_b, 100, X_MAX, Y_MAX, rho_a, 0, X_MAX, 0, Y_MAX); |
---|
178 | } |
---|
179 | |
---|
180 | soclib::caba::VciSimpleRam<vci_param> * ram_c0 = (soclib::caba::VciSimpleRam<vci_param> *) malloc(sizeof(soclib::caba::VciSimpleRam<vci_param>) * N_CLUSTERS); |
---|
181 | soclib::caba::VciSimpleRam<vci_param> * ram_c1 = (soclib::caba::VciSimpleRam<vci_param> *) malloc(sizeof(soclib::caba::VciSimpleRam<vci_param>) * N_CLUSTERS); |
---|
182 | for(int i = 0 ; i < X_MAX ; i++) |
---|
183 | for(int j = 0 ; j < Y_MAX ; j++){ |
---|
184 | std::ostringstream str0; |
---|
185 | std::ostringstream str1; |
---|
186 | str0 << "Ram_c0_" << (i*Y_MAX+j) ; |
---|
187 | str1 << "Ram_c1_" << (i*Y_MAX+j) ; |
---|
188 | new(&ram_c0[Y_MAX*i+j]) soclib::caba::VciSimpleRam<vci_param> (str0.str().c_str() , IntTab(i*Y_MAX+j,0), maptab0, soclib::common::Loader(), 0); |
---|
189 | new(&ram_c1[Y_MAX*i+j]) soclib::caba::VciSimpleRam<vci_param> (str1.str().c_str() , IntTab(i*Y_MAX+j,0), maptab1, soclib::common::Loader(), 0); |
---|
190 | } |
---|
191 | |
---|
192 | /////////////////////////////////////////////////////////////// |
---|
193 | // Connection of Synthetic Initiator to each local ring per cluster |
---|
194 | /////////////////////////////////////////////////////////////// |
---|
195 | for(int i = 0 ; i < N_CLUSTERS ; i++){ |
---|
196 | local_ring_c0[i].p_clk(signal_clk); |
---|
197 | local_ring_c0[i].p_resetn(signal_resetn); |
---|
198 | local_ring_c0[i].p_to_initiator[0](signal_vci_ini_synth_c0[0][i]); |
---|
199 | local_ring_c0[i].p_to_target[0](signal_vci_ini_synth_c0[1][i]); |
---|
200 | initiator_c0[i].p_clk(signal_clk); |
---|
201 | initiator_c0[i].p_resetn(signal_resetn); |
---|
202 | initiator_c0[i].p_vci(signal_vci_ini_synth_c0[0][i]); |
---|
203 | ram_c0[i].p_clk(signal_clk); |
---|
204 | ram_c0[i].p_resetn(signal_resetn); |
---|
205 | ram_c0[i].p_vci(signal_vci_ini_synth_c0[1][i]); |
---|
206 | local_ring_c1[i].p_clk(signal_clk); |
---|
207 | local_ring_c1[i].p_resetn(signal_resetn); |
---|
208 | local_ring_c1[i].p_to_initiator[0](signal_vci_ini_synth_c1[0][i]); |
---|
209 | local_ring_c1[i].p_to_target[0](signal_vci_ini_synth_c1[1][i]); |
---|
210 | initiator_c1[i].p_clk(signal_clk); |
---|
211 | initiator_c1[i].p_resetn(signal_resetn); |
---|
212 | initiator_c1[i].p_vci(signal_vci_ini_synth_c1[0][i]); |
---|
213 | ram_c1[i].p_clk(signal_clk); |
---|
214 | ram_c1[i].p_resetn(signal_resetn); |
---|
215 | ram_c1[i].p_vci(signal_vci_ini_synth_c1[1][i]); |
---|
216 | } |
---|
217 | |
---|
218 | /////////////////////////////////////////////////////////////// |
---|
219 | // Connection of each VDspin Router to each local ring and |
---|
220 | // neighbors VDspin Router |
---|
221 | /////////////////////////////////////////////////////////////// |
---|
222 | for(int i = 0; i < X_MAX ; i++){ |
---|
223 | for(int j = 0; j < Y_MAX ; j++){ |
---|
224 | routers_cmd[i][j].p_clk(signal_clk); |
---|
225 | routers_cmd[i][j].p_resetn(signal_resetn); |
---|
226 | routers_rsp[i][j].p_clk(signal_clk); |
---|
227 | routers_rsp[i][j].p_resetn(signal_resetn); |
---|
228 | local_ring_c0[i*Y_MAX+j].p_gate_cmd_in( dspin_signals_cmd_c0[0][i][j][LOCAL]); |
---|
229 | local_ring_c1[i*Y_MAX+j].p_gate_cmd_in( dspin_signals_cmd_c1[0][i][j][LOCAL]); |
---|
230 | local_ring_c0[i*Y_MAX+j].p_gate_cmd_out(dspin_signals_cmd_c0[1][i][j][LOCAL]); |
---|
231 | local_ring_c1[i*Y_MAX+j].p_gate_cmd_out(dspin_signals_cmd_c1[1][i][j][LOCAL]); |
---|
232 | local_ring_c0[i*Y_MAX+j].p_gate_rsp_in( dspin_signals_rsp_c0[0][i][j][LOCAL]); |
---|
233 | local_ring_c1[i*Y_MAX+j].p_gate_rsp_in( dspin_signals_rsp_c1[0][i][j][LOCAL]); |
---|
234 | local_ring_c0[i*Y_MAX+j].p_gate_rsp_out(dspin_signals_rsp_c0[1][i][j][LOCAL]); |
---|
235 | local_ring_c1[i*Y_MAX+j].p_gate_rsp_out(dspin_signals_rsp_c1[1][i][j][LOCAL]); |
---|
236 | for(int k = 0; k < 5; k++){ |
---|
237 | if(j == 0){ |
---|
238 | if(i == 0){ |
---|
239 | routers_cmd[i][j].p_out[0][k](dspin_signals_cmd_c0[0][i][j][k]); |
---|
240 | routers_cmd[i][j].p_out[1][k](dspin_signals_cmd_c1[0][i][j][k]); |
---|
241 | routers_cmd[i][j].p_in[0][k](dspin_signals_cmd_c0[1][i][j][k]); |
---|
242 | routers_cmd[i][j].p_in[1][k](dspin_signals_cmd_c1[1][i][j][k]); |
---|
243 | routers_rsp[i][j].p_out[0][k](dspin_signals_rsp_c0[0][i][j][k]); |
---|
244 | routers_rsp[i][j].p_out[1][k](dspin_signals_rsp_c1[0][i][j][k]); |
---|
245 | routers_rsp[i][j].p_in[0][k](dspin_signals_rsp_c0[1][i][j][k]); |
---|
246 | routers_rsp[i][j].p_in[1][k](dspin_signals_rsp_c1[1][i][j][k]); |
---|
247 | } else { |
---|
248 | if(k == WEST){ |
---|
249 | routers_cmd[i][j].p_out[0][k](dspin_signals_cmd_c0[1][i-1][j][EAST]); |
---|
250 | routers_cmd[i][j].p_out[1][k](dspin_signals_cmd_c1[1][i-1][j][EAST]); |
---|
251 | routers_cmd[i][j].p_in[0][k](dspin_signals_cmd_c0[0][i-1][j][EAST]); |
---|
252 | routers_cmd[i][j].p_in[1][k](dspin_signals_cmd_c1[0][i-1][j][EAST]); |
---|
253 | routers_rsp[i][j].p_out[0][k](dspin_signals_rsp_c0[1][i-1][j][EAST]); |
---|
254 | routers_rsp[i][j].p_out[1][k](dspin_signals_rsp_c1[1][i-1][j][EAST]); |
---|
255 | routers_rsp[i][j].p_in[0][k](dspin_signals_rsp_c0[0][i-1][j][EAST]); |
---|
256 | routers_rsp[i][j].p_in[1][k](dspin_signals_rsp_c1[0][i-1][j][EAST]); |
---|
257 | } else { |
---|
258 | routers_cmd[i][j].p_out[0][k](dspin_signals_cmd_c0[0][i][j][k]); |
---|
259 | routers_cmd[i][j].p_out[1][k](dspin_signals_cmd_c1[0][i][j][k]); |
---|
260 | routers_cmd[i][j].p_in[0][k](dspin_signals_cmd_c0[1][i][j][k]); |
---|
261 | routers_cmd[i][j].p_in[1][k](dspin_signals_cmd_c1[1][i][j][k]); |
---|
262 | routers_rsp[i][j].p_out[0][k](dspin_signals_rsp_c0[0][i][j][k]); |
---|
263 | routers_rsp[i][j].p_out[1][k](dspin_signals_rsp_c1[0][i][j][k]); |
---|
264 | routers_rsp[i][j].p_in[0][k](dspin_signals_rsp_c0[1][i][j][k]); |
---|
265 | routers_rsp[i][j].p_in[1][k](dspin_signals_rsp_c1[1][i][j][k]); |
---|
266 | } |
---|
267 | } |
---|
268 | } else { |
---|
269 | if(k == SOUTH){ |
---|
270 | routers_cmd[i][j].p_out[0][k](dspin_signals_cmd_c0[1][i][j-1][NORTH]); |
---|
271 | routers_cmd[i][j].p_out[1][k](dspin_signals_cmd_c1[1][i][j-1][NORTH]); |
---|
272 | routers_cmd[i][j].p_in[0][k](dspin_signals_cmd_c0[0][i][j-1][NORTH]); |
---|
273 | routers_cmd[i][j].p_in[1][k](dspin_signals_cmd_c1[0][i][j-1][NORTH]); |
---|
274 | routers_rsp[i][j].p_out[0][k](dspin_signals_rsp_c0[1][i][j-1][NORTH]); |
---|
275 | routers_rsp[i][j].p_out[1][k](dspin_signals_rsp_c1[1][i][j-1][NORTH]); |
---|
276 | routers_rsp[i][j].p_in[0][k](dspin_signals_rsp_c0[0][i][j-1][NORTH]); |
---|
277 | routers_rsp[i][j].p_in[1][k](dspin_signals_rsp_c1[0][i][j-1][NORTH]); |
---|
278 | } else if(k == WEST){ |
---|
279 | if(i == 0){ |
---|
280 | routers_cmd[i][j].p_out[0][k](dspin_signals_cmd_c0[0][i][j][k]); |
---|
281 | routers_cmd[i][j].p_out[1][k](dspin_signals_cmd_c1[0][i][j][k]); |
---|
282 | routers_cmd[i][j].p_in[0][k](dspin_signals_cmd_c0[1][i][j][k]); |
---|
283 | routers_cmd[i][j].p_in[1][k](dspin_signals_cmd_c1[1][i][j][k]); |
---|
284 | routers_rsp[i][j].p_out[0][k](dspin_signals_rsp_c0[0][i][j][k]); |
---|
285 | routers_rsp[i][j].p_out[1][k](dspin_signals_rsp_c1[0][i][j][k]); |
---|
286 | routers_rsp[i][j].p_in[0][k](dspin_signals_rsp_c0[1][i][j][k]); |
---|
287 | routers_rsp[i][j].p_in[1][k](dspin_signals_rsp_c1[1][i][j][k]); |
---|
288 | } else { |
---|
289 | routers_cmd[i][j].p_out[0][k](dspin_signals_cmd_c0[1][i-1][j][EAST]); |
---|
290 | routers_cmd[i][j].p_out[1][k](dspin_signals_cmd_c1[1][i-1][j][EAST]); |
---|
291 | routers_cmd[i][j].p_in[0][k](dspin_signals_cmd_c0[0][i-1][j][EAST]); |
---|
292 | routers_cmd[i][j].p_in[1][k](dspin_signals_cmd_c1[0][i-1][j][EAST]); |
---|
293 | routers_rsp[i][j].p_out[0][k](dspin_signals_rsp_c0[1][i-1][j][EAST]); |
---|
294 | routers_rsp[i][j].p_out[1][k](dspin_signals_rsp_c1[1][i-1][j][EAST]); |
---|
295 | routers_rsp[i][j].p_in[0][k](dspin_signals_rsp_c0[0][i-1][j][EAST]); |
---|
296 | routers_rsp[i][j].p_in[1][k](dspin_signals_rsp_c1[0][i-1][j][EAST]); |
---|
297 | } |
---|
298 | } else { |
---|
299 | routers_cmd[i][j].p_out[0][k](dspin_signals_cmd_c0[0][i][j][k]); |
---|
300 | routers_cmd[i][j].p_out[1][k](dspin_signals_cmd_c1[0][i][j][k]); |
---|
301 | routers_cmd[i][j].p_in[0][k](dspin_signals_cmd_c0[1][i][j][k]); |
---|
302 | routers_cmd[i][j].p_in[1][k](dspin_signals_cmd_c1[1][i][j][k]); |
---|
303 | routers_rsp[i][j].p_out[0][k](dspin_signals_rsp_c0[0][i][j][k]); |
---|
304 | routers_rsp[i][j].p_out[1][k](dspin_signals_rsp_c1[0][i][j][k]); |
---|
305 | routers_rsp[i][j].p_in[0][k](dspin_signals_rsp_c0[1][i][j][k]); |
---|
306 | routers_rsp[i][j].p_in[1][k](dspin_signals_rsp_c1[1][i][j][k]); |
---|
307 | } |
---|
308 | } |
---|
309 | } |
---|
310 | } |
---|
311 | } |
---|
312 | |
---|
313 | //////////////////////////////////////////////// |
---|
314 | // Simulation Loop // |
---|
315 | //////////////////////////////////////////////// |
---|
316 | |
---|
317 | |
---|
318 | sc_start(sc_core::sc_time(0, SC_NS)); |
---|
319 | signal_resetn = false; |
---|
320 | |
---|
321 | for(int i = 0; i < X_MAX ; i++){ |
---|
322 | for(int j = 0; j < Y_MAX ; j++){ |
---|
323 | if(j == 0){ |
---|
324 | dspin_signals_cmd_c0[0][i][j][SOUTH].read = true ; |
---|
325 | dspin_signals_cmd_c0[1][i][j][SOUTH].write = false ; |
---|
326 | dspin_signals_cmd_c1[0][i][j][SOUTH].read = true ; |
---|
327 | dspin_signals_cmd_c1[1][i][j][SOUTH].write = false ; |
---|
328 | dspin_signals_rsp_c0[0][i][j][SOUTH].read = true ; |
---|
329 | dspin_signals_rsp_c0[1][i][j][SOUTH].write = false ; |
---|
330 | dspin_signals_rsp_c1[0][i][j][SOUTH].read = true ; |
---|
331 | dspin_signals_rsp_c1[1][i][j][SOUTH].write = false ; |
---|
332 | } |
---|
333 | if(j == Y_MAX-1){ |
---|
334 | dspin_signals_cmd_c0[0][i][j][NORTH].read = true ; |
---|
335 | dspin_signals_cmd_c0[1][i][j][NORTH].write = false ; |
---|
336 | dspin_signals_cmd_c1[0][i][j][NORTH].read = true ; |
---|
337 | dspin_signals_cmd_c1[1][i][j][NORTH].write = false ; |
---|
338 | dspin_signals_rsp_c0[0][i][j][NORTH].read = true ; |
---|
339 | dspin_signals_rsp_c0[1][i][j][NORTH].write = false ; |
---|
340 | dspin_signals_rsp_c1[0][i][j][NORTH].read = true ; |
---|
341 | dspin_signals_rsp_c1[1][i][j][NORTH].write = false ; |
---|
342 | } |
---|
343 | if(i == 0){ |
---|
344 | dspin_signals_cmd_c0[0][i][j][WEST].read = true ; |
---|
345 | dspin_signals_cmd_c0[1][i][j][WEST].write = false ; |
---|
346 | dspin_signals_cmd_c1[0][i][j][WEST].read = true ; |
---|
347 | dspin_signals_cmd_c1[1][i][j][WEST].write = false ; |
---|
348 | dspin_signals_rsp_c0[0][i][j][WEST].read = true ; |
---|
349 | dspin_signals_rsp_c0[1][i][j][WEST].write = false ; |
---|
350 | dspin_signals_rsp_c1[0][i][j][WEST].read = true ; |
---|
351 | dspin_signals_rsp_c1[1][i][j][WEST].write = false ; |
---|
352 | } |
---|
353 | if(i == X_MAX-1){ |
---|
354 | dspin_signals_cmd_c0[0][i][j][EAST].read = true ; |
---|
355 | dspin_signals_cmd_c0[1][i][j][EAST].write = false ; |
---|
356 | dspin_signals_cmd_c1[0][i][j][EAST].read = true ; |
---|
357 | dspin_signals_cmd_c1[1][i][j][EAST].write = false ; |
---|
358 | dspin_signals_rsp_c0[0][i][j][EAST].read = true ; |
---|
359 | dspin_signals_rsp_c0[1][i][j][EAST].write = false ; |
---|
360 | dspin_signals_rsp_c1[0][i][j][EAST].read = true ; |
---|
361 | dspin_signals_rsp_c1[1][i][j][EAST].write = false ; |
---|
362 | } |
---|
363 | } |
---|
364 | } |
---|
365 | |
---|
366 | sc_start(sc_core::sc_time(1, SC_NS)); |
---|
367 | signal_resetn = true; |
---|
368 | |
---|
369 | for(int t = 0; t < ncycles; t++){ |
---|
370 | sc_start(sc_time(1, SC_NS)); |
---|
371 | //initiator_c1[4].print_trace(); |
---|
372 | //local_ring_c1[4].print_trace(); |
---|
373 | //ram_c1[4].print_trace(); |
---|
374 | #if defined(DEBUG) |
---|
375 | for(int i = 0 ; i < Y_MAX ; i++){ |
---|
376 | for(int j = 0 ; j < X_MAX ; j++){ |
---|
377 | #endif |
---|
378 | #if DEBUG==1 |
---|
379 | //initiator_c0[i*Y_MAX+j].print_trace(); |
---|
380 | //std::cout << std::hex; |
---|
381 | //std::cout << "synt_cmdval = " << signal_vci_ini_synth_c0[0][i*Y_MAX+j].cmdval.read() << std::endl; |
---|
382 | //std::cout << "synt_cmdack = " << signal_vci_ini_synth_c0[0][i*Y_MAX+j].cmdack.read() << std::endl; |
---|
383 | //std::cout << "synt_address = " << signal_vci_ini_synth_c0[0][i*Y_MAX+j].address.read() << std::endl; |
---|
384 | //std::cout << "synt_cmd = " << signal_vci_ini_synth_c0[0][i*Y_MAX+j].cmd.read() << std::endl; |
---|
385 | //std::cout << "synt_srcid = " << signal_vci_ini_synth_c0[0][i*Y_MAX+j].srcid.read() << std::endl; |
---|
386 | //std::cout << "synt_trdid = " << signal_vci_ini_synth_c0[0][i*Y_MAX+j].trdid.read() << std::endl; |
---|
387 | //std::cout << "synt_plen = " << signal_vci_ini_synth_c0[0][i*Y_MAX+j].plen.read() << std::endl; |
---|
388 | //std::cout << "synt_eop = " << signal_vci_ini_synth_c0[0][i*Y_MAX+j].eop.read() << std::endl; |
---|
389 | //std::cout << "synt_rspval = " << signal_vci_ini_synth_c0[0][i*Y_MAX+j].rspval.read() << std::endl; |
---|
390 | //std::cout << "synt_rspack = " << signal_vci_ini_synth_c0[0][i*Y_MAX+j].rspack.read() << std::endl; |
---|
391 | //std::cout << "synt_rsrcid = " << signal_vci_ini_synth_c0[0][i*Y_MAX+j].rsrcid.read() << std::endl; |
---|
392 | //std::cout << "synt_rtrdid = " << signal_vci_ini_synth_c0[0][i*Y_MAX+j].rtrdid.read() << std::endl; |
---|
393 | //std::cout << "synt_rpktid = " << signal_vci_ini_synth_c1[0][i*Y_MAX+j].rpktid.read() << std::endl; |
---|
394 | //std::cout << "synt_rerror = " << signal_vci_ini_synth_c0[0][i*Y_MAX+j].rerror.read() << std::endl; |
---|
395 | //std::cout << "synt_reop = " << signal_vci_ini_synth_c0[0][i*Y_MAX+j].reop.read() << std::endl; |
---|
396 | //ram_c0[i*Y_MAX+j].print_trace(); |
---|
397 | //std::cout << std::hex; |
---|
398 | //std::cout << "ram_cmdval = " << signal_vci_ini_synth_c0[1][i*Y_MAX+j].cmdval.read() << std::endl; |
---|
399 | //std::cout << "ram_address = " << signal_vci_ini_synth_c0[1][i*Y_MAX+j].address.read() << std::endl; |
---|
400 | //std::cout << "ram_cmd = " << signal_vci_ini_synth_c0[1][i*Y_MAX+j].cmd.read() << std::endl; |
---|
401 | //std::cout << "ram_srcid = " << signal_vci_ini_synth_c0[1][i*Y_MAX+j].srcid.read() << std::endl; |
---|
402 | //std::cout << "ram_trdid = " << signal_vci_ini_synth_c0[1][i*Y_MAX+j].trdid.read() << std::endl; |
---|
403 | //std::cout << "ram_plen = " << signal_vci_ini_synth_c0[1][i*Y_MAX+j].plen.read() << std::endl; |
---|
404 | //std::cout << "ram_eop = " << signal_vci_ini_synth_c0[1][i*Y_MAX+j].eop.read() << std::endl; |
---|
405 | //std::cout << "ram_rspval = " << signal_vci_ini_synth_c0[1][i*Y_MAX+j].rspval.read() << std::endl; |
---|
406 | //std::cout << "ram_rspack = " << signal_vci_ini_synth_c0[1][i*Y_MAX+j].rspack.read() << std::endl; |
---|
407 | //std::cout << "ram_rsrcid = " << signal_vci_ini_synth_c0[1][i*Y_MAX+j].rsrcid.read() << std::endl; |
---|
408 | //std::cout << "ram_rtrdid = " << signal_vci_ini_synth_c0[1][i*Y_MAX+j].rtrdid.read() << std::endl; |
---|
409 | //std::cout << "ram_rerror = " << signal_vci_ini_synth_c0[1][i*Y_MAX+j].rerror.read() << std::endl; |
---|
410 | //std::cout << "ram_reop = " << signal_vci_ini_synth_c0[1][i*Y_MAX+j].reop.read() << std::endl; |
---|
411 | //initiator_c1[i*Y_MAX+j].print_trace(); |
---|
412 | //std::cout << std::hex; |
---|
413 | //std::cout << "synt_cmdval = " << signal_vci_ini_synth_c1[0][i*Y_MAX+j].cmdval.read() << std::endl; |
---|
414 | //std::cout << "synt_cmdack = " << signal_vci_ini_synth_c1[0][i*Y_MAX+j].cmdack.read() << std::endl; |
---|
415 | //std::cout << "synt_address = " << signal_vci_ini_synth_c1[0][i*Y_MAX+j].address.read() << std::endl; |
---|
416 | //std::cout << "synt_cmd = " << signal_vci_ini_synth_c1[0][i*Y_MAX+j].cmd.read() << std::endl; |
---|
417 | //std::cout << "synt_srcid = " << signal_vci_ini_synth_c1[0][i*Y_MAX+j].srcid.read() << std::endl; |
---|
418 | //std::cout << "synt_trdid = " << signal_vci_ini_synth_c1[0][i*Y_MAX+j].trdid.read() << std::endl; |
---|
419 | //std::cout << "synt_pktid = " << signal_vci_ini_synth_c1[0][i*Y_MAX+j].pktid.read() << std::endl; |
---|
420 | //std::cout << "synt_plen = " << signal_vci_ini_synth_c1[0][i*Y_MAX+j].plen.read() << std::endl; |
---|
421 | //std::cout << "synt_eop = " << signal_vci_ini_synth_c1[0][i*Y_MAX+j].eop.read() << std::endl; |
---|
422 | //std::cout << "synt_rspval = " << signal_vci_ini_synth_c1[0][i*Y_MAX+j].rspval.read() << std::endl; |
---|
423 | //std::cout << "synt_rspack = " << signal_vci_ini_synth_c1[0][i*Y_MAX+j].rspack.read() << std::endl; |
---|
424 | //std::cout << "synt_rsrcid = " << signal_vci_ini_synth_c1[0][i*Y_MAX+j].rsrcid.read() << std::endl; |
---|
425 | //std::cout << "synt_rtrdid = " << signal_vci_ini_synth_c1[0][i*Y_MAX+j].rtrdid.read() << std::endl; |
---|
426 | //std::cout << "synt_rpktid = " << signal_vci_ini_synth_c1[0][i*Y_MAX+j].rpktid.read() << std::endl; |
---|
427 | //std::cout << "synt_rerror = " << signal_vci_ini_synth_c1[0][i*Y_MAX+j].rerror.read() << std::endl; |
---|
428 | //std::cout << "synt_reop = " << signal_vci_ini_synth_c1[0][i*Y_MAX+j].reop.read() << std::endl; |
---|
429 | ram_c1[i*Y_MAX+j].print_trace(); |
---|
430 | std::cout << std::hex; |
---|
431 | std::cout << "ram_cmdval = " << signal_vci_ini_synth_c1[1][i*Y_MAX+j].cmdval.read() << std::endl; |
---|
432 | std::cout << "ram_address = " << signal_vci_ini_synth_c1[1][i*Y_MAX+j].address.read() << std::endl; |
---|
433 | std::cout << "ram_cmd = " << signal_vci_ini_synth_c1[1][i*Y_MAX+j].cmd.read() << std::endl; |
---|
434 | std::cout << "ram_srcid = " << signal_vci_ini_synth_c1[1][i*Y_MAX+j].srcid.read() << std::endl; |
---|
435 | std::cout << "ram_trdid = " << signal_vci_ini_synth_c1[1][i*Y_MAX+j].trdid.read() << std::endl; |
---|
436 | std::cout << "ram_pktid = " << signal_vci_ini_synth_c1[1][i*Y_MAX+j].pktid.read() << std::endl; |
---|
437 | std::cout << "ram_plen = " << signal_vci_ini_synth_c1[1][i*Y_MAX+j].plen.read() << std::endl; |
---|
438 | std::cout << "ram_eop = " << signal_vci_ini_synth_c1[1][i*Y_MAX+j].eop.read() << std::endl; |
---|
439 | std::cout << "ram_rspval = " << signal_vci_ini_synth_c1[1][i*Y_MAX+j].rspval.read() << std::endl; |
---|
440 | std::cout << "ram_rspack = " << signal_vci_ini_synth_c1[1][i*Y_MAX+j].rspack.read() << std::endl; |
---|
441 | std::cout << "ram_rsrcid = " << signal_vci_ini_synth_c1[1][i*Y_MAX+j].rsrcid.read() << std::endl; |
---|
442 | std::cout << "ram_rtrdid = " << signal_vci_ini_synth_c1[1][i*Y_MAX+j].rtrdid.read() << std::endl; |
---|
443 | std::cout << "ram_rpktid = " << signal_vci_ini_synth_c1[1][i*Y_MAX+j].rpktid.read() << std::endl; |
---|
444 | std::cout << "ram_rerror = " << signal_vci_ini_synth_c1[1][i*Y_MAX+j].rerror.read() << std::endl; |
---|
445 | std::cout << "ram_reop = " << signal_vci_ini_synth_c1[1][i*Y_MAX+j].reop.read() << std::endl; |
---|
446 | #endif |
---|
447 | #if DEBUG==2 |
---|
448 | local_ring_c0[i*Y_MAX+j].print_trace(); |
---|
449 | routers_cmd[i][j].print_trace(0); |
---|
450 | std::cout << std::dec << t << " ns" << std::endl; |
---|
451 | routers_rsp[i][j].print_trace(0); |
---|
452 | #endif |
---|
453 | #ifdef DEBUG |
---|
454 | } |
---|
455 | } |
---|
456 | #endif |
---|
457 | //initiator_c1[4].print_trace(); |
---|
458 | //std::cout << std::hex; |
---|
459 | //std::cout << "synt_cmdval = " << signal_vci_ini_synth_c1[0][255].cmdval.read() << std::endl; |
---|
460 | //std::cout << "synt_cmdack = " << signal_vci_ini_synth_c1[0][255].cmdack.read() << std::endl; |
---|
461 | //std::cout << "synt_address = " << signal_vci_ini_synth_c1[0][255].address.read() << std::endl; |
---|
462 | //std::cout << "synt_cmd = " << signal_vci_ini_synth_c1[0][255].cmd.read() << std::endl; |
---|
463 | //std::cout << "synt_srcid = " << signal_vci_ini_synth_c1[0][255].srcid.read() << std::endl; |
---|
464 | //std::cout << "synt_trdid = " << signal_vci_ini_synth_c1[0][255].trdid.read() << std::endl; |
---|
465 | //std::cout << "synt_pktid = " << signal_vci_ini_synth_c1[0][255].pktid.read() << std::endl; |
---|
466 | //std::cout << "synt_plen = " << signal_vci_ini_synth_c1[0][255].plen.read() << std::endl; |
---|
467 | //std::cout << "synt_eop = " << signal_vci_ini_synth_c1[0][255].eop.read() << std::endl; |
---|
468 | //std::cout << "synt_rspval = " << signal_vci_ini_synth_c1[0][255].rspval.read() << std::endl; |
---|
469 | //std::cout << "synt_rspack = " << signal_vci_ini_synth_c1[0][255].rspack.read() << std::endl; |
---|
470 | //std::cout << "synt_rsrcid = " << signal_vci_ini_synth_c1[0][255].rsrcid.read() << std::endl; |
---|
471 | //std::cout << "synt_rtrdid = " << signal_vci_ini_synth_c1[0][255].rtrdid.read() << std::endl; |
---|
472 | //std::cout << "synt_rpktid = " << signal_vci_ini_synth_c1[0][255].rpktid.read() << std::endl; |
---|
473 | //std::cout << "synt_rerror = " << signal_vci_ini_synth_c1[0][255].rerror.read() << std::endl; |
---|
474 | //std::cout << "synt_reop = " << signal_vci_ini_synth_c1[0][255].reop.read() << std::endl; |
---|
475 | //ram_c1[4].print_trace(); |
---|
476 | //std::cout << std::hex; |
---|
477 | //std::cout << "ram_cmdval = " << signal_vci_ini_synth_c1[1][4].cmdval.read() << std::endl; |
---|
478 | //std::cout << "ram_address = " << signal_vci_ini_synth_c1[1][4].address.read() << std::endl; |
---|
479 | //std::cout << "ram_cmd = " << signal_vci_ini_synth_c1[1][4].cmd.read() << std::endl; |
---|
480 | //std::cout << "ram_srcid = " << signal_vci_ini_synth_c1[1][4].srcid.read() << std::endl; |
---|
481 | //std::cout << "ram_trdid = " << signal_vci_ini_synth_c1[1][4].trdid.read() << std::endl; |
---|
482 | //std::cout << "ram_pktid = " << signal_vci_ini_synth_c1[1][4].pktid.read() << std::endl; |
---|
483 | //std::cout << "ram_plen = " << signal_vci_ini_synth_c1[1][4].plen.read() << std::endl; |
---|
484 | //std::cout << "ram_eop = " << signal_vci_ini_synth_c1[1][4].eop.read() << std::endl; |
---|
485 | //std::cout << "ram_rspval = " << signal_vci_ini_synth_c1[1][4].rspval.read() << std::endl; |
---|
486 | //std::cout << "ram_rspack = " << signal_vci_ini_synth_c1[1][4].rspack.read() << std::endl; |
---|
487 | //std::cout << "ram_rsrcid = " << signal_vci_ini_synth_c1[1][4].rsrcid.read() << std::endl; |
---|
488 | //std::cout << "ram_rtrdid = " << signal_vci_ini_synth_c1[1][4].rtrdid.read() << std::endl; |
---|
489 | //std::cout << "ram_rpktid = " << signal_vci_ini_synth_c1[1][4].rpktid.read() << std::endl; |
---|
490 | //std::cout << "ram_rerror = " << signal_vci_ini_synth_c1[1][4].rerror.read() << std::endl; |
---|
491 | //std::cout << "ram_reop = " << signal_vci_ini_synth_c1[1][4].reop.read() << std::endl; |
---|
492 | |
---|
493 | //for(int i = 0 ; i < Y_MAX ; i++){ |
---|
494 | // for(int j = 0 ; j < X_MAX ; j++){ |
---|
495 | // std::cout << std::dec << t << " cycles " << std::endl; |
---|
496 | // local_ring_c1[i*Y_MAX+j].print_trace(); |
---|
497 | // //initiator_c1[i*Y_MAX+j].print_trace(); |
---|
498 | // } |
---|
499 | //} |
---|
500 | //initiator_c1[4].print_trace(); |
---|
501 | //std::cout << std::hex; |
---|
502 | //std::cout << "synt_cmdval = " << signal_vci_ini_synth_c1[0][4].cmdval.read() << std::endl; |
---|
503 | //std::cout << "synt_cmdack = " << signal_vci_ini_synth_c1[0][4].cmdack.read() << std::endl; |
---|
504 | //std::cout << "synt_address = " << signal_vci_ini_synth_c1[0][4].address.read() << std::endl; |
---|
505 | //std::cout << "synt_cmd = " << signal_vci_ini_synth_c1[0][4].cmd.read() << std::endl; |
---|
506 | //std::cout << "synt_srcid = " << signal_vci_ini_synth_c1[0][4].srcid.read() << std::endl; |
---|
507 | //std::cout << "synt_trdid = " << signal_vci_ini_synth_c1[0][4].trdid.read() << std::endl; |
---|
508 | //std::cout << "synt_pktid = " << signal_vci_ini_synth_c1[0][4].pktid.read() << std::endl; |
---|
509 | //std::cout << "synt_plen = " << signal_vci_ini_synth_c1[0][4].plen.read() << std::endl; |
---|
510 | //std::cout << "synt_eop = " << signal_vci_ini_synth_c1[0][4].eop.read() << std::endl; |
---|
511 | //std::cout << "synt_rspval = " << signal_vci_ini_synth_c1[0][4].rspval.read() << std::endl; |
---|
512 | //std::cout << "synt_rspack = " << signal_vci_ini_synth_c1[0][4].rspack.read() << std::endl; |
---|
513 | //std::cout << "synt_rsrcid = " << signal_vci_ini_synth_c1[0][4].rsrcid.read() << std::endl; |
---|
514 | //std::cout << "synt_rtrdid = " << signal_vci_ini_synth_c1[0][4].rtrdid.read() << std::endl; |
---|
515 | //std::cout << "synt_rpktid = " << signal_vci_ini_synth_c1[0][4].rpktid.read() << std::endl; |
---|
516 | //std::cout << "synt_rerror = " << signal_vci_ini_synth_c1[0][4].rerror.read() << std::endl; |
---|
517 | //std::cout << "synt_reop = " << signal_vci_ini_synth_c1[0][4].reop.read() << std::endl; |
---|
518 | //local_ring_c1[4].print_trace(); |
---|
519 | //initiator_c1[27].print_fifo_state(); |
---|
520 | //if (!(t%1000000)) |
---|
521 | // std::cout <<std::dec << t << " 1000000 cycles passed" << std::endl; |
---|
522 | |
---|
523 | |
---|
524 | } |
---|
525 | |
---|
526 | //double latency_c0 = 0; |
---|
527 | double latency_c1 = 0; |
---|
528 | double latency_bc = 0; |
---|
529 | std::cout << "Results : " << std::endl; |
---|
530 | for(int i = 0 ; i < Y_MAX ; i++){ |
---|
531 | for(int j = 0 ; j < X_MAX ; j++){ |
---|
532 | //initiator_c0[i*Y_MAX+j].printStats(); |
---|
533 | //latency_c0 += initiator_c0[i*Y_MAX+j].getLatencySingle() ; |
---|
534 | initiator_c1[i*Y_MAX+j].printStats(); |
---|
535 | latency_c1 += initiator_c1[i*Y_MAX+j].getLatencySingle() ; |
---|
536 | latency_bc += initiator_c1[i*Y_MAX+j].getLatencyBC(); |
---|
537 | std::cout << "bc latency " << latency_bc << std::endl; |
---|
538 | } |
---|
539 | } |
---|
540 | |
---|
541 | |
---|
542 | //std::cout << "Latency_c0 : " << latency_c0 << std::endl; |
---|
543 | std::cout << "Latency_c1 : " << latency_c1 << std::endl; |
---|
544 | std::cout << "BC latency : " << latency_bc << std::endl; |
---|
545 | |
---|
546 | std::cout << "Simulation Ends" << std::endl; |
---|
547 | |
---|
548 | |
---|
549 | return EXIT_SUCCESS; |
---|
550 | } |
---|
551 | |
---|
552 | int sc_main (int argc, char *argv[]) |
---|
553 | { |
---|
554 | try { |
---|
555 | return _main(argc, argv); |
---|
556 | } catch (std::exception &e) { |
---|
557 | std::cout << e.what() << std::endl; |
---|
558 | } catch (...) { |
---|
559 | std::cout << "Unknown exception occured" << std::endl; |
---|
560 | throw; |
---|
561 | } |
---|
562 | return 1; |
---|
563 | } |
---|
564 | |
---|