相关阅读
Spyglasshttps://blog.csdn.net/weixin_45791458/category_12828934.html?spm=1001.2014.3001.5482
本文是对Spyglass Hands-on Training中第二个实验的翻译(有删改),Lab文件可以从以下链接获取。
实验二、在SpyGlass中进行完整的设计读取
实验二的目标是进行完整的设计读取,与实验一不同的是,将在命令行使用-batch选项以批处理模式运行SpyGlass(相同的操作也可以通过图形用户界面(GUI)完成)。
从源文件列表中进行读取
1、使用实验一中保存的项目文件wb_subsystem.prj,以批处理模式运行SpyGlass并进行设计读取。
% spyglass -project wb_subsystem.prj -designread -batch
与实验一类似,此时终端显示了以下的三个设计读取错误。
---------------------------------------------------------------------------------------------------
Results Summary:
---------------------------------------------------------------------------------------------------
Goal Run : Design_Read
Top Module : wb_subsystem
---------------------------------------------------------------------------------------------------
Reports Directory:
/home/zhangchen/Training_labs/spyglass/wb_subsystem/consolidated_reports/wb_subsystem_Design_Read/
SpyGlass LogFile:
/home/zhangchen/Training_labs/spyglass/wb_subsystem/wb_subsystem/Design_Read/spyglass.log
Standard Reports:
moresimple.rpt no_msg_reporting_rules.rpt
HTML report:
<Not Available>
Technology Reports:
<Not Available>
---------------------------------------------------------------------------------------------------
Goal Violation Summary:
Waived Messages: 0 Errors, 0 Warnings, 0 Infos
Reported Messages: 0 Fatals, 3 Errors, 0 Warnings, 3 Infos
---------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------
可以在以下路径查看设计读取报告,需要注意的是,由于目前使用了wb_subsystem.prj作为项目文件,应在项目目录wb_subsystem中寻找报告而不是实验一中的默认项目目录spyglass-1。
spyglass/wb_subsystem/wb_subsystem/Design_Read/spyglass_reports/moresimple.rpt
################################################################################
#
# This file has been generated by SpyGlass:
# Report Name : moresimple
# Report Created by: zhangchen
# Report Created on: Mon May 5 22:58:10 2025
# Working Directory: /home/zhangchen/Training_labs/spyglass
# SpyGlass Version : SpyGlass_vW-2024.09-SP1
# Policy Name : SpyGlass(SpyGlass_vW-2024.09-SP1)
# clock-reset(SpyGlass_vW-2024.09-SP1)
# morelint(SpyGlass_vW-2024.09-SP1)
# power_est(SpyGlass_vW-2024.09-SP1)
#
# Total Number of Generated Messages : 6
# Number of Waived Messages : 0
# Number of Reported Messages : 6
# Number of Overlimit Messages : 0
#
#
################################################################################
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MORESIMPLE REPORT:
############### BuiltIn -> RuleGroup=Blackbox Resolution ###############
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ID Rule Alias Severity File Line Wt Message
======================================================================================
[5] ErrorAnalyzeBBox ErrorAnalyzeBBox Error ../rtl/wb_subsystem.v 114 10 Design Unit 'wb_conmax_top' has no definition; black-box behavior assumed and module interface inferred
[4] ErrorAnalyzeBBox ErrorAnalyzeBBox Error ../rtl/wb_subsystem.v 271 10 Design Unit 'usbf_top' has no definition; black-box behavior assumed and module interface inferred
[3] ErrorAnalyzeBBox ErrorAnalyzeBBox Error ../rtl/wb_subsystem.v 314 10 Design Unit 'IMA_ADPCM_top' has no definition; black-box behavior assumed and module interface inferred
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
############### BuiltIn -> RuleGroup=Design Read ###############
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ID Rule Alias Severity File Line Wt Message
======================================================================================
[1] DetectTopDesignUnits DetectTopDesignUnits Info ../rtl/wb_subsystem.v 11 2 Module wb_subsystem is a top level design unit
[0] ElabSummary ElabSummary Info ./wb_subsystem/Design_Read/spyglass_reports/SpyGlass/elab_summary.rpt 0 2 Please refer file './wb_subsystem/Design_Read/spyglass_reports/SpyGlass/elab_summary.rpt' for elab summary report
[2] InferBlackBox inferblackbox Info N.A. 0 10 Interfaces for blackbox modules have been inferred. Please refer to AnalyzeBBox violations for more details
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
报告中的消息将按照以下规则排序。
- 严重性(Severity):从高到低排序(FATAL、Error、Warning、Info)
- 规则名(Rule):按字母顺序
- 文件名(File):按字母顺序
- 行号(Line):升序
如果设置以下选项,则还会考虑严重性标签(Severity Label)和规则权重(Wt)进行排序。
set_option report_style sort_sevlabel_wt
- 严重性标签 (Severity Label):按字母顺序
- 规则权重(Wt):降序
- 严重性(Severity):从高到低排序(FATAL、Error、Warning、Info)
- 规则名(Rule):按字母顺序
- 文件名(File):按字母顺序
- 行号(Line):升序
2、使用外部文本编辑器,检查以下usbf_top模块和wb_conmax_top模块的源文件列表。
rtl/usb/file.list
rtl/wb_conmax/file.list
将以下读取源文件列表的命令(就像VCS中的-f选项)添加到项目文件wb_subsystem.prj中的##Data Import Section节(为了提高可读性)。
read_file -type sourcelist ../rtl/usb/file.list
read_file -type sourcelist ../rtl/wb_conmax/file.list
3、重复第一步,进行设计读取。
4、从下面的读取报告中可以看出,usbf_top模块和wb_conmax_top模块的黑盒错误已经解决,但出现了一些新的黑盒错误,这些错误来自usbf_top模块中实例化的某些单元。
################################################################################
#
# This file has been generated by SpyGlass:
# Report Name : moresimple
# Report Created by: zhangchen
# Report Created on: Mon May 5 23:54:58 2025
# Working Directory: /home/zhangchen/Training_labs/spyglass
# SpyGlass Version : SpyGlass_vW-2024.09-SP1
# Policy Name : SpyGlass(SpyGlass_vW-2024.09-SP1)
# clock-reset(SpyGlass_vW-2024.09-SP1)
# morelint(SpyGlass_vW-2024.09-SP1)
# power_est(SpyGlass_vW-2024.09-SP1)
#
# Total Number of Generated Messages : 10
# Number of Waived Messages : 0
# Number of Reported Messages : 10
# Number of Overlimit Messages : 0
#
#
################################################################################
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MORESIMPLE REPORT:
############### BuiltIn -> RuleGroup=Blackbox Resolution ###############
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ID Rule Alias Severity File Line Wt Message
======================================================================================
[7] ErrorAnalyzeBBox ErrorAnalyzeBBox Error ../rtl/usb/usbf_top.v 348 10 Design Unit 'usbf_pl' has no definition; black-box behavior assumed and module interface inferred
[6] ErrorAnalyzeBBox ErrorAnalyzeBBox Error ../rtl/usb/usbf_top.v 399 10 Design Unit 'usbf_mem_arb' has no definition; black-box behavior assumed and module interface inferred
[8] ErrorAnalyzeBBox ErrorAnalyzeBBox Error ../rtl/usb/usbf_top.v 426 10 Design Unit 'usbf_rf' has no definition; black-box behavior assumed and module interface inferred
[9] ErrorAnalyzeBBox ErrorAnalyzeBBox Error ../rtl/usb/usbf_top.v 480 10 Design Unit 'usbf_wb' has no definition; black-box behavior assumed and module interface inferred
[5] ErrorAnalyzeBBox ErrorAnalyzeBBox Error ../rtl/wb_subsystem.v 314 10 Design Unit 'IMA_ADPCM_top' has no definition; black-box behavior assumed and module interface inferred
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
############### BuiltIn -> RuleGroup=Design Read ###############
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ID Rule Alias Severity File Line Wt Message
======================================================================================
[3] DetectTopDesignUnits DetectTopDesignUnits Info ../rtl/wb_subsystem.v 11 2 Module wb_subsystem is a top level design unit
[0] ELAB_3519 ElaborationWarning ../rtl/usb/usbf_top.v 348 1000 The register in the always block also gets elaborated as u1. That conflicts with the usbf_pl instance name
[1] ELAB_3519 ElaborationWarning ../rtl/usb/usbf_top.v 399 1000 The register in the always block also gets elaborated as u2. That conflicts with the usbf_mem_arb instance name
[2] ElabSummary ElabSummary Info ./wb_subsystem/wb_subsystem/Design_Read/spyglass_reports/SpyGlass/elab_summary.rpt 0 2 Please refer file './wb_subsystem/wb_subsystem/Design_Read/spyglass_reports/SpyGlass/elab_summary.rpt' for elab summary report
[4] InferBlackBox inferblackbox Info N.A. 0 10 Interfaces for blackbox modules have been inferred. Please refer to AnalyzeBBox violations for more details
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
查看rtl/usb目录下的内容,看看是否有遗漏的文件,可以看到目录中确实存在一个usb_lib子目录,但file.list文件中并没有使用y选项来指定该库目录(就像VCS中的-y选项)(当然将库目录中的所有文件全加入file.list也是可以的,但比较繁琐)。
5、将以下设置库目录和指定拓展名的命令添加到项目文件wb_subsystem.prj中的##Common Options Section节。
set_option y { ../rtl/usb/usb_lib }
set_option libext { .v }
将这些选项添加到file.list中效果相同,注意要在选项前添加横杠-。
-y { ../rtl/usb/usb_lib }
-libext { .v }
6、再次重复第一步,可以看出此时只存在最后一个黑盒错误。
################################################################################
#
# This file has been generated by SpyGlass:
# Report Name : moresimple
# Report Created by: zhangchen
# Report Created on: Tue May 6 00:13:02 2025
# Working Directory: /home/zhangchen/Training_labs/spyglass
# SpyGlass Version : SpyGlass_vW-2024.09-SP1
# Policy Name : SpyGlass(SpyGlass_vW-2024.09-SP1)
# clock-reset(SpyGlass_vW-2024.09-SP1)
# morelint(SpyGlass_vW-2024.09-SP1)
# power_est(SpyGlass_vW-2024.09-SP1)
#
# Total Number of Generated Messages : 4
# Number of Waived Messages : 0
# Number of Reported Messages : 4
# Number of Overlimit Messages : 0
#
#
################################################################################
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MORESIMPLE REPORT:
############### BuiltIn -> RuleGroup=Blackbox Resolution ###############
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ID Rule Alias Severity File Line Wt Message
======================================================================================
[3] ErrorAnalyzeBBox ErrorAnalyzeBBox Error ../rtl/wb_subsystem.v 314 10 Design Unit 'IMA_ADPCM_top' has no definition; black-box behavior assumed and module interface inferred
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
############### BuiltIn -> RuleGroup=Design Read ###############
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ID Rule Alias Severity File Line Wt Message
======================================================================================
[1] DetectTopDesignUnits DetectTopDesignUnits Info ../rtl/wb_subsystem.v 11 2 Module wb_subsystem is a top level design unit
[0] ElabSummary ElabSummary Info ./wb_subsystem/wb_subsystem/Design_Read/spyglass_reports/SpyGlass/elab_summary.rpt 0 2 Please refer file './wb_subsystem/wb_subsystem/Design_Read/spyglass_reports/SpyGlass/elab_summary.rpt' for elab summary report
[2] InferBlackBox inferblackbox Info N.A. 0 10 Interfaces for blackbox modules have been inferred. Please refer to AnalyzeBBox violations for more details
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
预编译库
1、预编译库就像VCS三步法中的逻辑库和Design Compiler中的设计库那样,首先将源文件进行预编译并保存在库中,在再次使用时便无需重复编译。
就像在VCS中使用synopsys_sim.setup文件和Design Compiler中使用define_design_lib命令进行库映射那样,SpyGlass使用libhdlfiles选项进行库内容的定义,使用lib选项进行库映射。
使用外部文本编辑器,检查以下IMA_ADPCM_top模块的源文件列表。
rtl/ima_adpcm/file.list
file.list文件内容如下所示。
-libhdlfiles ima_adpcm_lib "../rtl/ima_adpcm/IMA_ADPCM_Encode.vhd \
../rtl/ima_adpcm/IMA_adpcm_steptable_rom.vhd \
../rtl/ima_adpcm/WAV_header_rom.vhd \
../rtl/ima_adpcm/IMA_ADPCM_top.vhd"
-lib ima_adpcm_lib ./ima_adpcm_lib
最简单的做法是将以下读取源文件列表的命令添加到项目文件wb_subsystem.prj中的##Data Import Section节。
read_file -type sourcelist ../rtl/ima_adpcm/file.list
也可将以下设置库内容和库映射的命令添加到项目文件wb_subsystem.prj中的##Common Options Section节。
set_option libhdlfiles ima_adpcm_lib "../rtl/ima_adpcm/IMA_ADPCM_Encode.vhd \
../rtl/ima_adpcm/IMA_adpcm_steptable_rom.vhd \
../rtl/ima_adpcm/WAV_header_rom.vhd \
../rtl/ima_adpcm/IMA_ADPCM_top.vhd"
set_option lib ima_adpcm_lib ./ima_adpcm_lib
2、进行设计读取,可以发现所有错误都解决了,如下所示。
################################################################################
#
# This file has been generated by SpyGlass:
# Report Name : moresimple
# Report Created by: zhangchen
# Report Created on: Tue May 6 00:49:34 2025
# Working Directory: /home/zhangchen/Training_labs/spyglass
# SpyGlass Version : SpyGlass_vW-2024.09-SP1
# Policy Name : SpyGlass(SpyGlass_vW-2024.09-SP1)
# clock-reset(SpyGlass_vW-2024.09-SP1)
# morelint(SpyGlass_vW-2024.09-SP1)
# power_est(SpyGlass_vW-2024.09-SP1)
#
# Total Number of Generated Messages : 4
# Number of Waived Messages : 0
# Number of Reported Messages : 4
# Number of Overlimit Messages : 0
#
#
################################################################################
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MORESIMPLE REPORT:
############### BuiltIn -> RuleGroup=Command-line read ###############
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ID Rule Alias Severity File Line Wt Message
======================================================================================
[2] HdlLibDuCheck_01 HdlLibDuCheck_01 Warning N.A. 0 10 To run RTLDU/RTLDULIST/RTLALLDULIST/LEXICAL rules on precompiled designs set option 'hdllibdu'
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
############### BuiltIn -> RuleGroup=Design Read ###############
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ID Rule Alias Severity File Line Wt Message
======================================================================================
[1] DetectTopDesignUnits DetectTopDesignUnits Info ../rtl/wb_subsystem.v 11 2 Module wb_subsystem is a top level design unit
[3] SYNTH_5159 SynthesisWarning /home/zhangchen/Training_labs/rtl/ima_adpcm/IMA_ADPCM_top.vhd 226 1000 ima_adpcm_top -> Report Statements are not supported for synthesis
[0] ElabSummary ElabSummary Info ./wb_subsystem/wb_subsystem/Design_Read/spyglass_reports/SpyGlass/elab_summary.rpt 0 2 Please refer file './wb_subsystem/wb_subsystem/Design_Read/spyglass_reports/SpyGlass/elab_summary.rpt' for elab summary report
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++