- Timestamp:
- Apr 15, 2015, 4:02:08 PM (10 years ago)
- Location:
- branches/reconfiguration/platforms/tsar_generic_iob/scripts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/reconfiguration/platforms/tsar_generic_iob/scripts/arch.py
r958 r974 53 53 IRQ_PER_PROC = 4 54 54 USE_RAMDISK = False 55 USE_NIC = False 55 56 56 57 # virtual address increment for distributed memory segments in the GietVM OS … … 69 70 nb_procs=4, 70 71 nb_ttys=1, 71 fbf_width=FBF_WIDTH): 72 fbf_width=FBF_WIDTH, 73 ioc_type='BDV'): 72 74 """This function describes the tsar_generic_iob platform and defines its 73 75 parameters""" … … 89 91 # define physical segments 90 92 ram_base = 0x0000000000 91 ram_size = 0x 10000000 / (x_size * y_size)93 ram_size = 0x4000000 / (x_size * y_size) 92 94 93 95 xcu_base = 0x00B0000000 … … 151 153 152 154 # external peripherals (accessible in cluster[0,0] only for this mapping) 155 pic = mapping.addPeriph('PIC', base=pic_base, size=pic_size, 156 ptype='PIC', channels=32) 157 153 158 mapping.addPeriph('IOB', base=iob_base, size=iob_size, 154 159 ptype='IOB') 155 160 156 mapping.addPeriph('BDV', base=bdv_base, size=bdv_size, 157 ptype='IOC', subtype='BDV') 158 159 mapping.addPeriph('TTY', base=tty_base, size=tty_size, 160 ptype='TTY', channels=nb_ttys) 161 162 mapping.addPeriph('NIC', base=nic_base, size=nic_size, 163 ptype='NIC', channels=NB_NICS) 164 165 mapping.addPeriph('CMA', base=cma_base, size=cma_size, 166 ptype='CMA', channels=2*NB_NICS) 161 bdv = mapping.addPeriph('BDV', base=bdv_base, size=bdv_size, 162 ptype='IOC', subtype='BDV') 163 164 mapping.addIrq(pic, index=8, src=bdv, isrtype='ISR_BDV', channel=0) 165 166 tty = mapping.addPeriph('TTY', base=tty_base, size=tty_size, 167 ptype='TTY', channels=nb_ttys) 168 169 for i in xrange(nb_ttys): 170 mapping.addIrq(pic, index=16+i, src=tty, isrtype='ISR_TTY_RX', channel=i) 171 172 if USE_NIC: 173 nic = mapping.addPeriph('NIC', base=nic_base, size=nic_size, 174 ptype='NIC', channels=NB_NICS) 175 176 mapping.addIrq(pic, index=0, src=nic, isrtype='ISR_NIC_RX', channel=0) 177 mapping.addIrq(pic, index=1, src=nic, isrtype='ISR_NIC_RX', channel=1) 178 mapping.addIrq(pic, index=2, src=nic, isrtype='ISR_NIC_TX', channel=0) 179 mapping.addIrq(pic, index=3, src=nic, isrtype='ISR_NIC_TX', channel=1) 180 181 cma = mapping.addPeriph('CMA', base=cma_base, size=cma_size, 182 ptype='CMA', channels=2*NB_NICS) 183 184 mapping.addIrq(pic, index=4, src=cma, isrtype='ISR_CMA', channel=0) 185 mapping.addIrq(pic, index=5, src=cma, isrtype='ISR_CMA', channel=1) 186 mapping.addIrq(pic, index=6, src=cma, isrtype='ISR_CMA', channel=2) 187 mapping.addIrq(pic, index=7, src=cma, isrtype='ISR_CMA', channel=3) 167 188 168 189 mapping.addPeriph('FBF', base=fbf_base, size=fbf_size, … … 174 195 mapping.addPeriph('ROM', base=rom_base, size=rom_size, 175 196 ptype='ROM') 176 177 pic = mapping.addPeriph('PIC', base=pic_base, size=pic_size,178 ptype='PIC', channels=32)179 180 mapping.addIrq(pic, index=0, isrtype='ISR_NIC_RX', channel=0)181 mapping.addIrq(pic, index=1, isrtype='ISR_NIC_RX', channel=1)182 mapping.addIrq(pic, index=2, isrtype='ISR_NIC_TX', channel=0)183 mapping.addIrq(pic, index=3, isrtype='ISR_NIC_TX', channel=1)184 mapping.addIrq(pic, index=4, isrtype='ISR_CMA', channel=0)185 mapping.addIrq(pic, index=5, isrtype='ISR_CMA', channel=1)186 mapping.addIrq(pic, index=6, isrtype='ISR_CMA', channel=2)187 mapping.addIrq(pic, index=7, isrtype='ISR_CMA', channel=3)188 mapping.addIrq(pic, index=8, isrtype='ISR_BDV', channel=0)189 190 for i in xrange(nb_ttys):191 mapping.addIrq(pic, index=16+i, isrtype='ISR_TTY_RX', channel=i)192 197 193 198 # hardware components replicated in all clusters … … 198 203 mapping.addRam('RAM', base=ram_base + offset, size=ram_size) 199 204 200 mapping.addPeriph('MMC', base=mmc_base + offset, size=mmc_size,201 ptype='MMC')202 203 205 mapping.addPeriph('DROM', base=drom_base + offset, size=drom_size, 204 206 ptype='DROM') 207 208 mmc = mapping.addPeriph('MMC', base=mmc_base + offset, size=mmc_size, 209 ptype='MMC') 205 210 206 211 dma = mapping.addPeriph('DMA', base=dma_base + offset, … … 214 219 215 220 # MMC IRQ replicated in all clusters 216 mapping.addIrq(xcu, index=0, isrtype='ISR_MMC')221 mapping.addIrq(xcu, index=0, src=mmc, isrtype='ISR_MMC') 217 222 218 223 # DMA IRQ replicated in all clusters 219 224 for i in xrange(dma.channels): 220 mapping.addIrq(xcu, index=1+i, isrtype='ISR_DMA', 221 channel=i) 225 mapping.addIrq(xcu, index=1+i, src=dma, isrtype='ISR_DMA', channel=i) 222 226 223 227 # processors … … 374 378 with open(hard_path, "w") as hard_config: 375 379 hard_config.write(mapping.hard_config()) 376 with open(dts_path, "w") as linux_dts: 377 linux_dts.write(mapping.linux_dts()) 380 381 if dts_path != None: 382 with open(dts_path, "w") as linux_dts: 383 linux_dts.write(mapping.linux_dts()) 378 384 379 385 ################################# platform test ################################ -
branches/reconfiguration/platforms/tsar_generic_iob/scripts/onerun.py
r969 r974 30 30 firmdebug -- activate the DEBUG compilation mode on software 31 31 diskimage -- relative or absolute path to the disk image 32 force -- create configuration files (or overwrite them) 32 33 """ 33 34 … … 48 49 hardpath = os.path.join(outdir, "config/hard_config.h") 49 50 xmlpath = os.path.join(outdir, "config/giet.map.xml") 50 dtspath = os.path.join(outdir, "config/linux.dts") 51 arch.main(args.x, args.y, args.nprocs, hardpath, xmlpath, dtspath) 52 faultyprocs.generate(args.faultycore, faultpath) 51 if args.linux: 52 dtspath = os.path.join(outdir, "config/platform.dts") 53 else: 54 dtspath = None 55 56 exist = True 57 exist = exist and os.path.exists(faultpath) 58 exist = exist and os.path.exists(hardpath) 59 exist = exist and os.path.exists(xmlpath) 60 if args.linux: exist = exist and os.path.exists(dtspath) 61 62 if not args.force and exist: 63 print "[ run.py ] Warning: Reusing existing configuration files. " 64 print "[ run.py ] Script arguments will be ignored (no --force option)" 65 cmd = raw_input('[ run.py ] Would you like to continue (y/n): ') 66 if cmd == 'n': exit(0) 67 if cmd == 'y': pass 68 else: exit(1) 69 else: 70 arch.main(args.x, args.y, args.nprocs, hardpath, xmlpath, dtspath) 71 faultyprocs.generate(args.faultycore, faultpath) 53 72 54 73 # create a log file … … 66 85 command.extend(['make']) 67 86 command.extend(['-C', basedir]) 68 subprocess.c all(command, stdout=logfile, stderr=logfile)87 subprocess.check_call(command, stdout=logfile, stderr=logfile) 69 88 70 89 # 4. compile distributed boot executable … … 81 100 command.extend(["CONFIG=" + outdir]) 82 101 command.extend(["DEBUG=" + str(args.firmdebug)]) 83 subprocess.call(command, stdout=logfile, stderr=logfile) 102 if args.linux: 103 command.extend(["PATCHER_OS=1"]) 104 else: 105 command.extend(["PATCHER_OS=0"]) 106 107 subprocess.check_call(command, stdout=logfile, stderr=logfile) 84 108 85 109 # stop after compiling when the compile-only option is activated 86 if args.compileonly == True: 87 exit(0) 110 if args.compileonly == True: exit(0) 88 111 89 112 # 5. execute simulator … … 107 130 if args.debug != None: 108 131 command.extend(["-DEBUG", str(args.debug[0])]); 109 command.extend(["-NCYCLES", str(args.debug[1])]); 110 command.extend(["-PROCID", str(args.debug[2])]); 111 command.extend(["-MEMCID", str(args.debug[3])]); 132 command.extend(["-PROCID", str(args.debug[1])]); 133 command.extend(["-MEMCID", str(args.debug[2])]); 134 135 if args.ncycles > 0: 136 command.extend(["-NCYCLES", str(args.ncycles)]) 112 137 113 138 elif os.environ.get('SOCLIB_GDB') == None: 114 139 # the procedure grows linearly with the diameter of the mesh. 115 maxcycles = 1500000 + (args.x + args.y) * 20000 116 command.extend(["-NCYCLES", str(maxcycles)]) 140 # maxcycles = 1500000 + (args.x + args.y) * 20000 141 # command.extend(["-NCYCLES", str(maxcycles)]) 142 command.extend(["-NCYCLES", str(200000000)]) 117 143 118 144 # OpenMP number of threads definition … … 131 157 logfile.flush() 132 158 133 subprocess.c all(command, stdout=logfile, stderr=logfile)159 subprocess.check_call(command, stdout=logfile, stderr=logfile) 134 160 135 161 logfile.close() … … 198 224 help='relative or absolute path to the external firmware') 199 225 226 parser.add_argument( 227 '--force', '-f', dest='force', action='store_true', 228 help='create configuration files (or overwrite them)') 229 230 parser.add_argument( 231 '--linux', dest='linux', action='store_true', 232 help='generate linux device tree and compile bootloader ' + 233 'with linux specifics') 234 235 parser.add_argument( 236 '--ncycles', type=int, dest='ncycles', default=-1, 237 help='max simulation cycles') 238 200 239 run(parser.parse_args()) 201 240
Note: See TracChangeset
for help on using the changeset viewer.