Index: /branches/reconfiguration/platforms/tsar_generic_iob/Makefile
===================================================================
--- /branches/reconfiguration/platforms/tsar_generic_iob/Makefile	(revision 973)
+++ /branches/reconfiguration/platforms/tsar_generic_iob/Makefile	(revision 974)
@@ -1,4 +1,8 @@
 TAGS := cscope.out
 SOCLIB_CC_ARGS :=
+SOCLIB_CC_ARGS += -bcaba:reconf:vci_xicu
+SOCLIB_CC_ARGS += -bcaba:vci_iopic
+SOCLIB_CC_ARGS += -bcaba:vci_block_device_tsar
+SOCLIB_CC_ARGS += -v
 
 all: simul.x
Index: /branches/reconfiguration/platforms/tsar_generic_iob/scripts/arch.py
===================================================================
--- /branches/reconfiguration/platforms/tsar_generic_iob/scripts/arch.py	(revision 973)
+++ /branches/reconfiguration/platforms/tsar_generic_iob/scripts/arch.py	(revision 974)
@@ -53,4 +53,5 @@
 IRQ_PER_PROC = 4
 USE_RAMDISK = False
+USE_NIC = False
 
 # virtual address increment for distributed memory segments in the GietVM OS
@@ -69,5 +70,6 @@
          nb_procs=4,
          nb_ttys=1,
-         fbf_width=FBF_WIDTH):
+         fbf_width=FBF_WIDTH,
+         ioc_type='BDV'):
     """This function describes the tsar_generic_iob platform and defines its
     parameters"""
@@ -89,5 +91,5 @@
     # define physical segments
     ram_base = 0x0000000000
-    ram_size = 0x10000000 / (x_size * y_size)
+    ram_size = 0x4000000 / (x_size * y_size)
 
     xcu_base = 0x00B0000000
@@ -151,18 +153,37 @@
 
     # external peripherals (accessible in cluster[0,0] only for this mapping)
+    pic = mapping.addPeriph('PIC', base=pic_base, size=pic_size,
+                            ptype='PIC', channels=32)
+
     mapping.addPeriph('IOB', base=iob_base, size=iob_size,
                       ptype='IOB')
 
-    mapping.addPeriph('BDV', base=bdv_base, size=bdv_size,
-                      ptype='IOC', subtype='BDV')
-
-    mapping.addPeriph('TTY', base=tty_base, size=tty_size,
-                      ptype='TTY', channels=nb_ttys)
-
-    mapping.addPeriph('NIC', base=nic_base, size=nic_size,
-                      ptype='NIC', channels=NB_NICS)
-
-    mapping.addPeriph('CMA', base=cma_base, size=cma_size,
-                      ptype='CMA', channels=2*NB_NICS)
+    bdv = mapping.addPeriph('BDV', base=bdv_base, size=bdv_size,
+                            ptype='IOC', subtype='BDV')
+
+    mapping.addIrq(pic, index=8, src=bdv, isrtype='ISR_BDV', channel=0)
+
+    tty = mapping.addPeriph('TTY', base=tty_base, size=tty_size,
+                            ptype='TTY', channels=nb_ttys)
+
+    for i in xrange(nb_ttys):
+        mapping.addIrq(pic, index=16+i, src=tty, isrtype='ISR_TTY_RX', channel=i)
+
+    if USE_NIC:
+        nic = mapping.addPeriph('NIC', base=nic_base, size=nic_size,
+                                ptype='NIC', channels=NB_NICS)
+
+        mapping.addIrq(pic, index=0, src=nic, isrtype='ISR_NIC_RX', channel=0)
+        mapping.addIrq(pic, index=1, src=nic, isrtype='ISR_NIC_RX', channel=1)
+        mapping.addIrq(pic, index=2, src=nic, isrtype='ISR_NIC_TX', channel=0)
+        mapping.addIrq(pic, index=3, src=nic, isrtype='ISR_NIC_TX', channel=1)
+
+    cma = mapping.addPeriph('CMA', base=cma_base, size=cma_size,
+                            ptype='CMA', channels=2*NB_NICS)
+
+    mapping.addIrq(pic, index=4, src=cma, isrtype='ISR_CMA', channel=0)
+    mapping.addIrq(pic, index=5, src=cma, isrtype='ISR_CMA', channel=1)
+    mapping.addIrq(pic, index=6, src=cma, isrtype='ISR_CMA', channel=2)
+    mapping.addIrq(pic, index=7, src=cma, isrtype='ISR_CMA', channel=3)
 
     mapping.addPeriph('FBF', base=fbf_base, size=fbf_size,
@@ -174,20 +195,4 @@
     mapping.addPeriph('ROM', base=rom_base, size=rom_size,
                       ptype='ROM')
-
-    pic = mapping.addPeriph('PIC', base=pic_base, size=pic_size,
-                            ptype='PIC', channels=32)
-
-    mapping.addIrq(pic, index=0, isrtype='ISR_NIC_RX', channel=0)
-    mapping.addIrq(pic, index=1, isrtype='ISR_NIC_RX', channel=1)
-    mapping.addIrq(pic, index=2, isrtype='ISR_NIC_TX', channel=0)
-    mapping.addIrq(pic, index=3, isrtype='ISR_NIC_TX', channel=1)
-    mapping.addIrq(pic, index=4, isrtype='ISR_CMA', channel=0)
-    mapping.addIrq(pic, index=5, isrtype='ISR_CMA', channel=1)
-    mapping.addIrq(pic, index=6, isrtype='ISR_CMA', channel=2)
-    mapping.addIrq(pic, index=7, isrtype='ISR_CMA', channel=3)
-    mapping.addIrq(pic, index=8, isrtype='ISR_BDV', channel=0)
-
-    for i in xrange(nb_ttys):
-        mapping.addIrq(pic, index=16+i, isrtype='ISR_TTY_RX', channel=i)
 
     # hardware components replicated in all clusters
@@ -198,9 +203,9 @@
             mapping.addRam('RAM', base=ram_base + offset, size=ram_size)
 
-            mapping.addPeriph('MMC', base=mmc_base + offset, size=mmc_size,
-                              ptype='MMC')
-
             mapping.addPeriph('DROM', base=drom_base + offset, size=drom_size,
                               ptype='DROM')
+
+            mmc = mapping.addPeriph('MMC', base=mmc_base + offset, size=mmc_size,
+                                    ptype='MMC')
 
             dma = mapping.addPeriph('DMA', base=dma_base + offset,
@@ -214,10 +219,9 @@
 
             # MMC IRQ replicated in all clusters
-            mapping.addIrq(xcu, index=0, isrtype='ISR_MMC')
+            mapping.addIrq(xcu, index=0, src=mmc, isrtype='ISR_MMC')
 
             # DMA IRQ replicated in all clusters
             for i in xrange(dma.channels):
-                mapping.addIrq(xcu, index=1+i, isrtype='ISR_DMA',
-                               channel=i)
+                mapping.addIrq(xcu, index=1+i, src=dma, isrtype='ISR_DMA', channel=i)
 
             # processors
@@ -374,6 +378,8 @@
     with open(hard_path, "w") as hard_config:
         hard_config.write(mapping.hard_config())
-    with open(dts_path, "w") as linux_dts:
-        linux_dts.write(mapping.linux_dts())
+
+    if dts_path != None:
+        with open(dts_path, "w") as linux_dts:
+            linux_dts.write(mapping.linux_dts())
 
 ################################# platform test ################################
Index: /branches/reconfiguration/platforms/tsar_generic_iob/scripts/onerun.py
===================================================================
--- /branches/reconfiguration/platforms/tsar_generic_iob/scripts/onerun.py	(revision 973)
+++ /branches/reconfiguration/platforms/tsar_generic_iob/scripts/onerun.py	(revision 974)
@@ -30,4 +30,5 @@
     firmdebug    -- activate the DEBUG compilation mode on software
     diskimage    -- relative or absolute path to the disk image
+    force        -- create configuration files (or overwrite them)
     """
 
@@ -48,7 +49,25 @@
     hardpath = os.path.join(outdir, "config/hard_config.h")
     xmlpath = os.path.join(outdir, "config/giet.map.xml")
-    dtspath = os.path.join(outdir, "config/linux.dts")
-    arch.main(args.x, args.y, args.nprocs, hardpath, xmlpath, dtspath)
-    faultyprocs.generate(args.faultycore, faultpath)
+    if args.linux:
+        dtspath = os.path.join(outdir, "config/platform.dts")
+    else:
+        dtspath = None
+
+    exist = True
+    exist = exist and os.path.exists(faultpath)
+    exist = exist and os.path.exists(hardpath)
+    exist = exist and os.path.exists(xmlpath)
+    if args.linux: exist = exist and os.path.exists(dtspath)
+
+    if not args.force and exist:
+        print "[ run.py ] Warning: Reusing existing configuration files. "
+        print "[ run.py ] Script arguments will be ignored (no --force option)"
+        cmd = raw_input('[ run.py ] Would you like to continue (y/n): ')
+        if cmd == 'n': exit(0)
+        if cmd == 'y': pass
+        else: exit(1)
+    else:
+        arch.main(args.x, args.y, args.nprocs, hardpath, xmlpath, dtspath)
+        faultyprocs.generate(args.faultycore, faultpath)
 
     # create a log file
@@ -66,5 +85,5 @@
     command.extend(['make'])
     command.extend(['-C', basedir])
-    subprocess.call(command, stdout=logfile, stderr=logfile)
+    subprocess.check_call(command, stdout=logfile, stderr=logfile)
 
     # 4. compile distributed boot executable
@@ -81,9 +100,13 @@
     command.extend(["CONFIG=" + outdir])
     command.extend(["DEBUG=" + str(args.firmdebug)])
-    subprocess.call(command, stdout=logfile, stderr=logfile)
+    if args.linux:
+        command.extend(["PATCHER_OS=1"])
+    else:
+        command.extend(["PATCHER_OS=0"])
+
+    subprocess.check_call(command, stdout=logfile, stderr=logfile)
 
     # stop after compiling when the compile-only option is activated
-    if args.compileonly == True:
-        exit(0)
+    if args.compileonly == True: exit(0)
 
     # 5. execute simulator
@@ -107,12 +130,15 @@
     if args.debug != None:
         command.extend(["-DEBUG", str(args.debug[0])]);
-        command.extend(["-NCYCLES", str(args.debug[1])]);
-        command.extend(["-PROCID", str(args.debug[2])]);
-        command.extend(["-MEMCID", str(args.debug[3])]);
+        command.extend(["-PROCID", str(args.debug[1])]);
+        command.extend(["-MEMCID", str(args.debug[2])]);
+
+    if args.ncycles > 0:
+        command.extend(["-NCYCLES", str(args.ncycles)])
 
     elif os.environ.get('SOCLIB_GDB') == None:
         # the procedure grows linearly with the diameter of the mesh.
-        maxcycles = 1500000 + (args.x + args.y) * 20000
-        command.extend(["-NCYCLES", str(maxcycles)])
+        # maxcycles = 1500000 + (args.x + args.y) * 20000
+        # command.extend(["-NCYCLES", str(maxcycles)])
+        command.extend(["-NCYCLES", str(200000000)])
 
     # OpenMP number of threads definition
@@ -131,5 +157,5 @@
     logfile.flush()
 
-    subprocess.call(command, stdout=logfile, stderr=logfile)
+    subprocess.check_call(command, stdout=logfile, stderr=logfile)
 
     logfile.close()
@@ -198,4 +224,17 @@
         help='relative or absolute path to the external firmware')
 
+    parser.add_argument(
+        '--force', '-f', dest='force', action='store_true',
+        help='create configuration files (or overwrite them)')
+
+    parser.add_argument(
+        '--linux', dest='linux', action='store_true',
+        help='generate linux device tree and compile bootloader ' +
+             'with linux specifics')
+
+    parser.add_argument(
+        '--ncycles', type=int, dest='ncycles', default=-1,
+        help='max simulation cycles')
+
     run(parser.parse_args())
 
Index: /branches/reconfiguration/platforms/tsar_generic_iob/top.cpp
===================================================================
--- /branches/reconfiguration/platforms/tsar_generic_iob/top.cpp	(revision 973)
+++ /branches/reconfiguration/platforms/tsar_generic_iob/top.cpp	(revision 974)
@@ -193,6 +193,4 @@
 #include "hard_config.h"
 
-#define USE_NIC               0
-
 ////////////////////////////////////////////////////////////
 //    Secondary Hardware Parameters values
@@ -491,6 +489,8 @@
            "The NB_TTY_CHANNELS parameter cannot be larger than 16" );
 
+#if USE_NIC
    assert( (NB_NIC_CHANNELS == 2) and
            "The NB_NIC_CHANNELS parameter must be 2" );
+#endif
 
    std::cout << std::endl << std::dec
@@ -1577,5 +1577,5 @@
 
    // cycles between stats
-   const size_t stats_period = 150000;
+   const size_t stats_period = 300000;
    const size_t simul_period = debug_ok ? debug_period : stats_period;
 
Index: /trunk/platforms/tsar_generic_iob/Makefile
===================================================================
--- /trunk/platforms/tsar_generic_iob/Makefile	(revision 973)
+++ /trunk/platforms/tsar_generic_iob/Makefile	(revision 974)
@@ -1,4 +1,4 @@
 simul.x: top.cpp top.desc
-	soclib-cc -P -p top.desc -I. -o simul.x
+	soclib-cc -v -P -p top.desc -I. -o simul.x
 
 clean:
