Index: /soft/giet_vm/mappings/4c_1p_sort.xml
===================================================================
--- /soft/giet_vm/mappings/4c_1p_sort.xml	(revision 269)
+++ /soft/giet_vm/mappings/4c_1p_sort.xml	(revision 270)
@@ -3,6 +3,8 @@
 <mapping_info signature    = "0xdeadbeef" 
               name         = "4c_1p_sort" 
-              cluster_x    = "2" 
-              cluster_y    = "2" 
+              x_size       = "2" 
+              y_size       = "2" 
+              x_width      = "4"
+              y_width      = "4"
               vspaces      = "1"
               increment    = "0x10000" >
@@ -16,6 +18,6 @@
     <clusterset>
 
-        <cluster index = "0" >
-            <pseg name = "PSEG_RAM"  type = "RAM"  base = "0x0000000000" length = "0x0010000000" />
+        <cluster x = "0" y = "0" >
+            <pseg name = "PSEG_RAM"  type = "RAM"  base = "0x0000000000" length = "0x0001000000" />
             <pseg name = "PSEG_XCU"  type = "PERI" base = "0x00B0000000" length = "0x0000002000" />
             <pseg name = "PSEG_DMA"  type = "PERI" base = "0x00B1000000" length = "0x0000008000" />
@@ -56,9 +58,9 @@
         </cluster>
 
-        <cluster index = "1" >
-            <pseg name = "PSEG_RAM"  type = "RAM"  base = "0x4000000000" length = "0x0010000000" />
-            <pseg name = "PSEG_XCU"  type = "PERI" base = "0x40B0000000" length = "0x0000002000" />
-            <pseg name = "PSEG_DMA"  type = "PERI" base = "0x40B1000000" length = "0x0000008000" />
-            <pseg name = "PSEG_MMC"  type = "PERI" base = "0x40B8000000" length = "0x0000001000" />
+        <cluster x = "0" y = "1" >
+            <pseg name = "PSEG_RAM"  type = "RAM"  base = "0x1000000000" length = "0x0001000000" />
+            <pseg name = "PSEG_XCU"  type = "PERI" base = "0x10B0000000" length = "0x0000002000" />
+            <pseg name = "PSEG_DMA"  type = "PERI" base = "0x10B1000000" length = "0x0000008000" />
+            <pseg name = "PSEG_MMC"  type = "PERI" base = "0x10B8000000" length = "0x0000001000" />
 
             <proc index = "0" >
@@ -72,9 +74,9 @@
         </cluster>
 
-        <cluster index = "2" >
-            <pseg name = "PSEG_RAM"  type = "RAM"  base = "0x8000000000" length = "0x0010000000" />
-            <pseg name = "PSEG_XCU"  type = "PERI" base = "0x80B0000000" length = "0x0000002000" />
-            <pseg name = "PSEG_DMA"  type = "PERI" base = "0x80B1000000" length = "0x0000008000" />
-            <pseg name = "PSEG_MMC"  type = "PERI" base = "0x80B8000000" length = "0x0000001000" />
+        <cluster x = "1" y = "0" >
+            <pseg name = "PSEG_RAM"  type = "RAM"  base = "0x0100000000" length = "0x0001000000" />
+            <pseg name = "PSEG_XCU"  type = "PERI" base = "0x01B0000000" length = "0x0000002000" />
+            <pseg name = "PSEG_DMA"  type = "PERI" base = "0x01B1000000" length = "0x0000008000" />
+            <pseg name = "PSEG_MMC"  type = "PERI" base = "0x01B8000000" length = "0x0000001000" />
 
             <proc index = "0" >
@@ -88,9 +90,9 @@
         </cluster>
 
-        <cluster index = "3" >
-            <pseg name = "PSEG_RAM"  type = "RAM"  base = "0xC000000000" length = "0x0010000000" />
-            <pseg name = "PSEG_XCU"  type = "PERI" base = "0xC0B0000000" length = "0x0000002000" />
-            <pseg name = "PSEG_DMA"  type = "PERI" base = "0xC0B1000000" length = "0x0000008000" />
-            <pseg name = "PSEG_MMC"  type = "PERI" base = "0xC0B8000000" length = "0x0000001000" />
+        <cluster x = "1" y = "1" >
+            <pseg name = "PSEG_RAM"  type = "RAM"  base = "0x1100000000" length = "0x0001000000" />
+            <pseg name = "PSEG_XCU"  type = "PERI" base = "0x11B0000000" length = "0x0000002000" />
+            <pseg name = "PSEG_DMA"  type = "PERI" base = "0x11B1000000" length = "0x0000008000" />
+            <pseg name = "PSEG_MMC"  type = "PERI" base = "0x11B8000000" length = "0x0000001000" />
 
             <proc index = "0" >
@@ -113,17 +115,17 @@
 - seg_boot_buffer is used by the boot-loader. It can contain a complete .elf file. The content is not reused by the kernel.
 
-        <vseg name = "seg_boot_mapping"   vbase = "0x00000000" mode = "C_W_" clusterid = "0" psegname = "PSEG_RAM" ident = "1" >
+        <vseg name = "seg_boot_mapping"   vbase = "0x00000000" mode = "C_W_" x = "0" y = "0" psegname = "PSEG_RAM" ident = "1" >
             <vobj name = "boot_mapping"   type = "BLOB"   length = "0x00010000" binpath	= "map.bin" />
         </vseg>
-        <vseg name = "seg_boot_code"      vbase = "0x00010000" mode = "CXW_" clusterid = "0" psegname = "PSEG_RAM" ident = "1" >
+        <vseg name = "seg_boot_code"      vbase = "0x00010000" mode = "CXW_" x = "0" y = "0" psegname = "PSEG_RAM" ident = "1" >
             <vobj name = "boot_code"      type = "BUFFER" length = "0x00020000" />
         </vseg>
-        <vseg name = "seg_boot_data"      vbase = "0x00030000" mode = "C_W_" clusterid = "0" psegname = "PSEG_RAM" ident = "1" >
+        <vseg name = "seg_boot_data"      vbase = "0x00030000" mode = "C_W_" x = "0" y = "0" psegname = "PSEG_RAM" ident = "1" >
             <vobj name = "boot_data"      type = "BUFFER" length = "0x00010000" />
         </vseg>
-        <vseg name = "seg_boot_buffer"    vbase = "0x00040000" mode = "C_W_" clusterid = "0" psegname = "PSEG_RAM" ident = "1" >
+        <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_" clusterid = "0" psegname = "PSEG_RAM" ident = "1" >
+        <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" />
         </vseg>
@@ -131,14 +133,14 @@
 *** Segments used by the kernel / A[31:28] = 0x8 
   
-        <vseg name = "seg_kernel_code"    vbase = "0x80000000" mode = "CXW_" clusterid = "0" psegname = "PSEG_RAM" > 
+        <vseg name = "seg_kernel_code"    vbase = "0x80000000" mode = "CXW_" x = "0" y = "0" psegname = "PSEG_RAM" > 
             <vobj name = "kernel_code"    type = "ELF" length = "0x00020000" binpath = "build/kernel/kernel.elf" />
         </vseg>
-        <vseg name = "seg_kernel_data"    vbase = "0x80020000" mode = "C_W_" clusterid = "0" psegname = "PSEG_RAM" > 
+        <vseg name = "seg_kernel_data"    vbase = "0x80020000" mode = "C_W_" x = "0" y = "0" psegname = "PSEG_RAM" > 
             <vobj name = "kernel_data"    type = "ELF" length = "0x00060000" binpath = "build/kernel/kernel.elf" />
 		</vseg>
-        <vseg name = "seg_kernel_uncdata" vbase = "0x80080000" mode = "__W_" clusterid = "0" psegname = "PSEG_RAM" > 
+        <vseg name = "seg_kernel_uncdata" vbase = "0x80080000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_RAM" > 
             <vobj name = "kernel_uncdata" type = "ELF" length = "0x00040000" binpath = "build/kernel/kernel.elf" />
         </vseg>
-        <vseg name = "seg_kernel_init"    vbase = "0x800C0000" mode = "CXW_" clusterid = "0" psegname = "PSEG_RAM" > 
+        <vseg name = "seg_kernel_init"    vbase = "0x800C0000" mode = "CXW_" x = "0" y = "0" psegname = "PSEG_RAM" > 
             <vobj name = "kernel_init"    type = "ELF" length = "0x00010000" binpath = "build/kernel/kernel.elf" />
         </vseg>
@@ -146,20 +148,20 @@
 *** Segments for non replicated peripherals / A[31:28] = 0xB / Identity mapping
 
-        <vseg name = "seg_fbf"            vbase = "0xB2000000" mode = "__W_" clusterid = "0" psegname = "PSEG_FBF" ident = "1" >
+        <vseg name = "seg_fbf"            vbase = "0xB2000000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_FBF" ident = "1" >
             <vobj name = "fbf"            type = "PERI" length  = "0x00004000" /> 
         </vseg>
-        <vseg name = "seg_ioc"            vbase = "0xB3000000" mode = "__W_" clusterid = "0" psegname = "PSEG_IOC" ident = "1" >
+        <vseg name = "seg_ioc"            vbase = "0xB3000000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_IOC" ident = "1" >
             <vobj name = "ioc"            type = "PERI" length  = "0x00001000" /> 
         </vseg>
-        <vseg name = "seg_tty"            vbase = "0xB4000000" mode = "__W_" clusterid = "0" psegname = "PSEG_TTY" ident = "1" >
+        <vseg name = "seg_tty"            vbase = "0xB4000000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_TTY" ident = "1" >
    			<vobj name = "tty"            type = "PERI" length  = "0x00001000" />
         </vseg>
-        <vseg name = "seg_nic"            vbase = "0xB5000000" mode = "__W_" clusterid = "0" psegname = "PSEG_NIC" ident = "1" >
+        <vseg name = "seg_nic"            vbase = "0xB5000000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_NIC" ident = "1" >
             <vobj name = "nic"            type = "PERI" length  = "0x00080000" /> 
         </vseg>
-        <vseg name = "seg_cma"            vbase = "0xB6000000" mode = "__W_" clusterid = "0" psegname = "PSEG_CMA" ident = "1" >
+        <vseg name = "seg_cma"            vbase = "0xB6000000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_CMA" ident = "1" >
             <vobj name = "cma"            type = "PERI" length  = "0x00008000" /> 
         </vseg>
-        <vseg name = "seg_rom"            vbase = "0xBFC00000" mode = "CXW_" clusterid = "0" psegname = "PSEG_ROM" ident = "1" >
+        <vseg name = "seg_rom"            vbase = "0xBFC00000" mode = "CXW_" x = "0" y = "0" psegname = "PSEG_ROM" ident = "1" >
             <vobj name = "rom"            type = "PERI" length  = "0x00004000" /> 
         </vseg>
@@ -167,59 +169,65 @@
 *** Segments for replicated ICUS / A[31:24] = 0xB0 / Increment = 0x10000 / Identity mapping in cluster 0            
 
-        <vseg name = "seg_icu_0"          vbase = "0xB0000000" mode = "__W_" clusterid = "0" psegname = "PSEG_XCU" ident = "1" > 
+        <vseg name = "seg_icu_0"          vbase = "0xB0000000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_XCU" ident = "1" > 
             <vobj name = "icu_0"          type = "PERI" length  = "0x00001000" /> 
         </vseg>
-        <vseg name = "seg_icu_1"          vbase = "0xB0010000" mode = "__W_" clusterid = "1" psegname = "PSEG_XCU" > 
+        <vseg name = "seg_icu_1"          vbase = "0xB0010000" mode = "__W_" x = "0" y = "1" psegname = "PSEG_XCU" > 
             <vobj name = "icu_1"          type = "PERI" length  = "0x00001000" /> 
         </vseg>
-        <vseg name = "seg_icu_2"          vbase = "0xB0020000" mode = "__W_" clusterid = "2" psegname = "PSEG_XCU" > 
+        <vseg name = "seg_icu_2"          vbase = "0xB0100000" mode = "__W_" x = "1" y = "0" psegname = "PSEG_XCU" > 
             <vobj name = "icu_2"          type = "PERI" length  = "0x00001000" /> 
         </vseg>
-        <vseg name = "seg_icu_3"          vbase = "0xB0030000" mode = "__W_" clusterid = "3" psegname = "PSEG_XCU" > 
+        <vseg name = "seg_icu_3"          vbase = "0xB0110000" mode = "__W_" x = "1" y = "1" psegname = "PSEG_XCU" > 
             <vobj name = "icu_3"          type = "PERI" length  = "0x00001000" /> 
         </vseg>
 
 *** segments for replicated DMAs / A[31:24] = 0xB1 / Increment = 0x10000 / Tdentity mapping in cluster 0
-
-        <vseg name = "seg_dma_0"          vbase = "0xB1000000" mode = "__W_" clusterid = "0" psegname = "PSEG_DMA" ident = "1" >
+*** 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)
+
+        <vseg name = "seg_dma_0"          vbase = "0xB1000000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_DMA" ident = "1" >
             <vobj name = "dma_0"          type = "PERI" length  = "0x00008000" />
         </vseg>
-        <vseg name = "seg_dma_1"          vbase = "0xB1010000" mode = "__W_" clusterid = "1" psegname = "PSEG_DMA" >
+        <vseg name = "seg_dma_1"          vbase = "0xB1010000" mode = "__W_" x = "0" y = "1" psegname = "PSEG_DMA" >
             <vobj name = "dma_1"          type = "PERI" length  = "0x00008000" />
         </vseg>
-        <vseg name = "seg_dma_2"          vbase = "0xB1020000" mode = "__W_" clusterid = "2" psegname = "PSEG_DMA" >
+        <vseg name = "seg_dma_2"          vbase = "0xB1100000" mode = "__W_" x = "1" y = "0" psegname = "PSEG_DMA" >
             <vobj name = "dma_2"          type = "PERI" length  = "0x00008000" />
         </vseg>
-        <vseg name = "seg_dma_3"          vbase = "0xB1030000" mode = "__W_" clusterid = "3" psegname = "PSEG_DMA" >
+        <vseg name = "seg_dma_3"          vbase = "0xB1110000" mode = "__W_" x = "1" y = "1" psegname = "PSEG_DMA" >
             <vobj name = "dma_3"          type = "PERI" length  = "0x00008000" />
         </vseg>
 
-*** segments for replicated MMC / A[31:24] = 0xB2 / Increment = 0x10000 / Identity mapping in cluster 0
-
-        <vseg name = "seg_memc_0"         vbase = "0xB8000000" mode = "__W_" clusterid = "0" psegname = "PSEG_MMC" ident = "1" >
+*** segments for replicated MMC / A[31:24] = 0xB8 / 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)
+
+        <vseg name = "seg_memc_0"         vbase = "0xB8000000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_MMC" ident = "1" >
             <vobj name = "memc_0"         type = "PERI" length  = "0x00001000" />
         </vseg>
-        <vseg name = "seg_memc_1"         vbase = "0xB8010000" mode = "__W_" clusterid = "1" psegname = "PSEG_MMC" >
+        <vseg name = "seg_memc_1"         vbase = "0xB8010000" mode = "__W_" x = "0" y = "1" psegname = "PSEG_MMC" >
             <vobj name = "memc_1"         type = "PERI" length  = "0x00001000" />
         </vseg>
-        <vseg name = "seg_memc_2"         vbase = "0xB8020000" mode = "__W_" clusterid = "2" psegname = "PSEG_MMC" >
+        <vseg name = "seg_memc_2"         vbase = "0xB8100000" mode = "__W_" x = "1" y = "0" psegname = "PSEG_MMC" >
             <vobj name = "memc_2"         type = "PERI" length  = "0x00001000" />
         </vseg>
-        <vseg name = "seg_memc_3"         vbase = "0xB8030000" mode = "__W_" clusterid = "3" psegname = "PSEG_MMC" >
+        <vseg name = "seg_memc_3"         vbase = "0xB8110000" mode = "__W_" x = "1" y = "1" psegname = "PSEG_MMC" >
             <vobj name = "memc_3"         type = "PERI" length  = "0x00001000" />
         </vseg>
 
 *** segments for replicated schedulers / A[31:28] = 0xF / Increment = 0x10000
-
-        <vseg name = "seg_sched_0"        vbase = "0xF0000000" mode = "C_W_" clusterid = "0" psegname = "PSEG_RAM" >
+*** 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)
+
+        <vseg name = "seg_sched_0"        vbase = "0xF0000000" mode = "C_W_" x = "0" y = "0" psegname = "PSEG_RAM" >
             <vobj name = "sched_0"        type = "SCHED" length  = "0x00008000" />
         </vseg>
-        <vseg name = "seg_sched_1"        vbase = "0xF0010000" mode = "C_W_" clusterid = "1" psegname = "PSEG_RAM" >
+        <vseg name = "seg_sched_1"        vbase = "0xF0010000" mode = "C_W_" x = "0" y = "1" psegname = "PSEG_RAM" >
             <vobj name = "sched_1"        type = "SCHED" length  = "0x00008000" />
         </vseg>
-        <vseg name = "seg_sched_2"        vbase = "0xF0020000" mode = "C_W_" clusterid = "2" psegname = "PSEG_RAM" >
+        <vseg name = "seg_sched_2"        vbase = "0xF0100000" mode = "C_W_" x = "1" y = "0" psegname = "PSEG_RAM" >
             <vobj name = "sched_2"        type = "SCHED" length  = "0x00008000" />
         </vseg>
-        <vseg name = "seg_sched_3"        vbase = "0xF0030000" mode = "C_W_" clusterid = "3" psegname = "PSEG_RAM" >
+        <vseg name = "seg_sched_3"        vbase = "0xF0110000" mode = "C_W_" x = "1" y = "1" psegname = "PSEG_RAM" >
             <vobj name = "sched_3"        type = "SCHED" length  = "0x00008000" />
         </vseg>
@@ -236,34 +244,34 @@
 
         <vspace name = "sort" startname = "sort_data" > 
-            <vseg name = "seg_sort_code"   vbase = "0x00400000" mode = "CXWU" clusterid = "3" psegname = "PSEG_RAM" > 
+            <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 = "__WU" clusterid = "3" psegname = "PSEG_RAM" >
+            <vseg name = "seg_sort_data"   vbase = "0x00500000" mode = "__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_" clusterid = "3" psegname = "PSEG_RAM" > 
+            <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_stack0" vbase = "0x00800000" mode = "C_WU" clusterid = "0" psegname = "PSEG_RAM" >
+            <vseg name = "seg_sort_stack0" vbase = "0x00800000" mode = "C_WU" x = "0" y = "0" psegname = "PSEG_RAM" >
                 <vobj name = "sort_stack0" type	 = "BUFFER" length = "0x00010000" /> 
                 <vobj name = "sort_heap0"  type	 = "BUFFER" length = "0x00010000" /> 
             </vseg>
-            <vseg name = "seg_sort_stack1" vbase = "0x00A00000" mode = "C_WU" clusterid = "1" psegname = "PSEG_RAM" >
+            <vseg name = "seg_sort_stack1" vbase = "0x00A00000" mode = "C_WU" x = "0" y = "1" psegname = "PSEG_RAM" >
                 <vobj name = "sort_stack1" type	 = "BUFFER" length = "0x00010000" /> 
                 <vobj name = "sort_heap1"  type	 = "BUFFER" length = "0x00010000" /> 
             </vseg>
-            <vseg name = "seg_sort_stack2" vbase = "0x00C00000" mode = "C_WU" clusterid = "2" psegname = "PSEG_RAM" >
+            <vseg name = "seg_sort_stack2" vbase = "0x00C00000" mode = "C_WU" x = "1" y = "0" psegname = "PSEG_RAM" >
                 <vobj name = "sort_stack2" type	 = "BUFFER" length = "0x00010000" /> 
                 <vobj name = "sort_heap2"  type	 = "BUFFER" length = "0x00010000" /> 
             </vseg>
-            <vseg name = "seg_sort_stack3" vbase = "0x00E00000" mode = "C_WU" clusterid = "3" psegname = "PSEG_RAM" >
+            <vseg name = "seg_sort_stack3" vbase = "0x00E00000" mode = "C_WU" x = "1" y = "1" psegname = "PSEG_RAM" >
                 <vobj name = "sort_stack3" type	 = "BUFFER" length = "0x00010000" /> 
                 <vobj name = "sort_heap3"  type	 = "BUFFER" length = "0x00010000" /> 
             </vseg>
 
-            <task name = "sort_0" clusterid = "0" proclocid = "0" stackname = "sort_stack0" heapname = "sort_heap3" startid = "0" usetty = "1" />
-            <task name = "sort_1" clusterid = "1" proclocid = "0" stackname = "sort_stack1" heapname = "sort_heap3" startid = "0" usetty = "1" />
-            <task name = "sort_2" clusterid = "2" proclocid = "0" stackname = "sort_stack2" heapname = "sort_heap3" startid = "0" usetty = "1" />
-            <task name = "sort_3" clusterid = "3" proclocid = "0" stackname = "sort_stack3" heapname = "sort_heap3" startid = "0" usetty = "1" />
+            <task name = "sort_0" trdid = "0" x = "0" y = "0" proclocid = "0" stackname = "sort_stack0" heapname = "sort_heap3" startid = "0" usetty = "1" />
+            <task name = "sort_1" trdid = "1" x = "0" y = "1" proclocid = "0" stackname = "sort_stack1" heapname = "sort_heap3" startid = "0" usetty = "1" />
+            <task name = "sort_2" trdid = "2" x = "1" y = "0" proclocid = "0" stackname = "sort_stack2" heapname = "sort_heap3" startid = "0" usetty = "1" />
+            <task name = "sort_3" trdid = "3" x = "1" y = "1" proclocid = "0" stackname = "sort_stack3" heapname = "sort_heap3" startid = "0" usetty = "1" />
         </vspace>
     </vspaceset>
Index: /soft/giet_vm/mappings/4c_1p_sort_chiplet.xml
===================================================================
--- /soft/giet_vm/mappings/4c_1p_sort_chiplet.xml	(revision 270)
+++ /soft/giet_vm/mappings/4c_1p_sort_chiplet.xml	(revision 270)
@@ -0,0 +1,231 @@
+<?xml version="1.0"?>
+
+<mapping_info signature    = "0xdeadbeef" 
+              name         = "4c_1p_sort_chiplet" 
+              x_size       = "2" 
+              y_size       = "2" 
+              x_width      = "4"
+              y_width      = "4"
+              vspaces      = "1"
+              increment    = "0x10000" >
+
+*** 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.
+
+    <clusterset>
+
+        <cluster x = "0" y = "0" >
+            <pseg name = "PSEG_RAM"  type = "RAM"  base = "0x0000000000" length = "0x0004000000" />
+            <pseg name = "PSEG_XCU"  type = "PERI" base = "0x00B0000000" length = "0x0000002000" />
+            <pseg name = "PSEG_MMC"  type = "PERI" base = "0x00A2000000" length = "0x0000001000" />
+
+*** Non replicated peripherals (including the ROM containing the preloader code)
+
+            <pseg name = "PSEG_IOC"  type = "PERI" base = "0x00B3000000" length = "0x0000001000" /> 
+            <pseg name = "PSEG_TTY"  type = "PERI" base = "0x00B4000000" length = "0x0000001000" /> 
+            <pseg name = "PSEG_ROM"  type = "PERI" base = "0x00BFC00000" length = "0x0000008000" />
+
+            <proc index  = "0" >
+                <irq type = "SOFT" icuid = "0"  isr = "ISR_WAKUP" /> 
+                <irq type = "TIME" icuid = "1"  isr = "ISR_SWITCH" /> 
+                <irq type = "HARD" icuid = "2"  isr = "ISR_IOC" /> 
+            </proc> 
+
+            <periph type = "XCU"  psegname = "PSEG_XCU"  channels = "1"  />
+            <periph type = "MMC"  psegname = "PSEG_MMC"  channels = "1"  />
+            <periph type = "IOC"  psegname = "PSEG_IOC"  channels = "1"  /> 
+            <periph type = "TTY"  psegname = "PSEG_TTY"  channels = "1" /> 
+            <periph type = "ROM"  psegname = "PSEG_ROM"  channels = "1"  />
+
+        </cluster>
+
+        <cluster x = "0" y = "1" >
+            <pseg name = "PSEG_RAM"  type = "RAM"  base = "0x0100000000" length = "0x0001000000" />
+            <pseg name = "PSEG_XCU"  type = "PERI" base = "0x01B0000000" length = "0x0000002000" />
+            <pseg name = "PSEG_MMC"  type = "PERI" base = "0x01A2000000" length = "0x0000001000" />
+
+            <proc index = "0" >
+                <irq type = "SOFT" icuid = "0" isr = "ISR_WAKUP" />
+                <irq type = "TIME" icuid = "1" isr = "ISR_SWITCH" />
+            </proc>
+
+            <periph type = "XCU"  psegname = "PSEG_XCU"  channels = "1" />
+            <periph type = "MMC"  psegname = "PSEG_MMC"  channels = "1" />
+        </cluster>
+
+        <cluster x = "1" y = "0" >
+            <pseg name = "PSEG_RAM"  type = "RAM"  base = "0x1000000000" length = "0x0001000000" />
+            <pseg name = "PSEG_XCU"  type = "PERI" base = "0x10B0000000" length = "0x0000002000" />
+            <pseg name = "PSEG_MMC"  type = "PERI" base = "0x10A2000000" length = "0x0000001000" />
+
+            <proc index = "0" >
+                <irq type = "SOFT" icuid = "0" isr = "ISR_WAKUP" />
+                <irq type = "TIME" icuid = "1" isr = "ISR_SWITCH" />
+            </proc>
+
+            <periph type = "XCU"  psegname = "PSEG_XCU"  channels = "1" />
+            <periph type = "MMC"  psegname = "PSEG_MMC"  channels = "1" />
+        </cluster>
+
+        <cluster x = "1" y = "1" >
+            <pseg name = "PSEG_RAM"  type = "RAM"  base = "0x1100000000" length = "0x0001000000" />
+            <pseg name = "PSEG_XCU"  type = "PERI" base = "0x11B0000000" length = "0x0000002000" />
+            <pseg name = "PSEG_MMC"  type = "PERI" base = "0x11A2000000" length = "0x0000001000" />
+
+            <proc index = "0" >
+                <irq type = "SOFT" icuid = "0" isr = "ISR_WAKUP" />
+                <irq type = "TIME" icuid = "1" isr = "ISR_SWITCH" />
+            </proc>
+
+            <periph type = "XCU"  psegname = "PSEG_XCU"  channels = "1" />
+            <periph type = "MMC"  psegname = "PSEG_MMC"  channels = "1" />
+        </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.
+
+        <vseg name = "seg_boot_mapping"   vbase = "0x00000000" mode = "C_W_" x = "0" y = "0" psegname = "PSEG_RAM" ident = "1" >
+            <vobj name = "boot_mapping"   type = "BLOB"   length = "0x00010000" binpath	= "map.bin" />
+        </vseg>
+        <vseg name = "seg_boot_code"      vbase = "0x00010000" mode = "CXW_" x = "0" y = "0" psegname = "PSEG_RAM" ident = "1" >
+            <vobj name = "boot_code"      type = "BUFFER" length = "0x00020000" />
+        </vseg>
+        <vseg name = "seg_boot_data"      vbase = "0x00030000" mode = "C_W_" x = "0" y = "0" psegname = "PSEG_RAM" ident = "1" >
+            <vobj name = "boot_data"      type = "BUFFER" length = "0x00010000" />
+        </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" />
+        </vseg>
+
+*** Segments used by the kernel / A[31:28] = 0x8 
+  
+        <vseg name = "seg_kernel_code"    vbase = "0x80000000" mode = "CXW_" x = "0" y = "0" psegname = "PSEG_RAM" > 
+            <vobj name = "kernel_code"    type = "ELF" length = "0x00020000" binpath = "build/kernel/kernel.elf" />
+        </vseg>
+        <vseg name = "seg_kernel_data"    vbase = "0x80020000" mode = "C_W_" x = "0" y = "0" psegname = "PSEG_RAM" > 
+            <vobj name = "kernel_data"    type = "ELF" length = "0x00060000" binpath = "build/kernel/kernel.elf" />
+		</vseg>
+        <vseg name = "seg_kernel_uncdata" vbase = "0x80080000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_RAM" > 
+            <vobj name = "kernel_uncdata" type = "ELF" length = "0x00040000" binpath = "build/kernel/kernel.elf" />
+        </vseg>
+        <vseg name = "seg_kernel_init"    vbase = "0x800C0000" mode = "CXW_" x = "0" y = "0" psegname = "PSEG_RAM" > 
+            <vobj name = "kernel_init"    type = "ELF" length = "0x00010000" binpath = "build/kernel/kernel.elf" />
+        </vseg>
+
+*** Segments for non replicated peripherals / A[31:28] = 0xB / Identity mapping
+
+        <vseg name = "seg_ioc"            vbase = "0xB3000000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_IOC" ident = "1" >
+            <vobj name = "ioc"            type = "PERI" length  = "0x00001000" /> 
+        </vseg>
+        <vseg name = "seg_tty"            vbase = "0xB4000000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_TTY" ident = "1" >
+   			<vobj name = "tty"            type = "PERI" length  = "0x00001000" />
+        </vseg>
+        <vseg name = "seg_rom"            vbase = "0xBFC00000" mode = "CXW_" x = "0" y = "0" psegname = "PSEG_ROM" ident = "1" >
+            <vobj name = "rom"            type = "PERI" length  = "0x00004000" /> 
+        </vseg>
+
+*** Segments for replicated ICUS / A[31:24] = 0xB0 / Increment = 0x10000 / Identity mapping in cluster 0            
+
+        <vseg name = "seg_icu_0"          vbase = "0xB0000000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_XCU" ident = "1" > 
+            <vobj name = "icu_0"          type = "PERI" length  = "0x00001000" /> 
+        </vseg>
+        <vseg name = "seg_icu_1"          vbase = "0xB0010000" mode = "__W_" x = "0" y = "1" psegname = "PSEG_XCU" > 
+            <vobj name = "icu_1"          type = "PERI" length  = "0x00001000" /> 
+        </vseg>
+        <vseg name = "seg_icu_2"          vbase = "0xB0100000" mode = "__W_" x = "1" y = "0" psegname = "PSEG_XCU" > 
+            <vobj name = "icu_2"          type = "PERI" length  = "0x00001000" /> 
+        </vseg>
+        <vseg name = "seg_icu_3"          vbase = "0xB0110000" mode = "__W_" x = "1" y = "1" psegname = "PSEG_XCU" > 
+            <vobj name = "icu_3"          type = "PERI" length  = "0x00001000" /> 
+        </vseg>
+
+*** segments for replicated MMC / A[31:24] = 0xB8 / 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)
+
+        <vseg name = "seg_memc_0"         vbase = "0xA2000000" mode = "__W_" x = "0" y = "0" psegname = "PSEG_MMC" ident = "1" >
+            <vobj name = "memc_0"         type = "PERI" length  = "0x00001000" />
+        </vseg>
+        <vseg name = "seg_memc_1"         vbase = "0xA2010000" mode = "__W_" x = "0" y = "1" psegname = "PSEG_MMC" >
+            <vobj name = "memc_1"         type = "PERI" length  = "0x00001000" />
+        </vseg>
+        <vseg name = "seg_memc_2"         vbase = "0xA2100000" mode = "__W_" x = "1" y = "0" psegname = "PSEG_MMC" >
+            <vobj name = "memc_2"         type = "PERI" length  = "0x00001000" />
+        </vseg>
+        <vseg name = "seg_memc_3"         vbase = "0xA2110000" mode = "__W_" x = "1" y = "1" psegname = "PSEG_MMC" >
+            <vobj name = "memc_3"         type = "PERI" length  = "0x00001000" />
+        </vseg>
+
+*** segments for replicated schedulers / A[31:28] = 0xF / 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)
+
+        <vseg name = "seg_sched_0"        vbase = "0xF0000000" mode = "C_W_" x = "0" y = "0" psegname = "PSEG_RAM" >
+            <vobj name = "sched_0"        type = "SCHED" length  = "0x00008000" />
+        </vseg>
+        <vseg name = "seg_sched_1"        vbase = "0xF0010000" mode = "C_W_" x = "0" y = "1" psegname = "PSEG_RAM" >
+            <vobj name = "sched_1"        type = "SCHED" length  = "0x00008000" />
+        </vseg>
+        <vseg name = "seg_sched_2"        vbase = "0xF0100000" mode = "C_W_" x = "1" y = "0" psegname = "PSEG_RAM" >
+            <vobj name = "sched_2"        type = "SCHED" length  = "0x00008000" />
+        </vseg>
+        <vseg name = "seg_sched_3"        vbase = "0xF0110000" mode = "C_W_" x = "1" y = "1" psegname = "PSEG_RAM" >
+            <vobj name = "sched_3"        type = "SCHED" length  = "0x00008000" />
+        </vseg>
+***
+    </globalset> 
+
+    <vspaceset>
+
+*** For each vspace, the startname field is the name of the vobj containing the start_vector (entry point array)
+*** For each task, the startid field define the task entry point as an index in the start_vector
+*** For each task, the clusterid and proclocid arguments define the task static placement
+*** For each task, the stackname field is the name of the vobj containing the task stack 
+*** For each task, the heapname field is the name of the vobj containing the task heap 
+
+        <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 = "__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_stack0" vbase = "0x00800000" mode = "C_WU" x = "0" y = "0" psegname = "PSEG_RAM" >
+                <vobj name = "sort_stack0" type	 = "BUFFER" length = "0x00010000" /> 
+                <vobj name = "sort_heap0"  type	 = "BUFFER" length = "0x00010000" /> 
+            </vseg>
+            <vseg name = "seg_sort_stack1" vbase = "0x00A00000" mode = "C_WU" x = "0" y = "1" psegname = "PSEG_RAM" >
+                <vobj name = "sort_stack1" type	 = "BUFFER" length = "0x00010000" /> 
+                <vobj name = "sort_heap1"  type	 = "BUFFER" length = "0x00010000" /> 
+            </vseg>
+            <vseg name = "seg_sort_stack2" vbase = "0x00C00000" mode = "C_WU" x = "1" y = "0" psegname = "PSEG_RAM" >
+                <vobj name = "sort_stack2" type	 = "BUFFER" length = "0x00010000" /> 
+                <vobj name = "sort_heap2"  type	 = "BUFFER" length = "0x00010000" /> 
+            </vseg>
+            <vseg name = "seg_sort_stack3" vbase = "0x00E00000" mode = "C_WU" x = "1" y = "1" psegname = "PSEG_RAM" >
+                <vobj name = "sort_stack3" type	 = "BUFFER" length = "0x00010000" /> 
+                <vobj name = "sort_heap3"  type	 = "BUFFER" length = "0x00010000" /> 
+            </vseg>
+
+            <task name = "sort_0" x = "0" y = "0" proclocid = "0" stackname = "sort_stack0" heapname = "sort_heap3" startid = "0" usetty = "1" />
+            <task name = "sort_1" x = "0" y = "1" proclocid = "0" stackname = "sort_stack1" heapname = "sort_heap3" startid = "0" usetty = "1" />
+            <task name = "sort_2" x = "1" y = "0" proclocid = "0" stackname = "sort_stack2" heapname = "sort_heap3" startid = "0" usetty = "1" />
+            <task name = "sort_3" x = "1" y = "1" proclocid = "0" stackname = "sort_stack3" heapname = "sort_heap3" startid = "0" usetty = "1" />
+        </vspace>
+    </vspaceset>
+</mapping_info>
