24.03.2013 Views

ModelSim SE User's Manual - Electrical and Computer Engineering

ModelSim SE User's Manual - Electrical and Computer Engineering

ModelSim SE User's Manual - Electrical and Computer Engineering

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

vgencomp component declaration<br />

vgencomp (CR-330) generates a component declaration according to these rules:<br />

Port clause<br />

VHDL: instantiating SystemC UM-223<br />

A port clause is generated if the module has ports. A corresponding VHDL port is defined<br />

for each named SystemC port.<br />

You can set the VHDL port type to bit or std_logic. If the SystemC port has a range, then<br />

the VHDL port type is bit_vector or std_logic_vector.<br />

Examples<br />

Exporting SystemC modules<br />

sccom -link<br />

SystemC identifier VHDL identifier<br />

_topmod \_topmod\<br />

SystemC port VHDL port<br />

sc_inp1; p1 : in std_logic;<br />

sc_outp2; p2 : out std_logic_vector(7 downto 0);<br />

sc_inoutp3; p3 : inout std_logic_vector(7 downto 0)<br />

Configuration declarations are allowed to reference SystemC modules in the entity aspects<br />

of component configurations. However, the configuration declaration cannot extend into a<br />

SystemC instance to configure the instantiations within the SystemC module.<br />

To be able to instantiate a SystemC module within VHDL (or use a SystemC module as a<br />

top level module), the module must be exported.<br />

Assume a SystemC module named transceiver exists, <strong>and</strong> that it is declared in header file<br />

transceiver.h. Then the module is exported by placing the following code in a .cpp file:<br />

#include "transceiver.h"<br />

SC_MODULE_EXPORT(transceiver);<br />

The sccom -link comm<strong>and</strong> collects the object files created in the work library, <strong>and</strong> uses<br />

them to build a shared library (.so) in the current work library. If you have changed your<br />

SystemC source code <strong>and</strong> recompiled it using sccom, then you must run sccom -link before<br />

invoking vsim. Otherwise your changes to the code are not recognized by the simulator.<br />

Generic support for VHDL instantiating SystemC<br />

Support for generics is available in a workaround flow for the current release. For<br />

workaround flow details, please refer to systemc_generics.note located in the<br />

/modeltech/docs/technotes directory.<br />

<strong>ModelSim</strong> <strong>SE</strong> User’s <strong>Manual</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!