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.

SystemC: instantiating Verilog<br />

Verilog instantiation criteria<br />

SystemC: instantiating Verilog UM-209<br />

To instantiate Verilog modules into a SystemC design, you must first create a "SystemC<br />

foreign module declaration" (UM-209) for each Verilog module. Once you have created the<br />

foreign module declaration, you can instantiate the foreign module just like any other<br />

SystemC module.<br />

A Verilog design unit may be instantiated within SystemC if it meets the following criteria:<br />

The design unit is a module (UDPs <strong>and</strong> Verilog primitives are not allowed).<br />

The ports are named ports (Verilog allows unnamed ports).<br />

The Verilog module name must be a valid C++ identifier.<br />

The ports are not connected to bidirectional pass switches (it is not possible to h<strong>and</strong>le pass<br />

switches in SystemC).<br />

A Verilog module that is compiled into a library can be instantiated in a SystemC design as<br />

though the module were a SystemC module by passing the Verilog module name to the<br />

foreign module constructor. For an illustration of this, see "Example #1" (UM-210).<br />

SystemC <strong>and</strong> Verilog identifiers<br />

The SystemC identifiers for the module name <strong>and</strong> port names are the same as the Verilog<br />

identifiers for the module name <strong>and</strong> port names. Verilog identifiers must be valid C++<br />

identifiers. SystemC <strong>and</strong> Verilog are both case sensitive.<br />

SystemC foreign module declaration<br />

In cases where you want to run a mixed simulation with SystemC <strong>and</strong> Verilog, you must<br />

generate <strong>and</strong> declare a foreign module that st<strong>and</strong>s in for each Verilog module instantiated<br />

under SystemC. The foreign modules can be created in one of two ways:<br />

running scgenmod, a utility that automatically generates your foreign module declaration<br />

(much like vgencomp generates a component declaration)<br />

modifying your SystemC source code manually<br />

Using scgenmod<br />

After you have analyzed the design, you can generate a foreign module declaration with an<br />

scgenmod comm<strong>and</strong> (CR-258) similar to the following:<br />

scgenmod mod1<br />

where mod1 is a Verilog module. A foreign module declaration for the specified module is<br />

written to stdout.<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!