一个简单的scenario脚本

本文记录了ICC实验中所需要用到的一个scenario脚本,脚本十分简单,仅作为学习练习使用。


1. 工程目录

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
./·········································工程根目录
|——用户.mw设计库
|——ref
| |——db··································物理/逻辑库(.db)
| |——design_data·························设计相关文件(.v .sdc .def .tdf)
| |——mw_lib······························mw库(宏单元、IO单元等)
| |——tech································工艺文件(.tf)
| |——tlup································TLU+模型(.tlup .map)
|
|——scripts
| |——scenario.tcl························本scenario脚本文件
|
|——.synopsys_dc.setup


2. 库和操作环境(PVT)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# 如何查看库
icc_shell> list_libs
Logical Libraries:
-------------------------------------------------------------------------
Library File Path
------- ---- ----
M smic18_ss_1p62v_125c smic18_ss_1p62v_125c.db <prj_path>/ref/db
m smic18_ff_1p98v_0c smic18_ff_1p98v_0c.db <prj_path>/ref/db
...
...
1

# 注意上文的Library, 即所对应的.db文件的库名
# 最大库: smic18_ss_1p62v_125c.db; 库名: smic18_ss_1p62v_125c
# 最小库: smic18_ff_1p98v_0c.db; 库名: smic18_ff_1p98v_0c

# 如何查看操作环境(PVT)
icc_shell> report_lib smic18_ss_1p62v_125c > smic18_ss_1p62v_125c.log
icc_shell> report_lib smic18_ff_1p98v_0c > smic18_ff_1p98v_0c.log

# 在./下面即可找到smic18_ss_1p62v_125c.log和smic18_ff_1p98v_0c.log, 打开
# smic18_ss_1p62v_125c.log部分内容如下:
****************************************
Report : library
Library: smic18_ss_1p62v_125c
Version: D-2010.03-ICC-SP5-2
Date : Tue May 3 20:09:59 2022
****************************************
...
...

Operating Conditions:


Operating Condition Name : ss_1p62v_125c
Library : smic18_ss_1p62v_125c
Process : 1.00
Temperature : 125.00
Voltage : 1.62
Interconnect Model : balanced_tree

Power Rails:
Rail Voltage Value
-------------------------
VDD 1.62
VSS 0.00
...
...
# smic18_ss_1p62v_125c.log部分内容如下:
****************************************
Report : library
Library: smic18_ff_1p98v_0c
Version: D-2010.03-ICC-SP5-2
Date : Tue May 3 20:11:05 2022
****************************************
...
...
Operating Conditions:


Operating Condition Name : ff_1p98v_0c
Library : smic18_ff_1p98v_0c
Process : 1.00
Temperature : 0.00
Voltage : 1.98
Interconnect Model : balanced_tree

Power Rails:
Rail Voltage Value
-------------------------
VDD 1.98
VSS 0.00
...
...

# 可以利用crtl+F查找"Operating Conditions"找到对应的操作环境(PVT)
# 根据上文可知, smic18_ss_1p62v_125c库【只有一个】操作环境(PVT):ss_1p62v_125c
# 同理, 可知smic18_ff_1p98v_0c【只有一个】操作环境(PVT):ff_1p98v_0c

3. scenario脚本编写

此处,设置4个scenario

即:func_ss_rcmax test_ss_rcmax func_ff_rcmin test_ff_rcmin

我们知道:

1
2
3
4
scenario = mode × delay corner = mode × PVT × RC corner
# mode(模式): 常见的有功能模式(正常工作模式)、扫描链模式(测试模式)
# PVT(工艺角):常见有ff、tt、ss
# RC corner(RC寄生参数延时模型):tlup模型, 有max.tlup和min.tlup

解释如下

  • func_ss_rcmax:功能模式、最差工艺角(PVT)ss、最大RC延迟max.tlup
  • test_ss_rcmax:扫描链模式、最差工艺角(PVT)ss、最大RC延迟max.tlup
  • func_ff_rcmin:功能模式、最好工艺角(PVT)ff、最小RC延迟min.tlup
  • test_ff_rcmin:扫描链模式、最好工艺角(PVT)ff、最小RC延迟min.tlup

脚本如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
remove_scenario -all
# 移除之前设置的所有的scenario

# scenario 1
create_scenario func_ss_rcmax
# scenario命名格式:mode_PVT_RC corner

set_scenario_options -setup true -hold false
# 用于CTS之前, CTS之前考虑hold time是没有意义的
#set_scenario_options -setup true -hold true
# 用于CTS之后, CTS之后需要考虑hold time

# 低端工艺, 如本文中的.18工艺, past_CTS只需要考虑hold time
# 而高端工艺, past_CTS需要考虑hold time和setup time
# 此处, 笔者在past_CTS阶段hold time和setup time均考虑了

# 设置.tlup和.map文件 -> RC corner
set_tlu_plus_files \
-max_tluplus ./ref/tlup/mcu_max.tluplus \
-min_tluplus ./ref/tlup/mcu_min.tluplus \
-tech2itf_map ./ref/tlup/SmicSPM8RR7R_018_mixRF_p1mt6_cell_1833.map

# 设置PVT, 也可在.sdc文件中设置
set_operating_conditions \
-analysis_type on_chip_variation \
-max ss_1p62v_125c \
-min ss_1p62v_125c \
-library smic18_ss_1p62v_125c

set_timing_derate -early 0.95
# 设置时钟比率, 此处涉及到OCV相关知识, 此处不展开讲
# 需要注意的是,不同的PVT有不同的设置:
# worst case corners(ss): 只能设置-early 0.95(<1, 具体数值看设计要求)
# best case corners(ff): 只能设置-late 1.05(>1, 具体数值看设计要求)
# type case corners(tt): 可以设置-early和-late

# 读入.sdc files -> constraints和mode
# .sdc文件中设置了对应的模式(功能/测试)
read_sdc ./ref/design_data/fdnoflash_scan.sdc
# func_mode.sdc的名字为fdnoflash_scan.sdc

# scenario 2
create_scenario test_ss_rcmax
set_scenario_options -setup true -hold false
#set_scenario_options -setup true -hold true

set_tlu_plus_files \
-max_tluplus ./ref/tlup/mcu_max.tluplus \
-min_tluplus ./ref/tlup/mcu_min.tluplus \
-tech2itf_map ./ref/tlup/SmicSPM8RR7R_018_mixRF_p1mt6_cell_1833.map

set_operating_conditions \
-analysis_type on_chip_variation \
-max ss_1p62v_125c \
-min ss_1p62v_125c \
-library smic18_ss_1p62v_125c
set_timing_derate -early 0.95

read_sdc ./ref/design_data/test_mode.sdc


# scenario 3
create_scenario func_ff_rcmin
set_scenario_options -setup true -hold false
#set_scenario_options -setup true -hold true

set_tlu_plus_files \
-max_tluplus ./ref/tlup/mcu_min.tluplus \
-tech2itf_map ./ref/tlup/SmicSPM8RR7R_018_mixRF_p1mt6_cell_1833.map

set_operating_conditions \
-analysis_type on_chip_variation \
-max ff_1p98v_0c \
-min ff_1p98v_0c \
-library smic18_ff_1p98v_0c
set_timing_derate -late 1.05

read_sdc ./ref/design_data/fdnoflash_scan.sdc


# scenario 4
create_scenario test_ff_rcmin
set_scenario_options -setup true -hold false
#set_scenario_options -setup true -hold true

set_tlu_plus_files \
-max_tluplus ./ref/tlup/mcu_min.tluplus \
-tech2itf_map ./ref/tlup/SmicSPM8RR7R_018_mixRF_p1mt6_cell_1833.map

set_operating_conditions \
-analysis_type on_chip_variation \
-max ff_1p98v_0c \
-min ff_1p98v_0c \
-library smic18_ff_1p98v_0c
set_timing_derate -late 1.05

read_sdc ./ref/design_data/test_mode.sdc


set_active_scenarios {func_ss_rcmax test_ss_rcmax func_ff_rcmin test_ff_rcmin}
# 激活所有设置的scenario
set_app_var timing_remove_clock_reconvergence_pessimism true
# 公共时钟路径不应用timing_derate, 公共路径如果应用, 则太悲观了
current_scenario func_ss_rcmax
# 设置当前的scenario为func_ss_rcmax

4. 应用

4.1 pre-CTS阶段

pre-CTS,即CTS之前的阶段,包括平面规划和布局设计等

在完成【.v文件的导入之后】即可执行

1
source ./scripts/scenario.tcl

接下来进行的所有操作和优化均会考虑到scenario.tcl中设置的4个scenario

4.2 post-CTS阶段

post-CTS,即CTS之后的阶段,包括CTS布线、布线设计等

在完成【clock_opt -only_cts -no_clock_route指令,且执行无误】即执行

1
source ./scripts/scenario.tcl

注意,此时的scenario.tcl中的set_scenario_options -setup true -hold false应该被注释,而set_scenario_options -setup true -hold true被激活,如下所示:

1
2
# set_scenario_options -setup true -hold false
set_scenario_options -setup true -hold true

本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!