Index: /trunk/platforms/tsar_generic_leti/arch.py
===================================================================
--- /trunk/platforms/tsar_generic_leti/arch.py	(revision 802)
+++ /trunk/platforms/tsar_generic_leti/arch.py	(revision 803)
@@ -1,18 +1,16 @@
 #!/usr/bin/env python
 
+from math import log, ceil
 from mapping import *
 
 ###############################################################################
-#   file   : arch.py  (for the tsar_generic_iob architecture)
+#   file   : arch.py  (for the tsar_generic_leti architecture)
 #   date   : may 2014
 #   author : Alain Greiner
 ###############################################################################
-#  This file contains a mapping generator for the "tsar_generic_iob" platform.
+#  This file contains a mapping generator for the "tsar_generic_leti" platform.
 #  This includes both the hardware architecture (clusters, processors,
 #  peripherals, physical space segmentation) and the mapping of all kernel
-#  objects (global vsegs).  This platform includes 6 external peripherals,
-#  accessible through two IO_Bridge components located in cluster [0,0] and
-#  cluster [x_size-1, y_size-1].  Available peripherals are: TTY, BDV, FBF,
-#  ROM, NIC, CMA.
+#  objects (global vsegs).
 #
 #  The "constructor" parameters are:
@@ -49,4 +47,5 @@
     x_width           = 4
     y_width           = 4
+    p_width           = int(ceil(log(nb_procs, 2)))
     paddr_width       = 40
     irq_per_proc      = 4
@@ -54,9 +53,9 @@
     peri_increment    = 0x10000
     reset_address     = 0x00000000
-    distributed_ptabs = True
+    distributed_ptabs = False
 
     ### parameters checking
 
-    assert( nb_procs <= 4 )
+    assert( nb_procs <= (1 << p_width) )
 
     assert( (x_size == 1) or (x_size == 2) or (x_size == 4)
@@ -71,5 +70,5 @@
             ((x_io == x_size-1) and (y_io == y_size-1)) )
 
-    platform_name  = 'tsar_iob_%d_%d_%d' % ( x_size, y_size, nb_procs )
+    platform_name  = 'tsar_leti_%d_%d_%d' % ( x_size, y_size, nb_procs )
 
     ### define physical segments
@@ -107,16 +106,21 @@
     rdk_size  = 0x02000000                 # 32 Mbytes
 
+    ### define  preloader vseg base address and size
+
+    preloader_vbase      = 0x00000000      # ident
+    preloader_size       = 0x00010000      # 64 Kbytes
+
     ### define  bootloader vsegs base addresses and sizes
 
-    boot_mapping_vbase   = 0x00000000      # ident
+    boot_mapping_vbase   = 0x00010000      # ident
     boot_mapping_size    = 0x00080000      # 512 Kbytes
 
-    boot_code_vbase      = 0x00080000      # ident
+    boot_code_vbase      = 0x00090000      # ident
     boot_code_size       = 0x00040000      # 256 Kbytes
 
-    boot_data_vbase      = 0x000C0000      # ident
+    boot_data_vbase      = 0x000D0000      # ident
     boot_data_size       = 0x00080000      # 512 Kbytes
 
-    boot_stack_vbase     = 0x00140000      # ident
+    boot_stack_vbase     = 0x00150000      # ident
     boot_stack_size      = 0x00050000      # 320 Kbytes
 
@@ -135,5 +139,5 @@
     kernel_init_size     = 0x00010000      # 64 Kbytes
 
-    kernel_sched_vbase   = 0xF0000000            # distributed in all clusters
+    kernel_sched_vbase   = 0x80060000            # distributed in all clusters
     kernel_sched_size    = 0x2000 * nb_procs     # 8 kbytes per processor
 
@@ -146,4 +150,5 @@
                        x_width        = x_width,
                        y_width        = y_width,
+                       p_width        = p_width,
                        paddr_width    = paddr_width,
                        coherence      = True,
@@ -218,9 +223,16 @@
                 mapping.addProc( x, y, p )
 
+    ### global vseg for preloader
+
+    mapping.addGlobal( 'seg_preloader', preloader_vbase, preloader_size, '__W_',
+                       vtype = 'BUFFER', x = 0, y = 0, pseg = 'RAM',
+                       identity = True )
+
     ### global vseg for ram disk
 
-    mapping.addGlobal( 'seg_rdk', rdk_base, rdk_size, '__W_',
-                       vtype = 'BUFFER', x = 0, y = 0, pseg = 'RAM',
-                       identity = True )
+    if use_ramdisk:
+        mapping.addGlobal( 'seg_rdk', rdk_base, rdk_size, '__W_',
+                           vtype = 'BUFFER', x = 0, y = 0, pseg = 'RAM',
+                           identity = True )
 
     ### global vsegs for external peripherals / identity mapping
Index: /trunk/platforms/tsar_generic_leti/top.cpp
===================================================================
--- /trunk/platforms/tsar_generic_leti/top.cpp	(revision 802)
+++ /trunk/platforms/tsar_generic_leti/top.cpp	(revision 803)
@@ -272,8 +272,8 @@
             trace_proc_ok = true;
             trace_proc_id = (size_t) strtol(argv[n + 1], NULL, 0);
-            size_t cluster_xy = trace_proc_id / NB_PROCS_MAX ;
+            size_t cluster_xy = trace_proc_id >> P_WIDTH ;
             size_t x          = cluster_xy >> Y_WIDTH;
             size_t y          = cluster_xy & ((1<<Y_WIDTH)-1);
-            size_t l          = trace_proc_id % NB_PROCS_MAX ;
+            size_t l          = trace_proc_id & ((1<<P_WIDTH)-1) ;
 
             assert( (x < X_SIZE) and (y < Y_SIZE) and (l < NB_PROCS_MAX) and
@@ -324,4 +324,7 @@
             "Illegal Y_SIZE parameter" );
 
+    assert( (P_WIDTH <= 2) and
+            "P_WIDTH parameter cannot be larger than 2" );
+
     assert( (NB_PROCS_MAX <= 4) and
             "Illegal NB_PROCS_MAX parameter" );
@@ -664,4 +667,5 @@
                 Y_WIDTH,
                 vci_srcid_width - X_WIDTH - Y_WIDTH,   // l_id width,
+                P_WIDTH,
                 MEMC_TGTID,
                 XICU_TGTID,
@@ -1177,7 +1181,7 @@
             if ( trace_proc_ok )
             {
-                l = trace_proc_id % NB_PROCS_MAX ;
-                x = (trace_proc_id / NB_PROCS_MAX) >> Y_WIDTH ;
-                y = (trace_proc_id / NB_PROCS_MAX) & ((1<<Y_WIDTH) - 1);
+                l = trace_proc_id & ((1<<P_WIDTH)-1) ;
+                x = (trace_proc_id >> P_WIDTH) >> Y_WIDTH ;
+                y = (trace_proc_id >> P_WIDTH) & ((1<<Y_WIDTH) - 1);
 
                 std::ostringstream proc_signame;
Index: /trunk/platforms/tsar_generic_leti/tsar_leti_cluster/caba/source/include/tsar_leti_cluster.h
===================================================================
--- /trunk/platforms/tsar_generic_leti/tsar_leti_cluster/caba/source/include/tsar_leti_cluster.h	(revision 802)
+++ /trunk/platforms/tsar_generic_leti/tsar_leti_cluster/caba/source/include/tsar_leti_cluster.h	(revision 803)
@@ -166,4 +166,5 @@
                      size_t                             y_width,       // y field bits
                      size_t                             l_width,       // l field bits
+                     size_t                             p_width,       // p field bits
                      size_t                             tgtid_memc,
                      size_t                             tgtid_xicu,
Index: /trunk/platforms/tsar_generic_leti/tsar_leti_cluster/caba/source/src/tsar_leti_cluster.cpp
===================================================================
--- /trunk/platforms/tsar_generic_leti/tsar_leti_cluster/caba/source/src/tsar_leti_cluster.cpp	(revision 802)
+++ /trunk/platforms/tsar_generic_leti/tsar_leti_cluster/caba/source/src/tsar_leti_cluster.cpp	(revision 803)
@@ -32,4 +32,5 @@
          size_t                             y_width,
          size_t                             l_width,
+         size_t                             p_width,
          size_t                             tgtid_memc,
          size_t                             tgtid_xicu,
@@ -87,5 +88,5 @@
     for (size_t p = 0; p < nb_procs; p++)
     {
-        uint32_t global_proc_id  = cluster_xy * nb_procs + p;
+        uint32_t global_proc_id  = (cluster_xy << p_width) + p;
         uint32_t global_cc_id    = (cluster_xy << l_width) + p;
         bool     trace_ok        = trace_proc_ok and (trace_proc_id == global_proc_id);
