Changeset 926


Ignore:
Timestamp:
Jan 20, 2015, 4:06:49 PM (9 years ago)
Author:
cfuguet
Message:

reconf: add external ROM in platform

  • The external ROM, which can be accessed through both IO Bridges, contains the bootloader program and some other utility functions which are used once the reconfiguration is performed.
Location:
branches/reconfiguration/platforms/tsar_generic_iob
Files:
6 edited

Legend:

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

    r907 r926  
    101101    mmc_size = 0x1000                     # 4 Kbytes
    102102
    103     rom_base = 0x00BFC00000
    104     rom_size = 0x8000                     # 32 Kbytes
     103    drom_base = 0x00BFC00000
     104    drom_size = 0x8000                    # 32 Kbytes
    105105
    106106    offset_io = pmsb(X_IO, Y_IO) << (PADDR_WIDTH - X_WIDTH - Y_WIDTH)
     
    129129    iob_base = 0x00BE000000 + offset_io
    130130    iob_size = 0x1000                     # 4 kbytes
     131
     132    rom_base = 0x00BA000000
     133    rom_size = 0x8000                     # 32 Kbytes
    131134
    132135    # create mapping
     
    170173                      ptype='SIM')
    171174
     175    mapping.addPeriph('ROM', base=rom_base, size=rom_size,
     176                      ptype='ROM')
     177
    172178    pic = mapping.addPeriph('PIC', base=pic_base, size=pic_size,
    173179                            ptype='PIC', channels=32)
     
    196202                              ptype='MMC')
    197203
    198             mapping.addPeriph('ROM', base=rom_base + offset, size=rom_size,
    199                               ptype='ROM')
     204            mapping.addPeriph('DROM', base=drom_base + offset, size=drom_size,
     205                              ptype='DROM')
    200206
    201207            dma = mapping.addPeriph('DMA', base=dma_base + offset,
     
    336342
    337343    # for the Giet-VM is not necessary to map the replicated ROMs
    338     mapping.addGlobal('seg_rom', rom_base, rom_size, 'CX__', vtype='PERI',
     344    mapping.addGlobal('seg_rom', drom_base, drom_size, 'CX__', vtype='PERI',
    339345                      x=X_IO, y=Y_IO, pseg='ROM', local=False, big=True)
    340346
  • branches/reconfiguration/platforms/tsar_generic_iob/scripts/onerun.py

    r919 r926  
    6969        os.unlink(dst)
    7070
    71     os.symlink(os.path.join(basedir, "soft/config/boot_config.h"), dst)
    72 
    73     # stop after compiling the platform when the compile-only option is activated
    74     if args.compileonly == True:
    75         exit(0)
     71    os.symlink(os.path.join(basedir, "soft/test/config/boot_config.h"), dst)
    7672
    7773    print "[ run.py ] compiling distributed boot procedure"
     
    8278    subprocess.call(command, stdout=logfile, stderr=logfile)
    8379
     80    # stop after compiling when the compile-only option is activated
     81    if args.compileonly == True:
     82        exit(0)
     83
    8484    # 5. execute simulator
    8585    os.environ["DISTRIBUTED_BOOT"] = "1"
     
    8888        os.environ["SOCLIB_TTY"] = "FILES"
    8989
    90     ompthreads = (args.x * args.y) / 4
    91     cpucount = multiprocessing.cpu_count()
    92     if ompthreads > cpucount: ompthreads = cpucount
    93 
    9490    print "[ run.py ] starting simulation"
    9591    command = []
    9692    command.extend([os.path.join(basedir, "simul.x")])
    97     command.extend(["-SOFT", os.path.join(basedir, "soft/build/soft.elf")])
    98     command.extend(["-DISK", "/dev/null"])
    99     command.extend(["-THREADS", str(ompthreads)])
     93    command.extend(["-DSOFT", os.path.join(basedir, "soft/build/soft.elf")])
     94    command.extend(["-SOFT", os.path.join(basedir,
     95                   "soft/loader/build/loader.elf")])
     96    command.extend(["-DISK", "file.dmg"])
    10097
    10198    if args.faultyrouter != None:
     
    104101            command.extend(["-FAULTY_ROUTER", str(f[0]), str(f[1]), str(f[2])])
    105102
     103    ompthreads = 1
    106104    if args.debug != None:
    107105        command.extend(["-DEBUG", str(args.debug[0])]);
     
    109107        command.extend(["-PROCID", str(args.debug[2])]);
    110108        command.extend(["-MEMCID", str(args.debug[3])]);
     109
    111110    elif os.environ.get('SOCLIB_GDB') == None:
     111        ompthreads = (args.x * args.y) / 4
     112        cpucount = multiprocessing.cpu_count()
     113        if ompthreads > cpucount:
     114            ompthreads = cpucount
     115
    112116        # the procedure grows linearly with the diameter of the mesh.
    113         maxcycles = 400000 + (args.x + args.y) * 20000;
     117        maxcycles = 1500000 + (args.x + args.y) * 20000
    114118        command.extend(["-NCYCLES", str(maxcycles)])
     119
     120    command.extend(["-THREADS", str(ompthreads)])
    115121
    116122    logfile.write("Execute: {0}\n".format(" ".join(command)))
  • branches/reconfiguration/platforms/tsar_generic_iob/top.cpp

    r916 r926  
    133133#include "vci_framebuffer.h"
    134134#include "vci_iox_network.h"
    135 #include "vci_iox_network.h"
    136135#include "vci_iopic.h"
    137136#include "vci_simhelper.h"
     
    213212
    214213#define cluster(x, y)   ((y) + ((x) << Y_WIDTH))
    215 
    216 ////////////////////////////////////////////////////////////
    217 //    Software to be loaded in ROM & RAM
    218 //////////////////////i/////////////////////////////////////
    219 
    220 #define BOOT_SOFT_NAME        "../../softs/tsar_boot/preloader.elf"
    221214
    222215////////////////////////////////////////////////////////////
     
    272265#define INT_XICU_TGT_ID              1
    273266#define INT_MDMA_TGT_ID              2
    274 #define INT_BROM_TGT_ID              3
     267#define INT_DROM_TGT_ID              3
    275268#define INT_IOBX_TGT_ID              4
    276269
     
    299292#define IOX_IOPI_TGT_ID              5
    300293#define IOX_SIMH_TGT_ID              6
    301 #define IOX_IOB0_TGT_ID              7
    302 #define IOX_IOB1_TGT_ID              8
     294#define IOX_ROM_TGT_ID               7
     295#define IOX_IOB0_TGT_ID              8
     296#define IOX_IOB1_TGT_ID              9
    303297
    304298#define IOX_BDEV_INI_ID              0
     
    317311
    318312
    319    char     soft_name[256]   = BOOT_SOFT_NAME;    // pathname: binary code
     313   char     dsoft_name[256]  = "";                // pathname: binary code
     314   char     soft_name[256]   = "";                // pathname: binary code
    320315   size_t   ncycles          = UINT_MAX;          // simulated cycles
    321316   char     disk_name[256]   = BDEV_IMAGE_NAME;   // pathname: disk image
     
    348343         {
    349344            strcpy(soft_name, argv[n+1]);
     345         }
     346         else if ((strcmp(argv[n], "-DSOFT") == 0) && (n+1<argc) )
     347         {
     348            strcpy(dsoft_name, argv[n+1]);
    350349         }
    351350         else if ((strcmp(argv[n], "-DEBUG") == 0) && (n+1<argc) )
     
    444443            std::cout << "   Accepted arguments are :" << std::endl << std::endl;
    445444            std::cout << "     -SOFT pathname_for_embedded_soft" << std::endl;
     445            std::cout << "     -DSOFT pathname_for_distributed_embedded_soft" << std::endl;
    446446            std::cout << "     -DISK pathname_for_disk_image" << std::endl;
    447447            std::cout << "     -NCYCLES number_of_simulated_cycles" << std::endl;
     
    580580                     IntTab(cluster(x, y), INT_MDMA_TGT_ID), not cacheable));
    581581
    582          std::ostringstream    sbrom;
    583          sbrom << "int_seg_brom_" << x << "_" << y;
    584          maptab_int.add(Segment(sbrom.str(), SEG_ROM_BASE+offset, SEG_ROM_SIZE,
    585                      IntTab(cluster(x, y), INT_BROM_TGT_ID), cacheable));
     582         std::ostringstream    sdrom;
     583         sdrom << "int_seg_drom_" << x << "_" << y;
     584         maptab_int.add(Segment(sdrom.str(), SEG_DROM_BASE+offset, SEG_DROM_SIZE,
     585                     IntTab(cluster(x, y), INT_DROM_TGT_ID), cacheable));
    586586
    587587         // the following segments are only defined in cluster_iob0 or in cluster_iob1
     
    628628            maptab_int.add(Segment(ssim.str(), SEG_SIM_BASE+offset, SEG_SIM_SIZE,
    629629                        IntTab(cluster(x, y), INT_IOBX_TGT_ID), not cacheable));
     630
     631            std::ostringstream    srom;
     632            srom << "int_seg_rom_" << x << "_" << y;
     633            maptab_int.add(Segment(srom.str(), SEG_ROM_BASE+offset, SEG_ROM_SIZE,
     634                        IntTab(cluster(x, y), INT_IOBX_TGT_ID), cacheable));
    630635         }
    631636
     
    711716    // - two levels srcid decoding for responses
    712717    // - 5 initiators (IOB0, IOB1, BDEV, CDMA, IOPI)
    713     // - 9 targets (IOB0, IOB1, BDEV, CDMA, MTTY, FBUF, BROM, MNIC, IOPI)
     718    // - 9 targets (IOB0, IOB1, BDEV, CDMA, MTTY, FBUF, ROM, MNIC, IOPI)
    714719    //
    715720    // Address bit 32 is used to determine if a command must be routed to
     
    743748    maptab_iox.add(Segment("iox_seg_simh_0", SEG_SIM_BASE + iob0_base, SEG_SIM_SIZE,
    744749                   IntTab(0, IOX_SIMH_TGT_ID), false));
     750    maptab_iox.add(Segment("iox_seg_rom_0", SEG_ROM_BASE + iob0_base, SEG_ROM_SIZE,
     751                   IntTab(0, IOX_ROM_TGT_ID), false));
    745752
    746753    if ( cluster_iob0 != cluster_iob1 )
     
    763770        maptab_iox.add(Segment("iox_seg_simh_1", SEG_SIM_BASE + iob1_base, SEG_SIM_SIZE,
    764771                   IntTab(0, IOX_SIMH_TGT_ID), false));
     772        maptab_iox.add(Segment("iox_seg_rom_1", SEG_ROM_BASE + iob1_base, SEG_ROM_SIZE,
     773                   IntTab(0, IOX_ROM_TGT_ID), false));
    765774    }
    766775
     
    858867    VciSignals<vci_param_ext>         signal_vci_tgt_iopi("signal_vci_ini_iopi");
    859868    VciSignals<vci_param_ext>         signal_vci_tgt_simh("signal_vci_ini_simh");
     869    VciSignals<vci_param_ext>         signal_vci_tgt_rom("signal_vci_ini_rom");
    860870
    861871   // Horizontal inter-clusters INT network DSPIN
     
    929939                                 almos_kernel_pathname);
    930940#else
    931    soclib::common::Loader loader(soft_name);
     941   soclib::common::Loader loader(soft_name, dsoft_name);
    932942#endif
    933943
     
    946956
    947957   const size_t nb_iox_initiators = (cluster_iob0 != cluster_iob1) ? 5 : 4;
    948    const size_t nb_iox_targets = (cluster_iob0 != cluster_iob1) ? 9 : 8;
     958   const size_t nb_iox_targets = (cluster_iob0 != cluster_iob1) ? 10 : 9;
    949959
    950960   // IOX network
     
    10221032                                          maptab_iox );
    10231033
     1034   // External ROM
     1035   VciSimpleRom<vci_param_ext>* rom;
     1036   rom = new VciSimpleRom<vci_param_ext>("rom",
     1037                                          IntTab(0, IOX_ROM_TGT_ID),
     1038                                          maptab_iox,
     1039                                          loader,
     1040                                          X_WIDTH + Y_WIDTH );
     1041
    10241042   // Clusters
    10251043   TsarIobCluster<vci_param_int,
     
    10891107                INT_XICU_TGT_ID,
    10901108                INT_MDMA_TGT_ID,
    1091                 INT_BROM_TGT_ID,
     1109                INT_DROM_TGT_ID,
    10921110                INT_IOBX_TGT_ID,
    10931111
     
    12021220    iox_network->p_to_tgt[IOX_IOPI_TGT_ID]               (signal_vci_tgt_iopi);
    12031221    iox_network->p_to_tgt[IOX_SIMH_TGT_ID]               (signal_vci_tgt_simh);
     1222    iox_network->p_to_tgt[IOX_ROM_TGT_ID]                (signal_vci_tgt_rom);
    12041223
    12051224    if (cluster_iob0 != cluster_iob1)
     
    12851304    simh->p_vci(signal_vci_tgt_simh);
    12861305
     1306    // External ROM connexion
     1307    rom->p_clk(signal_clk);
     1308    rom->p_resetn(signal_resetn);
     1309    rom->p_vci(signal_vci_tgt_rom);
     1310
    12871311    // IOB0 cluster connexion to IOX network
    12881312    (*clusters[0][0]->p_vci_iob_iox_ini) (signal_vci_ini_iob0);
  • branches/reconfiguration/platforms/tsar_generic_iob/top.desc

    r769 r926  
    4040                  cell_size = vci_cell_size_ext),
    4141
    42             # ROM
    43             Uses('caba:vci_simple_rom',
    44                   cell_size   = vci_cell_size_ext),
    45 
    4642            # Frame Buffer
    4743            Uses('caba:vci_framebuffer',
     
    7268                  cell_size = vci_cell_size_ext),
    7369
     70            # ROM
     71            Uses('caba:vci_simple_rom',
     72                  cell_size = vci_cell_size_ext),
     73
    7474            Uses('common:elf_file_loader'),
    7575            Uses('common:plain_file_loader'),
  • branches/reconfiguration/platforms/tsar_generic_iob/tsar_iob_cluster/caba/source/include/tsar_iob_cluster.h

    r904 r926  
    9696    VciSignals<vci_param_int>             signal_int_vci_tgt_xicu;
    9797    VciSignals<vci_param_int>             signal_int_vci_tgt_mdma;
    98     VciSignals<vci_param_int>             signal_int_vci_tgt_brom;
     98    VciSignals<vci_param_int>             signal_int_vci_tgt_drom;
    9999    VciSignals<vci_param_int>             signal_int_vci_tgt_iobx;
    100100
     
    149149    VciMultiDma<vci_param_int>*                       mdma;
    150150
    151     VciSimpleRom<vci_param_int>*                      brom;
     151    VciSimpleRom<vci_param_int>*                      drom;
    152152
    153153    VciLocalCrossbar<vci_param_int>*                  int_xbar_d;
     
    212212                    size_t                             int_xicu_tgt_id,
    213213                    size_t                             int_mdma_tgt_id,
    214                     size_t                             int_brom_tgt_id,
     214                    size_t                             int_drom_tgt_id,
    215215                    size_t                             int_iobx_tgt_id,
    216216                    size_t                             int_proc_ini_id,
  • branches/reconfiguration/platforms/tsar_generic_iob/tsar_iob_cluster/caba/source/src/tsar_iob_cluster.cpp

    r904 r926  
    5151        size_t                             int_xicu_tgt_id, // local index
    5252        size_t                             int_mdma_tgt_id, // local index
    53         size_t                             int_brom_tgt_id, // local index
     53        size_t                             int_drom_tgt_id, // local index
    5454        size_t                             int_iobx_tgt_id, // local index
    5555
     
    210210                     nb_dmas);                            // number of IRQs
    211211
    212     ///////////   DISTRIBUTED BOOT ROM
    213     std::ostringstream s_brom;
    214     s_brom << "brom_" << x_id << "_" << y_id;
    215     brom = new VciSimpleRom<vci_param_int>(
    216                      s_brom.str().c_str(),
    217                      IntTab(cluster_id, int_brom_tgt_id),
     212    ///////////   DISTRIBUTED ROM
     213    std::ostringstream s_drom;
     214    s_drom << "drom_" << x_id << "_" << y_id;
     215    drom = new VciSimpleRom<vci_param_int>(
     216                     s_drom.str().c_str(),
     217                     IntTab(cluster_id, int_drom_tgt_id),
    218218                     mt_int,
    219219                     loader,
     
    473473    int_xbar_d->p_to_target[int_xicu_tgt_id]          (signal_int_vci_tgt_xicu);
    474474    int_xbar_d->p_to_target[int_mdma_tgt_id]          (signal_int_vci_tgt_mdma);
    475     int_xbar_d->p_to_target[int_brom_tgt_id]          (signal_int_vci_tgt_brom);
     475    int_xbar_d->p_to_target[int_drom_tgt_id]          (signal_int_vci_tgt_drom);
    476476    int_xbar_d->p_to_initiator[int_mdma_ini_id]       (signal_int_vci_ini_mdma);
    477477    for (size_t p = 0; p < nb_procs; p++)
     
    597597        mdma->p_irq[i]                           (signal_irq_mdma[i]);
    598598
    599     /////////////////////////////////// BROM
    600     brom->p_clk                                  (this->p_clk);
    601     brom->p_resetn                               (this->p_resetn);
    602     brom->p_vci                                  (signal_int_vci_tgt_brom);
     599    /////////////////////////////////// DROM
     600    drom->p_clk                                  (this->p_clk);
     601    drom->p_resetn                               (this->p_resetn);
     602    drom->p_vci                                  (signal_int_vci_tgt_drom);
    603603
    604604    //////////////////////////// RAM network CMD & RSP routers
Note: See TracChangeset for help on using the changeset viewer.