Changeset 1020 for branches/reconfiguration/modules/dspin_router/caba
- Timestamp:
- Oct 13, 2015, 4:21:08 PM (9 years ago)
- Location:
- branches/reconfiguration/modules/dspin_router/caba
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/reconfiguration/modules/dspin_router/caba/source/src/dspin_router.cpp
r1016 r1020 321 321 const size_t ymax = (data >> (flit_width - 20)) & 0x1F; 322 322 323 int bhpos = NORMAL; 324 bool recovery = false; 325 if (is_reconfigurable()) { 326 bhpos = blackhole_position(); 327 recovery = is_recovery_routing_enabled(); 328 } 329 330 const bool is_n = recovery and (bhpos == N_OF_X); 331 const bool is_s = recovery and (bhpos == S_OF_X); 332 const bool is_w = recovery and (bhpos == W_OF_X); 333 const bool is_e = recovery and (bhpos == E_OF_X); 334 const bool is_nw = recovery and (bhpos == NW_OF_X); 335 const bool is_ne = recovery and (bhpos == NE_OF_X); 336 const bool is_sw = recovery and (bhpos == SW_OF_X); 337 const bool is_se = recovery and (bhpos == SE_OF_X); 338 339 const bool special = ((data & 0x2) != 0) and recovery; 323 const int bhpos = is_reconfigurable() ? blackhole_position() : NORMAL; 324 const bool is_n = (bhpos == N_OF_X); 325 const bool is_s = (bhpos == S_OF_X); 326 const bool is_w = (bhpos == W_OF_X); 327 const bool is_e = (bhpos == E_OF_X); 328 const bool is_nw = (bhpos == NW_OF_X); 329 const bool is_ne = (bhpos == NE_OF_X); 330 const bool is_sw = (bhpos == SW_OF_X); 331 const bool is_se = (bhpos == SE_OF_X); 332 333 const bool special = ((data & 0x2) != 0) and (bhpos != NORMAL); 340 334 341 335 int sel = REQ_NOP; -
branches/reconfiguration/modules/dspin_router/caba/test/synthetic_test/scripts/broadcast_check.sh
r998 r1020 4 4 # @brief This script validates that a broadcast transaction reaches once 5 5 # and only once every non-faulty router in the platform. 6 file=$1 6 fname=$1 7 npkts=$2 8 7 9 awk ' 8 10 BEGIN { 9 sent=0 10 last=0 11 failure=0 12 min=99999999 13 max=0 11 npkts=50 12 13 rcvpkts=0 14 nrecvrs=0 15 16 sndpkts=0 17 nsendrs=0 14 18 } 15 # Parse coordinates of routers16 # /DSPIN_GENERATOR/ {17 # regex="\\[[0-9]+\\]\\[";18 # if (match($2,regex)) {19 # x=substr($2,RSTART+1,RLENGTH-3);20 # }21 # regex="\\]\\[[0-9]+\\]";22 # if (match($2,regex)) {23 # y=substr($2,RSTART+2,RLENGTH-3);24 # }25 # }26 19 27 20 # Parse the number of sent broadcast packets 28 21 /broadcast sent packets += +/ { 29 if ($6 != 0) { 30 sent=$6; 22 sent=$6 23 if (sent > 0) { 24 if (nsendrs > 1) { 25 print "error: more than one initiator sent broadcast packets\n" 26 exit 1 27 } 28 if (sent != npkts) { 29 print "error: the number of sent broadcast packets does not " 30 print "correspond to the one specified\n" 31 exit 1 32 } 33 nsendrs++; 34 sndpkts=sent; 31 35 } 32 36 } … … 34 38 # Parse the number of received broadcast packets 35 39 /broadcast received packets +=/ { 36 if ($6 == 0) { 40 received=$6 41 if (received == 0) { 37 42 zero++; 38 43 } 39 44 else { 40 # store the min and max number of received packets 41 if ($6 < min) { 42 min=$6; 45 if (received != npkts) { 46 print "error: at least a router received a number of broadcast "; 47 if (received > npkts) { 48 print "greater than the number of broadcast sent\n"; 49 } 50 else { 51 print "less than the number of broadcast sent\n"; 52 } 53 exit 1 43 54 } 44 if ($6 > max) { 45 max=$6; 46 } 55 nrecvrs++; 56 rcvpkts=received 47 57 } 48 58 } … … 56 66 exit 1; 57 67 } 58 59 if (max > sent) {60 print "error: at least a router received a number of broadcast greater"61 print "than the number of broadcast sent\n";62 exit 1;63 }64 65 68 if (zero == 1) { 66 69 print "error: the broadcast source received broadcasts\n"; … … 68 71 } 69 72 70 error=sent - min 71 if (error > 0) { 72 print "error: the number of broadcast received by a router is inferior " 73 print "to the error threshold: error = " error "\n"; 74 exit 1; 75 } 76 73 print "sent: " sndpkts " / # senders: " nsendrs; 74 print "received: " rcvpkts " / # receivers " nrecvrs "\n"; 77 75 exit 0; 78 }' $f ile76 }' $fname 79 77 if [[ $? == 1 ]]; then exit 1; fi 80 78 -
branches/reconfiguration/modules/dspin_router/caba/test/synthetic_test/scripts/run_broadcast_check.sh
r998 r1020 1 1 #!/usr/bin/env sh 2 XSIZE=10 3 YSIZE=10 4 NPKTS=50 5 2 6 LOGDIR=logs 3 COMMON="-X 5 -Y 5 -P 1500"7 COMMON="-X $XSIZE -Y $YSIZE -P $NPKTS" 4 8 SCRIPTPATH=$(dirname $0) 5 9 … … 9 13 10 14 mkdir -p $LOGDIR 11 for (( x = 0; x < 5; x++ )); do12 for (( y = 0; y < 5; y++ )); do13 for (( fx = 0; fx < 5; fx++ )); do14 for (( fy = 0; fy < 5; fy++ )); do15 for (( x = 0; x < $XSIZE; x++ )); do 16 for (( y = 0; y < $YSIZE; y++ )); do 17 for (( fx = 0; fx < $XSIZE; fx++ )); do 18 for (( fy = 0; fy < $YSIZE; fy++ )); do 15 19 if [[ ( $x == $fx ) && ( $y == $fy ) ]]; then continue; fi 16 20 LOGFILE=$LOGDIR/$(echo log'_'$x'_'$y'_'$fx'_'$fy); … … 18 22 echo "./simul.x $ARGS ($LOGFILE)" 19 23 ./simul.x $ARGS > $LOGFILE 2>/dev/null; 20 $SCRIPTPATH/broadcast_check.sh $LOGFILE 24 $SCRIPTPATH/broadcast_check.sh $LOGFILE $NPKTS 21 25 if [[ $? == 1 ]]; then 22 26 echo "FAILURE";
Note: See TracChangeset
for help on using the changeset viewer.