- Timestamp:
- Jun 12, 2015, 3:22:12 PM (10 years ago)
- Location:
- branches/reconfiguration/modules/dspin_router/caba/test/synthetic_test
- Files:
-
- 14 added
- 2 deleted
- 2 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/reconfiguration/modules/dspin_router/caba/test/synthetic_test/scripts/broadcast_check.sh
r997 r998 69 69 70 70 error=sent - min 71 if (error > 20) {71 if (error > 0) { 72 72 print "error: the number of broadcast received by a router is inferior " 73 print "to the error threshold \n";73 print "to the error threshold: error = " error "\n"; 74 74 exit 1; 75 75 } -
branches/reconfiguration/modules/dspin_router/caba/test/synthetic_test/scripts/run_broadcast_check.sh
r997 r998 1 1 #!/usr/bin/env sh 2 2 LOGDIR=logs 3 COMMON="-X 5 -Y 5 -N 10000" 3 COMMON="-X 5 -Y 5 -P 1500" 4 SCRIPTPATH=$(dirname $0) 5 6 # compile the platform 7 make 8 if [[ ! -f ./simul.x ]]; then exit 1; fi; 4 9 5 10 mkdir -p $LOGDIR … … 13 18 echo "./simul.x $ARGS ($LOGFILE)" 14 19 ./simul.x $ARGS > $LOGFILE 2>/dev/null; 15 ./broadcast_check.sh $LOGFILE20 $SCRIPTPATH/broadcast_check.sh $LOGFILE 16 21 if [[ $? == 1 ]]; then 17 22 echo "FAILURE"; -
branches/reconfiguration/modules/dspin_router/caba/test/synthetic_test/top.cpp
r996 r998 9 9 #include <systemc> 10 10 #include <cassert> 11 #include <cstdlib> 11 12 12 13 #include "dspin_router.h" … … 25 26 #define Y_WIDTH 4 26 27 27 #define FIFO_DEPTH 828 #define NFLITS 228 #define FIFO_DEPTH 2 29 #define NFLITS 8 29 30 #define LOAD 1000 30 #define BROADCAST_PERIOD 331 #define BROADCAST_PERIOD 1 31 32 #define DSPIN_WIDTH 39 33 #define MAX_PACKETS 100 32 34 33 35 /* 34 36 * Platform default values 35 37 */ 36 #define X_SIZE 437 #define Y_SIZE 438 #define X_SIZE 5 39 #define Y_SIZE 5 38 40 39 41 static inline int cluster(int x, int y) … … 78 80 int yFaulty = -1; 79 81 80 /* enable the DSPIN router's debug*/81 int debug = false;82 83 /* number of simulation cycles*/84 int simCycles = 100000;82 /* simulation cycles */ 83 size_t simCycles = 0; 84 85 /* debug */ 86 bool debug = false; 85 87 86 88 /* synthetic generator load */ 87 89 int load = LOAD; 90 91 /* broadcast period */ 92 int bcp = BROADCAST_PERIOD; 93 94 /* maximum number of packets per generator */ 95 size_t max = MAX_PACKETS; 88 96 89 97 for (int n = 1; n < argc; n += 2) { … … 122 130 continue; 123 131 } 124 if ((strcmp(argv[n--], "-DEBUG") == 0)) { 132 if ((strcmp(argv[n], "-B") == 0) && ((n + 1) < argc) ) { 133 bcp = strtol(argv[n + 1], NULL, 0); 134 assert(bcp >= 0); 135 continue; 136 } 137 if ((strcmp(argv[n], "-P") == 0) && ((n + 1) < argc) ) { 138 max = strtol(argv[n + 1], NULL, 0); 139 continue; 140 } 141 if ((strcmp(argv[n--], "-G") == 0)) { 125 142 debug = true; 126 143 continue; … … 154 171 } 155 172 156 int broadcast_period = 0;157 173 int ld = 0; 158 174 const int SRCID = cluster(x,y); 159 175 bool all = (xSrc == -1) || (ySrc == -1); 160 176 if (all || (cluster(x,y) == cluster(xSrc,ySrc))) { 161 broadcast_period = BROADCAST_PERIOD; 162 ld = load; 177 ld = load; 178 } 179 if ((x == xFaulty) && (y == yFaulty)) { 180 ld = 0; 181 } 182 if (simCycles > 0) { 183 max = 0; 163 184 } 164 185 std::ostringstream generatorStr; … … 167 188 new DspinGeneratorType(generatorStr.str().c_str(), 168 189 SRCID, NFLITS, 169 ld, FIFO_DEPTH, 170 broadcast_period); 190 ld, 8, 191 bcp, 192 X_WIDTH, Y_WIDTH, 193 X_SIZE, Y_SIZE, 194 max); 171 195 } 172 196 } … … 266 290 } 267 291 292 srandom(3); 268 293 sc_start(sc_core::SC_ZERO_TIME); 269 294 signal_resetn = 0; … … 297 322 signal_resetn = 1; 298 323 299 for(int i = 0; i < simCycles; ++i) { 300 if (!debug) { 324 size_t n; 325 if (debug) { 326 for(n = 0; n < simCycles; ++n) { 327 std::cout << std::endl; 328 std::cout << "##########################################" << std::endl; 329 std::cout << "Simulation cycle " << n << std::endl; 330 std::cout << "##########################################" << std::endl; 331 std::cout << std::endl; 332 sc_start(sc_core::sc_time(1, SC_NS)); 333 for (int x = 0; x < xSize; ++x) { 334 for (int y = 0; y < ySize; ++y) { 335 dspinRouter[x][y]->print_trace(); 336 dspinGenerator[x][y]->print_trace(); 337 } 338 } 339 } 340 } else { 341 if (simCycles > 0) { 301 342 sc_start(sc_core::sc_time(simCycles, SC_NS)); 302 break; 303 } 304 std::cout << std::endl; 305 std::cout << "##########################################" << std::endl; 306 std::cout << "Simulation cycle " << i << std::endl; 307 std::cout << "##########################################" << std::endl; 308 std::cout << std::endl; 309 sc_start(sc_core::sc_time(1, SC_NS)); 310 for (int x = 0; x < xSize; ++x) { 311 for (int y = 0; y < ySize; ++y) { 312 dspinRouter[x][y]->print_trace(); 313 } 314 } 315 } 343 } 344 else { 345 const int period = 3000; 346 for (n = 0; n < (max * 200); n += period) { 347 if ((xSrc == -1) || (ySrc == -1)) { 348 std::cout << "When using a packet limit, there must be one "; 349 std::cout << "source only" << std::endl; 350 std::exit(1); 351 } 352 353 sc_start(sc_core::sc_time(period, SC_NS)); 354 355 uint32_t pkts = dspinGenerator[xSrc][ySrc]->get_sent_packets(); 356 if (pkts >= max) break; 357 } 358 sc_start(sc_core::sc_time(period, SC_NS)); 359 std::cout << "Simulated cycles: " << n + period << std::endl; 360 } 361 } 362 316 363 for (int x = 0; x < xSize; ++x) { 317 364 for (int y = 0; y < ySize; ++y) { -
branches/reconfiguration/modules/dspin_router/caba/test/synthetic_test/top.desc
r994 r998 10 10 flit_width=dspin_size), 11 11 12 Uses('caba: dspin_packet_generator',12 Uses('caba:reconf:dspin_router:dspin_packet_generator', 13 13 cmd_width=dspin_size, 14 14 rsp_width=dspin_size)
Note: See TracChangeset
for help on using the changeset viewer.