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.

UM-234 8 - WLF files (datasets) <strong>and</strong> virtuals<br />

Virtual functions<br />

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

order to reconstruct the original RTL hierarchy when simulating <strong>and</strong> driving a<br />

post-synthesis, gate-level implementation.<br />

A virtual signal can be used to reconstruct RTL-level design buses that were broken down<br />

during synthesis. The virtual hide comm<strong>and</strong> (CR-342) can be used to hide the display of the<br />

broken-down bits if you don't want them cluttering up the Objects pane.<br />

If the virtual signal has elements from more than one WLF file, it will be automatically<br />

installed in the virtual region virtuals:/Signals.<br />

Virtual signals are not hierarchical – if two virtual signals are concatenated to become a<br />

third virtual signal, the resulting virtual signal will be a concatenation of all the scalar<br />

elements of the first two virtual signals.<br />

The definitions of virtuals can be saved to a macro file using the virtual save comm<strong>and</strong><br />

(CR-349). By default, when quitting, <strong>ModelSim</strong> will append any newly-created virtuals (that<br />

have not been saved) to the virtuals.do file in the local directory.<br />

If you have virtual signals displayed in the Wave or List window when you save the Wave<br />

or List format, you will need to execute the virtuals.do file (or some other equivalent) to<br />

restore the virtual signal definitions before you re-load the Wave or List format during a<br />

later run. There is one exception: "implicit virtuals" are automatically saved with the Wave<br />

or List format.<br />

Implicit <strong>and</strong> explicit virtuals<br />

An implicit virtual is a virtual signal that was automatically created by <strong>ModelSim</strong> without<br />

your knowledge <strong>and</strong> without you providing a name for it. An example would be if you<br />

exp<strong>and</strong> a bus in the Wave window, then drag one bit out of the bus to display it separately.<br />

That action creates a one-bit virtual signal whose definition is stored in a special location,<br />

<strong>and</strong> is not visible in the Objects pane or to the normal virtual comm<strong>and</strong>s.<br />

All other virtual signals are considered "explicit virtuals".<br />

Virtual functions behave in the GUI like signals but are not aliases of combinations or<br />

elements of signals logged by the kernel. They consist of logical operations on logged<br />

signals <strong>and</strong> can be dependent on simulation time. They can be displayed in the Objects,<br />

Wave, <strong>and</strong> List windows <strong>and</strong> accessed by the examine comm<strong>and</strong> (CR-162), but cannot be<br />

set by the force comm<strong>and</strong> (CR-180).<br />

Examples of virtual functions include the following:<br />

a function defined as the inverse of a given signal<br />

a function defined as the exclusive-OR of two signals<br />

a function defined as a repetitive clock<br />

a function defined as "the rising edge of CLK delayed by 1.34 ns"<br />

Virtual functions can also be used to convert signal types <strong>and</strong> map signal values.<br />

The result type of a virtual signal can be any of the types supported in the GUI expression<br />

syntax: integer, real, boolean, std_logic, std_logic_vector, <strong>and</strong> arrays <strong>and</strong> records of these<br />

types. Verilog types are converted to VHDL 9-state std_logic equivalents <strong>and</strong> Verilog net<br />

strengths are ignored.

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

Saved successfully!

Ooh no, something went wrong!