Changeset 714 for trunk/platforms/tsar_generic_iob/arch.py
- Timestamp:
- Jun 20, 2014, 2:42:53 PM (10 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/platforms/tsar_generic_iob/arch.py
r710 r714 4 4 5 5 ####################################################################################### 6 # file : genmap.py6 # file : arch.py (for the tsar_generic_iob architecture) 7 7 # date : may 2014 8 8 # author : Alain Greiner … … 14 14 # components located in cluster [0,0] and cluster [x_size-1, y_size-1]. 15 15 # Available peripherals are: TTY, BDV, FBF, ROM, NIC, CMA. 16 # The parameters are: 17 # - x_size : number of clusters in a row 18 # - y_size : number of clusters in a column 19 # - procs_max : number of processors per cluster 20 # - nb_ttys : number of TTY channels 21 # - nb_nics : number of NIC channels 22 # - fbf_size : frame_buffer width = frame_buffer heigth 23 # - x_io : cluster_io x coordinate 24 # - y_io : cluster_io y coordinate 16 # 17 # The "constructor" parameters are: 18 # - x_size : number of clusters in a row 19 # - y_size : number of clusters in a column 20 # - nb_procs : number of processors per cluster 21 # 22 # The "hidden" platform parameters are: 23 # - nb_ttys : number of TTY channels 24 # - nb_nics : number of NIC channels 25 # - fbf_width : frame_buffer width = frame_buffer heigth 26 # - x_io : cluster_io x coordinate 27 # - y_io : cluster_io y coordinate 28 # - x_width : number of bits for x coordinate 29 # - y_width : number of bits for y coordinate 30 # - paddr_width : number of bits for physical address 31 # - irq_per_proc : number of input IRQs per processor 32 # - use_ramdisk : use a ramdisk when True 33 # - peri_increment : address increment for replicated peripherals 25 34 #################################################################################### 26 35 27 ########################## 28 def genmap( x_size = 2, 29 y_size = 2, 30 nb_procs = 2, 31 nb_ttys = 1, 32 nb_nics = 2, 33 fbf_width = 128, 34 x_io = 0, 35 y_io = 0 ): 36 36 ######################## 37 def arch( x_size = 2, 38 y_size = 2, 39 nb_procs = 2 ): 40 41 ### define architecture constants 42 43 nb_ttys = 1 44 nb_nics = 2 45 fbf_width = 1024 46 x_io = 0 47 y_io = 0 48 x_width = 4 49 y_width = 4 50 paddr_width = 40 51 irq_per_proc = 4 52 use_ramdisk = False 53 peri_increment = 0x10000 54 37 55 ### parameters checking 56 38 57 assert( nb_procs <= 4 ) 39 58 … … 44 63 or (y_size == 8) or (y_size == 16) ) 45 64 46 assert( nb_ttys <= 2)65 assert( nb_ttys == 1 ) 47 66 48 67 assert( ((x_io == 0) and (y_io == 0)) or 49 68 ((x_io == x_size-1) and (y_io == y_size-1)) ) 50 69 51 ### define architecture constants 52 53 platform_name = 'tsar_iob_%d_%d_%d' % ( x_size, y_size, nb_procs ) 54 x_width = 4 55 y_width = 4 56 paddr_width = 40 57 irq_per_proc = 4 58 use_ramdisk = False 59 70 platform_name = 'tsar_iob_%d_%d_%d' % ( x_size, y_size, nb_procs ) 71 60 72 ### define physical segments 61 73 62 74 ram_base = 0x0000000000 63 ram_size = 0x4000000 75 ram_size = 0x4000000 # 64 Mbytes 64 76 65 77 xcu_base = 0x00B0000000 66 xcu_size = 0x1000 78 xcu_size = 0x1000 # 4 Kbytes 67 79 68 80 dma_base = 0x00B1000000 69 dma_size = 0x1000 * nb_procs 81 dma_size = 0x1000 * nb_procs # 4 Kbytes * nb_procs 70 82 71 83 mmc_base = 0x00B2000000 72 mmc_size = 0x1000 84 mmc_size = 0x1000 # 4 Kbytes 73 85 74 86 offset_io = ((x_io << y_width) + y_io) << (paddr_width - x_width - y_width) 75 87 76 88 bdv_base = 0x00B3000000 + offset_io 77 bdv_size = 0x1000 89 bdv_size = 0x1000 # 4kbytes 78 90 79 91 tty_base = 0x00B4000000 + offset_io 80 tty_size = 0x4000 92 tty_size = 0x4000 # 16 Kbytes 81 93 82 94 nic_base = 0x00B5000000 + offset_io 83 nic_size = 0x80000 95 nic_size = 0x80000 # 512 kbytes 84 96 85 97 cma_base = 0x00B6000000 + offset_io 86 cma_size = 0x1000 * 2 * nb_nics 98 cma_size = 0x1000 * 2 * nb_nics # 4 kbytes * 2 * nb_nics 87 99 88 100 fbf_base = 0x00B7000000 + offset_io 89 fbf_size = fbf_width * fbf_width 101 fbf_size = fbf_width * fbf_width # fbf_width * fbf_width bytes 90 102 91 103 pic_base = 0x00B8000000 + offset_io 92 pic_size = 0x1000 104 pic_size = 0x1000 # 4 Kbytes 93 105 94 106 iob_base = 0x00BE000000 + offset_io 95 iob_size = 0x1000 107 iob_size = 0x1000 # 4kbytes 96 108 97 109 rom_base = 0x00BFC00000 + offset_io 98 rom_size = 0x4000 110 rom_size = 0x4000 # 16 Kbytes 99 111 100 112 ### define bootloader vsegs base addresses 101 113 102 boot_mapping_vbase = 0x00000000 103 boot_mapping_size = 0x00010000 104 105 boot_code_vbase = 0x00010000 106 boot_code_size = 0x00020000 114 boot_mapping_vbase = 0x00000000 # ident 115 boot_mapping_size = 0x00010000 # 64 Kbytes 116 117 boot_code_vbase = 0x00010000 # ident 118 boot_code_size = 0x00020000 # 128 Kbytes 107 119 108 boot_data_vbase = 0x00030000 109 boot_data_size = 0x00010000 110 111 boot_buffer_vbase = 0x00040000 112 boot_buffer_size = 0x00060000 113 114 boot_stack_vbase = 0x000A0000 115 boot_stack_size = 0x00050000 120 boot_data_vbase = 0x00030000 # ident 121 boot_data_size = 0x00010000 # 64 Kbytes 122 123 boot_buffer_vbase = 0x00040000 # ident 124 boot_buffer_size = 0x00060000 # 384 Kbytes 125 126 boot_stack_vbase = 0x000A0000 # ident 127 boot_stack_size = 0x00050000 # 320 Kbytes 116 128 117 129 ### define kernel vsegs base addresses 118 130 119 131 kernel_code_vbase = 0x80000000 120 kernel_code_size = 0x00020000 132 kernel_code_size = 0x00020000 # 128 Kbytes 121 133 122 134 kernel_data_vbase = 0x80020000 123 kernel_data_size = 0x00060000 135 kernel_data_size = 0x00060000 # 384 Kbytes 124 136 125 137 kernel_uncdata_vbase = 0x80080000 126 kernel_uncdata_size = 0x00040000 138 kernel_uncdata_size = 0x00040000 # 256 Kbytes 127 139 128 140 kernel_init_vbase = 0x800C0000 129 kernel_init_size = 0x00010000 141 kernel_init_size = 0x00010000 # 64 Kbytes 130 142 131 143 kernel_sched_vbase = 0xF0000000 # distributed in all clusters … … 134 146 ### create mapping 135 147 136 mapping = Mapping( name = platform_name, 137 x_size = x_size, 138 y_size = y_size, 139 procs_max = nb_procs, 140 x_width = x_width, 141 y_width = y_width, 142 paddr_width = paddr_width, 143 coherence = True, 144 irq_per_proc = irq_per_proc, 145 use_ramdisk = use_ramdisk, 146 x_io = x_io, 147 y_io = y_io ) 148 mapping = Mapping( name = platform_name, 149 x_size = x_size, 150 y_size = y_size, 151 procs_max = nb_procs, 152 x_width = x_width, 153 y_width = y_width, 154 paddr_width = paddr_width, 155 coherence = True, 156 irq_per_proc = irq_per_proc, 157 use_ramdisk = use_ramdisk, 158 x_io = x_io, 159 y_io = y_io, 160 peri_increment = peri_increment ) 148 161 149 162 ### external peripherals (accessible in cluster[0,0] only for this mapping) … … 159 172 cma = mapping.addPeriph( 'CMA', base = cma_base, size = cma_size, ptype = 'CMA', channels = 2*nb_nics ) 160 173 161 fbf = mapping.addPeriph( 'FBF', base = fbf_base, size = fbf_size, ptype = 'FBF', arg = 128)174 fbf = mapping.addPeriph( 'FBF', base = fbf_base, size = fbf_size, ptype = 'FBF', arg = fbf_width ) 162 175 163 176 rom = mapping.addPeriph( 'ROM', base = rom_base, size = rom_size, ptype = 'ROM' ) … … 198 211 ptype = 'XCU', channels = nb_procs * irq_per_proc, arg = 16 ) 199 212 200 # DMA IRQs replicated in all clusters201 for p in xrange( nb_procs ):202 mapping.addIrq( xcu, index = (p+1), isrtype = 'ISR_DMA', channel = p )203 204 213 # MMC IRQ replicated in all clusters 205 214 mapping.addIrq( xcu, index = 0, isrtype = 'ISR_MMC' ) … … 266 275 vtype = 'PERI', x = 0, y = 0, pseg = 'ROM', identity = True ) 267 276 268 ### Global vsegs for replicated peripherals, and for scheduler. 269 ### A replicated vseg is replicated in all clusters: vseg name is indexed by (x,y), 270 ### and vseg base address is incremented by (cluster_xy * 0x10000) 271 272 mapping.addGlobal( 'seg_xcu' , xcu_base , xcu_size , '__W_', 273 vtype = 'PERI' , x = 0, y = 0, pseg = 'XCU', replicated = True ) 274 275 mapping.addGlobal( 'seg_dma' , dma_base , dma_size , '__W_', 276 vtype = 'PERI' , x = 0, y = 0, pseg = 'DMA', replicated = True ) 277 278 mapping.addGlobal( 'seg_mmc' , mmc_base , mmc_size , '__W_', 279 vtype = 'PERI' , x = 0, y = 0, pseg = 'MMC', replicated = True ) 280 281 mapping.addGlobal( 'seg_sched', kernel_sched_vbase, kernel_sched_size, 'C_W_', 282 vtype = 'SCHED', x = 0, y = 0, pseg = 'RAM', replicated = True ) 277 ### Global vsegs for replicated peripherals, and for schedulers 278 ### name is indexed by (x,y), base address is incremented by (cluster_xy * peri_increment) 279 280 for x in xrange( x_size ): 281 for y in xrange( y_size ): 282 cluster_xy = (x << y_width) + y; 283 offset = cluster_xy * peri_increment 284 285 mapping.addGlobal( 'seg_xcu_%d_%d' %(x,y), xcu_base + offset, xcu_size, 286 '__W_', vtype = 'PERI' , x = x , y = y , pseg = 'XCU' ) 287 288 mapping.addGlobal( 'seg_dma_%d_%d' %(x,y), dma_base + offset, dma_size, 289 '__W_', vtype = 'PERI' , x = x , y = y , pseg = 'DMA' ) 290 291 mapping.addGlobal( 'seg_mmc_%d_%d' %(x,y), mmc_base + offset, mmc_size, 292 '__W_', vtype = 'PERI' , x = x , y = y , pseg = 'MMC' ) 293 294 mapping.addGlobal( 'seg_sched_%d_%d' %(x,y), kernel_sched_vbase + offset, kernel_sched_size, 295 'C_W_', vtype = 'SCHED', x = x , y = y , pseg = 'RAM' ) 283 296 284 297 ### return mapping ###
Note: See TracChangeset
for help on using the changeset viewer.