1

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

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

2 Answers2

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.

dave_59
  • 39,096
  • 3
  • 24
  • 63
  • 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. – Andy Aug 12 '14 at 15:58
  • No, that's the first you mentioned using VHDL. Using $signal_force or mti_Command() will work with VHDL. – dave_59 Aug 13 '14 at 06:29
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.

Tudor Timi
  • 7,453
  • 1
  • 24
  • 53