2023年11月27日发(作者:)

利用DC进行综合设计

(2012-03-25 17:45:10)

转载

标签:

dc

综合

杂谈

DC的综合术语用于设计的ASICEDA工具往往是一套很复杂的软件,包括大量的工具和文档。同

时,每个公司都有自己的一套术...

一、预备知识

1.1DC的综合术语

用于设计的ASICEDA工具往往是一套很复杂的软件,包括大量的工具和文档。同时,

每个公司都有自己的一套术语。只有理解了这些术语的含义才能很好的掌握这些工艺。

1 设计和设计对象

设计是实现一定逻辑功能的电路的描述。

设计对象就是在设计中被DC命令、属性和约束操作或控制的对象。常用的设计中包括元件、

网络、端口、引脚和时钟。另外,一个设计可能包括某个相同子设计或库元件的多个例化。

这时候被例化的设计或库元件称作参考。

在一个设计中查找某个对象的命令:find,这是在DC命令中很常用的命令。如:

列出当前设计的所有端口(ports:Dc_shell>findport OR find(port,*)

列出所有包含DW字母的元件:dc_shell>find (cell,*DW*)

列出cba_core库中的AN2门的所有接脚:dc_shell>find(pin,cba_core/AN2

Read format vhdl ./src/rtl/timer_

Read format vhdl ./src/rtl/test_

Check_error v

If(dc_shell_status= =1){exit 1}

Current_design test_top

Link

Check_error v

If(dc_shell_status= =1){exit 1}

Sh date;

Current_design test_top

Write format db hierarchy output pass0/db/test_

Write format verilog hierarchy output pass0/db/test_top.v

Write format vhdl hierarchy output pass0/db/test_

Report_timing> pass0/report/test_

Report_area> pass0/report/test_

Report_constraints> pass0/report/test_

Report_qor> pass0/report/test_

Report_constraintsall_violatorsverbose>pass0/report/test_

quit

脚本文件可以使用任何一个文本编辑工具产生或修改,也可以在dc_shell中执行write_scirpt

命令产生。如,下面的命令就是将设计的属性和约束等信息保存到名为的脚本文件。

Dc_shell>write_>

脚本文件的语法应该符合dc_shell命令的语法。DC提供了一个语法检查工具和一个上下文

检查工具,他们可以检查脚本文件的语法和脚本文件的错误,并提供相应的错误信息。

语法检查工具检查脚本文件的语法,但是不执行其中的命令。语法检查实现的功能包括:

查预先定义的命令参数是否正确,检查必须的参数是否存在、文件重定向问题、检查引用文

件中的命令的语法、按照dc_shell正常的使用方式执行赋值。要使用语法检查,我们必须对

该功能进行使能,此后每次引用或执行脚本前就会首先进行语法检查。在dc_shell中使能语

法检查功能的方法如下:

Dc_shell>syntax_check true

Syntax check on.

上下文检查工具检查上下文的错误。在执行一个脚本文件前,我们应该对其进行上下文检查。

上下文检查在检查每个命令的语法的同时,还会读入设计、检查设计和库文件是否有效、

件设法齐全等。其执行具体的功能包括:检查设计对象和属性的合法性,检查用户定义的属

性,检查变量是否存在,检查条件语句的条件,检查循环语句,读入需要读入的文件,根据

命令重定向文件,检查库和库对象。要使用上下文检查,我们必须对该功能进行使能,此后

每次引用或执行脚本文件前就会进行上下文检查。使能命令如下。

Dc_shell>context_check true

Context check on.

最后,脚本文件的执行是比较简单的,可以通过两种方法:

dc_shell中,应该使用include命令执行脚本文,include

在启动dc_shell时,可以使用-f选项执行脚本文件,dc_shell f

在执行脚本前,如果我们激活了脚本语法检查和上下文检查,那么就会先进行相应的检查。

二、准备HDL文件

输入DC的文件通常是HDL文件,HDL的代码质量将直接影响综合的效果,因此在编码中

必须考虑设计数据管理、设计划分和HDL代码的风格

2.1、数据文件管理

首先,由于综合过程中需要大量的数据和多种文件,因此数据的管理就显得非常重要。这种

管理通常设计两个部分,设计数据控制和数据组织。控制设计数据主要是控制数据的创建、

维护、覆盖和删除等。这和软件工程中的版本控制是基本一致的。在DC中对于不同类型的

的文件,一般有约定的扩展名。在控制数据的同时还必须注意对数据合理有效的组织,一般,

在使用DC综合的时候,我们都会使用层次化的目录结构来存放数据文件。相对于不同的综

合策略,我们也有两种不同的目录结构。

可以看出,在应用自顶向下的综合策略时,由于综合是从顶层模块开始一次到各个模块,

以只需要一个综合目录。而自底向上的综合则现对各个模块进行综合,因此可能有多个综合

目录。

2.2、设计划分

对设计的合理划分可以改善综合的结果,减少操作的时间,简化约束文件和脚本文件。划分

直接影响设计中模块的大小,如果模块太小,相当于人为的制造了一个界限,将限制DC

效的进行优化。另一方面,如果划分的模块太大,则会增加综合消耗的时间。

在划分的时候还要考虑设计的重用性,主要应该注意以下几点:详细定义并记录设计的接口,

尽可能使接口标准化,编写参数化的代码。

通常,我们设计的划分一般使用以下策略:

1)将相关的组合逻辑划分在一起

2)消除胶连逻辑

3)模块的输出都应该使用寄存器

4)按照设计目标进行划分

按照编译技术划分,将设计中使用不同编译技术的部分划分到不同的模块。特别使当设计中

既有高度结构化的逻辑(ALU),又有随机逻辑时,应当将他们分开。因为对于结构化的

逻辑应该使用结构化编译,而对随机逻辑,应该使用扁平化的编译。

可以将共享的资源划分到一起

将用户定义的资源和他们驱动的逻辑划分到一起,用户定义的资源包括用户定义的函数、

程、宏单元和designware元件。DC对于这些资源无法自动实现共享和复制。因此,将他们

和它们所驱动的逻辑放在一起,我们就可以手工的插入多个元件来增大驱动能力。

把顶层逻辑分成至少3级,将一些特殊的功能独立出来,如管脚、时钟、边界扫描和异步逻

辑等。

如下图所示,一般情况下,设计的最顶层是I/O管脚。下一层包括边界扫描、时钟处理、异

步逻辑和核心逻辑。增加这一层是为了I/O管脚例化的灵活性.将时钟处理独立出来是为了对

这部分进行详细的分析仿真。将异步逻辑独立出来是为了可测性和静态时序分析的问题限制

在一个比较小的范围之内。

设计划分的方法分为HDL划分和DC中的划分。HDL的划分就是根据上面一些原则通过

HDL代码对设计进行划分。而DC中的划分是在DC中通过使用专门的命令,改变HDL

的划分和层次的结构。DC中提供了两个与此相关的命令:group,ungroup

三、确定设计库

综合之前必须设定链接库、目标库、符号库和综合库。连接和目标库属于工艺库,它们定义

了半导体生产厂的工艺元件和其它信息。符号库定义用于design vision design analyzer

的元件的符号表示

确定这些库是使用DC进行综合的前提条件,因此我们必须掌握DC中库的命令的使用,以

便DC可以正确的使用库中的数据。

3.1、工艺库

工艺库包括描述每个单元的功能和特性的信息。工艺库由半导体厂商提供和维护。

元件库包括元件名称、元件接脚名称、面积、时延信息、接脚负载。同时工艺库还定义了实

现设计功能必须满足的条件。这些条件也可以称作设计规则约束。除此之外,工艺库还确定

了工艺的工作条件和线载模型。

工艺库在DC中有下面一些用途:

1)实现设计的功能,在dc综合过程中要将设计映射到某个工艺库,他们称作目标库。目

标库包括了所有用于生产网表的元件以及设计工作条件的定义。

2解析元件参考,在dc中用于解析元件参考的工艺库称为链接库。链接库中除了工艺库

外还可能包括设计文件。

3)计算时延和路径延时,链接库还定义了用于计算时延值和路径延时的时延模型

4)计算消耗的功率

3.2、设置库变量

在使用dc综合之前我们必须对库进行设置。具体的方法是使用dc_shell中的变量来确定各

种库。变量和库文件的定义见下表

在确定库的位置的时候,我们可以使用完整的路径也可以只用文件名。如果只确定了文件名,

DC会在search_path变量确定的搜索路径中查找这个文件。

在设置工艺库和链接库的时候要注意:链接库包括了工艺库和设计文件。因此,link_library

变量的值是工艺库加上一个星号*,表示链接时,DC既搜索工艺库,也搜索调入内存中的

设计文件。

除了设置库变量,DC还支持各种对库的操作,如:读入和保存库,列出使用的库,显示库

的内容,确定库的对象甚至直接对库对象进行操作。如下为一个工艺库的例子:

Cell(AND2 3)//元件名称

(area:8.000;//元件面积

Pin(Y)(direction :output;

Timing()(

Related_pin:”A”;

Timing_sence:positive_unate;

Rise_propagation(drive_3 table_1)(values(“0.2626,0.2607…..”)) //接脚延时

Fall_progpagation(drive_3_table_3)(values(“0.1316,0.1331….”))

)

……..

)

Timing()(related_pin:”B”;

……………..

)

:”A&B”;//接脚的功能描述

Max_capatiance:0.00220

Min_capatiance:0.00220 //输出引脚的设计规则

)

Pin(A)(direction:input;

Capacitance:0.012000;)

Pin(B)(direction:input;//输入引脚的电器特性

Capacitance:0.010000;)

)

四、DC对设计的一些操作

4.1、读入文件

下表列出了DC支持的所有文件类型

对于设计文件,可以使用两种方法读入。使用read_file命令或使用analyzeelaborate命令。

这两种方法有一些区别。简单的说,前一种适用于各种类型的文件,而后一种主要用于综合

VHDLverilog文件。但是使用后者有一些特殊的功能。具体说来,analyze的功能包括读

HDL源文件,检查错误,产生独立于HDL的中间类型的HDL库对象,存储中间文件。

如果一个设计执行的analyze命令,只需要在这个设计改变之后再执行该操作。Elaborate

令根据analyze产生的中间文件产生一个与工艺无关的设计。这个操作还将HDL中的算术操

作用于DESIGN WARE 库中的元件替代,同时确定总线的宽度。

当设计读入内存之后,它将转换为synopsys内部数据库的格式。DC之后的综合优化过程都

是对内存中的设计执行的。

1)链接

对于一个完整的设计,必须把所有的库元件和他们对应的设计参考链接起来。对于每一个设

计,还必须有一个参考来衔接子设计和链接库。这一过程称为链接设计或参考解析。换句话

说,链接就是要在链接库中找到设计中使用的所有元件和子设计,保证设计的完整。如果不

能正确的链接,则无法进行以后的综合等操作。

DC通过一下步骤完成参考解析:首先,它确定哪个库元件和子设计在当前的设计中被使用。

然后,它在链接库中定位这些参考。最后,把定位好的参考和设计链接起来。如图。

链接的操作可以自动进行,也可以手工完成。当使用一些DC命令,如compile时会自动进

行链接。如果需要,也可以使用link命令进行手工链接。

2)对设计和设计对象的操作

这些操作时DC中的一些基本操作,和其它EDA软件中的操作类似,如生成新设计、拷贝

设计、重新命名等。其中比较重要的有以下几种:

设置当前设计。在DC中,我们应当注意当前设计的概念,因为大多数的命令都是针对当前

设计进行的。一般说来,如果成功的读入了一个设计之后,这个设计就会作为当前设计。另

外,如果指定了一个当前设计,可以使用current_design命令。

列出设计和设计对象。使用list_designs命令来列出内存中的设计,其中带*为当前设计。

下表也列出了显示设计对象信息的一些命令。

改变设计的层次,在DC中我们可以改变HDL所描述的设计层次关系。首先,使用

report_hierarchy命令可以显示设计当前的层次关系。然后,使用group可以将一些元件或子

设计组合起来,增加一个逻辑层次。或使用ungroup名去掉一个逻辑层次。

编辑设计,使用下表列出的命令可以对设计对象进行编辑,如生成,删除等。

Creat_cell 生成一个元件

Remove_cell删除一个元件

Create_net生成一个网络

Connect_net 连接一个网络

Disconnect_net 断开一个网络

Remove_net 删除一个网络

Create_port 生成一个端口

Remove_port 删除一个端口

Create_bus生成一个总线

Remove_bus 删除一个总线

4.2、属性的处理

属性描述了设计数据库中对象逻辑的电气、物理和其它特性。一个属性通常都是附加给一个

设计对象并存储于设计数据库中。

DC中,我们可以设置和使用以下一些对象的属性

整个设计

设计对象,如时钟,网络和端口

设计中的子设计或元件的例化

工艺库,库元件

属性有自己的名称、类型和值。属性一般有以下几种类型:串、数或是逻辑。属性可以

DC预设的,这些属性可以被DC识别;也可以是用户定义的。一些属性是只读的,其值

DC设置,用户无法修改,另一些是用户可以自己修改的。

例如,我们经常使用dout_touch属性,它可以付给网络,单元,端口或设计。而当我们需

要设置这个属性的时候,需要专门的命令:set_dont_touch

而对于一般的属性,可以使用命令set_attribute来设置。

Design Compiler 综合脚本常用命令和模板

(2012-03-25 17:47:12)

转载

标签: 分类: 微电子

dc

综合

script

杂谈

参照自己的设计,以及自己的工艺信息,适当修改下面的Constraints Run Script 等的脚本,添

加一些相关的约束语句,就可以运行了详细...

参照自己的设计,以及自己的工艺信息,适当修改下面的Constraints Run Script 等的脚

本,添加一些相关的约束语句,就可以运行了

详细的命令请参照DC的官方User Guide等相关资料

Invoking Design Compiler

Unix% design_vision # Interactive GUI, WLM mode

Unix% design_vision topographical # Interactive GUI, Topographical mode

Unix% dc_shell-t # Interactive shell, WLM mode

Unix% dc_shell-t topographical # Interactive shell, Topographical mode

Unix% dc_shell-t f | tee i # Batch mode

.synopsys_

set search_path “$search_path libs cons unmapped rtl”

set synthetic_library dw_

set target_library

set link_library “* $target_library $synthetic_library ”

set symbol_library

define_design_lib WORK path ./work

set_svf

set_vsdc

history keep 200

set sh_enable_page_mode false

set cache_write .

set cache_read $cache_write

suppress_message {LINT-28 LINT-32 LINT-33 UID-401}

set alib_library_analysis_path [get_unix_variable HOME]

alias h history

alias rc “report_constraint -all_violators”

TCL Commands and Constructs

set PER 2.0 # Define a variable and its value

echo $PER # Variable substitution à 2.0

set MARG 0.95

expr $PER * $MARG # expr: *, /, +, -, >, <, =, <=, >=

set pci_ports [get_ports A] # Imbedded command

set pci_ports [get_ports “Y??M Z*”] # Wildcards

echo “Effctv P = # Soft quotes à 1.9

[expr $PERIOD * $MARGIN]”

echo {Effctv P = # Hard quotes

set_max_area 0

create_clock -period 2 name Main_Clk [get_ports Clk1]

create_clock period 2.5 waveform {2 3.5} [get_ports Clk2]

create_clock period 3.5 name V_Clk; # VIRTUAL clock

set_clock_uncertainty setup 0.14 [get_clocks *]

set_clock_uncertainty setup 0.21 from [get_clocks Main_Clk] to [get_clocks Clk2]

set_clock_latency max 0.6 [get_clocks Main_Clk]

set_clock_latency source max 0.3 [get_clocks Main_Clk]

set_clock_transition 0.08 [get_clocks Main_Clk]

set_input_delay -max 0.6 -clock Main_Clk [all_inputs]

set_input_delay max 0.3 clock Clk2 clock_fall –add_delay [get_ports “B E”]

set_input_delay -max 0.5 -clock –network_latency_included V_Clk [get_ports “A C F”]

set_output_delay -max 0.8 -clock source_latency_included Main_Clk [all_outputs]

set_output_delay -max 1.1 -clock V_Clk [get_ports “OUT2 OUT7]

set_max_capacitance 1.2 [all_inputs]

set_load 0.080 [all_outputs]

set_load [expr [load_of slow_proc/NAND2_3/A] * 4] [get_ports OUT3]

set_load 0.12 [all_inputs]

set_input_transition 0.12 [remove_from_collection [all_inputs][get_ports B]]

set_driving_cell lib_cell FD1 pin Q [get_ports B]

set_operating_conditions max WCCOM

set auto_wire_load_selection false

set_wire_load_model name 1.6MGates

set_wire_load_mode enclosed

set_wire_load_model name 200KGates [get_designs “SUB1 SUB2”]

set_wire_load_model name 3.2MGates [get_ports IN_A]

set_port_fanout_number 8 [get_ports IN_A]

set_false_path -from [get_clocks Asynch_CLKA] -to [get_clocks Asynch_CLKB]

set_multicycle_path setup 4 from from A_reg -through U_Mult/Out to B_reg

set_multicycle_path hold 3 from from A_reg -through U_Mult/Out to B_reg

set_isolate_ports type inverter [all_outputs]

set_ideal_network [get_ports reset* select*]

set_ideal_network [get_pins FF_SET_reg/Q]

set_ideal_network no_propagate [get_nets CTRL]

set_ideal_latency 1.4 [get_ports reset* select*]

set_ideal_transition 0.5 [get_pins FF_SET_reg/Q]

set_scan_configuration -style

Checking and Removing Constraints and Directives

report_clock; report_clock -skew

report_design

report_port verbose

report_wire_load

report_path_groups

report_timing_requirements (ignored)

report_auto_ungroup

report_isolate_ports

write_script output <>

check_timing

reset_path from FF1_reg

remove_clock

remove_clock_transition

remove_clock_uncertainty

# resource-sharing info

report_resources

# List area for all cells in the design

report_cell [get_cells hier *]

Run Script

read_verilog {A.v B.v TOP.v} or

read_vhdl { } or

read_ddc MY_ or

acs_read_hdl MY_TOP or

analyze format verilog {A.v B.v TOP.v}

elaborate MY_TOP –parameters “A_WIDTH=8, B_WIDTH=16”

current_design MY_TOP

link

if {[check_design] ==0} {

echo “Check Design Error”

exit # Exits DC if a check-design error is encountered

} # Continue if NO problems encountered

write f ddc hier out unmappedd/

redirect tee file reports/ {source echo -verbose }

redirect append tee file reports/ {check_timing}

source or # Source tcl constraints, if available, or

extract_physical_constraints # Extract and apply from an existing

# DEF floorplan file

group_path -name CLK1 -critical_range <10% of CLK1 Period> weight 5

group_path -name CLK2 -critical_range <10% of CLK2 Period> weight 2

group_path name INPUTS from [all_inputs]

group_path name OUTPUTS to [all_outputs]

group_path name COMBO from [all_inputs] to [all_outputs]

set_fix_multiple_port_nets all buffer_constants

*********************************************************

* *

* Insert Expert, Ultra or ACS compile flow here *

* *

*********************************************************

check_design

report_constraint all_violators

report_timing delay to from through input_pins max_paths

nworst nets cap sig group

report_area

report_qor

set verilogout_no_tri true

change_names rule verilog hier

write f verilog hier out mapped/TOP.v

write f ddc hier out mapped/

write_sdc

write_scan_def out TOP_

write_physical_constraints output TOP_

exit

Object Retrieval and Manipulation (Collection Commands)

get_ports, get_pins, get_designs

get_cells, get_nets, get_clocks

get_nets of_objects [get_pins FF1_reg/Q]

get_libs

get_lib_cells

get_lib_pins

all_inputs, all_outputs, all_clocks, all_registers

all_connected

all_fanin, all_fanout

all_ideal_nets

set pci_ports [get_ports pci_*]

echo $pci_ports # à _sel184

query_objects $pci_ports # à {pci_1 pci_2 ...}

get_object_name $pci_ports # à pci_1 pci_2 ...

sizeof_collection $pci_ports # à 37

set pci_ports [add_to_collection $pci_ports

[get_ports CTRL*]]

set all_inputs_except_clk [remove_from_collection

[all_inputs] [get_ports CLK]]

compare_collections

index_collection

sort_collection

get_cells * -filter “dont_touch == true”

get_clocks * -filter “period < 10”

# List all cell attributes and redirect output to a file

redirect file cell_attr

{list_attributes application class cell}

# Grep the file for cell attributes starting with dont_

UNIX% grep dont_ cell_attr | more

# List the value of the attribute dont_touch

get_attribute dont_touch

Ultra Compile Flow - Topographical or WLM Mode

Ultra + DesignWare and DFTC licenses available

# In “topo” mode (dc_shell-t topo) specify Milkyway reference and design libraries

create_mw_lib tech -mw_reference_library

open_mw_lib

set_tlu_plus_files -max_tluplus -tech2itf_map

set compile_auto_ungroup_delay_num_cells 99999999

set compile_auto_ungroup_count_leaf_cells true

set compile_auto_ungroup_override_wlm true

set_ungroup false

# OPTIONAL: Disable unconditional auto-ungrouping

# of DesignWare hierarchy (not usually recommended)

set compile_ultra_ungroup_dw false

# If design contains pipelined sub-designs and the pipeline registers

# are grouped together at the input or output, relax timing

set_multicycle_path setup <#_stages> -from U_Pipeline/R3_reg* to U_Pipeline/R7_reg*

# In “ topo” mode, if the floorplan is available, apply or extract the physical constraints

source OR

extract_physical_constraints

# OPTIONAL: Exclude specific cells/design from adaptive retiming (-retime)

set_dont_retime true

# First compile

set_optimize_registers true design My_Pipeline_Subdesign

optimize_registers only_attributed_designs

# Continue if design is NOT meeting all constraints:

# Apply more focus on violating critical paths, as necessary

group_path name -from -to

critical range <10% of max delay goal> -weight 5

# Select appropriate second compile

# In “topo” mode in DC v2006.06, or any mode in DC v2007.03 or later

compile_ultra scan incremental

# In “WLM” mode in DC v2006.06

set_ultra_optimization true

compile boundary scan map_effort high incremental (-area_effort medium|low|none)

# In “topo” mode prior to DC v2007.03: Write out updated physical constraints

write_physical_constraints output

DFT Flow Expert or Ultra

DFTC license available

# Prior to the first compile set the

# scan cell style

set_scan_configuration style ..

# Perform the first test-ready compile

compile boundary map high scan # OR

compile_ultra timing -scan

# Continue before the next compile:

# Read in the scan specification file

source scan_

# Check for DFT rule violations

dft_drc

# Preview the scan chains

preview_dft

# Insert and optimize scan

insert_dft

******************************************************

* *

* Execute additional Ultra/Expert optimization *

* techniques, as needed *

* *

******************************************************

# and write out the scan DEF file

dft_drc coverage_estimate

write_scan_def -out

Some Scan Specification Commands

set_scan_state test_ready

set_dft_configuration ...

set_dft_signal ...

set_scan_path ...

set_scan_configuration ...

create_test_protocol

Expert Compile Flow

No Ultra license available; DFTC license available

compile boundary scan map_effort high

# Continue if NOT meeting constraints

# Note: -scan requires DFTC license

compile boundary scan map_effort high incremental

(-area_effort medium|low|none)

# Continue if NOT meeting constraints:

# Increase max-delay priority if OK to postpone DRC fixing

set_cost_priority delay

# Note: The design hierarchy may have changed due to auto-

# uniquifying

# Apply more focus on violating critical paths, as necessary

group_path name -from

-to critical range <10% of max delay goal> -weight 5

“Pseudo Ultra” Compile Flow

Ultra license available; No DesignWare license available

set compile_auto_ungroup_delay_num_cells 99999999

set compile_auto_ungroup_area_num_cells 99999999

set compile_auto_ungroup_count_leaf_cells true

set compile_auto_ungroup_override_wlm true

set_ungroup false

# OPTIONAL: Disable unconditional auto-ungrouping

# of DesignWare hierarchy (not usually recommended)

set compile_ultra_ungroup_dw false

# If design contains pipelined sub-designs and the pipeline registers

# are grouped together at the input or output, relax timing

set_multicycle_path setup <#_stages>

-from U_Pipeline/R3_reg* to U_Pipeline/R7_reg*

# Enable Ultra optimizations available for compile

set_ultra_optimization no_auto_dwlib true

set hlo_disable_datapath_optimization true

set compile_slack_driven_buffering true

compile boundary scan map_effort high auto_ungroup delay|area (-area_effort

medium|low|none)

# Note: The design hierarchy may have changed due to auto-

# ungrouping and auto-uniquifying

reset_path -from U_Pipeline/R3_reg* -to U_Pipeline/R7_reg*

# OPTIONAL: Maintain registered pipeline outputs if required

set_dont_touch [get_cells U_Pipeline/R12_reg*] true

# Optimize registers if pipeline violates timing; Skip if no pipeline issues:

set_optimize_registers true design My_Pipeline_Subdesign

optimize_registers only_attributed_designs

# Continue if design is NOT meeting all constraints:

compile boundary scan map_effort high incremental (-area_effort medium|low|none)

# Continue if NOT meeting all constraints:

set_cost_priority delay

# Ungroup DesignWare components amid combinational logic

ungroup

# Apply more focus on violating critical paths, as necessary

group_path name -from -to

critical range <10% of max delay goal> -weight 5

compile boundary scan map_effort high incremental (-area_effort medium|low|none)

DC脚本示例及解释

(2012-03-25 17:48:31)

转载

标签: 分类: 微电子

dc

综合

script

杂谈

#script for Design Compiler

# Language : TCL

# Usage :

# 1) make sure the lib in the current directory

# 2) if you have the file .synopsys_,

# set synopsys_dc_setup_file 1,

# if not, set synopsys_dc_setup_file 0

# 3) change Step 3 : Variables to what you want

# Especially : top module name, clock name,

# reset name, all files name, and period

# 4) typing dc_shell-t -f run_ | tee -i

#

#=====================================================

===

set synopsys_dc_setup_file 0

/home/chanshi/dc/script]

set target_library {}

#set target_library {CSM35OS142_};

# if you want use typical library,change to

#set link_library [list {*} ram_interp_typical_ ram_458_typical_ ]

set link_library [list {*} $target_library]

}

#set symbol_library { }

#set synthetic_library {dw_};

# Design Ware

set command_log_file ""

#-----------------------------------------------------

# Step 2 :

# Compile Swithes

#-----------------------------------------------------

#set verilogout_no_tri true ;

# if inout used, tri net will be used

#通过将三态(tri)逻辑声明成线网(wire)来确保网表中不会出现三态逻辑,因为一些布

线工具很难读取包含tritran源语、assign语句的网表,对于“inout”类型的port,DC产生

tri wire 语句和tran 源语,对于tri,还会产生assign语句

set test_default_scan_style multiplexed_flip_flop

#设置扫描链的类型,还可以通过set_scan_configuration -style来设置

set link_force_case case_insensitive

#设置link命令是否区分大小写,默认是check_reference,就是根据产生reference的模块

格式来判断是否大小写敏感,如果是vhdl格式就是不敏感,如果是verilog就敏感

define_name_rules VLSI_NET -allowed "a-zA-Z0-9_" -first_restricted "0-9_" -type net

-max_length 256

define_name_rules VLSI_CELL -allowed "a-zA-Z0-9_" -first_restricted "0-9_" -type cell

-max_length 256

define_name_rules VLSI_PORT -allowed "a-zA-Z0-9_" -first_restricted "0-9_" -type port

-max_length 256

define_name_rules TAN_RULE -allowed "a-zA-Z0-9_" -first_restricted "0-9_[]"

-max_length 256 -map {{{"*cell*", "mycell"}, {"*-return", "myreturn"}}};

set hdlin_check_no_latch "true"

#设置如果推断出锁存器,是否报warning,默认是false,即不报。

set hdlin_merge_nested_conditional_statements "true"

#顾名思义,是否把嵌套的if融合,默认值是false,就是对于嵌套的条件语句(ifcase

语句)中的每一个ifcase都推断出一个选择器,这种做法有利于把某些迟到的条件判断

信号(late arriving signals)安排到离输出最近的选择器上(进而有利于减小延迟),如果

设成true就会把这些选择器融合成一个大的选择器,这样所有的选择信号到输出的距离都

是相同的

#-----------------------------------------------------

# Step 3 :

# Define Variables

#-----------------------------------------------------

set active_design "whole_modules";

# Top module name

source ;

# All RTL source_files (verilog)

set clock_name "clk";

# Name of clock

set reset_name "reset";

# Name of reset

set clk_period 70.0

#设置时钟周期,注意带小数点,这样计算出的值都带小数点,不然小于1的数都显示为0

# Desired Clock Period = 1000/Frequence

set clk_uncertainty_setup [expr $clk_period/200];

#设置时钟不确定性,这里只设置了相对于建立时间的不确定性,就是时钟上升沿有可能提

clk_uncertainty_setup时钟偏差和时钟抖动之和)到来,dc要提前clk_uncertainty_setup

检查建立时间是否满足

# Uncertainty of clock

set clk_latency [expr $clk_period/10];

#设置时钟延迟,是时钟信号从其实际时钟原点到设计中时钟定义点的传输时间

# Network Latency of clock

#reg1+combo1--------combo2_input+reg2+combo2_output-----------combo3+reg3

的模型来解释input_delayoutput_delay,中间的combo2_input+reg2+combo2_output

是要综合的模块

set input_delay [expr $clk_period/4];

#设置输入延迟,设置一个外部输入(组合逻辑combo1)用了多少时间(即从时钟上升沿

到输入数据到来经历的延迟),dc计算还有多少时间留给内部组合逻辑combo2_input,例

如时钟周期为10nsinput_delay4ns则还有6-tsu留给内部组合逻辑combo2_input

# Input Delay of all input ports except clock

set output_delay [expr $clk_period/4];

#设置输出延迟,设置一个外部输出(组合逻辑combo3)用了多少时间(即外部组合逻辑

的延迟),dc计算有多少时间留给内部组合逻辑combo2_output,例如时钟周期为10ns

output_delay4ns,则还有(6-Tclk2Q)留给内部组合逻辑combo2_output

# Output Delay of all output ports

set area_desired 0;

#设置面积的期望值,用于set_max_area

set wire_load_model "smic18_wl20";

#为了精确地计算设置线载模型(DC支持三种模式:

以此来决定如何选择用于跨层次边界的网线的线载模型)用于计算时序路径的延迟,用于

set_wire_load_model

# Model of the intra net

set output_load "typical/NAND2BX1/AN" ;

#为了精确地计算输出电路的时间,需要设置端口负载(输出或输入的外部电容负载),就

是为所有输出端口指定一个负载,综合时dc就会认为这里有一个这样的负载(并不是说综

合时在这里强制添加一个电容),dc综合时就会选择满足这个负载的器件,例如假设已经

知道某输出端口要驱动的是一个反相器,那么把输出负载设置成这个反相器的输入负载即可,

当然可以设置成很大,这样dc就会用驱动能力很大的器件,来满足所有单元被驱动。这个

指令的作用是在布图前综合过程中设置模块输出端口的容性负载和往连线上反标注布图后

提取的电容信息,这里选取某一器件的某一引脚的负载作为output load,也就是dc认为所

有输出端口要达到能驱动这个引脚

# model of the output_load

set synthesis_reports {/home/chanshi/dc/report};

#指定综合报告的输出目录

#name of report directory

sh mkdir $synthesis_reports;

set timing_report "$synthesis_reports/$active_design_"

set timing_max20_report "$synthesis_reports/$active_design_timing_"

set area_report "$synthesis_reports/$active_design_"

set references_report "$synthesis_reports/$active_design_"

set cell_report "$synthesis_reports/$active_design_"

set constraint_report "$synthesis_reports/$active_design_"

set power_report "$synthesis_reports/$active_design_"

set check_syntax_report "$synthesis_reports/$active_design_check_"

set synthesis_netlist {/home/chanshi/dc/result};

#指定网表和sdf/sdc/db文件输出目录,dc不支持生成db文件

#name of outfile directory

sh mkdir $synthesis_netlist;

#创建目录

set out_netlist "$synthesis_netlist/$active_design.v";

set out_db "$synthesis_netlist/$active_";

set out_sdf "$synthesis_netlist/$active_";

set out_sdc "$synthesis_netlist/$active_";

#-----------------------------------------------------

# Step 4 :

# Read design to DC Memory

#-----------------------------------------------------

foreach active_files $files {read_verilog $active_files}

#foreach语句,$files是一个文件列表,把列表里的每一个文件轮流赋值给active_files,然

后对active_files执行read_verilog函数,就相当于轮流对每一个文件执行read_verilog

#exit

current_design $active_design

#设置当前设计

link

#把当前设计中实例化引用的单元链接到当前设计(即读取link_library指定的库到当前设计)

uniquify

#为每一个例化单元起一个单独的名字(是对于某个模块多次引用的情况)

#check_design > $check_syntax_report

#if {[check_design] == 0} {

# echo "Check Design Error!";

# exit;

# }

#-----------------------------------------------------

# Step 5 :

# Constraint

#-----------------------------------------------------

#-----Net load------

set_wire_load_model -name $wire_load_model

#设置线载模型

set_wire_load_mode top

#设置线载模式(top:所有层次中所有连线将继承和顶层模块同样的线载模型,因为顶层

电路规模最大,所以连线延迟最大,线载模型最悲观;enclosed:选择连线所在的子模块的

线载模型,子模块电路规模较顶层要小,连线延迟较短;segmented:不常用,用于跨层次

边界的连线)

#-----clock------

create_clock -name $clock_name -period [expr $clk_period] [get_ports $clock_name]

#设置时钟

set_clock_uncertainty -setup $clk_uncertainty_setup [get_clocks $clock_name]

#设置时钟不确定性

set_clock_latency $clk_latency [get_clocks $clock_name]

#设置时钟延迟

set_dont_touch_network [get_clocks $clock_name]

#在优化过程中对时钟网络不进行改变和替换,原因:由于时钟端口的负载很大,DC 会使用

Buffer 来增加其驱动能力。但一般设计者都使用布局布线工具来完成此项工作,所以有必要

指示 DC 不要对时钟网络进行修改,可以选中上图中“Don’t touch network”进行设置。

set_dont_touch_network [get_ports $reset_name]

#在优化过程中对复位信号不进行改变和替换

set_ideal_network [get_ports $reset_name]

#reset设置成理想线网,因为resetfanout太大,一般布图前都设置成理想线网,具

体原因有待研究#-----drive------

#set_driving_cell -lib_cell xr02d2 -pin A1 -library CSM35OS142_typ [all_inputs]

set_driving_cell -lib_cell NAND2BX1 -pin Y [all_inputs]

#为所有输入端口(除去时钟和复位)设置驱动模型,从而指定了驱动强度和转换时间

set_drive 0 [get_ports $clock_name]

#将时钟驱动能力设为无穷大,即将其阻抗设为 0

set_drive 0 [get_ports $reset_name]

#同上

#-----input/output delay------

set allin_except_CLK [remove_from_collection [all_inputs] [get_ports clk]]

set_input_delay [expr $input_delay] -clock $clock_name $allin_except_CLK

#设置输入延时

set_output_delay [expr $output_delay] -clock $clock_name [all_outputs]

#设置输出延时

#-----Output load------

set_load [load_of $output_load] [all_outputs]

#设置所有输出端口的负载

#----- Area ------

#set_max_area $area_desired

#----- insert buffer replace assign ------

set_fix_multiple_port_nets -all -buffer_constants

#如果一个线网连接着多个端口,则在网表中会出现assign语句,这是一种错误,为避免这

种错误,要消除多端口连线,可以通过插入buffer来消除(具体见《专用集成电路设计实

用教程》p146

#-----------------------------------------------------

#-----------------------------------------------------

remove_unconnected_ports [get_cells -hier {*}]

change_names -hierarchy -rules TAN_RULE

report_timing -delay max -max_paths 1 > $timing_report

report_timing -delay max -path end -max_path 80 > $timing_max20_report

report_area > $area_report

report_reference > $references_report

report_cell [get_cells -hier *] > $cell_report

report_constraint -all_violators -verbose > $constraint_report

report_power -analysis_effort high -verbose > $power_report

check_design > $check_syntax_report

#-----------------------------------------------------

create_clock -name clk -period 4 [get_ports clk]

set_dont_touch_network [get_clocks clk]

set_fix_hold [get_clocks clk]

set_clock_uncertainty 0.1 [get_clocks clk]

set_clock_latency -source 0 [get_clocks clk]

set_clock_latency 1 [get_clocks clk]

#set_input_transition 0.5 [all_inputs]

#set_clock_transition 0.2 [all_clocks]

#Setting Design Environment

set_operating_conditions -min BCCOM -max WCCOM

set_wire_load_model -name G5K -library fsd0a_a_generic_core_wc

set_wire_load_mode top

set_driving_cell -library fsd0a_a_generic_core_wc -lib_cell BUFX4 -pin {O} [get_ports clk]

set_driving_cell -library fsd0a_a_generic_core_wc -lib_cell DFFX1 -pin

{Q} [remove_from_collection [all_inputs] [get_ports clk]]

set_load [load_of "fsd0a_a_generic_core_wc/DFFX1/D"] [all_outputs]

set_input_delay -max 1 -clock clk [all_inputs]

set_input_delay -min 0.2 -clock clk [all_inputs]

set_output_delay -max 1 -clock clk [all_outputs]

set_output_delay -min 0.1 -clock clk [all_outputs]

#Setting DRC Constraint

set_max_area 0

set_max_fanout 2 [all_inputs]

set_max_transition 0.3 [all_inputs]

#Solve Multiple Instance

uniquify