1

Background : ModelSim v10.4d installed with quartus v16.0

I was a Cadence Incisive user, now have to pass to mentor ModelSim, but with ModelSim I can't find a way to get all signals' data before adding them to the waveform window.

For example,

In an .do(tcl) ModelSim simmulation script, a typical flow could be:

1,vcom : compile all sources files and testbench
2,vsim : load testbench for simulation
3,view structure/signals/wave : open some windows
4,add wave : add signals to waveform window
5,run xx us : run simulation for a certain time

with this flow, I have to re-do step 5 each time adding a signal to waveform window, or it will show me "NO DATA" for that newly added signal.

So I wonder if it's possible that we skip step 4, do step 5 just once to obtain all signals' simulation data, then we choose signals to send to waveform window, and we have every signal's data without re-doing the "run".

Cong Li
  • 369
  • 2
  • 5
  • 13

2 Answers2

5

The command you need is log. The reference manual says:

This command creates a wave log format (WLF) file containing simulation data for all HDL objects whose names match the provided specifications.

Try this flow, you can go to step 6 before the end of step 5 :

1- vcom *.vhd : compile all sources files and testbench
2- vsim work.my_tb : load testbench for simulation
3- view structure/signals/wave : open some windows
4- log * -r : tell modelsim to record everything
5- run xx us : run simulation for a certain time
6- add signals to waveform window

Using the log * -r will slow the simulation down and fill your disk up. So, you perhaps would wish to target a specific part of your design rather than using * or perhaps would wish to restrict the depth using the -depth option. Full details can be found in the Modelsim reference manual, available via the Help menu.

Matthew Taylor
  • 13,365
  • 3
  • 17
  • 44
grorel
  • 1,408
  • 15
  • 21
  • Thanks! This is exactly what I want. Actually I don't have a very big project, so I didn't feel that `log * -r` slowed down the simulation. – Cong Li Mar 28 '18 at 08:20
3

If you want to add every signal in the design, just do something like:

add wave -recursive -depth 10 *

This will add every signal up to 10 levels of hierarchy deep. Note that the signal logging only applies to simulation run after the add command.

In a large design, logging every signal will cause the simulation to slow down. By picking and choosing which signals you are actually interested in before running the simulation, you will get the shortest simulation run time.

You can quickly navigate the design using the 'sim' panel, then right-click an object in the 'Objects' panel to add to wave. Here you can also Add to > Wave > Signals in region, or in the 'sim' panel you can Add to > Wave > Signals in region and below.

scary_jeff
  • 4,314
  • 13
  • 27
  • 1
    the simulation slows down because all the selected signals are recorded to a file. This file IO is of course much slower then the simple operations.captured. – JHBonarius Mar 27 '18 at 18:44
  • This isn't true if the object window doesn't show the signals, so technically the sim data isn't 'obtained' yet, to use the OPs words. – Joe Jul 24 '20 at 04:08