| Link for ModelSim | ![]() |
Once you establish a link between ModelSim and MATLAB, you are ready to apply stimuli to the test bench environment. One way of applying stimuli is through the iport parameter of the linked MATLAB function. This parameter forces signal values by deposit. Other ways include issuing force commands in the ModelSim Main window or using the Edit>Clock option in the ModelSim Signals window.
For example, consider the following sequence of force commands:
VSIM n> force clk 0 0 ns, 1 5 ns -repeat 10 ns VSIM n> force clk_en 1 0 VSIM n> force reset 0 0
These commands
Force the clk signal to 0 at 0 nanoseconds after the current simulation time and to 1 at 5 nanoseconds after the current ModelSim simulation time. This cycle repeats starting at 10 nanoseconds after the current simulation time, causing transitions from 1 to 0 and 0 to 1 every 5 nanoseconds, as the following diagram shows.

Force the clk_en signal to 1 at 0 nanoseconds after the current simulation time.
Forces the reset signal to 0 at 0 nanoseconds after the current simulation time.
| Initializing the Simulator for a MATLAB Test Bench Session | Running and Monitoring a Test Bench Session | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |