Index: soft/giet_vm/mappings/4c_4p_sort_leti.xml
===================================================================
--- soft/giet_vm/mappings/4c_4p_sort_leti.xml	(revision 292)
+++ soft/giet_vm/mappings/4c_4p_sort_leti.xml	(revision 295)
@@ -1,148 +1,174 @@
 <?xml version="1.0"?>
 
-<mapping_info signature    = "0xdeadbeef" 
-              name         = "4c_4p_sort_intact" 
+<mapping_info signature    = "0xdace2014" 
+              name         = "4c_4p_sort_leti" 
               x_size       = "2" 
-              y_size       = "2" 
+              y_size       = "3" 
               x_width      = "4"
               y_width      = "4"
-              vspaces      = "1"
-			  increment    = "0x10000"
-			  irq_per_proc = "4" >
-
-*** The "increment" parameter is the virtual address cluster increment 
-*** The physical address cluster increment is 0x10000000000 / NB_CLUSTERS
-
-*** This first section describes an instance of the "tsar_generic_iob" architecture
-*** with 4 clusters, 1 processor per cluster and 40 bits physical address.
+			  irq_per_proc = "4" 
+              use_ramdisk  = "1"
+			  x_io         = "0"
+              y_io         = "0" >
+
+*** This mapping is for the "tsar_generic_leti" hardware architecture
+*** with 4 clusters containing processors and 4 processors per cluster
+*** 40 bits physical address, and 64 Mbytes per cluster.
+*** There is 4 IRQ inputs per processor
+*** It does not use the external peripherals.
+*** It uses the RAMDISK in cluster(0,0)
+*** It uses the mono-channel TTY implemented in cluster(0,0).
 
     <clusterset>
-
         <cluster x = "0" y = "0" >
-            <pseg name = "PSEG_RAM"  type = "RAM"  base = "0x0000000000" length = "0x0000800000" />
+            <pseg name = "PSEG_RAM"  type = "RAM"  base = "0x0000000000" length = "0x0400000000" />
             <pseg name = "PSEG_XCU"  type = "PERI" base = "0x00F0000000" length = "0x0000002000" />
             <pseg name = "PSEG_MMC"  type = "PERI" base = "0x00E0000000" length = "0x0000001000" />
-
-*** Non replicated peripherals (including the ROM containing the preloader code)
-
             <pseg name = "PSEG_IOC"  type = "PERI" base = "0x00F2000000" length = "0x0000001000" /> 
             <pseg name = "PSEG_TTY"  type = "PERI" base = "0x00F4000000" length = "0x0000001000" /> 
 
-            <proc index  = "0" >
-                <irq type = "SOFT" icuid = "0"  isr = "ISR_WAKUP" /> 
-                <irq type = "TIME" icuid = "4"  isr = "ISR_SWITCH" /> 
-                <irq type = "HARD" icuid = "8"  isr = "ISR_DEFAULT" /> 
-                <irq type = "HARD" icuid = "9"  isr = "ISR_IOC" /> 
-                <irq type = "HARD" icuid = "10" isr = "ISR_TTY" /> 
-            </proc> 
-            <proc index  = "1" >
-                <irq type = "SOFT" icuid = "1"  isr = "ISR_WAKUP" /> 
-                <irq type = "TIME" icuid = "5"  isr = "ISR_SWITCH" /> 
-            </proc> 
-            <proc index  = "2" >
-                <irq type = "SOFT" icuid = "2"  isr = "ISR_WAKUP" /> 
-                <irq type = "TIME" icuid = "6"  isr = "ISR_SWITCH" /> 
-            </proc> 
-            <proc index  = "3" >
-                <irq type = "SOFT" icuid = "3"  isr = "ISR_WAKUP" /> 
-                <irq type = "TIME" icuid = "7"  isr = "ISR_SWITCH" /> 
-            </proc> 
-
-            <periph type = "XCU"  psegname = "PSEG_XCU"  channels = "16" />
-            <periph type = "MMC"  psegname = "PSEG_MMC"  channels = "1"  />
-            <periph type = "IOC"  psegname = "PSEG_IOC"  channels = "1" subtype = "BDV" /> 
-            <periph type = "TTY"  psegname = "PSEG_TTY"  channels = "1"  /> 
-
+            <proc index  = "0" />
+            <proc index  = "1" />
+            <proc index  = "2" />
+            <proc index  = "3" />
+
+            <periph type = "MMC"  psegname = "PSEG_MMC"  >
+            </periph>
+            <periph type = "IOC"  psegname = "PSEG_IOC"  subtype = "BDV" > 
+            </periph>
+            <periph type = "TTY"  psegname = "PSEG_TTY"  channels = "1" > 
+            </periph>
+            <periph type = "XCU"  psegname = "PSEG_XCU"  channels = "16" >
+                <irq srcid = "0"  srctype = "WTI"  isr = "ISR_WAKUP"                  dstx = "0"  dsty = "0"  dstid = "0" />
+                <irq srcid = "1"  srctype = "WTI"  isr = "ISR_WAKUP"                  dstx = "0"  dsty = "0"  dstid = "1" />
+                <irq srcid = "2"  srctype = "WTI"  isr = "ISR_WAKUP"                  dstx = "0"  dsty = "0"  dstid = "2" />
+                <irq srcid = "3"  srctype = "WTI"  isr = "ISR_WAKUP"                  dstx = "0"  dsty = "0"  dstid = "3" />
+                <irq srcid = "4"  srctype = "WTI"  isr = "ISR_NIC_RX"  channel = "0"  dstx = "0"  dsty = "0"  dstid = "0" />
+                <irq srcid = "5"  srctype = "WTI"  isr = "ISR_NIC_RX"  channel = "1"  dstx = "0"  dsty = "0"  dstid = "0" />
+                <irq srcid = "6"  srctype = "WTI"  isr = "ISR_NIC_TX"  channel = "0"  dstx = "0"  dsty = "0"  dstid = "0" />
+                <irq srcid = "7"  srctype = "WTI"  isr = "ISR_NIC_TX"  channel = "1"  dstx = "0"  dsty = "0"  dstid = "0" />
+                <irq srcid = "8"  srctype = "WTI"  isr = "ISR_CMA"     channel = "0"  dstx = "0"  dsty = "0"  dstid = "0" />
+                <irq srcid = "9"  srctype = "WTI"  isr = "ISR_CMA"     channel = "1"  dstx = "0"  dsty = "0"  dstid = "0" />
+                <irq srcid = "10" srctype = "WTI"  isr = "ISR_CMA"     channel = "2"  dstx = "0"  dsty = "0"  dstid = "0" />
+                <irq srcid = "11" srctype = "WTI"  isr = "ISR_CMA"     channel = "3"  dstx = "0"  dsty = "0"  dstid = "0" />
+                <irq srcid = "12" srctype = "WTI"  isr = "ISR_BDV"     channel = "0"  dstx = "0"  dsty = "0"  dstid = "0" />
+                <irq srcid = "13" srctype = "WTI"  isr = "ISR_TTY_RX"  channel = "0"  dstx = "0"  dsty = "0"  dstid = "0" />
+
+                <irq srcid = "0"  srctype = "PTI"  isr = "ISR_TICK"                   dstx = "0"  dsty = "0"  dstid = "0" />
+                <irq srcid = "1"  srctype = "PTI"  isr = "ISR_TICK"                   dstx = "0"  dsty = "0"  dstid = "1" />
+                <irq srcid = "2"  srctype = "PTI"  isr = "ISR_TICK"                   dstx = "0"  dsty = "0"  dstid = "2" />
+                <irq srcid = "3"  srctype = "PTI"  isr = "ISR_TICK"                   dstx = "0"  dsty = "0"  dstid = "3" />
+
+                <irq srcid = "8"  srctype = "HWI"  isr = "ISR_DEFAULT"                dstx = "0"  dsty = "0"  dstid = "0" />
+                <irq srcid = "9"  srctype = "HWI"  isr = "ISR_BDV"     channel = "0"  dstx = "0"  dsty = "0"  dstid = "0" />
+                <irq srcid = "10" srctype = "HWI"  isr = "ISR_TTY_RX"  channel = "0"  dstx = "0"  dsty = "0"  dstid = "0" />
+            </periph>
         </cluster>
 
         <cluster x = "0" y = "1" >
-            <pseg name = "PSEG_RAM"  type = "RAM"  base = "0x0100000000" length = "0x0000800000" />
+            <pseg name = "PSEG_RAM"  type = "RAM"  base = "0x0100000000" length = "0x0400000000" />
             <pseg name = "PSEG_XCU"  type = "PERI" base = "0x01F0000000" length = "0x0000002000" />
             <pseg name = "PSEG_MMC"  type = "PERI" base = "0x01E0000000" length = "0x0000001000" />
 
-            <proc index  = "0" >
-                <irq type = "SOFT" icuid = "0"  isr = "ISR_WAKUP" /> 
-                <irq type = "TIME" icuid = "4"  isr = "ISR_SWITCH" /> 
-                <irq type = "HARD" icuid = "8"  isr = "ISR_DEFAULT" /> 
-            </proc> 
-            <proc index  = "1" >
-                <irq type = "SOFT" icuid = "1"  isr = "ISR_WAKUP" /> 
-                <irq type = "TIME" icuid = "5"  isr = "ISR_SWITCH" /> 
-            </proc> 
-            <proc index  = "2" >
-                <irq type = "SOFT" icuid = "2"  isr = "ISR_WAKUP" /> 
-                <irq type = "TIME" icuid = "6"  isr = "ISR_SWITCH" /> 
-            </proc> 
-            <proc index  = "3" >
-                <irq type = "SOFT" icuid = "3"  isr = "ISR_WAKUP" /> 
-                <irq type = "TIME" icuid = "7"  isr = "ISR_SWITCH" /> 
-            </proc> 
-
-            <periph type = "XCU"  psegname = "PSEG_XCU"  channels = "16" />
-            <periph type = "MMC"  psegname = "PSEG_MMC"  channels = "1" />
+            <proc index  = "0" />
+            <proc index  = "1" />
+            <proc index  = "2" />
+            <proc index  = "3" />
+
+            <periph type = "MMC"  psegname = "PSEG_MMC" >
+            </periph>
+            <periph type = "XCU"  psegname = "PSEG_XCU"  channels = "16" >
+                <irq srcid = "0"  srctype = "WTI"  isr = "ISR_WAKUP"                  dstx = "0"  dsty = "1"  dstid = "0" />
+                <irq srcid = "1"  srctype = "WTI"  isr = "ISR_WAKUP"                  dstx = "0"  dsty = "1"  dstid = "1" />
+                <irq srcid = "2"  srctype = "WTI"  isr = "ISR_WAKUP"                  dstx = "0"  dsty = "1"  dstid = "2" />
+                <irq srcid = "3"  srctype = "WTI"  isr = "ISR_WAKUP"                  dstx = "0"  dsty = "1"  dstid = "3" />
+
+                <irq srcid = "0"  srctype = "PTI"  isr = "ISR_TICK"                   dstx = "0"  dsty = "1"  dstid = "0" />
+                <irq srcid = "1"  srctype = "PTI"  isr = "ISR_TICK"                   dstx = "0"  dsty = "1"  dstid = "1" />
+                <irq srcid = "2"  srctype = "PTI"  isr = "ISR_TICK"                   dstx = "0"  dsty = "1"  dstid = "2" />
+                <irq srcid = "3"  srctype = "PTI"  isr = "ISR_TICK"                   dstx = "0"  dsty = "1"  dstid = "3" />
+
+                <irq srcid = "8"  srctype = "HWI"  isr = "ISR_DEFAULT"                dstx = "0"  dsty = "1"  dstid = "0" />
+            </periph>
         </cluster>
 
         <cluster x = "1" y = "0" >
-            <pseg name = "PSEG_RAM"  type = "RAM"  base = "0x1000000000" length = "0x0000800000" />
+            <pseg name = "PSEG_RAM"  type = "RAM"  base = "0x1000000000" length = "0x0400000000" />
             <pseg name = "PSEG_XCU"  type = "PERI" base = "0x10F0000000" length = "0x0000002000" />
             <pseg name = "PSEG_MMC"  type = "PERI" base = "0x10E0000000" length = "0x0000001000" />
 
-            <proc index  = "0" >
-                <irq type = "SOFT" icuid = "0"  isr = "ISR_WAKUP" /> 
-                <irq type = "TIME" icuid = "4"  isr = "ISR_SWITCH" /> 
-                <irq type = "HARD" icuid = "8"  isr = "ISR_DEFAULT" /> 
-            </proc> 
-            <proc index  = "1" >
-                <irq type = "SOFT" icuid = "1"  isr = "ISR_WAKUP" /> 
-                <irq type = "TIME" icuid = "5"  isr = "ISR_SWITCH" /> 
-            </proc> 
-            <proc index  = "2" >
-                <irq type = "SOFT" icuid = "2"  isr = "ISR_WAKUP" /> 
-                <irq type = "TIME" icuid = "6"  isr = "ISR_SWITCH" /> 
-            </proc> 
-            <proc index  = "3" >
-                <irq type = "SOFT" icuid = "3"  isr = "ISR_WAKUP" /> 
-                <irq type = "TIME" icuid = "7"  isr = "ISR_SWITCH" /> 
-            </proc> 
-
-            <periph type = "XCU"  psegname = "PSEG_XCU"  channels = "16" />
-            <periph type = "MMC"  psegname = "PSEG_MMC"  channels = "1" />
+            <proc index  = "0" />
+            <proc index  = "1" />
+            <proc index  = "2" />
+            <proc index  = "3" />
+
+            <periph type = "MMC"  psegname = "PSEG_MMC" >
+            </periph>
+            <periph type = "XCU"  psegname = "PSEG_XCU"  channels = "16" >
+                <irq srcid = "0"  srctype = "WTI"  isr = "ISR_WAKUP"                  dstx = "1"  dsty = "0"  dstid = "0" />
+                <irq srcid = "1"  srctype = "WTI"  isr = "ISR_WAKUP"                  dstx = "1"  dsty = "0"  dstid = "1" />
+                <irq srcid = "2"  srctype = "WTI"  isr = "ISR_WAKUP"                  dstx = "1"  dsty = "0"  dstid = "2" />
+                <irq srcid = "3"  srctype = "WTI"  isr = "ISR_WAKUP"                  dstx = "1"  dsty = "0"  dstid = "3" />
+
+                <irq srcid = "0"  srctype = "PTI"  isr = "ISR_TICK"                   dstx = "1"  dsty = "0"  dstid = "0" />
+                <irq srcid = "1"  srctype = "PTI"  isr = "ISR_TICK"                   dstx = "1"  dsty = "0"  dstid = "1" />
+                <irq srcid = "2"  srctype = "PTI"  isr = "ISR_TICK"                   dstx = "1"  dsty = "0"  dstid = "2" />
+                <irq srcid = "3"  srctype = "PTI"  isr = "ISR_TICK"                   dstx = "1"  dsty = "0"  dstid = "3" />
+
+                <irq srcid = "8"  srctype = "HWI"  isr = "ISR_DEFAULT"                dstx = "1"  dsty = "0"  dstid = "0" />
+            </periph>
         </cluster>
 
         <cluster x = "1" y = "1" >
-            <pseg name = "PSEG_RAM"  type = "RAM"  base = "0x1100000000" length = "0x0000800000" />
+            <pseg name = "PSEG_RAM"  type = "RAM"  base = "0x1100000000" length = "0x0400000000" />
             <pseg name = "PSEG_XCU"  type = "PERI" base = "0x11F0000000" length = "0x0000002000" />
             <pseg name = "PSEG_MMC"  type = "PERI" base = "0x11E0000000" length = "0x0000001000" />
 
-            <proc index  = "0" >
-                <irq type = "SOFT" icuid = "0"  isr = "ISR_WAKUP" /> 
-                <irq type = "TIME" icuid = "4"  isr = "ISR_SWITCH" /> 
-                <irq type = "HARD" icuid = "8"  isr = "ISR_DEFAULT" /> 
-            </proc> 
-            <proc index  = "1" >
-                <irq type = "SOFT" icuid = "1"  isr = "ISR_WAKUP" /> 
-                <irq type = "TIME" icuid = "5"  isr = "ISR_SWITCH" /> 
-            </proc> 
-            <proc index  = "2" >
-                <irq type = "SOFT" icuid = "2"  isr = "ISR_WAKUP" /> 
-                <irq type = "TIME" icuid = "6"  isr = "ISR_SWITCH" /> 
-            </proc> 
-            <proc index  = "3" >
-                <irq type = "SOFT" icuid = "3"  isr = "ISR_WAKUP" /> 
-                <irq type = "TIME" icuid = "7"  isr = "ISR_SWITCH" /> 
-            </proc> 
-
-            <periph type = "XCU"  psegname = "PSEG_XCU"  channels = "16" />
-            <periph type = "MMC"  psegname = "PSEG_MMC"  channels = "1" />
-        </cluster>
+            <proc index  = "0" />
+            <proc index  = "1" />
+            <proc index  = "2" />
+            <proc index  = "3" />
+
+            <periph type = "MMC"  psegname = "PSEG_MMC" >
+            </periph>
+            <periph type = "XCU"  psegname = "PSEG_XCU"  channels = "16" >
+                <irq srcid = "0"  srctype = "WTI"  isr = "ISR_WAKUP"                  dstx = "1"  dsty = "1"  dstid = "0" />
+                <irq srcid = "1"  srctype = "WTI"  isr = "ISR_WAKUP"                  dstx = "1"  dsty = "1"  dstid = "1" />
+                <irq srcid = "2"  srctype = "WTI"  isr = "ISR_WAKUP"                  dstx = "1"  dsty = "1"  dstid = "2" />
+                <irq srcid = "3"  srctype = "WTI"  isr = "ISR_WAKUP"                  dstx = "1"  dsty = "1"  dstid = "3" />
+
+                <irq srcid = "0"  srctype = "PTI"  isr = "ISR_TICK"                   dstx = "1"  dsty = "1"  dstid = "0" />
+                <irq srcid = "1"  srctype = "PTI"  isr = "ISR_TICK"                   dstx = "1"  dsty = "1"  dstid = "1" />
+                <irq srcid = "2"  srctype = "PTI"  isr = "ISR_TICK"                   dstx = "1"  dsty = "1"  dstid = "2" />
+                <irq srcid = "3"  srctype = "PTI"  isr = "ISR_TICK"                   dstx = "1"  dsty = "1"  dstid = "3" />
+
+                <irq srcid = "8"  srctype = "HWI"  isr = "ISR_DEFAULT"                dstx = "1"  dsty = "1"  dstid = "0" />
+            </periph>
+        </cluster>
+
+*** empty clusters
+
+        <cluster x = "0" y = "2" >
+        </cluster>
+        <cluster x = "1" y = "2" >
+        </cluster>
+
     </clusterset>
 
     <globalset> 
 
-*** Segments used by the boot code / A[31:28] = 0x0 / Identity mapping
-- seg_boot_mapping is loaded by the boot-loader. It contains the mapping info. The content is reused by the kernel.
-- seg_boot_code and seg_boot data are loaded by the preloader, used by the boot-loader The content is not reused by the kernel.
-- seg_boot_stack is contains the stacks used by all processors during reset and boot. The content is not reused by the Kernel.
-- seg_boot_buffer is used by the boot-loader. It can contain a complete .elf file. The content is not reused by the kernel.
+*** Global vsegs associated to peripherals  replicated in all clusters (XCU, MMC, SCHED)
+*** must respect the following policy (checked by the XML parser) :
+*** vbase[x,y] = vbase[0,0] + 64K * cluster_xy
+*** pbase[x,y] = pbase[0,0] + 4G  * cluster_xy 
+*** ( with cluster_xy = x*16 + y )
+*** the vseg type is entirely defined by the 8 virtual address MSB bits (mask_type = 0xFF000000)
+*** The cluster index must be encoded in the next 8 virtual address bits (cluster_mask = 0x00FF0000)
+
+*** 5 global vsegs used by the boot code / A[31:28] = 0x0 / Identity mapping
+*** seg_boot_mapping is loaded by the boot-loader. It contains the mapping info.  Reused by the kernel.
+*** seg_boot_code and seg_boot data are loaded by the preloader, used by the boot-loader.  Not reused by the kernel.
+*** seg_boot_stack contains the stacks used by all processors during reset and boot.  Not reused by the Kernel.
+*** seg_boot_buffer is used by the boot-loader. It contains a complete .elf file.  Not reused by the kernel.
 
         <vseg name = "seg_boot_code"      vbase = "0x00010000" mode = "CXW_" x = "0" y = "0" psegname = "PSEG_RAM" ident = "1" >
@@ -153,14 +179,14 @@
         </vseg>
         <vseg name = "seg_boot_buffer"    vbase = "0x00040000" mode = "C_W_" x = "0" y = "0" psegname = "PSEG_RAM" ident = "1" >
-            <vobj name = "boot_buffer"    type = "BUFFER" length = "0x00020000" />
-        </vseg>
-        <vseg name = "seg_boot_stack"     vbase = "0x00060000" mode = "C_W_" x = "0" y = "0" psegname = "PSEG_RAM" ident = "1" >
-            <vobj name = "boot_stack"     type = "BUFFER" length = "0x00090000" />
+            <vobj name = "boot_buffer"    type = "BUFFER" length = "0x00060000" />
+        </vseg>
+        <vseg name = "seg_boot_stack"     vbase = "0x000A0000" mode = "C_W_" x = "0" y = "0" psegname = "PSEG_RAM" ident = "1" >
+            <vobj name = "boot_stack"     type = "BUFFER" length = "0x00050000" />
         </vseg>
         <vseg name = "seg_boot_mapping"   vbase = "0x000F0000" mode = "C_W_" x = "0" y = "0" psegname = "PSEG_RAM" ident = "1" >
             <vobj name = "boot_mapping"   type = "BLOB"   length = "0x00010000" binpath	= "map.bin" />
         </vseg>
-
-*** Segments used by the kernel / A[31:28] = 0x8 
+        
+*** 4 global vsegs used by the kernel / A[31:28] = 0x8  / No identity mapping constraint
   
         <vseg name = "seg_kernel_code"    vbase = "0x80000000" mode = "CXW_" x = "0" y = "0" psegname = "PSEG_RAM" > 
@@ -177,17 +203,25 @@
         </vseg>
 
-*** Segments for non replicated peripherals / A[31:28] = 0xF / Identity mapping
-
-        <vseg name = "seg_ioc"            vbase = "0xF2000000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_IOC" ident = "1" >
+*** 2 global vsegs for non replicated peripherals in cluster(0,0) / A[31:28] = 0xF / 
+
+        <vseg name = "seg_ioc"            vbase = "0xF2000000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_IOC" >
             <vobj name = "ioc"            type = "PERI" length  = "0x00001000" /> 
         </vseg>
-        <vseg name = "seg_tty"            vbase = "0xF4000000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_TTY" ident = "1" >
+
+        <vseg name = "seg_tty"            vbase = "0xF4000000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_TTY" >
    			<vobj name = "tty"            type = "PERI" length  = "0x00001000" />
         </vseg>
-        <vseg name = "seg_preloader"      vbase = "0x00000000" mode = "CXW_" x = "0" y = "0" psegname = "PSEG_RAM" ident = "1" >
+
+*** 2 global vsegs for pseudo-peripherals (PRELOADER and RAMDISK) / A[31:28] = 0x0 
+
+        <vseg name = "seg_reset_code"     vbase = "0x00000000" mode = "CX__" x = "0" y = "0" psegname = "PSEG_RAM" ident = "1" >
             <vobj name = "preloader"      type = "BUFFER" length  = "0x00010000" /> 
         </vseg>
 
-*** Segments for replicated ICUS / A[31:24] = 0xF0 / Increment = 0x10000 / Identity mapping in cluster 0            
+        <vseg name = "seg_ram_disk"       vbase = "0x02000000" mode = "C_W_" x = "0" y = "0" psegname = "PSEG_RAM" ident = "1" >
+            <vobj name = "ramdisk"        type = "BUFFER" length  = "0x02000000" />
+        </vseg>
+
+*** 4 global vsegs for replicated ICUS / A[31:24] = 0xF0 / Increment = 0x10000 / Identity mapping in cluster (0,0)            
 
         <vseg name = "seg_icu_0"          vbase = "0xF0000000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_XCU" ident = "1" > 
@@ -204,7 +238,5 @@
         </vseg>
 
-*** segments for replicated MMC / A[31:24] = 0xE0 / Increment = 0x10000 / Identity mapping in cluster 0
-*** The peripheral type must be entirely defined by the 8 virtual address MSB bits (mask_type = 0xFF000000)
-*** The cluster id must be encoded in the next 8 virtual address bits (cluster_mask = 0x00FF0000)
+*** 4 global vsegs for replicated MMC / A[31:24] = 0xE0 / Increment = 0x10000 / Identity mapping in cluster 0
 
         <vseg name = "seg_memc_0"         vbase = "0xE0000000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_MMC" ident = "1" >
@@ -221,7 +253,5 @@
         </vseg>
 
-*** segments for replicated schedulers / A[31:28] = 0xC / Increment = 0x10000
-*** The type must be entirely defined by the 8 virtual address MSB bits (mask_type = 0xFF000000)
-*** The cluster id must be encoded in the next 8 virtual address bits (cluster_mask = 0x00FF0000)
+*** 4 global vsegs for replicated schedulers / A[31:28] = 0xC / Increment = 0x10000
 
         <vseg name = "seg_sched_0"        vbase = "0xC0000000" mode = "C_W_" x = "0" y = "0" psegname = "PSEG_RAM" >
@@ -237,5 +267,5 @@
             <vobj name = "sched_3"        type = "SCHED" length  = "0x00008000" />
         </vseg>
-***
+
     </globalset> 
 
@@ -249,61 +279,67 @@
 
         <vspace name = "sort" startname = "sort_data" > 
-            <vseg name = "seg_sort_code"   vbase = "0x00400000" mode = "CXWU" x = "1" y = "1" psegname = "PSEG_RAM" > 
-                <vobj name = "sort_code"   type	 = "ELF" length = "0x00010000" binpath = "build/sort/sort.elf" /> 
-            </vseg>
-            <vseg name = "seg_sort_data"   vbase = "0x00500000" mode = "C_WU" x = "1" y = "1" psegname = "PSEG_RAM" >
-                <vobj name = "sort_data"   type	 = "ELF" length = "0x00010000" binpath = "build/sort/sort.elf" />
-            </vseg>
-            <vseg name = "seg_sort_ptab"   vbase = "0x00600000" mode = "C_W_" x = "1" y = "1" psegname = "PSEG_RAM" > 
-                <vobj name = "sort_ptab"   type	 = "PTAB" length  = "0x00020000" align = "13" />
-            </vseg>
-            <vseg name = "seg_sort_stack00" vbase = "0x00800000" mode = "C_WU" x = "0" y = "0" psegname = "PSEG_RAM" >
-                <vobj name = "sort_stack0"  type	 = "BUFFER" length = "0x00010000" /> 
-                <vobj name = "sort_stack1"  type	 = "BUFFER" length = "0x00010000" /> 
-                <vobj name = "sort_stack2"  type	 = "BUFFER" length = "0x00010000" /> 
-                <vobj name = "sort_stack3"  type	 = "BUFFER" length = "0x00010000" /> 
-                <vobj name = "sort_heap0"   type	 = "BUFFER" length = "0x00010000" /> 
-            </vseg>
-            <vseg name = "seg_sort_stack01" vbase = "0x00A00000" mode = "C_WU" x = "0" y = "1" psegname = "PSEG_RAM" >
-                <vobj name = "sort_stack4"  type	 = "BUFFER" length = "0x00010000" /> 
-                <vobj name = "sort_stack5"  type	 = "BUFFER" length = "0x00010000" /> 
-                <vobj name = "sort_stack6"  type	 = "BUFFER" length = "0x00010000" /> 
-                <vobj name = "sort_stack7"  type	 = "BUFFER" length = "0x00010000" /> 
-                <vobj name = "sort_heap1"   type	 = "BUFFER" length = "0x00010000" /> 
-            </vseg>
-            <vseg name = "seg_sort_stack10" vbase = "0x00C00000" mode = "C_WU" x = "1" y = "0" psegname = "PSEG_RAM" >
-                <vobj name = "sort_stack8"  type	 = "BUFFER" length = "0x00010000" /> 
-                <vobj name = "sort_stack9"  type	 = "BUFFER" length = "0x00010000" /> 
-                <vobj name = "sort_stack10" type	 = "BUFFER" length = "0x00010000" /> 
-                <vobj name = "sort_stack11" type	 = "BUFFER" length = "0x00010000" /> 
-                <vobj name = "sort_heap2"   type	 = "BUFFER" length = "0x00010000" /> 
-            </vseg>
-            <vseg name = "seg_sort_stack11" vbase = "0x00E00000" mode = "C_WU" x = "1" y = "1" psegname = "PSEG_RAM" >
-                <vobj name = "sort_stack12" type	 = "BUFFER" length = "0x00010000" /> 
-                <vobj name = "sort_stack13" type	 = "BUFFER" length = "0x00010000" /> 
-                <vobj name = "sort_stack14" type	 = "BUFFER" length = "0x00010000" /> 
-                <vobj name = "sort_stack15" type	 = "BUFFER" length = "0x00010000" /> 
-                <vobj name = "sort_heap3"   type	 = "BUFFER" length = "0x00010000" /> 
-            </vseg>
-			<vseg name = "seg_params"       vbase = "0x00F00000" mode = "C_WU" x = "0" y = "0" psegname = "PSEG_RAM" >
-				<vobj name = "nb_thread"    type     = "CONST"  length = "0x4" init = "16" />
+            <vseg name = "seg_sort_code"     vbase = "0x00400000" mode = "CXWU" x = "1" y = "1" psegname = "PSEG_RAM" > 
+                <vobj name = "sort_code"     type  = "ELF" length = "0x00010000" binpath = "build/sort/sort.elf" /> 
+            </vseg>
+            <vseg name = "seg_sort_data"     vbase = "0x00500000" mode = "C_WU" x = "1" y = "1" psegname = "PSEG_RAM" >
+                <vobj name = "sort_data"     type  = "ELF" length = "0x00010000" binpath = "build/sort/sort.elf" />
+            </vseg>
+            <vseg name = "seg_sort_ptab"     vbase = "0x00600000" mode = "C_W_" x = "1" y = "1" psegname = "PSEG_RAM" > 
+                <vobj name = "sort_ptab"     type  = "PTAB" length  = "0x00020000" align = "13" />
+            </vseg>
+            <vseg name = "seg_sort_stack_0"  vbase = "0x00200000" mode = "C_WU" x = "0" y = "0" psegname = "PSEG_RAM" >
+                <vobj name = "sort_stack_00" type  = "BUFFER" length = "0x00010000" /> 
+                <vobj name = "sort_stack_01" type  = "BUFFER" length = "0x00010000" /> 
+                <vobj name = "sort_stack_02" type  = "BUFFER" length = "0x00010000" /> 
+                <vobj name = "sort_stack_03" type  = "BUFFER" length = "0x00010000" /> 
+                <vobj name = "sort_heap_0"   type  = "BUFFER" length = "0x00040000" /> 
+            </vseg>
+            <vseg name = "seg_sort_stack_1"  vbase = "0x00280000" mode = "C_WU" x = "0" y = "1" psegname = "PSEG_RAM" >
+                <vobj name = "sort_stack_10" type  = "BUFFER" length = "0x00010000" /> 
+                <vobj name = "sort_stack_11" type  = "BUFFER" length = "0x00010000" /> 
+                <vobj name = "sort_stack_12" type  = "BUFFER" length = "0x00010000" /> 
+                <vobj name = "sort_stack_13" type  = "BUFFER" length = "0x00010000" /> 
+                <vobj name = "sort_heap_1"   type  = "BUFFER" length = "0x00040000" /> 
+            </vseg>
+            <vseg name = "seg_sort_stack_2"  vbase = "0x00300000" mode = "C_WU" x = "1" y = "0" psegname = "PSEG_RAM" >
+                <vobj name = "sort_stack_20" type  = "BUFFER" length = "0x00010000" /> 
+                <vobj name = "sort_stack_21" type  = "BUFFER" length = "0x00010000" /> 
+                <vobj name = "sort_stack_22" type  = "BUFFER" length = "0x00010000" /> 
+                <vobj name = "sort_stack_23" type  = "BUFFER" length = "0x00010000" /> 
+                <vobj name = "sort_heap_2"   type  = "BUFFER" length = "0x00040000" /> 
+            </vseg>
+            <vseg name = "seg_sort_stack_3"  vbase = "0x00380000" mode = "C_WU" x = "1" y = "1" psegname = "PSEG_RAM" >
+                <vobj name = "sort_stack_30" type  = "BUFFER" length = "0x00010000" /> 
+                <vobj name = "sort_stack_31" type  = "BUFFER" length = "0x00010000" /> 
+                <vobj name = "sort_stack_32" type  = "BUFFER" length = "0x00010000" /> 
+                <vobj name = "sort_stack_33" type  = "BUFFER" length = "0x00010000" /> 
+                <vobj name = "sort_heap_3"   type  = "BUFFER" length = "0x00040000" /> 
+            </vseg>
+
+*** This vobj emulates a command line argument for the sort application
+
+			<vseg name = "seg_params"       vbase = "0x00100000" mode = "C_WU" x = "0" y = "0" psegname = "PSEG_RAM" >
+				<vobj name = "nb_thread"    type  = "CONST"  length = "0x4" init = "16" />
 			</vseg>
-            <task name = "sort_0"  x = "0" y = "0" proclocid = "0" stackname = "sort_stack0"  heapname = "sort_heap0" startid = "0" usetty = "1" />
-            <task name = "sort_1"  x = "0" y = "0" proclocid = "1" stackname = "sort_stack1"  heapname = "sort_heap0" startid = "0" usetty = "1" />
-            <task name = "sort_2"  x = "0" y = "0" proclocid = "2" stackname = "sort_stack2"  heapname = "sort_heap0" startid = "0" usetty = "1" />
-            <task name = "sort_3"  x = "0" y = "0" proclocid = "3" stackname = "sort_stack3"  heapname = "sort_heap0" startid = "0" usetty = "1" />
-            <task name = "sort_4"  x = "0" y = "1" proclocid = "0" stackname = "sort_stack4"  heapname = "sort_heap1" startid = "0" usetty = "1" />
-            <task name = "sort_5"  x = "0" y = "1" proclocid = "1" stackname = "sort_stack5"  heapname = "sort_heap1" startid = "0" usetty = "1" />
-            <task name = "sort_6"  x = "0" y = "1" proclocid = "2" stackname = "sort_stack6"  heapname = "sort_heap1" startid = "0" usetty = "1" />
-            <task name = "sort_7"  x = "0" y = "1" proclocid = "3" stackname = "sort_stack7"  heapname = "sort_heap1" startid = "0" usetty = "1" />
-            <task name = "sort_8"  x = "1" y = "0" proclocid = "0" stackname = "sort_stack8"  heapname = "sort_heap2" startid = "0" usetty = "1" />
-            <task name = "sort_9"  x = "1" y = "0" proclocid = "1" stackname = "sort_stack9"  heapname = "sort_heap2" startid = "0" usetty = "1" />
-            <task name = "sort_10" x = "1" y = "0" proclocid = "2" stackname = "sort_stack10" heapname = "sort_heap2" startid = "0" usetty = "1" />
-            <task name = "sort_11" x = "1" y = "0" proclocid = "3" stackname = "sort_stack11" heapname = "sort_heap2" startid = "0" usetty = "1" />
-            <task name = "sort_12" x = "1" y = "1" proclocid = "0" stackname = "sort_stack12" heapname = "sort_heap3" startid = "0" usetty = "1" />
-            <task name = "sort_13" x = "1" y = "1" proclocid = "1" stackname = "sort_stack13" heapname = "sort_heap3" startid = "0" usetty = "1" />
-            <task name = "sort_14" x = "1" y = "1" proclocid = "2" stackname = "sort_stack14" heapname = "sort_heap3" startid = "0" usetty = "1" />
-            <task name = "sort_15" x = "1" y = "1" proclocid = "3" stackname = "sort_stack15" heapname = "sort_heap3" startid = "0" usetty = "1" />
-
+
+            <task name = "sort_00" x = "0" y = "0" proclocid = "0" stackname = "sort_stack_00"  heapname = "sort_heap_0" startid = "0"  />
+            <task name = "sort_01" x = "0" y = "0" proclocid = "1" stackname = "sort_stack_01"  heapname = "sort_heap_0" startid = "0"  />
+            <task name = "sort_02" x = "0" y = "0" proclocid = "2" stackname = "sort_stack_02"  heapname = "sort_heap_0" startid = "0"  />
+            <task name = "sort_03" x = "0" y = "0" proclocid = "3" stackname = "sort_stack_03"  heapname = "sort_heap_0" startid = "0"  />
+
+            <task name = "sort_10" x = "0" y = "1" proclocid = "0" stackname = "sort_stack_10"  heapname = "sort_heap_1" startid = "0"  />
+            <task name = "sort_11" x = "0" y = "1" proclocid = "1" stackname = "sort_stack_11"  heapname = "sort_heap_1" startid = "0"  />
+            <task name = "sort_12" x = "0" y = "1" proclocid = "2" stackname = "sort_stack_12"  heapname = "sort_heap_1" startid = "0"  />
+            <task name = "sort_13" x = "0" y = "1" proclocid = "3" stackname = "sort_stack_13"  heapname = "sort_heap_1" startid = "0"  />
+
+            <task name = "sort_20" x = "1" y = "0" proclocid = "0" stackname = "sort_stack_20"  heapname = "sort_heap_2" startid = "0"  />
+            <task name = "sort_21" x = "1" y = "0" proclocid = "1" stackname = "sort_stack_21"  heapname = "sort_heap_2" startid = "0"  />
+            <task name = "sort_22" x = "1" y = "0" proclocid = "2" stackname = "sort_stack_22"  heapname = "sort_heap_2" startid = "0"  />
+            <task name = "sort_23" x = "1" y = "0" proclocid = "3" stackname = "sort_stack_23"  heapname = "sort_heap_2" startid = "0"  />
+
+            <task name = "sort_30" x = "1" y = "1" proclocid = "0" stackname = "sort_stack_30"  heapname = "sort_heap_3" startid = "0"  />
+            <task name = "sort_31" x = "1" y = "1" proclocid = "1" stackname = "sort_stack_31"  heapname = "sort_heap_3" startid = "0"  />
+            <task name = "sort_32" x = "1" y = "1" proclocid = "2" stackname = "sort_stack_32"  heapname = "sort_heap_3" startid = "0"  />
+            <task name = "sort_33" x = "1" y = "1" proclocid = "3" stackname = "sort_stack_33"  heapname = "sort_heap_3" startid = "0"  />
         </vspace>
     </vspaceset>
