1

Is there a way to call a ModelSim command (e.g. force -freeze) from SystemVerilog?

2
  • Could you expand your example, are you trying to do some thing like : initial begin #2m force -freeze end Commented Aug 12, 2014 at 13:27
  • yes, I'd expect something like: initial begin #2m $simulator("force -freeze /tb/i_dut/some_signal 0 0"); end Commented Aug 12, 2014 at 13:36

2 Answers 2

2

There is a package mti_fli that you can import lets you call modelsim commands using the SystemVerilog DPI. Look in "Simplified Import of Library Functions" in the User Manual.

However for large designs, I would strongly recommend using Verilog's force statement directly for performance reasons. Anytime you have to look up a signal by string name at run time prevents many optimizations to keep those names available.

Sign up to request clarification or add additional context in comments.

2 Comments

Does the verilog's force command work when the DUT is written in VHDL? I've tried it already and it failed, but maybe I just did something wrong.
No, that's the first you mentioned using VHDL. Using $signal_force or mti_Command() will work with VHDL.
0

If you just want to force a signal, you can use the $signal_force system task. Have a look in the ModelSim manual on its input parameters.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.