Ignore:
Timestamp:
Apr 15, 2015, 4:02:08 PM (9 years ago)
Author:
cfuguet
Message:

reconf: improve reconf:tsar_generic_iob simulation scripts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/reconfiguration/platforms/tsar_generic_iob/scripts/arch.py

    r958 r974  
    5353IRQ_PER_PROC = 4
    5454USE_RAMDISK = False
     55USE_NIC = False
    5556
    5657# virtual address increment for distributed memory segments in the GietVM OS
     
    6970         nb_procs=4,
    7071         nb_ttys=1,
    71          fbf_width=FBF_WIDTH):
     72         fbf_width=FBF_WIDTH,
     73         ioc_type='BDV'):
    7274    """This function describes the tsar_generic_iob platform and defines its
    7375    parameters"""
     
    8991    # define physical segments
    9092    ram_base = 0x0000000000
    91     ram_size = 0x10000000 / (x_size * y_size)
     93    ram_size = 0x4000000 / (x_size * y_size)
    9294
    9395    xcu_base = 0x00B0000000
     
    151153
    152154    # 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
    153158    mapping.addPeriph('IOB', base=iob_base, size=iob_size,
    154159                      ptype='IOB')
    155160
    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)
    167188
    168189    mapping.addPeriph('FBF', base=fbf_base, size=fbf_size,
     
    174195    mapping.addPeriph('ROM', base=rom_base, size=rom_size,
    175196                      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)
    192197
    193198    # hardware components replicated in all clusters
     
    198203            mapping.addRam('RAM', base=ram_base + offset, size=ram_size)
    199204
    200             mapping.addPeriph('MMC', base=mmc_base + offset, size=mmc_size,
    201                               ptype='MMC')
    202 
    203205            mapping.addPeriph('DROM', base=drom_base + offset, size=drom_size,
    204206                              ptype='DROM')
     207
     208            mmc = mapping.addPeriph('MMC', base=mmc_base + offset, size=mmc_size,
     209                                    ptype='MMC')
    205210
    206211            dma = mapping.addPeriph('DMA', base=dma_base + offset,
     
    214219
    215220            # 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')
    217222
    218223            # DMA IRQ replicated in all clusters
    219224            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)
    222226
    223227            # processors
     
    374378    with open(hard_path, "w") as hard_config:
    375379        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())
    378384
    379385################################# platform test ################################
Note: See TracChangeset for help on using the changeset viewer.