Creating a Script for Batch-Mode Linting

Introduction

Many ALINT users run the tool interactively with the Graphical User Interface (GUI), and perform all necessary actions using the mouse and hotkeys. However the tool can function in two more modes:

  1. Interactive Command Line

  2. Batch

Scripts and macro commands can be efficiently leveraged in any mode ALINT can operate in, but they are an absolute must-have in the Interactive Command Line and Batch modes. This document gives you an introduction to the essential commands you need to create the design linting scripts efficiently.

Tool Operation Modes

ALINT can operate in three different modes as described in Table 1.

Table 1: Operation Modes

Mode

Description

How To Invoke

GUI

Interactive graphical interface: windows, menus, push-buttons, and Command Line in the Console window.

Desktop icon or the following command from the OS command shell prompt:

> runalint

Interactive Command Line

Interactive Command Line, no GUI.

Desktop icon or the following command from the OS command shell prompt:

> runalintcon

Batch

Non-interactive batch execution, no GUI or Interactive Command Line.

Command from the OS command shell prompt:

> vlint <argument>

Typical Script Line-by-Line

This section gives you an example of commands to use in your linting TCL script:

Set the working directory

set DSN (c:/my_designs/alint_demo)

cd $DSN

Save working directory path to 'DSN'

Set the working directory

Create and clear the working library

Note: compilation results are stored in the working library

alib work

set worklib work

adel -all

Creates library 'work'

Set 'work' as default library

Clean the default library

Run the linting process

Hint: use '\' for multi-line commands

alint -f "$DSN/src/files.lst" \

-alint_policy DEFAULT \

-alint_avdb results.avdb \

-alint_gclk top.CLK1 -alint_gclk top.CLK2 \

-alint_grst top.RST \

Check files listed in 'files.lst'

Use built-in 'DEFAULT' policy

Save results to 'results.avdb'

Treat 'CLK1' and 'CLK2' as clocks

Treat 'RST' as reset

Manipulate the results

avdb2html results.avdb -report critical.html \

-rulelevel rule -rulelevel r1 \

-order_asc source -order_asc rule

Generate .html report [1], information to include:

- 'Rule' and 'Recommendation-1' only

- Group by file name and then rule

avdbcopy results.avdb results_uut_a.avdb \

-instance_regexp {UUT_A.*}

Copy subset to a separate database:

- Violations in 'UUT_A' hierarchy region

avdbcompare res1.avdb res2.avdb \

-source "./src/tx.v" \

-report tx_comparison.txt \

-o tx_comparison.avdb \

-summary console

Compare 'res1' and 'res2' databases:

- Consider violations in the tx.v file only

- Save comparison results to 'tx.v'

- Save to 'comparison.avdb' as well

- Display high-level summary in the Console

NOTE: If you want to save all of the linting options to a variable and then pass this variable to alint, you have to use the eval command, for example:

set ALINT_OPTS {-alint_policy DEFAULT \ 
-alint_avdb results.avdb \ 
-alint_gclk top.CLK1 -alint_gclk top.CLK2 \ 
-alint_grst top.RST} 

eval alint $ALINT_OPTS -f "$DSN/src/files.lst"

Scripts are usually saved as files with a .do or .tcl extension. Once a script is saved, it can be executed from either the GUI or Interactive Command Line mode:

Notes on Batch Mode

When it comes to the Batch mode, there are a few standalone commands to memorize:

The following sequence gives you an example of standalone commands to use for design linting:

# Create the working library (library work is used by vlint by default)
> vlib work
ALIB: Library `work' attached.
work = c:\my_designs\alint_demo\work\work.lib

# Clear the working library
> vdel -lib work -all
ADEL: All units removed from library `work'.

# Run linting for VHDL file (-c stands for Console)
> vlint -c -acom mux.vhd

# Run linting for Verilog file, use STARC_RTL policy
> vlint -c -alint_policy STARC_RTL -alog mux.v

If you have a linting script then you can run the vlint command with the -do argument:

> vlint -c -do run.do 

Hint: Use the quit command at the end of your script if you want vlint to exit the OS shell automatically.

References



Printed version of site: ns1.aldec.com/en/support/resources/documentation/articles/1520