Changes between Version 9 and Version 10 of Soclib Cc/And Modelsim


Ignore:
Timestamp:
Jun 14, 2010, 8:50:56 PM (14 years ago)
Author:
Nicolas Pouillon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Soclib Cc/And Modelsim

    v9 v10  
    1919 * Select modules and dependancies from a platform description file,
    2020 * Explicitly instantiate C++ templates,
    21  * Call the C++ compiler. Only this step is implemented in `sccom`.
     21 * Call the C++ compiler. Only this step is implemented in `sccom`,
     22 * Call the vhdl or verilog compiler: `vcom` and `vlog`.
    2223
    2324The flow is as in the picture:
     
    4243 * the path to !ModelSim's SystemC implementation
    4344 * used flags
    44  * object file names pattern in sccom work directory
     45 * object file names pattern in sccom `work` directory
    4546
    4647For all these, we must create 3 new configurations in soclib-cc's
     
    5152
    5253{{{
     54#!python
    5355# Definition of the compiler used for ModelSim-usable SoCLib components.
    5456# We use sccom for components compilation and linkage, gcc/g++ for utilities
     
    6264        tool_CC_LINKER = 'sccom',
    6365        tool_CXX_LINKER = 'sccom',
     66        tool_VHDL = 'vcom',
     67        tool_VERILOG = 'vlog',
    6468        # Modelsim cant do parallel builds :'(
    6569        max_processes = 1,
     
    6872        # Special features, it has a -link invocation needed at end...
    6973        libs = ['-link'],
     74        # VHDL compilation flags
     75        vflags = ['-05', '-quiet', '-check-synthesis'],
    7076)
    7177       
     
    107113There is no `sc_main()` function in modelsim-based simulators. The top
    108114module must be a `sc_module` with no interfaces. This probably needs a
    109 rewrite of your netlists.
     115rewrite of your netlists. (Note: If you use DSX-generated netlists,
     116this is done transparently)
    110117
    111 If you use DSX-generated netlists, this is done transparently.
     118= Component Metadata =
     119
     120RTL modules, exactly like their caba counterparts, have their own metadata files.
     121Caba modules can use RTL ones as dependancies.
    112122
    113123= Usage =
     
    130140
    131141It contains:
    132  `fifo_gen`::
     142 `rtl:fifo_gen`::
    133143  The VHDL component writing to the Fifo
    134  `fifo_gen_wrapper`::
     144 `caba:fifo_gen`::
    135145  The VHDL/SystemC wrapper to export `fifo_gen` to the SystemC world
    136  `fifo_reader`::
     146 `caba:fifo_reader`::
    137147  A SystemC component reading from the fifo
    138  `topcell`::
     148 `caba:topcell`::
    139149  A SystemC component implementing the topcell
    140  `system_driver`::
     150 `caba:system_driver`::
    141151  A SystemC component controlling `reset` and `clock` signals
    142152
     
    144154 * Reset the work directory, to make sure,
    145155{{{
    146  $ rm -rf work transcript modelsim.ini fifo_gen_wrapper/fifo_gen.h  vsim.wlf
     156 $ rm -rf work transcript modelsim.ini vsim.wlf
    147157}}}
    148158 * Initialize modelsim `work` directory,
     
    151161 $ vmap work work
    152162}}}
    153  * Compile the VHDL module with vcom.
    154 {{{
    155  $ vcom fifo_gen/fifo_gen.vhd
    156 }}}
    157  * Generate the SystemC wrapper of the `fifo_gen` VHDL module with `scgenmod`
    158 {{{
    159  $ scgenmod -sc_uint -bool fifo_gen > fifo_gen_wrapper/fifo_gen.h
    160 }}}
    161163 * Compile the SystemC system driver with soclib-cc, all dependancies are pulled with it.
    162    `.sd` metadata are needed (even for the VHDL/SystemC wrapper), see in tarball.
     164   `.sd` metadata are needed (even for the VHDL/SystemC wrapper and VHDL modules), see in tarball.
    163165{{{
    164166 $ soclib-cc -1 caba:system_driver -t modelsim -v -o sccom-link.o
     
    166168 * Open modelsim with the platform
    167169{{{
    168  $ vsim -novopt -sclib work system_driver
     170 $ vsim -sclib work system_driver
    169171}}}
    170172