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-66 3 - Design libraries<br />

Regenerating your design libraries<br />

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

Depending on your current <strong>ModelSim</strong> version, you may need to regenerate your design<br />

libraries before running a simulation. Check the installation README file to see if your<br />

libraries require an update. You can regenerate your design libraries using the Refresh<br />

comm<strong>and</strong> from the Library tab context menu (see "Managing library contents" (UM-61)), or<br />

by using the -refresh argument to vcom (CR-311) <strong>and</strong> vlog (CR-358).<br />

From the comm<strong>and</strong> line, you would use vcom with the -refresh option to update VHDL<br />

design units in a library, <strong>and</strong> vlog with the -refresh option to update Verilog design units.<br />

By default, the work library is updated; use -work to update a different library.<br />

For example, if you have a library named mylib that contains both VHDL <strong>and</strong> Verilog<br />

design units:<br />

vcom -work mylib -refresh<br />

vlog -work mylib -refresh<br />

An important feature of -refresh is that it rebuilds the library image without using source<br />

code. This means that models delivered as compiled libraries without source code can be<br />

rebuilt for a specific release of <strong>ModelSim</strong> (4.6 <strong>and</strong> later only). In general, this works for<br />

moving forwards or backwards on a release. Moving backwards on a release may not work<br />

if the models used compiler switches or directives that do not exist in the older release.<br />

Note: You don't need to regenerate the std, ieee, vital22b, <strong>and</strong> verilog libraries. Also, you<br />

cannot use the -refresh option to update libraries that were built before the 4.6 release.<br />

Maintaining 32-bit <strong>and</strong> 64-bit versions in the same library<br />

It is possible with <strong>ModelSim</strong> to maintain 32-bit <strong>and</strong> 64-bit versions of a design in the same<br />

library, as long as they haven’t been optimized by the vopt comm<strong>and</strong> (CR-371).<br />

To do this, you must compile the design with the 32-bit version <strong>and</strong> then "refresh" the<br />

design with the 64-bit version. For example:<br />

Using the 32-bit version of <strong>ModelSim</strong>:<br />

vlog file1.v file2.v -forcecode -work asic_lib<br />

Next, using the 64-bit version of <strong>ModelSim</strong>:<br />

vlog -work asic_lib -refresh<br />

This allows you to use either version without having to do a refresh.<br />

Do not compile the design with one version, <strong>and</strong> then recompile it with the other. If you do<br />

this, <strong>ModelSim</strong> will remove the first module, because it could be "stale."

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

Saved successfully!

Ooh no, something went wrong!