- Timestamp:
- Dec 11, 2014, 4:52:15 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/reconfiguration/platforms/tsar_generic_iob/top.cpp
r900 r904 415 415 debug_period = strtol(argv[n+1], NULL, 0); 416 416 } 417 else if ((strcmp(argv[n], "-FAULTY_ROUTER") == 0) && (n+2 < argc) ) 418 { 419 size_t x = strtol(argv[n+1], NULL, 0); 420 size_t y = strtol(argv[n+2], NULL, 0); 421 n++; 417 else if ((strcmp(argv[n], "-FAULTY_ROUTER") == 0) && (n+3 < argc) ) 418 { 419 size_t t = strtol(argv[n+1], NULL, 0); 420 size_t x = strtol(argv[n+2], NULL, 0); 421 size_t y = strtol(argv[n+3], NULL, 0); 422 n+=2; 423 if( (t > 4) ) 424 { 425 std::cout << "FAULTY_ROUTER NoC index is too big (index > 4)" << std::endl; 426 exit(0); 427 } 422 428 if( (x>=X_SIZE) || (y>=Y_SIZE) ) 423 429 { … … 425 431 exit(0); 426 432 } 427 faulty_routers.push_back((x << Y_WIDTH) | y); 433 faulty_routers.push_back((t << (X_WIDTH + Y_WIDTH)) | 434 (x << (Y_WIDTH)) | 435 (y)); 428 436 } 429 437 else if ((strcmp(argv[n], "-FAULTY_MASK") == 0) && (n+1 < argc) ) … … 1131 1139 #endif 1132 1140 1133 // disable all interfaces of the faulty router 1141 // disable all interfaces of the faulty CMD routers 1142 std::cout << "\n*** List of deactivated routers ***\n"; 1134 1143 for (std::vector<size_t>::iterator it = faulty_routers.begin(); 1135 1144 it != faulty_routers.end(); 1136 1145 ++it) 1137 1146 { 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); 1147 int ry = (*it) & ((1 << Y_WIDTH) - 1); 1148 int rx = (*it >> Y_WIDTH) & ((1 << X_WIDTH) - 1); 1149 int rt = (*it) >> (X_WIDTH + Y_WIDTH); 1150 1151 if (rt == 0) 1152 { 1153 std::cout << "Deactivate CMD router (" << rx << "," << ry << ")" 1154 << std::endl; 1155 clusters[rx][ry]->int_router_cmd[0]->set_disable_mask(faulty_mask); 1156 continue; 1157 } 1158 if (rt == 1) 1159 { 1160 std::cout << "Deactivate RSP router (" << rx << "," << ry << ")" 1161 << std::endl; 1162 clusters[rx][ry]->int_router_rsp[0]->set_disable_mask(faulty_mask); 1163 continue; 1164 } 1165 if (rt == 2) 1166 { 1167 std::cout << "Deactivate M2P router (" << rx << "," << ry << ")" 1168 << std::endl; 1169 clusters[rx][ry]->int_router_cmd[1]->set_disable_mask(faulty_mask); 1170 continue; 1171 } 1172 if (rt == 3) 1173 { 1174 std::cout << "Deactivate P2M router (" << rx << "," << ry << ")" 1175 << std::endl; 1176 clusters[rx][ry]->int_router_rsp[1]->set_disable_mask(faulty_mask); 1177 continue; 1178 } 1179 if (rt == 4) 1180 { 1181 std::cout << "Deactivate CLACK router (" << rx << "," << ry << ")" 1182 << std::endl; 1183 clusters[rx][ry]->int_router_cmd[2]->set_disable_mask(faulty_mask); 1184 continue; 1185 } 1142 1186 } 1143 1187 … … 1475 1519 uint64_t ms2 = (uint64_t) t2.tv_sec * 1000ULL + 1476 1520 (uint64_t) t2.tv_usec / 1000; 1477 std::cerr << "### cycle = " << n << " / frequency (Khz) = "1521 std::cerr << "### cycle = " << std::dec << n << " / frequency (Khz) = " 1478 1522 << (double) stats_period / (double) (ms2 - ms1) << std::endl; 1479 1523 }
Note: See TracChangeset
for help on using the changeset viewer.