DC综合教程

更新时间:2023-10-18 09:27:01 阅读量: 综合文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

启动dc的三种方法: DCSH: dc_shell TCL: dc_shell-t //注意:-t前没有空格 图形化界面: design_vision

tip1. 综合主要包括三个阶段:转换(translation)、优化 (optimization)与映射(mapping)。

1. 转换阶段:综合工具将高层语言描述的电路用门级的逻辑来实现,对于 Synopsys 的综合工具 DC 来说,就是使用 gtech.db库中的门级单元来组成 HDL 语言描述的电路,从而构成初始的未优化的电路。

2. 优化与映射:是综合工具对已有的初始电路进行分析,去掉电路中的冗余单元,并对不满足限制条件的路径进行优化, 然后将优化之后的电路映射到由制造商提供的工艺库上。 tip2

DesignWare 是集成在 DC综合环境中的可重用电路的集合

DesignWare 分为 DesignWare Basic 与 DesignWare Foundation,DesignWare Basic 提供基本的电路,DesignWare Foundation提供性能较高的电路结构。如果需要 Foundation的 DesignWare,需要在综合的时候设置synthetic_library3。

tip3 日志文件 Design Analyzer 在启动时自动在启动目录下面创建两个日志文件: command.log 和 view_command.log,用于记录用户在使用 Design Compiler 时所执行的命令以及设置的参数,

在运行过程中同时还产生filenames.log的文件,用于记录 design compiler访问过的目录,包括库、源文件等,filenames.log文件在退出 design compiler 时会被自动删除。启动 dc_shell时则只产生command.log 的日志文件。

tip4

Propagation Delay传播延时

Transition Time转变 延时

Setup Time建立时间

The setup time for a sequential cell is theminimumlength of time the data-inputsignal must remain stable before the active edge of the clock

Hold Time保持时间

The hold time for a sequential cell is the minimum length of time the data-inputsignal must remain stable after the active edge of the clock

脚本:

################################ # Read design file # //

read –format verilog[db、vhdl] file //dcsh的工作模式 read_db file.db //TCL工作模式读取 DB格式 read_verilog file.v //TCL工作模式读取verilog格式 read_vhdl file.vhd //TCL工作模式读取VHDL格式

//设定时钟

create_clock -name \ } { clk }

//输出文件

write -f verilog -out output/count.v //输出网表 write -f ddc -out output/count.ddc//综合数据文件 write_sdf mapped/count.sdf //标准延时文件

//综合

compile -map_effort medium -incremental_mapping

tip6设置设计环境Define the Design Environment

1. Defining the Operating Conditions设置操作环境 查看有哪些操作环境

dc_shell> read_file my_lib.db dc_shell> report_lib my_lib

指定操作环境

dc_shell> set_operating_conditions WCCOM -lib my_lib

2.设置线负载模型 set_wire_load_mode Top/Enclosed/Segmented set_wire_load_model \

3. Modeling the System Interface设置系统接口 The set_drive and set_input_transition Commands:

dc_shell> current_design top_level_design dc_shell> set_drive 1.5 {I1 I2}

dc_shell> current_design sub_design2

dc_shell> set_driving_cell -lib_cell IV {I3}

dc_shell> set_driving_cell -lib_cell AN2 -pin Z -from_pin B {I4} Defining Loads on Input and Output Ports Defining Fanout Loads on Output Ports

4. Setting Logic Constraints on Ports set_equal port1 port2 set_opposite set_logic_dc set_logic_one set_logic_zero set_unconnected

tip7设定 设计约束 When Design Compiler optimizes your design, it uses two types of constraints: Design rule constraints Optimization constraints

用于组成逻辑

1. Maximum Transition Time

dc_shell> set_max_transition 5 [current design]

2. Maximum Fanout You can set a maximum fanout constraint on every driving pin and input port as follows:

dc_shell> set_max_fanout 8 [get_designs ADDER] 计算Fanout值:

Maximum Fanout>=Total Fanout Load

注意:取出某些约束用:

dc_shell> remove_attribute [get_designs adder] max_transition dc_shell> remove_attribute [get_ports port_name] max_fanout dc_shell> remove_attribute [get_designs design_name]max_fanout dc_shell> remove_attribute port_name fanout_load

3. The set_fanout_load command sets the expected fanout load value for listed output ports.

To find the fanout load on the input pin of library cell AND2 in library libA, enter dc_shell> get_attribute \

To find the default fanout load set on technology library libA, enter dc_shell> get_attribute libA default_fanout_load

用于综合时 里边可以连接的扇出数量用于综合出可以驱动的最大扇出的引脚set_max_fanoutset_fanout_loadset_max_fanout

4. Maximum Capacitance

Maximum capacitance is a design rule constraint. It is set as a pin-level attribute that defines the maximum total capacitive load that an output pin can drive. That is, the pin cannot connect to a net that has a total capacitance greater than or equal to the maximum capacitance defined at the pin. dc_shell> set_max_capacitance 3 [get_designs adder] 5. Minimum Capacitance The min_capacitance design rule specifies the minimum load a cell can drive. 设计规则的优先权 1. Minimum capacitance 2. Maximum transition 3. Maximum fanout

4. Maximum capacitance 5. Cell degradation

tip8设定优化约束Optimization Constraints

Timing Constraints 对于同步pashs create_clock

set_input_delay set_output_delay

对于异步pashs set_max_delay set_min_delay Maximum Area dc_shell> set_max_area 0.0

dc_shell> set_max_area 14.0 Managing Constraint Priorities set_cost_priority [-default] [-delay] cost_list

Reporting Constraints:

dc_shell >report_constraint

写脚本

tip9:在终端中启动DC用脚本综合

dc_shell-t -f ./scripts/seg_drive.tcl > 1

将报告写入1文件

tip10:设计中有多个模块时,如果用top_down策略,则在脚本中得把所有的模块读入:

set active_design seg_drive //注意:相等于一个宏定义,用active_design代替seg_drive read_verilog {encode_seg.v number_mod.v scan.v seg_drive.v} //read_file也可以,它可以读多种格式文件,包括.db

#analyze -format verilog {encode_seg.v number_mod.v scan.v seg_drive.v}

#elaborate $active_design //注意这里是$active_design

current_design $active_design //将顶层设置成当前设计 link

//read_verilog命令与 后面的analyze、elaborate功能相同,可以选择其中一个;参看 《ASIC综合与DC使用》:

set_svf ./mapped/svf/$active_design.svf //没查

###############################################1 # Define the Design Environment

#1

###############################################1

13Modeling the System Interface设置系统接口2

1)

set_operating_conditions slow //设定一个库的环境,库内包含使用温度、电压、电路特征线

宽等

2)set_wire_load_model –name model_name –lib_name library –max –min//设定线负载模型

set_wire_load_model -name tsmc090_wl40 -library slow //表示使用库slow里的

tsmc090_wl40线模型

如果没有 wire_load_model,可以将 auto_wire_load_selection 参数设置为 true,则 DC 自动根据综合之后的面积来选择一个统计的线负载模型用于估计连线延迟。 set auto_wire_load_selection true

set_wire_load_mode enclosed //跨模块线负载模式选择

3)Modeling the System Interface设置系统接口

输出端:设置set_load

由于外部电路的负载将会影响到接到端口上单元电路的延迟(这里设置的是电容值),因此, 需要对端口的带负载能力做限制。为了比较精确地计算输出电路的延迟, DC需要知道输出电路驱动的所有负载。参看p144

参看@@Design Compiler User Guide 2010.03 p44

如:set_load [load_of ssc_core_slow/buf1a2/A] [all_outputs]

set_load [expr 4*[load_of DICE_DELAY_DFF_RN_slow/DICE_DELAY_DFF_RN/D]] [all_outputs]

输入端:设置set_driving_cell

set_driving_cell -lib_cell DICE_DELAY_DFF_RN -pin Q –library DICE_DELAY_DFF_RN_slow [all_inputs]

set_drive 0 [list clk_62_5M rst_n] //参见Design Compiler User Guide 2010.03.pdf 144页

为了更加精确的估计输入电路的延迟, DC需要知道信号到达输入端

口的过渡时间(transition time) 。set_drive 使用一个确定的值来估计输入端的输入电阻,

从而得到输入端口的延迟;而 set_driving_cell 是假定一个实际的驱动单元来估计输入的 transtion time:Time = arrive_time + drive*net_load +connect_delay dc_shell> current_design top_level_design dc_shell> set_drive 1.5 {I1 I2}

dc_shell> current_design sub_design2 //注意切换当前设计 dc_shell> set_driving_cell -lib_cell IV {I3}

dc_shell> set_driving_cell -lib_cell AN2 -pin Z -from_pin B {I4}

################################### # Design constraint

#

###################################

Design rule constraints

1.

set_max_transition 1.8 [current_design] 2.

set_max_fanout 10 [current_design] 3.

set_max_capacitance //用于设置输出单元允许的电容负载。 4. set_min_capacitance

transition time是指电压从 10%VDD上升到 90%VDD 所需要的时间

5. set_Cell_degradation

Optimization Constraints

################################### # CLOCK defintion # ################################### 1.create_clock 命令的格式为

create_clock –name clk_name –period cycle_value –waveform edge_list create_clock -period 14 -waveform [list 0.0 7.0] clk_62_5M 或

create_clock -period 14 –waveform [list 0.0 7.0] -name clk [get_ports clk_62.5M]

注意:[get_ports clk_62.5M]中的clk_62.5M是设计文件中的时钟名,-name后面的clk时钟名是

脚本中的时钟名

重要:在时序逻辑电路中,创建时钟约束是真实的时钟,要与设计中的时钟信号相连接,即用或

定义好 Clock 之后,为了模拟实际的时钟,可以用 set_clock_uncertainty 来指定实际时钟网络的 clock_skew。

set_clock_uncertainty 0.3 [get_clocks core_clk]

2、 set_dont_touch_network

由于时钟信号是驱动大负载的。在综合的时候综合工具会对负载进行估计,从而在该网络上加上一些有足够驱动能力的 buffer 或者反相器(增强驱动能力),以使得电路的上升时间和下降时间能够满足要求。而前端工具无法知道连线的走向和长度,在估计时钟网络的负载时不准确,而且 floorplan 的结果将会影响连线的长度,从而影响连线的负载,因此,前端工具不对大负载的网络进行处理,而把这个工作留到后端。所以在综合的时候需要告诉综合工具不对时钟网络进行处理。 参看《ASIC综合与DC使用》25 set_dont_touch_network clk_name

3、set_dont_touch

用于指定不需要综合工具进行优化的对象,这些对象有单元电路、 子模块、硬核等,使得在综合的时候综合工具可以忽略施加在这些对象 上的限制条件。

set_dont_touch_network [list clk_62_5M rst_n]

set_ideal_network [list clk_62_5M rst_n]//延时分析时认为时钟复位无延时

set_false_path 命令用于给出异步电路或者逻辑上不存在的电路,优化的时候所有加在该路径上的限制条件都不予以考虑。如果要取消该设置,使用reset_path命令。 指出异步电路的路径:

如图,由于 CLKA 和 CLKB 是属于不同的时钟晶振,因此,CLKA到 CLKB 的路径是异步电路。 set_false_path –from [get_clocks CLKA] –to [get_clocks CLKB] set_false_path -through rst_n

###################################

在纯组合逻辑电路中,需要创建虚拟时钟约束virtual clock,此时不用连接到设计,即不用写[get_ports clk_62.5M]

# INPUT TIMING # ################################### 参见笔记图DC时序计算

命令的格式:

set_input_delay –clock clk_name –max max_value –min min_value –add_delay

2) -max 的选项:指定输入的最大延迟,为了满足时序单元建立时间(setup time) 的要求。

3) -min 的选项:指定输入的最小延迟,为了满足时序单元保持时间(hold time) 的要求。

set_input_delay 5.8 -clock clk_62_5M [all_inputs]

remove_input_delay [get_ports [list clk_62_5M rst_n]]//为了去掉像clk、rst_n这些不需要设置输入延时的信号

################################### # OUTPUT TIMING # ###################################

set_output_delay 5.8 -clock clk_62_5M [all_outputs]

################################### # DESIGN AREA # ###################################

可以将 max_area 设置为 0,此时综合后的电路肯定不能满足要求,但 DC 会尽量对电路的面积进行优化,达到可能的最小面积,但同时也使得综合后的电路没有 “弹性” set_max_area 0

################################### #

组合电路 #

################################### set_max_delay set_min_delay

如果电路完全是组合逻辑电路,而没有时钟,可以使用这两条命令直接限制路径的最大最小的延迟。 例如,限制一个 reset 信号:由于 reset 信号跨越了不同的模块,因此,一般在顶层模块中对该模块做限制: set_max_delay 5 –from reset

即指定所有 reset 信号出发的路径的最大延迟都为 5限制一个从 IN输入到 OUT输出的最小路径: set_min_delay 10 –from IN –to OUT

对设置环境和约束的一些报告

################################### # Check missing or conflicting #

# constraints # ################################### check_timing

################################## # Check constraints were correct #

# applied to design # ################################### report_clock report_clock -skew

report_port –verbose //报告冗余端口 实例:

由于之前设置的:

set_driving_cell -lib_cell DICE_DELAY_DFF_RN -pin Q -library DICE_DELAY_DFF_RN_slow [all_inputs] set_drive 0 [list clk_62_5M rst_n]

所以Pin Load为0;Wire Load为DICE_ DELAY_DFF_RN -pin Q 的驱动能力(电容)0.0279

################################### # compile & report #

################################### compile -map_effort medium

report_area

report_timing -max_paths 100 report_power

#report_constraints report_cell

report_compile_options report_qor

################################### # write compiled design database # ###################################

write -format ddc -hier -o $ddc_path$active_design.ddc write -f verilog -h -o $netlist_path$active_design.v write_sdc $sdc_path$active_design.sdc write_sdf $sdf_path$active_design.sdf quit

###################################

# Read design file # ################################### read_ddc fc_ae_1553_rst.ddc set_dont_touch fc_ae_1553

set active_design asic_top

analyze -format verilog $active_design.v elaborate $active_design current_design $active_design

set_svf ./mapped/svf/$active_design.svf

################################### # Operation condition # ################################### #set_wire_load_model set_wire_load_mode enclosed set_operating_conditions slow

################################### # Design rule constraint # ################################### set_max_transition 1.8 [current_design] set_max_fanout 10 [current_design]

################################### # CLOCK defintion # ###################################

create_clock -period 7 -waveform [list 0.0 3.0] -name clk_mux_125M [get_pins fc_ae_1553/clk_mux_125M_buf/Y]

#set_clock_latency -source -max 3 [get_clocks clk] #set_clock_latency -max 3 [get_clocks clk] #set_clock_transition #set_clock_uncertainty

create_generated_clock -name clk_62_5M -divide_by 2 -source [get_pins fc_ae_1553/clk_mux_125M_buf/Y] [get_pins fc_ae_1553/clk_mng/clk_62_5M] create_generated_clock -name clk_local_125M -divide_by 1 -source [get_pins fc_ae_1553/clk_mux_125M_buf/Y] [get_pins fc_ae_1553/clk_mng/clk_local_125M_buf/Y]

#create_clock -period 7 -waveform [list 0.0 3.0] -name RXCLK_E [get_ports RXCLK_E]

#create_generated_clock [get_pins fc_ae_1553/clk_mng/RX_CLK_E] -name RX_CLK_E

-divide_by 2 -source [get_ports RXCLK_E]

create_clock -period 40 -waveform [list 0.0 20.0] -name clk_1575 [get_ports clk_1575]

create_clock -period 7 -waveform [list 0.0 3.0] -name RX_CLK_125_I1 [get_pins fc_ae_1553/clk_mng/RX_CLK_125_I1_buf/Y]

create_generated_clock [get_pins fc_ae_1553/clk_mng/RX_CLK_1] -name RX_CLK_1 -divide_by 2 -source [get_pins fc_ae_1553/clk_mng/RX_CLK_125_I1_buf/Y]

create_clock -period 7 -waveform [list 0.0 3.0] -name RX_CLK_125_I2 [get_pins fc_ae_1553/clk_mng/RX_CLK_125_I2_buf/Y]

create_generated_clock [get_pins fc_ae_1553/clk_mng/RX_CLK_2] -name RX_CLK_2 -divide_by 2 -source [get_pins fc_ae_1553/clk_mng/RX_CLK_125_I2_buf/Y]

create_clock -period 18 -waveform [list 0.0 9.0] -name clk_50_M [get_ports clk_50_M]

#create_generated_clock -name clk_local_125M -divide_by 1 -source [get_ports clk_mux_125M] [get_pins fc_ae_1553/clk_mng/clk_local_125M]

set_dont_touch_network [get_ports [list RESET clk_50_M clk_1575 ]] set_dont_touch_network [get_pins fc_ae_1553/clk_mng/RX_CLK_125_I1_buf/Y] set_dont_touch_network [get_pins fc_ae_1553/clk_mng/RX_CLK_125_I2_buf/Y] #set_dont_touch_network [get_pins fc_ae_1553/clk_mng/RX_CLK_E] set_dont_touch_network [get_pins fc_ae_1553/clk_mng/clk_62_5M] set_dont_touch_network [get_pins fc_ae_1553/clk_mng/RX_CLK_1] set_dont_touch_network [get_pins fc_ae_1553/clk_mng/RX_CLK_2]

set_dont_touch_network [get_pins fc_ae_1553/clk_mng/clk_local_125M_buf/Y] set_dont_touch_network [get_pins fc_ae_1553/clk_mux_125M_buf/Y] set_false_path -through RESET

set_false_path -from [get_clocks clk_1575] -to [get_clocks RX_CLK_1] set_false_path -from [get_clocks clk_1575] -to [get_clocks RX_CLK_2] set_false_path -from [get_clocks clk_1575] -to [get_clocks clk_62_5M] #set_false_path -from [get_clocks clk_1575] -to [get_clocks clk_mux_125M] set_false_path -from [get_clocks clk_1575] -to [get_clocks clk_local_125M]

#set_false_path -from [get_clocks clk_mux_125M] -to [get_clocks clk_1575]

set_false_path -from [get_clocks clk_62_5M] -to [get_clocks RX_CLK_1] set_false_path -from [get_clocks clk_62_5M] -to [get_clocks RX_CLK_2] set_false_path -from [get_clocks clk_62_5M] -to [get_clocks clk_1575] set_false_path -from [get_clocks clk_62_5M] -to [get_clocks clk_local_125M]

本文来源:https://www.bwwdw.com/article/rj5f.html

Top