Changeset 974


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

reconf: improve reconf:tsar_generic_iob simulation scripts

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/reconfiguration/platforms/tsar_generic_iob/Makefile

    r906 r974  
    11TAGS := cscope.out
    22SOCLIB_CC_ARGS :=
     3SOCLIB_CC_ARGS += -bcaba:reconf:vci_xicu
     4SOCLIB_CC_ARGS += -bcaba:vci_iopic
     5SOCLIB_CC_ARGS += -bcaba:vci_block_device_tsar
     6SOCLIB_CC_ARGS += -v
    37
    48all: simul.x
  • 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 ################################
  • branches/reconfiguration/platforms/tsar_generic_iob/scripts/onerun.py

    r969 r974  
    3030    firmdebug    -- activate the DEBUG compilation mode on software
    3131    diskimage    -- relative or absolute path to the disk image
     32    force        -- create configuration files (or overwrite them)
    3233    """
    3334
     
    4849    hardpath = os.path.join(outdir, "config/hard_config.h")
    4950    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)
    5372
    5473    # create a log file
     
    6685    command.extend(['make'])
    6786    command.extend(['-C', basedir])
    68     subprocess.call(command, stdout=logfile, stderr=logfile)
     87    subprocess.check_call(command, stdout=logfile, stderr=logfile)
    6988
    7089    # 4. compile distributed boot executable
     
    81100    command.extend(["CONFIG=" + outdir])
    82101    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)
    84108
    85109    # 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)
    88111
    89112    # 5. execute simulator
     
    107130    if args.debug != None:
    108131        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)])
    112137
    113138    elif os.environ.get('SOCLIB_GDB') == None:
    114139        # 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)])
    117143
    118144    # OpenMP number of threads definition
     
    131157    logfile.flush()
    132158
    133     subprocess.call(command, stdout=logfile, stderr=logfile)
     159    subprocess.check_call(command, stdout=logfile, stderr=logfile)
    134160
    135161    logfile.close()
     
    198224        help='relative or absolute path to the external firmware')
    199225
     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
    200239    run(parser.parse_args())
    201240
  • branches/reconfiguration/platforms/tsar_generic_iob/top.cpp

    r969 r974  
    193193#include "hard_config.h"
    194194
    195 #define USE_NIC               0
    196 
    197195////////////////////////////////////////////////////////////
    198196//    Secondary Hardware Parameters values
     
    491489           "The NB_TTY_CHANNELS parameter cannot be larger than 16" );
    492490
     491#if USE_NIC
    493492   assert( (NB_NIC_CHANNELS == 2) and
    494493           "The NB_NIC_CHANNELS parameter must be 2" );
     494#endif
    495495
    496496   std::cout << std::endl << std::dec
     
    15771577
    15781578   // cycles between stats
    1579    const size_t stats_period = 150000;
     1579   const size_t stats_period = 300000;
    15801580   const size_t simul_period = debug_ok ? debug_period : stats_period;
    15811581
  • trunk/platforms/tsar_generic_iob/Makefile

    r618 r974  
    11simul.x: top.cpp top.desc
    2         soclib-cc -P -p top.desc -I. -o simul.x
     2        soclib-cc -v -P -p top.desc -I. -o simul.x
    33
    44clean:
Note: See TracChangeset for help on using the changeset viewer.