目录
Spyglass CDC 之一:设计读入
因为平时makefile用的比较多,因此此流程给出了makefile和tcl脚本的使用流程。
Makefile
lint:
spyglass -tcl setup.tcl
clean:
rm -rf spyglass-1
rm -rf *.log
setup.tcl
// 加载rtl的Flist文件
read_file -type sourcelist ./flist.f
//加载sgdc文件
read_file -type sgdc ./XXX.sgdc
//如果sgdc文件里面还吃了sdc文件
set_option sdc2sgdc yes
//指定设计顶层,XXX为数字顶层的 top module 名
set_option top XXX
current_goal Design_Read -top XXX
//指定默认的waive文件 .awl 文件
read_file -type awl XXX.awl
set_option default_waiver_file XXX.awl
//其他一些参数设置
set_option enableV05 yes
set_option enableSV yes
link_design -force
......
flist.f
// Flist文件需要列出相关的宏定义
+define+XXX
//如果用了Foundry的cell,需要添加相关工艺的lib或者.v文件
-v /Foundry/TSMC/xxx/xxx.v
//添加相关的rtl文件的.v路径
./xxxxx.v
XXX.sgdc
//指定设计顶层,XXX为数字顶层的top module 名
current_design XXX
//相关端口和时钟、复位信号的申明
clock -name CLKA -period 10 -edge {0 5}
clock -name CLKB -period 100 -edge {0 50}
reset -name reset_a -value 0
reset -name reset_b -value 0
input -name {in_a xxx in_b xxx reset_a xxx} -clock clka
input -name {resetn_b xxx} -clock clka
output -name {dout xxx} -clock clkb
// 如果使用的sdc文件,需要吃sdc文件;一般添加了sdc文件,上述相关端口、时钟和复位信号就不需要另外约束了,sdc文件里面会包含相应的约束
sdc_data -file ./XXX.sdc
//有些约束命令的用法将在遇到相应的warning或者ERROR时给出使用方法
Spyglass CDC 之二:CDC流程
Spyglass CDC 界面
CDC的goals主要包括下面几点cdc_setup_check、clock_reset_integrity、cdc_verify_struct、cdc_verify、cdc_abstract 。
Goals | Summary |
---|---|
cdc_setup_check | 获得模块约束,例如clock,时钟域,reset,或其他的约束;检查设置的正确性和完整性 |
clock_reset_integrity | 修改时钟和复位的完整性问题 |
cdc_verify_struct | 使用子模块的抽象视图abstract view验证SoC |
cdc_verify | 验证所有的子模块。在Creating SpyGlass CDC setup中获得的输入约束,据定了子模块验证的质量。如果一个input在给定的时钟域,那么它应当输入给同样的时钟域,或在不同时钟域使用前进行同步。然而,在输出侧,类似时钟域的约束会被忽略,输出会在验证中自动识别,并生成抽象模型 |
cdc_abstract | 创建模块的 抽象视图 abstract view |
Spyglass CDC 之三:CDC不同流程的Warning、Error的解决方法(不断更新中…)
Clock_info01
报告可能是时钟信号的推断信号,Clock_info01规则将会报告设计中不同类型的时钟。
描述 | 时钟类型 |
---|---|
Primary inputs or undriven output pins of a library cell that have a defined clock attribute 普通输入时钟 | Primary Clocks |
Black box instances and instances of ASIC cells whose functional description is not available 黑盒(blackbox)或工艺库单元输出的时钟 | Black box clocks |
Outputs of flip-flops and instances of ASIC cells 寄存器或工艺库单元输出的时钟 | Derived Clocks |
Hanging nets, clocks derived from disabled latches and tristates 悬空的线或门控锁存器(门控未打开)输出的时钟 | Undrived Clocks |
Outputs of latches or tristate or combinational gates if the fan-in of the gate does not have a Primary, black box, Derived, or Undriven clock 除去以上情况,锁存器,三态器件或者组合逻辑输出的时钟 | Gated Clocks |
Example Code and/or Schematic
// 示例代码
module top (d, q, clk1, sr);
input [3:0]d;
input clk1, sr;
output [3:0]q;
reg [3:0]q;
reg clk3;
wire clk2, clk4, w1;
BB I1(clk1, clk2, w1);
always @(posedge clk1)
q[0] = d[0];
always @(negedge clk2)
q[1] = d[1];
always @(posedge clk3)
q[2] = d[2];
always @(posedge clk1)
if (sr==1)
clk3 = 0;
else
clk3 = ~clk3;
always @(posedge clk4)
q[3] = d[3];
endmodule
//clk1 是 Primary clock,clk2 是Black box clock
//clk3 是Derived Clock,clk4 是Undrived Clocks
Clock_info05b
Reports clock signals converging at a combinational gate other than a MUX。即报告门控时钟,非两个时钟mux的选择器。
Example Code and/or Schematic
Constraint
clock(Optional): Use this constraint to specify clock signals.
set_case_analysis(Optional): Use this constraint to specify case analysis conditions.
quasi_static(Optional): Specify this constraint on a clock signal to suppress the Clock_info05brule violation for the convergence using that clock signal.
glitchfree_cell: (Optional): Use this constraint to specify modules that must be ignored for reconvergence with mixed unateness glitch analysis.