Changes between Version 4 and Version 5 of Soclib Cc/And Modelsim


Ignore:
Timestamp:
Mar 26, 2010, 5:03:37 PM (14 years ago)
Author:
Nicolas Pouillon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Soclib Cc/And Modelsim

    v4 v5  
    6767        max_processes = 1,
    6868        # No cflags are needed, sccom forces them
    69         cflags = [],
     69        cflags = ['-m32'],
    7070        # Special features, it has a -link invocation needed at end...
    7171        libs = ['-link'],
     
    118118Now we configured soclib-cc, we can compile a complete SystemC system.
    119119
    120 Example to come
     120Let's have an example system with two basic components communicating through a fifo.
     121
     122[[Image(cosim-pf1.png,nolink)]]
     123
     124We'll use
     125 * SoCLib SystemC Fifo Ports,
     126 * a VHDL `fifo_gen` component,
     127 * a VHDL-SystemC `fifo_gen_wrapper` wrapper,
     128 * a SystemC `fifo_wrapper` hosting a pure-C++.
     129
     130This basic system has to be modeled as the following tree:
     131
     132[[Image(cosim-pf2.png,nolink)]]
     133
     134It contains:
     135 `fifo_gen`::
     136  The VHDL component writing to the Fifo
     137 `fifo_gen_wrapper`::
     138  The VHDL/SystemC wrapper to export `fifo_gen` to the SystemC world
     139 `fifo_reader`::
     140  A SystemC component reading from the fifo
     141 `topcell`::
     142  A SystemC component implementing the topcell
     143 `system_driver`::
     144  A SystemC component controlling `reset` and `clock` signals
     145
     146In order to simulate this system we need to:
     147 * Reset the work directory, to make sure,
     148{{{
     149 $ rm -rf work transcript modelsim.ini fifo_gen_wrapper/fifo_gen.h  vsim.wlf
     150}}}
     151 * Initialize modelsim `work` directory,
     152{{{
     153 $ vlib work
     154 $ vmap work work
     155}}}
     156 * Compile the VHDL module with vcom.
     157{{{
     158 $ vcom fifo_gen/fifo_gen.vhd
     159}}}
     160 * Generate the SystemC wrapper of the `fifo_gen` VHDL module with `scgenmod`
     161{{{
     162 $ scgenmod -sc_uint -bool fifo_gen > fifo_gen_wrapper/fifo_gen.h
     163}}}
     164 * Compile the SystemC system driver with soclib-cc, all dependancies are pulled with it.
     165   `.sd` metadata are needed (even for the VHDL/SystemC wrapper), see in tarball.
     166{{{
     167 $ soclib-cc -1 caba:system_driver -t sccom -v -o sccom-link.o
     168}}}
     169 * Open modelsim with the platform
     170{{{
     171 $ vsim -novopt -sclib work system_driver
     172}}}
     173
     174See the attached tarball for the complete example