Generate RTL Lint Check Report Using HDL Workflow Advisor and Synopsys SpyGlass Lint Tool - MATLAB & Simulink (original) (raw)

This example shows how to generate an RTL lint check report when you generate HDL code for generic ASIC or FPGA in the HDL Workflow Advisor and select the Synopsys SpyGlass Lint tool.

Synopsys SpyGlass is a tool that analyzes, debugs, and fixes structural and electrical issues in the register-transfer-level (RTL) description of the design. VC SpyGlass is the part of the SpyGlass platform that provides information about algorithms and analysis techniques early in the RTL phase.

Requirements

Generate HDL Code and Set Up Model

To generate a lint report for the generated HDL code using Synopsys SpyGlass tool:

1. Set the Synopsys SpyGlass tool path to the MATLAB® path:

hdlsetuptoolpath('ToolName','Synopsys SpyGlass','ToolPath','C:\Synopsys\vc_static_vU-2023.03-1\bin');

2. Open the example hdlcoder_led_blinking_4bit model, which is compatible for HDL code generation. To open this model, enter:

modelname = 'hdlcoder_led_blinking_4bit'; load_system(modelname); open_system(modelname);

hdlcoder_led_blinking_4bit Simulink model

3. In the Apps tab, click HDL Coder. Then, in the HDL Code tab, click Workflow Advisor.

4. In the HDL Workflow Advisor 1.1 Set Target Device and Synthesis Tool task, set Target workflow to Generic ASIC/FPGA and set Synthesis tool to any tool. Then, click Run This Task.

5. Perform each task in the HDL Workflow Advisor until 3.1 Set HDL Options task.

6. In the 3.2 Generate RTL Code and Testbench task, select the Generate RTL code and Generate RTL lint check report options to enable the 3.3 Generate RTL Lint Check Report task. Then, click Run This Task.

Selecting Generate RTL link check report option in HDL Workflow Advisor Task 3.2

7. In the 3.3 Generate RTL Lint Check Report task, set the Lint tool to Synopsys SpyGlass. This action shows the latest tool version for the Synopsys SpyGlass tool available in the MATLAB path.

8. To generate a report that uses the default settings, leave the Custom lint file box empty. MATLAB generates a SpyGlass lint script file with a .prj extension using default values. When you click Run This Task, the SpyGlass tool uses this script file to perform lint checks on the HDL code and generate an RTL lint check report.

To view the generated SpyGlass lint script and SpyGlass lint report, click the HTML links in the Result pane.

Selecting Synopsys SpyGlass Lint tool in HDL Workflow Advisor Task 3.3

This image shows the MATLAB generated script file, which uses lint_assurance as the goal name. The box shows the methodology path.

Generated script file with .prj extension in default workflow

This image shows the generated lint report after you perform the RTL lint checks on the generated HDL code. To view the complete lint report, click the HTML link in the Result pane.

Generated int report with .txt extension in default workflow

The image shows the folder hierarchy for the relevant files in this example. A dedicated folder is created for the SpyGlass script and report files.

Example folder structure

9. To generate a report using a custom lint file, enter a TCL or PRJ file in the Custom lint file box, or use the Add custom lint file button to select the custom lint file. Then, click Run This Task.

You can use create a custom lint script file by modifying the Methodology and Goal, Tag and Parameter, and Data Import sections in this sample script. To see the sample custom lint script, open led_counter_custom_spyglass_lint_script.tcl.

#!SPYGLASS_PROJECT_FILE #!VERSION U-2023.3-1

-------------------------------------------------------------------

Auto-generated project file for SpyGlass tools, from HDL Coder. Manual changes will be over written.

(C) 2012-2024 The Mathworks, Inc.

Generated by MATLAB 25.1, HDL Coder 25.1, and Simulink 25.1 on 25-Nov-2024 11:15:26

-------------------------------------------------------------------

##Application Variable set_app_var enable_lint true

##Methodology and Goal set met_path $::env(VC_STATIC_HOME)/auxx/monet/tcl/GuideWare/2022.06/block/initial_rtl/lint set goal_name lint_synth configure_lint_methodology -path metpath−goalmet_path -goal metpathgoalgoal_name

##Tag and Parameter configure_lint_setup -goal $goal_name set top led_counter

##Data Import Section read_file -top $top -format vhdl
-vcs {-f filelist}

Run Lint Check

check_lint

Report

report_lint -file report_lint.txt -verbose -limit 0 report_violations -app { setup design lint }

Save Session

save_session -session "my_session" -compression "gzip"

exit

HDL Coder validates the custom lint file and then the SpyGlass tool uses the script to perform the RTL lint check on the HDL code and generate the lint report. You can view the generate SpyGlass lint report file in the Result pane.

Selecting Custom lint file in HDL Workflow Advisor Task 3.3

The image shows the generated lint report after performing the RTL lint checks on the generated HDL code. You can view a copy of this report by opening led_counter_custom_spyglass_report_lint.txt.

Generated lint report in custom workflow

Additionally, you can generate a MATLAB® script to execute the HDL Workflow Advisor tasks from the MATLAB® command prompt by exporting the HDL Workflow Advisor settings to a script. In the HDL Workflow Advisor pane, navigate to File > Export to Script. In the Export Workflow Configuration dialog box, enter a file name and save the script.

See Also

Topics