AHDL Linter Usage (ahdllint)
Description
The AHDL Linter technology offers a powerful set of capabilities for upfront identification of issues that worry designers even well beyond the model creation stage. The AHDL Linter feature helps identify complex design modeling issues and can be used on block simulation or SOC verifications performed just before tape out. Early warnings enable designers to avoid expensive design iterations, and meeting quality and time-to-market goals.
You can use the AHDL Linter feature to analyze Spectre APS, and Spectre XPS test cases containing Verilog-A models.
AHDL Linter checks each Verilog-A behavioral model in the design and suggests which line should be improved to:
- Avoid potential convergence or performance problems
- Improve model accuracy, reusability, and portability
AHDL linter consists of static and dynamic lint checks. Static lint checks are performed at compilation stage. Dynamic lint checks are performed during analysis for dynamic modeling issues that may cause convergence or performance problems during simulation.
Using the AHDL Linter Feature
The AHDL Linter feature is activated in Spectre APS, and Spectre XPS using the following command-line options:
% spectre +aps -ahdllint netlist.scs
% spectre +xps +cktpreset=sram -ahdllint netlist.scs
where netlist.scs is written using Spectre, SPICE, or eSpice syntax and includes one or more Verilog-A models.
You can perform static linter checks on a netlist file that includes one or more Verilog-A models, as follows:
spectre +aps -ahdllint=static test.scs // test.scs includes the Verilog-A files
Spectre, in this case, performs only linter checks on all Verilog-A files and does not run the simulation.
You can also perform static lint checks on a Verilog-A file directly without specifying the top-level netlist file (.scs), as follows:
spectre +aps -ahdllint=static test.va //perform static lint check on test.va
The -ahdllint option accepts the following arguments:
-ahdllint option can be used without any argument, which is equivalent to specifying -ahdlint=warn. You can also set the -ahdllint option as default by setting the SPECTRE_DEFAULTS environment variable, as follows:setenv SPECTRE_DEFAULTS "-ahdllint=warn"
You can use the -ahdllint_maxwarn =n command-line option to control the maximum number of static and dynamic warnings. The default value is 5.
You can also control the maximum number of warnings by using the environment variable SPECTRE_DEFAULTS or ULSTRASIM_DEFAULTS, as show below.
setenv SPECTRE_DEFAULTS "-ahdllint -ahllint_maxwarn=10"
setenv ULSTRASIM_DEFAULTS "-ahdllint -ahllint_maxwarn=10"
You can use the -ahdllint_warn_id=<ID> option to control the warning messages for a specific message ID. ID should be a positive integer value between 5001 and 6000 or 8001 and 9999. In addition, the -ahdllint_warn_id option should always be used with the -ahdllint_maxwarn option and should be directly specified after it in the command line, otherwise, the option will be ignored. For example:
spectre +aps -ahdllint -ahdllint_maxwarn=2 -ahdllint_warn_id=5001 input.scs
In the above example, Spectre will display only two warning messages related to the message ID 5001.
You can specify the -ahdllint_maxwarn and -ahdllint_warn_id options multiple times at the command line. For example:
spectre +aps -ahdllint -ahdllint_maxwarn=1 -ahdllint_warn_id=5001 -ahdllint_maxwarn=3 -ahdllint_warn_id=8001 input.scs
In the above example, only one warning message related to the message ID 5001 will be displayed. In addition, three warning messages related to the message ID 8001 will be displayed.
You can also specify multiple IDs with the -ahdllint_warn_id option. However, the IDs must be specified using double quotes with a space between them. For example:
spectre +aps -ahdllint -ahdllint_maxwarn=2 -ahdllint_warn_id="5001 5003 5005" input.scs
Use the -ahdllint_minstep=value command-line option to set the minimal time step size boundary that will trigger an AHDL Linter warning, when the step size imposed by a Verilog-AMS filter or function, such as transition, cross, above, $bound_step, and timer is smaller than value. The default value is 1e-12.
You can use the -ahdllint_summary_maxentries=<value> command-line option to control the maximum number of messages to be displayed in dynamic lint summary. The default value is 25. For example:
spectre -ahdllint_summary_maxentries=20 input.scs
By default, the static and dynamic lint warnings and the dynamic lint summary output are sent to the simulation log file. You can use the -ahdllint_log=file command-line option to output all the information to a specified file instead of the output log file.
Filtering AHDL Messages
You can filter the AHDL Linter messages using the options control statement, as follows:
Nameoptions warning_limit=num warning_id=id
warning_limit specifies the number of messages to be printed.
warning_id specifies the message id that needs to be printed.
myoptions options warning_limit=0 warning_id=[AHDLLINT-8004 AHDLLINT-8005]
In the above example, Spectre APS/XPS will not print any message with the id AHDLLINT-8004 and AHDLLINT-8005.
myoptions2 options warning_limit=1 warning_id=[AHDLLINT-8005]
In the above example, Spectre APS/XPS will print only one message with the id AHDLLINT-8005.
For more information about the options control statement, see spectre -h options.
Using the ahdlhelp Utility
You can use the ahdlhelp utility to view the extended help on various messages reported by AHDL Linter. To view the extended help, you need to provide the AHD Linter id number as an argument, as shown below.
% ahdlhelp 8005
The following is an example of the ahdlhelp utility:
% ahdlhelp 5012
AHDLLINT-5012: Detected $abstime in an equality expression inside a conditional.
Analog simulations select timepoints using a variable timestep size algorithm based on accuracy considerations, so the value of "time" only changes between discrete real values. In order to perform an event at a particular time, the @(timer) construct must be used to tell the simulator to step to a particular timepoint and execute the desired code when that event actually occurs.
example:
if ($abstime==50n) xval=2;
solution:
Return to top