Ignore:
Timestamp:
Nov 17, 2014, 6:06:02 PM (8 years ago)
Author:
cfuguet
Message:

reconf: support multiple faulty routers in the platform

  • Each faulty router can be passed as a main parameter and should be preceeded with -FAULTY_ROUTER.
  • The same thing is supported by the onerun.py script.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/reconfiguration/platforms/tsar_generic_iob/top.cpp

    r887 r889  
    122122#include <climits>
    123123#include <stdint.h>
     124#include <vector>
    124125
    125126#include "gdbserver.h"
     
    326327   char     nic_tx_name[256] = NIC_TX_NAME;       // pathname: tx packets file
    327328   ssize_t  threads_nr       = 1;                 // simulator's threads number
    328    size_t   faulty_router_id = 0xFFFFFFFF;        // faulty router coordinates
    329329   size_t   faulty_mask      = 0x1F;              // interface mask for the faulty router
    330330   bool     debug_ok         = false;             // trace activated
     
    337337   uint32_t frozen_cycles    = MAX_FROZEN_CYCLES; // monitoring frozen processor
    338338
     339   std::vector<size_t> faulty_routers;
     340
    339341   assert( (X_WIDTH == 4) and (Y_WIDTH == 4) and
    340342   "ERROR: we must have X_WIDTH == Y_WIDTH == 4");
     
    415417         else if ((strcmp(argv[n], "-FAULTY_ROUTER") == 0) && (n+1 < argc) )
    416418         {
    417             faulty_router_id = strtol(argv[n+1], NULL, 0);
     419            size_t faulty_router_id = strtol(argv[n+1], NULL, 0);
    418420            size_t x = faulty_router_id >> Y_WIDTH;
    419421            size_t y = faulty_router_id & ((1 << Y_WIDTH) - 1);
     
    423425                exit(0);
    424426            }
     427            faulty_routers.push_back(faulty_router_id);
    425428         }
    426429         else if ((strcmp(argv[n], "-FAULTY_MASK") == 0) && (n+1 < argc) )
     
    11291132
    11301133    // 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)
    11321137    {
    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);
    11361142    }
    11371143
Note: See TracChangeset for help on using the changeset viewer.