Product Documentation
Spectre Classic Simulator, Spectre APS, Spectre X, Spectre XPS, Spectre FMC Analysis, and Legato Reliability Solution User Guide
Product Version 23.1, September 2023

15


AHDL Linter Checks

This chapter contains the following topics:

About the AHDL Linter Feature

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, Spectre APS and Spectre XPS test cases containing Verilog-A models.

AHDL Linter checks each behavioral model in the design and suggests which line should be improved to:

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, Spectre APS, and Spectre XPS using the following command-line options:

% spectre -ahdllint netlist.scs
% 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 lint 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 lint 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:

no

Disables lint checks. There is no change in the existing compilation or simulation error messages.

warn

(default) Turns on the static lint and dynamic lint checks. Except the models with attribute (* ahdllint = "no" *), the static lint checks all models, continues the simulation, and then performs dynamic lint checks.

error

Turns on the static lint check. Dynamic lint checks are performed only when static lint issues are not detected. Except the models with attribute
(* ahdllint = "no" *), the static lint checks all models. The simulator generates an error and exits if there is any static lint warning reported after compiling all the models of the circuit. If there are no static lint warnings, the simulator continues the simulation and performs dynamic lint checks. However, in the case of dynamic lint issues, the simulator does not error out.

force

Similar to warn, but this option overrides the model attribute
(* ahdllint = "no" *), and forces to check all models, continue the simulation, and perform dynamic lint checks.

static

Performs static lint checks on a Verilog-A file directly.

The -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, as show below.

setenv SPECTRE_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.

The following figure displays the AHDL Linter usage summary with Spectre APS.

Identifying AHDL Linter Messages

The messages generated from AHDL Linter (static or dynamic) have the AHDL Linter message identifier AHDLLINT at the beginning of the message followed by the message id.

The following examples show the static and dynamic AHDL linter messages generated by Spectre, Spectre APS, and Spectre XPS:

Static AHDL Linter Message

Dynamic AHDL Linter Message

Filtering AHDL Linter Messages

You can filter the AHDL Linter messages using the options control statement, as follows:

Name options warning_limit=num warning_id=id

where:

warning_limit specifies the number of messages to be printed.

warning_id specifies the message id that needs to be printed.

Example1

myoptions options warning_limit=0 warning_id=[AHDLLINT-8004 AHDLLINT-8005]

In the above example, Spectre, Spectre APS, or Spectre XPS will not print any message with the id AHDLLINT-8004 and AHDLLINT-8005.

Example2

myoptions2 options warning_limit=1 warning_id=[AHDLLINT-8005]

In the above example, Spectre, Spectre APS, or Spectre XPS will print only one message with the id AHDLLINT-8005.

For more information about the options control statement, see The options Statement.

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:
  @(timer(50n)) xval=2;


Return to top
 ⠀
X