Main Content

Generate an HDL Lint Tool Script

You can generate a lint tool script to use with a third-party lint tool to check your generated HDL code.

HDL Coder™ can generate Tcl scripts for the following lint tools:

  • Ascent Lint

  • HDL Designer

  • Leda

  • SpyGlass

  • Custom

If you specify one of the supported third-party lint tools, you can either generate a default tool-specific script, or customize the script by specifying the initialization, command, and termination names as a character vector. If you want to generate a script for a custom lint tool, you must specify the initialization, command, and termination names.

HDL Coder writes the initialization, command, and termination names to a Tcl script that you can use to run the third-party tool.

How To Generate an HDL Lint Tool Script

Using the HDL Workflow Advisor

  1. In the HDL Workflow Advisor, select the HDL Code Generation task.

  2. In the Script Options tab, select Lint.

  3. For Choose lint tool, select Ascent Lint, HDL Designer, Leda, SpyGlass, or Custom.

  4. Optionally, enter text to customize the Lint script initialization, Lint script command, and Lint script termination fields. For a custom tool, you must specify these fields.

After you generate code, the command window shows a link to the lint tool script.

Using the Command Line

To generate an HDL lint tool script from the command line, set the HDLLintTool property to AscentLint, HDLDesigner, Leda, SpyGlass or Custom in your coder.HdlConfig object.

To disable HDL lint tool script generation, set the HDLLintTool property to None.

For example, to generate a default SpyGlass lint script using a coder.HdlConfig object, hdlcfg, enter:

hdlcfg.HDLLintTool = 'SpyGlass';
After you generate code, the command window shows a link to the lint tool script.

To generate an HDL lint tool script with custom initialization, command, and termination strings, use the HDLLintTool, HDLLintInit, HDLLintCmd, and HDLLintTerm properties.

For example, you can use the following command to generate a custom Leda lint script for a DUT subsystem, sfir_fixed\symmetric_fir, with custom initialization, termination, and command strings:

hdlcfg.HDLLintTool = 'Leda';
hdlcfg.HDLLintInit = 'myInitialization';
hdlcfg.HDLLintCmd = 'myCommand %s';
hdlcfg.HDLLintTerm = 'myTermination';
After you generate code, the command window shows a link to the lint tool script.

Custom Lint Tool Command Specification

If you want to generate a lint tool script for a custom lint tool, you must use %s as a placeholder for the HDL file name in the generated Tcl script.

For Lint script command or HDLLintCmd, specify the lint command in the following format:

custom_lint_tool_command -option1 -option2 %s

For example, to set the HDLLintCmd for a coder.HdlConfig object, hdlcfg, where the lint command is custom_lint_tool_command -option1 -option2, enter:

hdlcfg.HDLLintCmd = 'custom_lint_tool_command -option1 -option2 %s';