Index: /branches/reconfiguration/platforms/tsar_generic_iob/scripts/onerun.py
===================================================================
--- /branches/reconfiguration/platforms/tsar_generic_iob/scripts/onerun.py	(revision 858)
+++ /branches/reconfiguration/platforms/tsar_generic_iob/scripts/onerun.py	(revision 859)
@@ -43,4 +43,8 @@
     '--faulty-router', '-f', dest='faultyrouter', default=-1,
     help='ID (X,Y) of faulty router')
+
+parser.add_argument(
+    '--faulty-mask', '-m', dest='faultymask', default=0x1F,
+    help='Disable mask for faulty router interfaces')
 
 parser.add_argument(
@@ -128,4 +132,5 @@
 if args.faultyrouter != -1:
     command.extend(["-FAULTY_ROUTER", str(args.faultyrouter)])
+    command.extend(["-FAULTY_MASK", str(args.faultymask)])
 
 if args.debug != None:
Index: /branches/reconfiguration/platforms/tsar_generic_iob/top.cpp
===================================================================
--- /branches/reconfiguration/platforms/tsar_generic_iob/top.cpp	(revision 858)
+++ /branches/reconfiguration/platforms/tsar_generic_iob/top.cpp	(revision 859)
@@ -318,21 +318,20 @@
 
 
-   char     soft_name[256]   = BOOT_SOFT_NAME;              // pathname: binary code
-   size_t   ncycles          = UINT_MAX;                    // simulated cycles
-   char     disk_name[256]   = BDEV_IMAGE_NAME;             // pathname: disk image
-   char     nic_rx_name[256] = NIC_RX_NAME;                 // pathname: rx packets file
-   char     nic_tx_name[256] = NIC_TX_NAME;                 // pathname: tx packets file
-   ssize_t  threads_nr       = 1;                           // simulator's threads number
-   size_t   faulty_router_id = 0xFFFFFFFF;                  // faulty router coordinates
-   bool     debug_ok         = false;                       // trace activated
-   size_t   debug_period     = 1;                           // trace period
-   size_t   debug_memc_id    = 0xFFFFFFFF;                  // index of traced memc
-   size_t   debug_proc_id    = 0xFFFFFFFF;                  // index of traced proc
-   size_t   debug_xram_id    = 0xFFFFFFFF;                  // index of traced xram
-   bool     debug_iob        = false;                       // trace iob0 & iob1 when true
-   uint32_t debug_from       = 0;                           // trace start cycle
-   uint32_t frozen_cycles    = MAX_FROZEN_CYCLES;           // monitoring frozen processor
-   size_t   cluster_iob0     = cluster(0, 0);               // cluster containing IOB0
-   size_t   cluster_iob1     = cluster(X_SIZE-1, Y_SIZE-1); // cluster containing IOB1
+   char     soft_name[256]   = BOOT_SOFT_NAME;    // pathname: binary code
+   size_t   ncycles          = UINT_MAX;          // simulated cycles
+   char     disk_name[256]   = BDEV_IMAGE_NAME;   // pathname: disk image
+   char     nic_rx_name[256] = NIC_RX_NAME;       // pathname: rx packets file
+   char     nic_tx_name[256] = NIC_TX_NAME;       // pathname: tx packets file
+   ssize_t  threads_nr       = 1;                 // simulator's threads number
+   size_t   faulty_router_id = 0xFFFFFFFF;        // faulty router coordinates
+   size_t   faulty_mask      = 0x1F;              // interface mask for the faulty router
+   bool     debug_ok         = false;             // trace activated
+   size_t   debug_period     = 1;                 // trace period
+   size_t   debug_memc_id    = 0xFFFFFFFF;        // index of traced memc
+   size_t   debug_proc_id    = 0xFFFFFFFF;        // index of traced proc
+   size_t   debug_xram_id    = 0xFFFFFFFF;        // index of traced xram
+   bool     debug_iob        = false;             // trace iob0 & iob1 when true
+   uint32_t debug_from       = 0;                 // trace start cycle
+   uint32_t frozen_cycles    = MAX_FROZEN_CYCLES; // monitoring frozen processor
 
    assert( (X_WIDTH == 4) and (Y_WIDTH == 4) and
@@ -420,4 +419,13 @@
             {
                 std::cout << "FAULTY_ROUTER parameter doesn't fit X_SIZE/Y_SIZE" << std::endl;
+                exit(0);
+            }
+         }
+         else if ((strcmp(argv[n], "-FAULTY_MASK") == 0) && (n+1 < argc) )
+         {
+            faulty_mask = strtol(argv[n+1], NULL, 0);
+            if( faulty_mask > 0x1F )
+            {
+                std::cout << "FAULTY_MASK parameter max value is 0x1F" << std::endl;
                 exit(0);
             }
@@ -517,4 +525,7 @@
                                    vci_trdid_width,
                                    vci_wrplen_width> vci_param_ext;
+
+   const size_t cluster_iob0 = cluster(0, 0);               // cluster containing IOB0
+   const size_t cluster_iob1 = cluster(X_SIZE-1, Y_SIZE-1); // cluster containing IOB1
 
    /////////////////////////////////////////////////////////////////////
@@ -1120,5 +1131,5 @@
        int faulty_x = faulty_router_id >> Y_WIDTH;
        int faulty_y = faulty_router_id & ((1 << Y_WIDTH) - 1);
-       clusters[faulty_x][faulty_y]->int_router_cmd[0]->set_disable_mask(0x1F);
+       clusters[faulty_x][faulty_y]->int_router_cmd[0]->set_disable_mask(faulty_mask);
     }
 
