Look up the "when" command in ModelSim. It allows you to set up
fairly complex trigger conditions (much more complex than you
could do with a logic analyzer). When the trigger fires, you
can execute a Tcl script that will start or stop logging of
signals to the waveform dump file.
I don't think you will find the "center trigger" feature
in a simulator. The reason for this is that file storage
space (for waveform dumps) is cheap; it's logging the data
that is expensive. So there's no special benefit in
having a pre-trigger buffer in the way you get in a logic
analyzer, where buffering is the limited resource.
--
Jonathan Bromley, Consultant
DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services
Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
(e-mail address removed)://
www.MYCOMPANY.com
The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
Hi Jonathan,
I have a project continuously running more than 20 days to get an
error. In my project I have many assert statements to make sure the
design is going well. If there is an error, the design stops.
But I couldn't open the waveform window under ModelSim when starting
the simulation, the reason is very simple: any size of hard disk would
be filled up within one day simulation.
I would like the ModelSim or other simulation software to have the
following function:
It has two windows to accept two numbers to specify how many clocks
before and after the point where assert statement fails to generate
waveform window data.
For example, 10k, 200. It means the software always keeps latest 10k
clocks of waveforms and when an assert statement fails, it continue
running for another 200 clocks and saves 10k+200 clocks of waveforms.
If ModelSim has the above function, it may be called breakpoint
function.
1. Start a project as usual;
2. Open waveform window and load its *.do file;
3. Set up Breakpoint window two numbers: number of clocks to record
waveforms before the break point and number of clocks to record
waveforms after the break point;
4. Run ModelSim with waveoform window opened and *.do file loaded;
5. When you manually stop its running or the running stops because an
assert statement fails, its shows latest waveforms of specified number
of clocks.
It execution in code is very simple:
1. Run as usual without drawing waveform window;
2. Generate waveform data into a buffer zone whose size is fixed based
on the two numbers;
3. When an assert statement fails, continue run another number of
clocks; then stop drawing waveform window with all collected data.
The differences between this method and currrent waveform window
method are:
1. The size of waveform data never grow beyond the size of specified
number of clocks.
2. When stopped manually or automatically (by failed assert
statement), it show the latest wavefors of specified number of clocks.
The above behavior exactly likes the logical analyser break point
function.
The method you mention cannot resolve my problem: if you figure out an
error condition in a when command, then start dumping data, there are
two situations:
1. If waveform window is opened and *.do file was loaded, hard disk
would have been full long before the error condition is met;
2. If it starts log waveform data, it is too later, because the
critical error situation has passed.
If I have any misunderstand, please let me know.
Thank you.
Weng