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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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);
Note: See TracChangeset for help on using the changeset viewer.