Changeset 802 for trunk/platforms/tsar_generic_iob/arch.py
- Timestamp:
- Sep 12, 2014, 3:10:04 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/platforms/tsar_generic_iob/arch.py
r770 r802 1 1 #!/usr/bin/env python 2 2 3 from math import log, ceil 3 4 from mapping import * 4 5 … … 8 9 # author : Alain Greiner 9 10 ####################################################################################### 10 # This file contains a mapping generator for the "tsar_generic_iob" platform. 11 # This file contains a mapping generator for the "tsar_generic_iob" platform. 11 12 # This includes both the hardware architecture (clusters, processors, peripherals, 12 13 # physical space segmentation) and the mapping of all kernel objects (global vsegs). … … 42 43 43 44 nb_ttys = 1 44 nb_nics = 2 45 nb_nics = 2 45 46 fbf_width = 128 46 47 x_io = 0 … … 48 49 x_width = 4 49 50 y_width = 4 51 p_width = int(ceil(log(nb_procs, 2))) 50 52 paddr_width = 40 51 53 irq_per_proc = 4 … … 53 55 peri_increment = 0x10000 54 56 distributed_ptabs = True 55 57 56 58 ### parameters checking 57 59 58 assert( nb_procs <= 4)59 60 assert( (x_size == 1) or (x_size == 2) or (x_size == 4) 60 assert( nb_procs <= (1 << p_width) ) 61 62 assert( (x_size == 1) or (x_size == 2) or (x_size == 4) 61 63 or (x_size == 8) or (x_size == 16) ) 62 64 63 assert( (y_size == 1) or (y_size == 2) or (y_size == 4) 65 assert( (y_size == 1) or (y_size == 2) or (y_size == 4) 64 66 or (y_size == 8) or (y_size == 16) ) 65 67 … … 70 72 71 73 platform_name = 'tsar_iob_%d_%d_%d' % ( x_size, y_size, nb_procs ) 72 74 73 75 ### define physical segments 74 76 … … 76 78 ram_size = 0x4000000 # 64 Mbytes 77 79 78 xcu_base = 0x00B0000000 79 xcu_size = 0x1000 # 4 Kbytes 80 xcu_base = 0x00B0000000 81 xcu_size = 0x1000 # 4 Kbytes 80 82 81 83 dma_base = 0x00B1000000 82 84 dma_size = 0x1000 * nb_procs # 4 Kbytes * nb_procs 83 85 84 mmc_base = 0x00B2000000 86 mmc_base = 0x00B2000000 85 87 mmc_size = 0x1000 # 4 Kbytes 86 88 … … 117 119 118 120 boot_code_vbase = 0x00080000 # ident 119 boot_code_size = 0x00040000 # 256 Kbytes 120 121 boot_code_size = 0x00040000 # 256 Kbytes 122 121 123 boot_data_vbase = 0x000C0000 # ident 122 124 boot_data_size = 0x00080000 # 512 Kbytes … … 127 129 ### define kernel vsegs base addresses and sizes 128 130 129 kernel_code_vbase = 0x80000000 131 kernel_code_vbase = 0x80000000 130 132 kernel_code_size = 0x00020000 # 128 Kbytes 131 133 … … 144 146 ### create mapping 145 147 146 mapping = Mapping( name = platform_name, 147 x_size = x_size, 148 y_size = y_size, 149 procs_max = nb_procs, 150 x_width = x_width, 151 y_width = y_width, 152 paddr_width = paddr_width, 153 coherence = True, 154 irq_per_proc = irq_per_proc, 155 use_ramdisk = use_ramdisk, 156 x_io = x_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 p_width = p_width, 155 paddr_width = paddr_width, 156 coherence = True, 157 irq_per_proc = irq_per_proc, 158 use_ramdisk = use_ramdisk, 159 x_io = x_io, 157 160 y_io = y_io, 158 peri_increment = peri_increment, 159 ram_base = ram_base, 160 ram_size = ram_size ) 161 peri_increment = peri_increment, 162 ram_base = ram_base, 163 ram_size = ram_size ) 161 164 162 165 ### external peripherals (accessible in cluster[0,0] only for this mapping) … … 168 171 tty = mapping.addPeriph( 'TTY', base = tty_base, size = tty_size, ptype = 'TTY', channels = nb_ttys ) 169 172 170 nic = mapping.addPeriph( 'NIC', base = nic_base, size = nic_size, ptype = 'NIC', channels = nb_nics ) 173 nic = mapping.addPeriph( 'NIC', base = nic_base, size = nic_size, ptype = 'NIC', channels = nb_nics ) 171 174 172 175 cma = mapping.addPeriph( 'CMA', base = cma_base, size = cma_size, ptype = 'CMA', channels = 2*nb_nics ) … … 193 196 mapping.addIrq( pic, index = 9, isrtype = 'ISR_TTY_RX', channel = 0 ) 194 197 195 ### hardware components replicated in all clusters 198 ### hardware components replicated in all clusters 196 199 197 200 for x in xrange( x_size ): … … 202 205 ram = mapping.addRam( 'RAM', base = ram_base + offset, size = ram_size ) 203 206 204 mmc = mapping.addPeriph( 'MMC', base = mmc_base + offset, size = mmc_size, 207 mmc = mapping.addPeriph( 'MMC', base = mmc_base + offset, size = mmc_size, 205 208 ptype = 'MMC' ) 206 209 207 dma = mapping.addPeriph( 'DMA', base = dma_base + offset, size = dma_size, 208 ptype = 'DMA', channels = nb_procs ) 209 210 xcu = mapping.addPeriph( 'XCU', base = xcu_base + offset, size = xcu_size, 210 dma = mapping.addPeriph( 'DMA', base = dma_base + offset, size = dma_size, 211 ptype = 'DMA', channels = nb_procs ) 212 213 xcu = mapping.addPeriph( 'XCU', base = xcu_base + offset, size = xcu_size, 211 214 ptype = 'XCU', channels = nb_procs * irq_per_proc, arg = 16 ) 212 215 … … 223 226 mapping.addProc( x, y, p ) 224 227 225 ### global vsegs for boot_loader / identity mapping 228 ### global vsegs for boot_loader / identity mapping 226 229 227 230 mapping.addGlobal( 'seg_boot_mapping', boot_mapping_vbase, boot_mapping_size, … … 241 244 identity = True ) 242 245 243 ### the code global vsegs for kernel can be replicated in all clusters 246 ### the code global vsegs for kernel can be replicated in all clusters 244 247 ### if the page tables are distributed in all clusters. 245 248 … … 267 270 ### shared global vsegs for kernel 268 271 269 mapping.addGlobal( 'seg_kernel_data', kernel_data_vbase, kernel_data_size, 270 'C_W_', vtype = 'ELF', x = 0, y = 0, pseg = 'RAM', 272 mapping.addGlobal( 'seg_kernel_data', kernel_data_vbase, kernel_data_size, 273 'C_W_', vtype = 'ELF', x = 0, y = 0, pseg = 'RAM', 271 274 binpath = 'build/kernel/kernel.elf', local = False ) 272 275 273 276 mapping.addGlobal( 'seg_kernel_uncdata', kernel_uncdata_vbase, kernel_uncdata_size, 274 '__W_', vtype = 'ELF', x = 0, y = 0, pseg = 'RAM', 277 '__W_', vtype = 'ELF', x = 0, y = 0, pseg = 'RAM', 275 278 binpath = 'build/kernel/kernel.elf', local = False ) 276 279 277 280 ### global vsegs for external peripherals / identity mapping 278 281 279 mapping.addGlobal( 'seg_iob', iob_base, iob_size, '__W_', 280 vtype = 'PERI', x = 0, y = 0, pseg = 'IOB', 281 identity = True ) 282 283 mapping.addGlobal( 'seg_bdv', bdv_base, bdv_size, '__W_', 282 mapping.addGlobal( 'seg_iob', iob_base, iob_size, '__W_', 283 vtype = 'PERI', x = 0, y = 0, pseg = 'IOB', 284 identity = True ) 285 286 mapping.addGlobal( 'seg_bdv', bdv_base, bdv_size, '__W_', 284 287 vtype = 'PERI', x = 0, y = 0, pseg = 'BDV', 285 288 identity = True ) 286 289 287 mapping.addGlobal( 'seg_tty', tty_base, tty_size, '__W_', 290 mapping.addGlobal( 'seg_tty', tty_base, tty_size, '__W_', 288 291 vtype = 'PERI', x = 0, y = 0, pseg = 'TTY', 289 292 identity = True ) 290 293 291 mapping.addGlobal( 'seg_nic', nic_base, nic_size, '__W_', 294 mapping.addGlobal( 'seg_nic', nic_base, nic_size, '__W_', 292 295 vtype = 'PERI', x = 0, y = 0, pseg = 'NIC', 293 296 identity = True ) 294 297 295 mapping.addGlobal( 'seg_cma', cma_base, cma_size, '__W_', 298 mapping.addGlobal( 'seg_cma', cma_base, cma_size, '__W_', 296 299 vtype = 'PERI', x = 0, y = 0, pseg = 'CMA', 297 300 identity = True ) 298 301 299 mapping.addGlobal( 'seg_fbf', fbf_base, fbf_size, '__W_', 302 mapping.addGlobal( 'seg_fbf', fbf_base, fbf_size, '__W_', 300 303 vtype = 'PERI', x = 0, y = 0, pseg = 'FBF', 301 304 identity = True ) 302 305 303 mapping.addGlobal( 'seg_pic', pic_base, pic_size, '__W_', 306 mapping.addGlobal( 'seg_pic', pic_base, pic_size, '__W_', 304 307 vtype = 'PERI', x = 0, y = 0, pseg = 'PIC', 305 308 identity = True ) 306 309 307 mapping.addGlobal( 'seg_rom', rom_base, rom_size, 'CXW_', 310 mapping.addGlobal( 'seg_rom', rom_base, rom_size, 'CXW_', 308 311 vtype = 'PERI', x = 0, y = 0, pseg = 'ROM', 309 312 identity = True ) 310 313 311 ### global vsegs for internal peripherals, and for schedulers 314 ### global vsegs for internal peripherals, and for schedulers 312 315 ### name is indexed by (x,y) / vbase address is incremented by (cluster_xy * peri_increment) 313 316 … … 346 349 347 350 # print mapping.giet_vsegs() 348 351 349 352 350 353 # Local Variables:
Note: See TracChangeset
for help on using the changeset viewer.