|
vcs design.v -o design.vcs -line +cli+3 \
-P record.tab record-lcb.o -lX11
Command line Options Description
-lineTurns line debugging on
+cli+3Enables variable forcing and time breakpoints
-P record.tabSpecifies the system task "table" file
record-lcb.oThe actual PLI routines (record-lcb.a if not SunOS)
The files record.tab and record-lcb.o (or record-lcb.a) are included in the DAI Signalscan distribution. The record.tab file is a system task "table" file. record-lcb.o specifies system tasks to be linked into the simulator. If another table file is already being used, the record.tab file may be merged with the existing table file so that only one table file must be specified.

You may now add DAI Signalscan PLI System Tasks to your design files, as shown below:
module record;
initial begin
$recordfile("test.sst");//default="verilog.sst"
$recordvars;
end
endmodule
module record;
initial begin
$recordvars;
end
endmodule
module record;
initial begin
$recordfile("test.sst","wrapsize=20M");
$recordvars;
end
endmodule
module record;
initial begin
$recordvars(top.middle.clock,module2);
end
endmodule
module record;
initial begin
$recordvars("depth=3");
end
endmodule
module record;
initial begin
$recordvars("primitives","drivers");
end
endmodule;
Multiple Variables and Scopes Example
This is a more complex example showing how to apply multiple constraints to multiple variables and scopes. In this example, the first $recordvars records three levels of variables within scope top.mod1 and all variables within top.mod2. The second $recordvars records driver information for variables in mod1 and no driver information for variables in mod2. Note that all options apply to all variables specified later in that $recordvars task unless overridden.
module record;
initial begin
$recordfile("mydesign.sst", "wrapsize=20M");
$recordvars("depth=3", top.mod1,"depth=0", top.mod2);
$recordvars("drivers",mod1,"nodrivers",mod2);
end
endmodule
Recordon and Recordoff Example
In this example, the $recordoff and $recordon tasks are used to record variables only for a small portion of the total simulation time. The initial state is $recordon.
module record;
initial begin
$recordvars;
$recordoff;
end
endmodule
module top;
reg clock;
initial begin
#0 clock=0;
#100 clock=1;
#100 clock=1;
#100 clock=0;$recordon;
#100 clock=1;
#100 clock=0;
#100 clock=1;$recordoff;
#100 clock=0;
#100 clock=1;
end
endmodule
Snapshot Example
In this example the $recordfilecopy task is used to make a "snapshot" of live data for later use. The original default file, verilog.sst file, will be overwritten after the $reset.
module top;
reg clock,a,out,sin;
initial begin
$recordvars;
#0 a = 0;clock=0;out=0;sin=0;
#100 clock=1;
#100 clock=1;
#100 clock=1;
#100 clock=0;
#100 clock=0;$recordfilecopy("copy.sst");
#100 clock=1;
#100 $reset;
end
endmodule
$recordfile
$recordvars
$recordon
$recordoff
$recordfilecopy
$recordfilechange
$recordclose
$recordabort
$signalscan
$signalscankill
$signalscanabort
$recordfile(<filename> [, <options>] ...)
<filename> is the name of the SST file. It may be a string, enclosed in double quotes, or the name of a variable containing the file name. Although not required, an extension of .sst is recommended to identify the file as an SST file. If incremental file options are specified, <filename> is the name of the final merged file, if any, and incremental files will contain a sequence number inserted before the file name suffix (if any). The default file name is verilog.sst.
The filename may be followed by a list of options. Each option is a string, enclosed in double quotes, or a variable containing the option string. Available options are described below:
"wrapsize=<size>"
The transition data in the SST file "wraps" when it reaches the specified size, so that only this amount of data is kept in the file. <size> is a number followed by B, K, M, or G to specify bytes, kilobytes, megabytes, or gigabytes, or by no letter to use the default of megabytes. This option limits the size of the transition data, and does not affect the space used by other information such as scope and variable names. When the transition data begins to occupy more than its allotted maximum, the oldest transitions are overwritten by newer transitions. However, transitions are written to the file in blocks of about four to five megabytes, when possible, and the maximum size may be increased if it is below this amount. It is recommended that the maximum size be at least ten megabytes, if specified.
"incsize=<size>"
A new incremental SST file is started when the current file grows beyond the specified size. <size> is a number followed by B, K, M, or G to specify bytes, kilobytes, megabytes, or gigabytes, or by no letter to use the default of megabytes.
"inctime=<simtime>"
A new incremental SST file is started when the current file contains the specified amount of simulation time. <simtime> is a number followed by a time unit such as ps, or a number in the current time scale otherwise.
"inccpu=<cputime>"
A new incremental SST file is started when the specified amount of CPU time has been used by the simulator since the current file was opened. <cputime> is a number followed by one of the units s (seconds), m (minutes), h (hours), or d (days), or just a number in seconds.
"incfiles=<count>"
A maximum of <count> complete incremental files will be kept. When more than this number of complete incremental files have been written, the oldest files will be automatically deleted. The default is "incfiles=0". Zero is a special value which indicates that all incremental files will be kept.
"nosummary"
Disable writing of the summary file. By default, a summary file will be written if and only if the incsize, inctime, or inccpu options are used to write an incremental file.
"summary"
"summary=<summary-filename>"
A summary file will be written with the default name, or with the name specified. The default name is the name of the merged SST file, with the final suffix (if any) removed, and .sum appended.
"nomerge"
Do not automatically merge incremental SST files when the simulation is complete, or when $recordclose is used. The incremental files may be used individually to view only a portion of the total simulation time, or they may be merged later.
"merge"
Automatically merge incremental SST files into one larger SST file when the simulation is complete, or when $recordclose is used. After the incremental files are successfully merged, the incremental files are automatically removed. This is the default.
"nosequence"
Do not save sequence information in the SST file. This is the default.
"sequence"
Save sequence information in the SST file. This information is used to record the sequence in which events occurred, and allows the use of the sequence time and multivalue indication options in DAI Signalscan.
$recordfile is optional, but if used it must be placed before the first $recordvars. The $recordfile task only sets the defaults to be used when a file is created by $recordvars, and does not create the file itself.
$recordvars[(<options>...)];
Options are expressed as strings (characters enclosed in double quotes). Options apply to all following variables and scopes in the call, or to the default scopes if none are specified. Available options are described below:
"depth=n"
When a scope is specified (see below), all scopes within the scope are recursively recorded. This option sets a limit, n, to the depth of this recursion. For example, if n=1, no child scopes are automatically included. The default is "depth=0". Zero is a special value indicating no recursion limit.
"nodrivers"
"drivers"
These options indicate that drivers are not to be recorded or are to be recorded, respectively. The default is "nodrivers".
When "drivers" is specified, all variables that are recorded will also have their drivers recorded, if they have more than one driver. In this context, a driver is an output terminal of a primitive. DAI Signalscan can use this information to trace back signal states in gate-level designs.
"noprimitives"
"primitives"
These options indicate that primitives are not to be recorded or are to be recorded, respectively. The default is "noprimitives". When "primitives" is specified, all scopes that are recorded will have their primitives recorded in addition to their variables. DAI Signalscan can use this information to trace back signal states in gate-level designs.
"nocells"
"cells"
The "nocells" option indicates that variables within a cell, and all scopes below the cell, are not to be recorded. The default is "cells", which causes these variables to be recorded like any other variables. By default, modules defined in a library are cells and other modules are not cells. A non-library module can be defined as a cell using the Verilog "celldefine" directive.
"noports"
"ports"
The "ports" option, which is the default, causes a small amount of port connectivity information to be recorded for each recorded module. The "noports" option disables this, and is used primarily to work around a simulator defect that affects some designs. If the "noports" option is used, DAI Signalscan will not display ports in different colors, the Trace Browser will not display port connectivity, and Add Trace and Add Module Inputs commands will not display ports.
variables
Variables listed as arguments are recorded in the SST file. A variable may be a net, register, integer, time, real, or named event. For example: top.control.q0.
scopes
When a scope argument is listed, all variables within the scope are recorded in the SST file. In addition, variables in all child scopes will be included recursively (see the description of the dept h option above). A scope may be a module, task, function, or named block. For example: top.control.
If no variables or scopes are specified in a $recordvars call, the default of all top level modules is used. This will have the effect of recording all variables, unless the depth option is used. In many cases, this default is sufficient. An example of this usage is shown below:
module record;
initial $recordvars;
endmodule
In the above example, a separate module is used to invoke the $recordvars task. Alternatively, $recordvars could be placed in an initial block within some other module. A more complex example, which sets the file name and maximum transition data size as well as recording a number of variables and scopes with various options, is shown below:
module record;
initial begin
$recordfile("mydesign.sst", "wrapsize=20M");
$recordvars("depth=3", "drivers", top.a, "nodrivers", top.b);
$recordvars("depth=4", top.control);
$recordvars(top.io.mux1.q0, top.io.mux2.q0);
end
endmodule
$recordon and $recordoff tasks are used to turn recording on or off, respectively. These tasks take no parameters. At the beginning of the simulation, recording is on for the first SST file opened. In addition, when an SST file is closed or aborted, recording is reset to on for the next SST file. Recording may be turned off for uninteresting periods of time during a simulation.Variable transitions will not be recorded during the period where recording is off. This allows these parts of the simulation to be run at maximum speed, and can also save on disk space. All recorded variables will be updated to their current values when recording is turned back on. Recording may be turned off and on any number of times during the simulation.
The name of the new file may be specified as an optional argument. It may be a string enclosed in double quotes, or the name of a variable containing the file name. The default file name is the name of the original file with a dash and a sequence number appended before the file name suffix (if any).
Normally, all of the transitions in the original file, plus any buffered transitions not yet written to the original file, are copied to the new file. All indices and other information are also written to the new file, and it is closed. Because buffered transitions are copied in addition to transitions already in the original file, the number of transitions in the new file may slightly exceed the maximum specified for the original file, if any. However, the second argument to $recordfilecopy may specify a maximum size for the transition data in the new file, in megabytes. If specified, this maximum should be at least 10 megabytes. Of course, if the maximum is much larger than the amount of transition data in the original file, the actual size of the transition data will be the size of the transition data in the original file plus the size of the buffered transition data.
The name of the new incremental file may be specified as an optional argument. If no name is specified, the next name in the file name sequence is used.
A $reset (on simulators supporting $reset) will perform an automatic $recordabort. If you want to reset the simulation but keep any partial SST file, use the $recordclose task or the $recordfilecopy task before the $reset. Since $reset will also reset the SST file name to the default, be sure to use the $recordfile task after the $reset task to select a new file name, if necessary, to avoid overwriting a previous SST file.
module record;
initial begin
$recordvars;
$signalscan;
end
endmodule
When the $signalscan task is called, DAI Signalscan will be executed on the system where the simulator is running. The PATH environment variable is used to find the DAI Signalscan executable, which must be named "signalscan", and the DISPLAY environment variable is used to determine where the windows should be displayed. Arguments may be passed to the DAI Signalscan program by specifying them as a single parameter to the $signalscan task. The parameter may be a string, enclosed in double quotes, or a variable containing the list of arguments. For instance, this may be used to load a Do-File or another SST file to be used with the data from the simulation.
For example:
$signalscan("-do mydesign.do");
All variables being recorded to the SST file will be available for viewing. Conversely, a variable must be recorded in the SST file in order to view it with DAI Signalscan. This means that there must be at least one call to $recordvars in order for $signalscan to be useful.
There may only be one interactive DAI Signalscan connection at a time for each simulation. If you exit DAI Signalscan or the simulator, or use the $signalscankill, $signalscanabort, $recordclose, $recordabort, or $reset tasks, the interactive connection will be closed. The $signalscan task may then be used again to start a new interactive connection.
|