【25秋招】数字IC复习-逻辑综合

基础知识

逻辑综合的目的和流程

逻辑综合的目的:决定电路门级结构、寻求时序和与面积的平衡、寻求功耗与时序的平衡、增强电路的测试性。
DC综合的流程:转译 + 优化 + 映射 + 后优化
转译是将RTL文件转换为通用网表,又称GTECH(generic technology)网表,使用的是DC自带的数据库。
GTECH网表中仅包含逻辑功能,但可以对PPA建模。

库文件

目标库
综合后电路网表要最终映射到的库。.db格式,不能由文本方式打开。包含行为、引脚、面积、时序、功耗等信息。
链接库
DC使用链接库来解决依赖,对于所有DC可能用到的库,都需要在link_library中指定,link_library包含target_library、synthetic_library、购买的硬核IP、IO Pad。在link_library的设置中必须包含“*”。表示DC在引用实例化模块或者单元电路时首先搜索已经调进DC memory的模块和单元电路。
符号库
是工艺库单元显示原理图的库,扩展名.sdb。
算术运算库
synthetic_library是算术运算库,扩展名是.sldb,DC初始化时默认使用standard.sldb来实现算术运算。例如加法,默认综合会使用串行进位的加法器来实现,如果需要超前进位加法器,就需要设置synthetic library。

脚本流程

参考文章:https://blog.csdn.net/weixin_51116586/article/details/134752928
使用dc_shell打开DC命令行,可以使用exit命令来退出DC。
指定库文件

set search_path {/home/aaa/dc_prj/test0}
set target_library {scc55nll_hd_lvt_ff_v1p32_0c_basic.db}
set link_library {*scc55nll_hd_lvt_ff_v1p32_0c_basic.db}

读取设计文件
一是read指令,二是 analyze 和 elaborate 的组合。
读入单个文件:

read_verilog multi_sel.v

读入多个文件:

set design_path “rtl” set verilog_files [glob -nocomplain -type f
$design_path/*.v] foreach file $verilog_files { read_file -format
verilog $file }

link命令将读取到 DC 存储区的模块或者实例连接起来。DC默认将最后读入的一个模块作为顶层模块,需要指定顶层模块。uniquify 命令为每个实例在内存中创建一份副本,以便区分开每个实例。

set top_name multi_sel
current_design $top_name
link
uniquify

定义设计环境
在这里插入图片描述

设计约束
在这里插入图片描述

综合的时候不对时钟信号进行优化:set dont_touch_network [get_clocks clk]
综合设计
compile或者compile_ultra(需要额外licence)进行综合
输出报告和结果
输出面积、功耗、时序、约束违例和summary报告。
保存DC综合结果。
ddc文件:保留综合结果的ddc文件,可以直接load这个文件,查看综合结果;
sdc(Synopsys design constraints)文件:保留了本次设计时序约束信息;
sdf(Standard Delay Format)文件:标准延时格式,用于静态分析和后仿;
netlist.v文件:综合后吐出的门级网表。

逻辑综合实例:小米笔试题

前几天小米笔试里面有一题是关于阻塞和非阻塞的分析,如下:

module multi_sel(
input [3:0]in ,
input clk,
input rst_n,
output reg [3:0]a,
output reg [3:0]b
);
always@(posedge clk) begin
a <= in + 1;
b = a + 1;
end
endmodule

问题是最终a和b的值是多少,选项如下:

a=in+1,b=in+1
a=in+1,b=a+1
a=in+1,b=in+2
a=in,b=in+2(这里是in+1还是in+2忘了)

当时做题的时候就有点迷惑,于是后面用DC跑了一下,脚本如下:

sh date 
remove_design -designs  
#------------------------Define------------------------
set top_name multi_sel
#-------------------Specify Libraries------------------
set search_path {/home/aaa/dc_prj/test0}
set target_library {scc55nll_hd_lvt_ff_v1p32_0c_basic.db}
set link_library {* scc55nll_hd_lvt_ff_v1p32_0c_basic.db}
#----------------------Read Designs--------------------
set design_path "rtl"
set verilog_files [glob -nocomplain -type f $design_path/*.v]
foreach file $verilog_files {
    read_file -format verilog $file
}
current_design  $top_name
# Reset all constraints
reset_design               
link
uniquify
#-------------------Operating environment--------------
set_load 0.01 [all_output]
#--------------------Design Constrains-----------------
create_clock -name clk -period 10 -waveform { 0 5  } [get_ports clk]
set_max_area 0
#---------------------Run Compile----------------------
compile 
#-------------------Generate Reports-------------------
report_area  > ./report/area_report.txt
report_power > ./report/power_report.txt
report_timing > ./report/timing_report.txt
report_constraint -all_violators > ./report/violators.txt   
report_qor > ./report/qor_report.txt  
#-------------------Save Output File-------------------
write_sdc ./sdc/top.sdc
write_sdf -version 2.1 ./sdc/top.sdf 
write -f verilog -hier -output ./netlist/netlist.v 
write_file -f ddc -hierarchy -output ./sdc/top.ddc

最后综合出来的电路有两种:
在这里插入图片描述
情况1对应的DC综合结果如下:in —> 加法 —> reg_a —> 加法 —> reg_b
在这里插入图片描述
在这里插入图片描述
情况1对应的DC综合结果如下:
in —> 加法 —> reg_a
in —> 加法 —> 加法 —> reg_b
在这里插入图片描述
当a在前b在后时,a的阻塞会影响到b,因此结果是第二种;当b在前a在后时,由于b的阻塞是不会影响到a的,又由于a在后面,所以a的阻塞和非阻塞同样不会影响到b,因此结果都是第一种。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值