Ignore:
Timestamp:
Oct 13, 2015, 4:21:08 PM (9 years ago)
Author:
cfuguet
Message:

reconf: improving dspin_router transition function.

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  
    321321        const size_t ymax = (data >> (flit_width - 20)) & 0x1F;
    322322
    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);
    340334
    341335        int sel = REQ_NOP;
  • branches/reconfiguration/modules/dspin_router/caba/test/synthetic_test/scripts/broadcast_check.sh

    r998 r1020  
    44# @brief        This script validates that a broadcast transaction reaches once
    55#                       and only once every non-faulty router in the platform.
    6 file=$1
     6fname=$1
     7npkts=$2
     8
    79awk '
    810BEGIN {
    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
    1418}
    15 #   Parse coordinates of routers
    16 #   /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 #   }
    2619
    2720#   Parse the number of sent broadcast packets
    2821/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;
    3135        }
    3236}
     
    3438#   Parse the number of received broadcast packets
    3539/broadcast received packets +=/ {
    36         if ($6 == 0) {
     40        received=$6
     41        if (received == 0) {
    3742                zero++;
    3843        }
    3944        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
    4354                }
    44                 if ($6 > max) {
    45                         max=$6;
    46                 }
     55                nrecvrs++;
     56                rcvpkts=received
    4757        }
    4858}
     
    5666                exit 1;
    5767        }
    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 
    6568        if (zero == 1) {
    6669                print "error: the broadcast source received broadcasts\n";
     
    6871        }
    6972
    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";
    7775        exit 0;
    78 }' $file
     76}' $fname
    7977if [[ $? == 1 ]]; then exit 1; fi
    8078
  • branches/reconfiguration/modules/dspin_router/caba/test/synthetic_test/scripts/run_broadcast_check.sh

    r998 r1020  
    11#!/usr/bin/env sh
     2XSIZE=10
     3YSIZE=10
     4NPKTS=50
     5
    26LOGDIR=logs
    3 COMMON="-X 5 -Y 5 -P 1500"
     7COMMON="-X $XSIZE -Y $YSIZE -P $NPKTS"
    48SCRIPTPATH=$(dirname $0)
    59
     
    913
    1014mkdir -p $LOGDIR
    11 for (( x = 0; x < 5; x++ )); do
    12         for (( y = 0; y < 5; y++ )); do
    13                 for (( fx = 0; fx < 5; fx++ )); do
    14                         for (( fy = 0; fy < 5; fy++ )); do
     15for (( 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
    1519                                if [[ ( $x == $fx ) && ( $y == $fy ) ]]; then continue; fi
    1620                                LOGFILE=$LOGDIR/$(echo log'_'$x'_'$y'_'$fx'_'$fy);
     
    1822                                echo "./simul.x $ARGS ($LOGFILE)"
    1923                                ./simul.x $ARGS > $LOGFILE 2>/dev/null;
    20                                 $SCRIPTPATH/broadcast_check.sh $LOGFILE
     24                                $SCRIPTPATH/broadcast_check.sh $LOGFILE $NPKTS
    2125                                if [[ $? == 1 ]]; then
    2226                                        echo "FAILURE";
Note: See TracChangeset for help on using the changeset viewer.