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.

Simulating VHDL designs UM-81<br />

In this example you have two synchronous processes, one triggered with clk <strong>and</strong> the other<br />

with clk2. To your surprise, the signals change in the clk2 process on the same edge as they<br />

are set in the clk process. As a result, the value of inp appears at s1 rather than s0.<br />

During simulation an event on clk occurs (from the testbench). From this event <strong>ModelSim</strong><br />

performs the "clk2 Runtime Options menu or by modifying the IterationLimit (UM-532)<br />

variable in the modelsim.ini. See "Preference variables located in INI files" (UM-524) for<br />

more information on modifying the modelsim.ini file.<br />

If the problem persists, look for zero-delay loops. Run the simulation <strong>and</strong> look at the source<br />

code when the error occurs. Use the step button to step through the code <strong>and</strong> see which<br />

signals or variables are continuously oscillating. Two common causes are a loop that has<br />

no exit, or a series of gates with zero delay where the outputs are connected back to the<br />

inputs.<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!