【腳本篇】---spyglass lint腳本

目錄結構

在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述

sg_lint.tcl (頂層)

#1.source env
#date
set WORK_HOME .
set REPORT_PATH ${WORK_HOME}/reports
puts [clock format [clock second] -format "%Y-%m-%d %H:%M:%S"]
#2.generate source filelist
#3.set top module
puts "######### set top module #########"
source ${WORK_HOME}/scripts/set_top_module.tcl#4.set waiver
puts "######### set waiver file #########"
source ${WORK_HOME}/scripts/set_top_waiver.tcl#5.new project
puts "######### new project #########"
#new_project sg_lint -projectwdir ${WORK_HOME}/project/  -force
new_project sg_lint -force#6.read design file
puts "######### read design file #########"
read_file -type sourcelist ${WORK_HOME}/../02_flst/filelist.f#7.read waiver file
puts "######### read waiver file #########"
read_file -type awl $TOP_WAIVER_FILE#8.set common option and parameter
puts "######### set common option and parameter #########"
source ${WORK_HOME}/scripts/set_option_and_parameter.tcl#9.methodlogy and goal setup
puts "######### methodlogy and goal setup #########"
source ${WORK_HOME}/scripts/set_methodology_and_goal.tcl#10.set rules
puts "######### set rules #########"
source ${WORK_HOME}/scripts/set_sg_lint_rules.tcl#11.run goal
puts "######### run goal #########"
run_goal#12.analyze results
puts "######### analyze results #########"
write_report goal_summary > $REPORT_PATH/$TOP_MODULE/goal_summary.rpt
write_report goal_setup   > $REPORT_PATH/$TOP_MODULE/goal_setup.rpt
write_report moresimple   > $REPORT_PATH/$TOP_MODULE/moresimple.rpt
write_report summary      > $REPORT_PATH/$TOP_MODULE/summary.rpt
write_report waiver       > $REPORT_PATH/$TOP_MODULE/waiver.rptputs "$REPORT_PATH/$TOP_MODULE/goal_summary.rpt"
puts "$REPORT_PATH/$TOP_MODULE/goal_setup.rpt"
puts "$REPORT_PATH/$TOP_MODULE/moresimple.rpt"
puts "$REPORT_PATH/$TOP_MODULE/summary.rpt"
puts "$REPORT_PATH/$TOP_MODULE/waiver.rpt"#14.save & close project
puts "######### save & close project #########"
save_project  -force sg_lint.prj
close_project -force
#date
puts "######### Using follow command to open SG_Lint project #########"
puts "spyglass -project sg_lint.prj &"

set_methodology_and_goal.tcl

set METHODOLOGY_TYPE  initial_rtl
set GOAL_TYPE         mandatory
if { $METHODOLOGY_TYPE == "initial_rtl" } {current_methodology $env(SPYGLASS_HOME)/GuideWare2.0/block/initial_rtlset regression_mandatory_list {lint/lint_rtl adv_lint/adv_lint_struct}set regression_optional_list  {lint/design_audit lint/lint_functional_rtl}
} else {current_methodology $env(SPYGLASS_HOME)/GuideWare2.0/block/rtl_handoffset regression_mandatory_list {lint/lint_rtl adv_lint/adv_lint_verify}set regression_optional_list  {lint/lint_functional_rtl lint/abstract}
}
append regression_all_list {regression_mandatory_list} {regression_optional_list}if { $GOAL_TYPE == "mandatory" } {current_goal Group_Run -goal ${regression_mandatory_list} -top $TOP_MODULE
} elseif { $GOAL_TYPE == "optional" } {current_goal Group_Run -goal ${regression_optional_list} -top $TOP_MODULE
} else {current_goal Group_Run -goal ${regression_all_list} -top $TOP_MODULE
}
unset regression_all_list

set_option_and_parameter.tcl

#refer to 《SpyGlass_Explorer_UserGuide.pdf》
# ##################### set options #####################
#Use this design-read option to specify macro definitions in your Verilog analysis run.
set_option define {RD = 0}#Use this design-read option to specify a top-level module so that all design units instantiated directly 
#or indirectly under this module are included in the scope of SpyGlass analysis.
set_option top $TOP_MODULE#Use this design-read option to enable or disable SystemVerilog
#compatibility mode. By default, this option is disabled.
set_option enableSV yes#Use this command to enable parsing of SystemVerilog constructs.
#By default, SpyGlass reports SystemVerilog constructs as syntax errors.
set_option enableSV09 yes#Use this command to specify the operating language for the current SpyGlass run.
set_option language_mode mixed#Use this command to specify a default waiver file for saving interactive
#waiver commands. If you do not specify a default waiver file by using this command, SpyGlass
#Explorer considers the <project-wdir>/<project_name>.awl file as the default waiver file.
set_option default_waiver_file $TOP_WAIVER_FILE#Disables flattening during the compile_design command in the sg_shell.
#Also disables flattening while opening a project, if the project was closed with a flattened view.
set_option designread_disable_flatten no#The default value of the enable_save_restore option is yes.
#Use this design-read option to view built-in messages during the restore
#run that were reported during the save run.
set_option enable_save_restore no#Use this design-read option to translate design attributes from SDC format
#to SGDC format. These attributes are then used during SpyGlass analysis.
set_option sdc2sgdc no#Use this command to print the waived messages in the waiver report when
#the -ip argument of the waive constraint is specified. By default, only
#the count of waived messages is reported in the waiver report.
set_option report_ip_waiver yes#If you set the force_gateslib_autocompile command to yes to
#automatically compile gate libraries, any criteria for re-compilation of gate
#libraries is not evaluated. In such cases, the specified .lib files are always
#compiled and these files overwrite the existing .sglib file present in the
#cache directory.
set_option force_gateslib_autocompile yes# ##################### set parameters #####################
#Specifies whether the related rules check the bit_width as per LRM.
#By default, the nocheckoverflow rule parameter is set to no, and the affected rules do not check the bit-width as per LRM.
#Lint: W116, W164a, W164b, W164c, W486, W110, W263, W362
set_parameter nocheckoverflow no#(Optional) Causes the CombLoop rule to proceed from enable pin to Q (output) pin of a latch, while detecting the combinational loop.
#By default, the enableE2Q rule parameter is unset and the CombLoop rule does not traverse through latches for locating combination loops.
set_parameter enableE2Q yes#The default value is no. Set this parameter toyes to use the automatically-generated clock information.
#NOTE: This is the parameter of SpyGlass CDC solution
set_parameter use_inferred_clocks yes#Specifies whether the STARC02-2.10.3.7 rule reports a violation for hexal, octal, and decimal based 
#numbers if the width specified is greater than the actual bit-width of the based number.
#The STARC02-2.10.3.7 rule reports based numbers where the bit-width definition and specified value do not match.
#If the bit-width definition-part and the value part does not match like the examples below, it can easily lead to mistakes:
#a = 3'b11111111;
#a = 3'b11;
set_parameter ignore_based_width yes#Specifies whether the STARC-2.11.3.1 rule reports a violation for sequential block infer counter logic.
#By default, the value of the ignore_fsm_counter parameter is set to no and the STARC-2.11.3.1 rule reports a violation for sequential block infer 
#counter logic.Set the value of this parameter to yes to ignore violations for such cases.This parameter is only applicable for Verilog.
#STARC-2.11.3.1 : Ensure that the sequential and combinational parts of an FSM description should be in separate always blocks. (Verilog)
#Use this rule to report detect the sequential and combinational parts of an FSM that are in the same always or sequential blocks.
set_parameter ignore_fsm_counter yes#(Optional) Specifies the maximum number of logic levels beyond which the LogicDepth rule should flag an error message.
set_parameter delaymax 250#Enables the W164a, W164b, W116, and W362 rules to report a violation for static expressions and non-static expressions that contain static 
#expressions.By default, this parameter is set to no. In this case, the specified rules do not report a violation for static expressions and non-static #expressions that contain static expressions.
set_parameter check_static_value yes#Use this command to enable reporting of incremental messages so that you can compare results of a previously run goal with the current goal.
if { ![file exists ${WORK_HOME}/out/${TOP_MODULE}.vdb] } {set_goal_option report_incr_messages yes#Specifies path of previous Violation Database file for consideration in Incremental Modeset_goal_option old_vdbfile ${WORK_HOME}/out/${TOP_MODULE}.vdb
} else {set_goal_option report_incr_messages no
}

set_sg_lint_rules.tcl

# ########################### ignore rules ###########################
#The W446 rule flags output ports that are read in the module where they are set.
#Such models could lead to an unintended feedback path from the instantiating module in the post-synthesis simulation while this issue is not apparent 
#in the pre-synthesis simulation. Such models are also not recommended for some test tools that need to handle inout ports specially (by attaching 
#bus-holders, for example).
set_goal_option ignorerules {'W446'}#The W280 rule flags intra-assignment delays specified with nonblocking assignments.
#Such description is unlikely to correspond to the physical implementation. However, such description may be required to use a unit delay to avoid 
#race conditions in simulation.
set_goal_option ignorerules {'W280'}set_goal_option ignorerules {'W11'}#Use this rule to report unregistered output from a top module./ Use this rule to report output ports in a module that are not driven by a flip-flop.
set_goal_option ignorerules {'RegOutputs'}#The CheckDelayTimescale-ML rule reports a violation if a delay is used in a module and no timescale units are specified using the 'timescale compiler directive.
set_goal_option ignorerules {'checkDelayTimescale-ML'}#The LogNMux rule reports multiplexer constructs in which log of the number of select input pins is greater than the specified number, that is, the logmux_max value that is 3 by default. 
set_goal_option ignorerules {'LogNMux'}#The FlopDataConstant rule reports flip-flop instances for which the data pin is tied to a constant value.
set_goal_option ignorerules {'FlopDataConstant'}#The sim_race01 rule reports signals that are assigned and used within the same module in the same simulation cycle. 
#This rule detects signals that are in two always constructs in the same module or one always construct and one continuous 
#assignment statement in the same module.
set_goal_option ignorerules {'sim_race01'}#The ArrayIndex rule reports violation for the bus signals that are declared with the low-order bit first, 
#that is, it reports those multi-bit signals that do not follow the specified bit-order specification convention.
set_goal_option ignorerules {'ArrayIndex'}#The DisabledAnd rule reports AND or NAND gate instances for which at least one input is tied low. 
#Therefore, these gate instances are effectively disabled.
set_goal_option ignorerules {'DisabledAnd'}
#The DisabledOr rule reports OR or NOR type gate instances for which at least one input is tied high. 
#Therefore, these gate instances are effectively disabled.
set_goal_option ignorerules {'DisabledOr'}#The MuxSelConst rule reports the MUX gate instances for which the select pin is tied to a constant value.
set_goal_option ignorerules {'MuxSelConst'}#The DiffTimescaleUsed-ML rule flags different timescales used in the design.If different timescales are used in different modules of the design, 
#then in a single simulation, delay values in one module will be different from that of other module.
set_goal_option ignorerules {'DiffTimescaleUsed-ML'}#The LogicDepth rule reports logic paths, which originate or terminate at flip-flops or primary pins, 
#where the number of delay levels exceeds the specified value. This rule performs a simplified version of the critical path analysis.
set_goal_option ignorerules {'LogicDepth'}# ########################### change the rules' level ###########################
#The W210 rule flags a violation for module or interface instances with unconnected ports.
#The W210 rule flags message only when number of terminals are less than the number of ports. 
#The W210 rule ignores ports that are intentionally kept open (by passing extra comma [Verilog] or by connecting them to open [VHDL]).
#If any of the unconnected ports are inputs or inouts, this is an error. It may or may not be an error if the unconnected ports are outputs.
set_option overloadrules W210+severity=Error#The W287a rule flags module or gate instances where nets connected to input ports are not driven and the instance input which are not connected.
set_option overloadrules W287a+severity=Error#The W480 rule reports violation for those for constructs in which the loop index variable evaluates to a non-integer.
set_option overloadrules W480+severity=Error#The W213 rule reports PLI tasks and functions used in the design.
set_option overloadrules W213+severity=Error#Reports constant assignments that are X-extended
set_option overloadrules W342+severity=Error#The STARC05-1.3.1.3 rule reports violation for asynchronous reset/preset signals that are used as non-reset/preset signals or as synchronous reset/preset signals.
set_option overloadrules STARC05-1.3.1.3+severity=Error#The STARC05-2.1.4.5 rule reports violation for logical operators that are used on vector operands.
#No violation is reported for logical negation on integer variables.
set_option overloadrules STARC05-2.1.4.5+severity=Error#Bit-width of operands of a logical operator must match. (Verilog)
#The STARC05-2.10.3.2a rule flags bit-width mismatches between operand expressions of logical operations.
#Bit-width mismatch between operands of a logical operation may lead to incorrect results.
#The STARC05-2.10.3.2a rule does not flag a relational operation if an integer constant is used as one of the operands and the width of that constant is less than or equal to the width of the other operand.
set_option overloadrules STARC05-2.10.3.2a+severity=Error#Do not mix descriptions of flip-flops with asynchronous reset and flip-flops without asynchronous reset in the same process/always block
#The STARC05-2.3.6.1 rule flags those always or process constructs that have a flip-flop description with a reset line and another flip-flop description without a reset line.
#The STARC05-2.3.6.1 rule does not report violation for hanging flip-flops.
#Mixing the descriptions of flip-flops with and without reset lines in the same always or process construct has the following issues:
#Such description may be confusing and difficult to debug
#Such description may also cause problems for synthesis tools.
set_option overloadrules STARC05-2.3.6.1+severity=Error#The IntReset rule reports internally generated asynchronous resets in the design.
set_option overloadrules IntReset+severity=Error#The DisallowCaseX-ML rule reports violation for casex constructs used in the design.
set_option overloadrules DisallowCaseX-ML+severity=Error#The W443 rule flags based numbers that contain the unknown value character (X).
#The unknown value character (X) has no physical counterpart and may lead to a mismatch between pre- and post-synthesis simulation.
#By default, the W443 rule does not check the presence of X value in the default statement of the case construct in Verilog designs. 
#Use the strict rule parameter to check in the default statement also.
#For Verilog, no rule checking is done for unused macro definitions and unused parameters.
set_option overloadrules W443+severity=Error#A signal is included in the sensitivity list of a combinational always block but none of its bits are read in that block (Verilog)
#The W456a rule flags signals that are in the sensitivity list of a combinational always construct but are never read in the construct.
set_option overloadrules W456a+severity=Error#Do not connect buses in reverse order
#The W156 rule flags reverse connected buses.
#Making reversed connections (for example, 15:0 connected to 0:15) is legal but bad design practice and may represent an error.
#One exception (which can be handled with a waiver) is in making a big-endian/little-endian choice in connecting to a processor bus port.
set_option overloadrules W156+severity=Error#Reports a case expression width that does not match case select expression width
#The W263 rule reports the case clause labels whose widths do not match the width of the corresponding case construct selector.
set_option overloadrules W263+severity=Error

set_top_module.tcl

#get top module from environment
if { [info exist $env(TOP_MODULE)] } {set TOP_MODULE $env(TOP_MODULE)
} else {set TOP_MODULE async_fifo_mem
}
puts "TOP_MODULE = $TOP_MODULE"

set_top_waiver.tcl

#set top waiver file
set TOP_WAIVER_FILE ${WORK_HOME}/waiver/${TOP_MODULE}.awl
if { ![file exists $TOP_WAIVER_FILE] } {exec touch $TOP_WAIVER_FILE
} 

執行腳本

1、cd /home/xxx/chip/eda_test
2、source SourceMe
3、cd 03_lint
4、sg_shell < scripts/sg_lint.tcl | tee sg_lint_screen.log
5、spyglass -project sg_lint &

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/bicheng/16098.shtml
繁體地址,請注明出處:http://hk.pswp.cn/bicheng/16098.shtml
英文地址,請注明出處:http://en.pswp.cn/bicheng/16098.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

qt-C++筆記之QThread使用

qt-C筆記之QThread使用 ——2024-05-26 下午 code review! 參考博文&#xff1a; qt-C筆記之使用QtConcurrent異步地執行槽函數中的內容&#xff0c;使其不阻塞主界面 qt-C筆記之QThread使用 文章目錄 qt-C筆記之QThread使用一:Qt中幾種多線程方法1.1. 使用 QThread 和 Lambda…

ubuntu server 24.04 網絡 SSH等基礎配置

1 安裝參考上一篇: VMware Workstation 虛擬機安裝 ubuntu 24.04 server 詳細教程 服務器安裝圖形化界面-CSDN博客 2 網絡配置 #安裝 sudo apt install net-tools#查看 ifconfig #修改網絡配置 sudo vim /etc/netplan/50-cloud-init.yaml network:version: 2ethernets:en…

課時136:變量進階_變量實踐_高級賦值

2 變量進階 2.1 變量實踐 2.1.1 高級賦值 學習目標 這一節&#xff0c;我們從 基礎知識、簡單實踐、小結 三個方面來學習 基礎知識 簡介 所謂的高級賦值&#xff0c;是另外的一種變量值獲取方法&#xff0c;這里涉及到更多我們學習之外的一些shell內置變量格式,其實這部分…

飛雞:從小訓練飛行的雞能飛行嗎?為什么野雞能飛嗎?是同一品種嗎?今天自由思考

雞的飛行能力在很大程度上受到其生理結構的限制。盡管雞有翅膀&#xff0c;但與能夠長時間飛行的鳥類相比&#xff0c;雞的翅膀相對較小&#xff0c;且胸部肌肉較弱。再加上雞的身體較重&#xff0c;這些因素共同限制了雞的飛行能力。通常&#xff0c;雞只能進行短暫的、低空的…

【wiki知識庫】01.wiki知識庫前后端項目搭建(SpringBoot+Vue3)

&#x1f4dd;個人主頁&#xff1a;哈__ 期待您的關注 &#x1f33c;環境準備 想要搭建自己的wiki知識庫&#xff0c;要提前搭建好自己的開發環境&#xff0c;后端我使用的是SpringBoot&#xff0c;前端使用的是Vue3&#xff0c;采用前后端分離的技術實現。同時使用了Mysql數…

C++ vector,dequeu,list容器中元素的引用失效問題

文章目錄 一、std::list不會產生引用失效問題二、std::vector中元素引用失效問題三、std::deque中元素引用失效問題 一、std::list不會產生引用失效問題 在C中&#xff0c;std::list&#xff08;雙向鏈表&#xff09;提供了一種非常靈活的容器類型&#xff0c;其設計使其在插入…

微信小程序的事件對象屬性,事件綁定

微信小程序 小程序簡介 1 小程序與普通網頁開發的區別&#xff1f; 1運行環境的不同&#xff1a;網頁運行在瀏覽器&#xff0c;小程序運行在微信環境&#xff1b; 2.API 不同&#xff1a;小程序無法調用 DOM 和 BOM 的 API&#xff0c;但可以調用微信環境提供的 API&#xff1…

單工無線發射接收系統

1 緒論 隨著無線電技術的發展,通訊方式也從傳統的有線通訊逐漸轉向無線通訊。由于傳統的有線傳輸系統有配線的問題,較不便利,而無線通訊具有成本廉價、建設工程周期短、適應性好、擴展性好、設備維護容易實現等特點,故未來通訊方式將向無線傳輸系統方向發展。同時,實現系…

mfc140.dll丟失原因和mfc140.dll丟失修復辦法分享

mfc140.dll是與微軟基礎類庫&#xff08;Microsoft Foundation Classes, MFC&#xff09;緊密相關的動態鏈接庫&#xff08;DLL&#xff09;文件。MFC是微軟為C開發者設計的一個應用程序框架&#xff0c;用于簡化Windows應用程序的開發工作。以下是mfc140.dll文件的一些關鍵屬性…

棧的實現(C語言)

文章目錄 前言1.棧的概念及結構2.棧的實現3.具體操作3.1.初始化棧(StackInit)和銷毀棧(StackDestory)3.2.入棧(StackPush)和出棧(StackPop)3.3.獲得棧的個數(StackSize)、獲得棧頂元素(StackTop)以及判空(StackEmpty) 前言 前段時間我們學習過了鏈表和順序表等相關操作&#x…

go-zero 實戰(4)

中間件 在 userapi 項目中引入中間件。go項目中的中間可以處理請求之前和之后的邏輯。 1. 在 userapi/internal目錄先創建 middlewares目錄&#xff0c;并創建 user.go文件 package middlewaresimport ("github.com/zeromicro/go-zero/core/logx""net/http&q…

經濟寒冬下的黃金跳板:方案、活動、競標一手掌握

推薦策劃人必備的寶藏地產策劃資源平臺&#xff0c; 訂閱浩叫&#xff1a;地產營銷策劃圈。這個平臺簡直是地產策劃人的百寶箱&#xff0c;里面藏著無數的策劃秘籍&#xff0c;等著你來挖掘。 這個平臺就像是一個大型的方案庫&#xff0c;里面收錄了眾多知名地產企業的內部資料…

leetcode:計數質數

class Solution { public:// 如果 x 是質數&#xff0c;那么大于 x 的 x 的倍數 2x,3x… 一定不是質數int countPrimes(int n) {vector<int> isPrime(n, 1);int ans 0;for (int i 2; i < n; i) {if (isPrime[i]) {ans 1;if ((long long)i * i < n) {for (int j …

leetcode-55 跳躍游戲

leetcode Problem: 55. 跳躍游戲 思路 假設我們是一個小人&#xff0c;從第一個下標開始&#xff0c;每次經過一個位置&#xff0c;我們就可以根據當前位置的數值nums[i]和位置下標i計算出該位置所能到達的后續位置的最大值rnums[i]i。而這個r之前的區域一定都是可以經過的。…

AI 談“潯川AI翻譯機”

在天工AI&#xff0c;天工AI在全網搜索“潯川AI翻譯機”。 1 創作助手談“潯川AI翻譯機”&#xff1a; “潯川AI翻譯機”是一個利用人工智能技術進行語言翻譯的設備或應用程序。它可以將一種語言的文字或口語翻譯成另一種語言&#xff0c;以實現不同語言之間的溝通和理解。潯…

08. Redis 緩存穿透和雪崩

文章目錄 1. 緩存穿透&#xff08;查不到導致的&#xff09;1.1 概念1.2 解決方案布隆過濾器緩存空對象 2. 緩存擊穿&#xff08;量太大、緩存過期&#xff09;2.1 概念2.2 解決方案設置熱點數據永不過期加互斥鎖 3. 緩存雪崩&#xff08;緩存集體失效或 Redis 宕機&#xff09…

說一下你對dom驅動和數據驅動的理解

DOM驅動和數據驅動是前端開發中兩種常見的操作方式&#xff0c;尤其在構建用戶界面時。下面&#xff0c;我將分別解釋這兩種驅動方式&#xff0c;并提供詳細的代碼示例。 DOM驅動 DOM驅動的核心思想是直接操作DOM元素來更新用戶界面。在早期的Web開發中&#xff0c;這種方式非…

Linux指令初識

ls:顯示當前目錄底下的指定文件或目錄 ls -l更詳細的信息 ls -a顯示當前目錄下的所有文件 命令中的選項可以一次傳遞多個 ,例如&#xff1a;ls -al 命令和選項有必須一個或多個空格 以.開頭的文件&#xff0c;為隱藏文件ls -a可以看到,ls -l看不見 支持命令拼在一起&#…

牛客熱題:滑動窗口的最大值

&#x1f4df;作者主頁&#xff1a;慢熱的陜西人 &#x1f334;專欄鏈接&#xff1a;力扣刷題日記 &#x1f4e3;歡迎各位大佬&#x1f44d;點贊&#x1f525;關注&#x1f693;收藏&#xff0c;&#x1f349;留言 文章目錄 牛客熱題&#xff1a;滑動窗口的最大值題目鏈接方法一…

DNS服務的部署與配置(2)

1、dns的安裝及開啟 dnf install bind.x86_64 -y #安裝 #Berkeley Internet Name Domain (BIND) systemctl enable --now named #啟用dns服務&#xff0c;服務名稱叫named firewall-cmd --permanent --add-servicedns #火墻設置 firewall-cmd --reload …