Is there a way to call a ModelSim command (e.g. force -freeze) from SystemVerilog?
2 Answers
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.
initial begin #2m force -freeze end