Changeset 889 for branches/reconfiguration/platforms/tsar_generic_iob
- Timestamp:
- Nov 17, 2014, 6:06:02 PM (10 years ago)
- Location:
- branches/reconfiguration/platforms/tsar_generic_iob
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/reconfiguration/platforms/tsar_generic_iob/scripts/onerun.py
r859 r889 41 41 42 42 parser.add_argument( 43 '--faulty-router', '-f', dest='faultyrouter', default=-1,43 '--faulty-router', '-f', dest='faultyrouter', action='append', 44 44 help='ID (X,Y) of faulty router') 45 45 … … 130 130 command.extend(["-THREADS", str(ompthreads)]) 131 131 132 if args.faultyrouter != -1: 133 command.extend(["-FAULTY_ROUTER", str(args.faultyrouter)]) 132 if args.faultyrouter != None: 134 133 command.extend(["-FAULTY_MASK", str(args.faultymask)]) 134 for f in args.faultyrouter: 135 command.extend(["-FAULTY_ROUTER", str(f)]) 135 136 136 137 if args.debug != None: -
branches/reconfiguration/platforms/tsar_generic_iob/top.cpp
r887 r889 122 122 #include <climits> 123 123 #include <stdint.h> 124 #include <vector> 124 125 125 126 #include "gdbserver.h" … … 326 327 char nic_tx_name[256] = NIC_TX_NAME; // pathname: tx packets file 327 328 ssize_t threads_nr = 1; // simulator's threads number 328 size_t faulty_router_id = 0xFFFFFFFF; // faulty router coordinates329 329 size_t faulty_mask = 0x1F; // interface mask for the faulty router 330 330 bool debug_ok = false; // trace activated … … 337 337 uint32_t frozen_cycles = MAX_FROZEN_CYCLES; // monitoring frozen processor 338 338 339 std::vector<size_t> faulty_routers; 340 339 341 assert( (X_WIDTH == 4) and (Y_WIDTH == 4) and 340 342 "ERROR: we must have X_WIDTH == Y_WIDTH == 4"); … … 415 417 else if ((strcmp(argv[n], "-FAULTY_ROUTER") == 0) && (n+1 < argc) ) 416 418 { 417 faulty_router_id = strtol(argv[n+1], NULL, 0);419 size_t faulty_router_id = strtol(argv[n+1], NULL, 0); 418 420 size_t x = faulty_router_id >> Y_WIDTH; 419 421 size_t y = faulty_router_id & ((1 << Y_WIDTH) - 1); … … 423 425 exit(0); 424 426 } 427 faulty_routers.push_back(faulty_router_id); 425 428 } 426 429 else if ((strcmp(argv[n], "-FAULTY_MASK") == 0) && (n+1 < argc) ) … … 1129 1132 1130 1133 // disable all interfaces of the faulty router 1131 if (faulty_router_id != 0xFFFFFFFF) 1134 for (std::vector<size_t>::iterator it = faulty_routers.begin(); 1135 it != faulty_routers.end(); 1136 ++it) 1132 1137 { 1133 int faulty_x = faulty_router_id >> Y_WIDTH; 1134 int faulty_y = faulty_router_id & ((1 << Y_WIDTH) - 1); 1135 clusters[faulty_x][faulty_y]->int_router_cmd[0]->set_disable_mask(faulty_mask); 1138 int router_id = *it; 1139 int router_x = router_id >> Y_WIDTH; 1140 int router_y = router_id & ((1 << Y_WIDTH) - 1); 1141 clusters[router_x][router_y]->int_router_cmd[0]->set_disable_mask(faulty_mask); 1136 1142 } 1137 1143
Note: See TracChangeset
for help on using the changeset viewer.