Index: trunk/platforms/tsar_generic_iob/arch.py
===================================================================
--- trunk/platforms/tsar_generic_iob/arch.py	(revision 912)
+++ trunk/platforms/tsar_generic_iob/arch.py	(revision 913)
@@ -53,5 +53,6 @@
     ### define architecture constants
 
-    nb_nics         = 2 
+    nb_nics         = 1 
+    nb_cmas         = 2
     x_io            = 0
     y_io            = 0
@@ -63,6 +64,4 @@
     use_ramdisk     = False
     peri_increment  = 0x10000    # distributed peripherals vbase address increment
-    sched_increment = 0x10000    # distributed schedulers vbase address increment 
-    ptab_increment  = 0x200000   # distributed page tables vbase address increment
 
     ### parameters checking
@@ -87,5 +86,5 @@
 
     ram_base = 0x0000000000
-    ram_size = 0x4000000                   # 64 Mbytes
+    ram_size = 0x1000000                   # 16 Mbytes
 
     xcu_base = 0x00B0000000
@@ -129,41 +128,45 @@
     ### define  bootloader vsegs base addresses and sizes
     ### We want to pack these 4 vsegs in the same big page
-    ### => boot cost is one BPP in cluster[0][0]
-
-    boot_mapping_vbase   = 0x00000000      # ident
-    boot_mapping_size    = 0x00080000      # 512 Kbytes
-
-    boot_code_vbase      = 0x00080000      # ident
-    boot_code_size       = 0x00040000      # 256 Kbytes
-
-    boot_data_vbase      = 0x000C0000      # ident
-    boot_data_size       = 0x00080000      # 512 Kbytes
-
-    boot_stack_vbase     = 0x00140000      # ident
-    boot_stack_size      = 0x00050000      # 320 Kbytes
+    ### => boot cost is one BIG page in cluster[0][0]
+
+    boot_mapping_vbase   = 0x00000000           # ident
+    boot_mapping_size    = 0x00080000           # 512 Kbytes
+
+    boot_code_vbase      = 0x00080000           # ident
+    boot_code_size       = 0x00040000           # 256 Kbytes
+
+    boot_data_vbase      = 0x000C0000           # ident
+    boot_data_size       = 0x000C0000           # 768 Kbytes
+
+    boot_stack_vbase     = 0x00180000           # ident
+    boot_stack_size      = 0x00080000           # 512 Kbytes
 
     ### define kernel vsegs base addresses and sizes
-    ### code, init, ptab & sched vsegs are replicated in all clusters.
+    ### code, init, ptab, heap & sched vsegs are replicated in all clusters.
     ### data & uncdata vsegs are only mapped in cluster[0][0].
-    ### - We pack code, init, data vsegs in the same BIG page.
-    ### - We use another BIG page for the ptab vseg.
-    ### - We use 2*nb_procs SMALL pages for the sched vseg.
-    ### - we use one SMALL page for uncdata
-    ### => kernel cost is 2 BPPs and (2*n + 1) SPPs per cluster.
+    ### - We use one BIG page for code vsegs in each cluster.
+    ### - We use one BIG page for ptab vsegs in each cluster.
+    ### - we use one BIG page for heap vsegs in each cluster.
+    ### - We use 2*procs SMALL pages for sched vsegs in each cluster.
+    ### - We use one BIG page for data vseg in cluster[0,0].
+    ### - we use one SMALL page for uncdata in cluster[0,0].
 
     kernel_code_vbase    = 0x80000000
-    kernel_code_size     = 0x00080000      # 512 Kbytes per cluster
-
-    kernel_init_vbase    = 0x80080000
-    kernel_init_size     = 0x00080000      # 512 Kbytes per cluster
-
-    kernel_data_vbase    = 0x80100000
-    kernel_data_size     = 0x00100000      # 1 Mbytes in cluster[0][0]
+    kernel_code_size     = 0x00100000           # 1 Mbytes per cluster
+
+    kernel_init_vbase    = 0x80100000
+    kernel_init_size     = 0x00100000           # 1 Mbytes per cluster
+
+    kernel_data_vbase    = 0x90000000
+    kernel_data_size     = 0x00200000           # 2 Mbytes in cluster[0,0]
+
+    kernel_uncdata_vbase = 0x90200000
+    kernel_uncdata_size  = 0x00001000           # 4 Kbytes in cluster[0,0]
 
     kernel_ptab_vbase    = 0xE0000000
-    kernel_ptab_size     = 0x00200000      # 2 Mbytes per cluster
-
-    kernel_uncdata_vbase = 0x90000000
-    kernel_uncdata_size  = 0x00001000      # 4 Kbytes
+    kernel_ptab_size     = 0x00200000           # 2 Mbytes per cluster
+
+    kernel_heap_vbase    = 0xD0000000
+    kernel_heap_size     = 0x00200000           # 2 Mbytes per cluster
 
     kernel_sched_vbase   = 0xA0000000   
@@ -199,5 +202,5 @@
     nic = mapping.addPeriph( 'NIC', base = nic_base, size = nic_size, ptype = 'NIC', channels = nb_nics )
 
-    cma = mapping.addPeriph( 'CMA', base = cma_base, size = cma_size, ptype = 'CMA', channels = 2*nb_nics )
+    cma = mapping.addPeriph( 'CMA', base = cma_base, size = cma_size, ptype = 'CMA', channels = nb_cmas )
 
     fbf = mapping.addPeriph( 'FBF', base = fbf_base, size = fbf_size, ptype = 'FBF', arg = fbf_width )
@@ -253,5 +256,5 @@
 
             xcu = mapping.addPeriph( 'XCU', base = xcu_base + offset, size = xcu_size,
-                                     ptype = 'XCU', channels = nb_procs * irq_per_proc, arg = 16 )
+                                     ptype = 'XCU', channels = nb_procs * irq_per_proc, arg = 32 )
 
             # MMC IRQ replicated in all clusters
@@ -287,10 +290,9 @@
                        identity = True , local = False, big = True )
 
-    ### Global vsegs kernel_ptab_x_y : big page
+    ### Global vsegs kernel_ptab_x_y : big / non local
     ### one vseg per cluster: name indexed by (x,y) 
-    ### vbase address incremented by (cluster_xy * vseg_increment)
-    for x in xrange( x_size ):
-        for y in xrange( y_size ):
-            offset = ((x << y_width) + y) * ptab_increment
+    for x in xrange( x_size ):
+        for y in xrange( y_size ):
+            offset = ((x << y_width) + y) * kernel_ptab_size
             base   = kernel_ptab_vbase + offset
             mapping.addGlobal( 'seg_kernel_ptab_%d_%d' %(x,y), base, kernel_ptab_size,
@@ -298,5 +300,5 @@
                                local = False , big = True )
 
-    ### global vsegs kernel_code, kernel_init : big page
+    ### global vsegs kernel_code, kernel_init : big / local
     ### replicated in all clusters with the same name & same vbase
     for x in xrange( x_size ):
@@ -312,5 +314,5 @@
                                local = True, big = True )
 
-    ### global vseg kernel_data : big page
+    ### global vseg kernel_data : big / non local
     ### Only mapped in cluster[0][0]
     mapping.addGlobal( 'seg_kernel_data', kernel_data_vbase, kernel_data_size, 
@@ -319,5 +321,5 @@
                        local = False, big = True )
 
-    ### global vseg kernel_uncdata : small page
+    ### global vseg kernel_uncdata : small / non local
     ### Only mapped in cluster[0][0]
     mapping.addGlobal( 'seg_kernel_uncdata', kernel_uncdata_vbase, kernel_uncdata_size,
@@ -326,13 +328,21 @@
                        local = False, big = False )
 
-    ### global vsegs kernel_sched_x_y : small pages 
+    ### global vsegs kernel_sched_x_y : small / non local
     ### one vseg per cluster with name indexed by (x,y) 
-    ### as vbase address is incremented by (cluster_xy * vseg_increment)
-    for x in xrange( x_size ):
-        for y in xrange( y_size ):
-            offset = ((x << y_width) + y) * sched_increment
+    for x in xrange( x_size ):
+        for y in xrange( y_size ):
+            offset = ((x << y_width) + y) * kernel_sched_size
             mapping.addGlobal( 'seg_kernel_sched_%d_%d' %(x,y), kernel_sched_vbase + offset , kernel_sched_size,
                                'C_W_', vtype = 'SCHED', x = x , y = y , pseg = 'RAM',
                                local = False, big = False )
+
+    ### global vsegs kernel_heap_x_y : big / non local 
+    ### one vseg per cluster with name indexed by (x,y) 
+    for x in xrange( x_size ):
+        for y in xrange( y_size ):
+            offset = ((x << y_width) + y) * kernel_heap_size
+            mapping.addGlobal( 'seg_kernel_heap_%d_%d' %(x,y), kernel_heap_vbase + offset , kernel_heap_size,
+                               'C_W_', vtype = 'HEAP', x = x , y = y , pseg = 'RAM',
+                               local = False, big = True )
 
     ### global vsegs for external peripherals : non local / big page
