源代码仿真和dc综合后仿真的差异
求问各位大拿们有没有经过这类问题,是什么原因大概,还有。怎么解决啊?
你带SDF了吗?反标成功了没?
没生成sdf文件。我综合没做延时。
没做延时。没生成sdf
可以把对应的test文件、综合前仿真接口、综合后仿真接口贴上来,更清楚些。
后仿不带SDF没有时延的,达不到你想要的结果
//这是test文件,包括了综合后的接口。太长了,因为牵扯按时序赋值,mdi_开头的那四个接口是曼彻斯特编码,连续输入很多很多组。
- `timescale 1ns/1ps
- module test;
-
-
- reg rst, clk, ext_clk, mdi_a, mdi_r_a, mdi_b, mdi_r_b, sel_reg, write_reg, addr_reg_4_,
- addr_reg_3_, addr_reg_2_, addr_reg_1_, addr_reg_0_, wdata_reg_15_, wdata_reg_14_, wdata_reg_13_, wdata_reg_12_, wdata_reg_11_, wdata_reg_10_,
- wdata_reg_9_, wdata_reg_8_, wdata_reg_7_, wdata_reg_6_, wdata_reg_5_, wdata_reg_4_, wdata_reg_3_, wdata_reg_2_, wdata_reg_1_, wdata_reg_0_,
- sel_mem, write_mem, addr_mem_11_, addr_mem_10_, addr_mem_9_, addr_mem_8_, addr_mem_7_, addr_mem_6_, addr_mem_5_, addr_mem_4_,
- addr_mem_3_, addr_mem_2_, addr_mem_1_, addr_mem_0_, wdata_mem_15_, wdata_mem_14_, wdata_mem_13_, wdata_mem_12_, wdata_mem_11_, wdata_mem_10_,
- wdata_mem_9_, wdata_mem_8_, wdata_mem_7_, wdata_mem_6_, wdata_mem_5_, wdata_mem_4_, wdata_mem_3_, wdata_mem_2_, wdata_mem_1_, wdata_mem_0_;
- reg rst_t, clk_t, ext_clk_t, mdi_a_t, mdi_r_a_t, mdi_b_t, mdi_r_b_t, sel_reg_t, write_reg_t, addr_reg_4__t, addr_reg_3__t,
- addr_reg_2__t, addr_reg_1__t, addr_reg_0__t, wdata_reg_15__t, wdata_reg_14__t, wdata_reg_13__t, wdata_reg_12__t, wdata_reg_11__t, wdata_reg_10__t, wdata_reg_9__t,
- wdata_reg_8__t, wdata_reg_7__t, wdata_reg_6__t, wdata_reg_5__t, wdata_reg_4__t, wdata_reg_3__t, wdata_reg_2__t, wdata_reg_1__t, wdata_reg_0__t, sel_mem_t,
- write_mem_t, addr_mem_11__t, addr_mem_10__t, addr_mem_9__t, addr_mem_8__t, addr_mem_7__t, addr_mem_6__t, addr_mem_5__t, addr_mem_4__t, addr_mem_3__t,
- addr_mem_2__t, addr_mem_1__t, addr_mem_0__t, wdata_mem_15__t, wdata_mem_14__t, wdata_mem_13__t, wdata_mem_12__t, wdata_mem_11__t, wdata_mem_10__t, wdata_mem_9__t,
- wdata_mem_8__t, wdata_mem_7__t, wdata_mem_6__t, wdata_mem_5__t, wdata_mem_4__t, wdata_mem_3__t, wdata_mem_2__t, wdata_mem_1__t, wdata_mem_0__t;
- wire irq, mdo_a, mdo_r_a, mdo_b, mdo_r_b, tr_busy_a, tr_busy_b, rdata_mem_15_, rdata_mem_14_, rdata_mem_13_,
- rdata_mem_12_, rdata_mem_11_, rdata_mem_10_, rdata_mem_9_, rdata_mem_8_, rdata_mem_7_, rdata_mem_6_, rdata_mem_5_, rdata_mem_4_, rdata_mem_3_,
- rdata_mem_2_, rdata_mem_1_, rdata_mem_0_, parityb, rdata_reg_15_, rdata_reg_14_, rdata_reg_13_, rdata_reg_12_, rdata_reg_11_, rdata_reg_10_,
- rdata_reg_9_, rdata_reg_8_, rdata_reg_7_, rdata_reg_6_, rdata_reg_5_, rdata_reg_4_, rdata_reg_3_, rdata_reg_2_, rdata_reg_1_, rdata_reg_0_;
- wire irq_t, mdo_a_t, mdo_r_a_t, mdo_b_t, mdo_r_b_t, tr_busy_a_t, tr_busy_b_t, rdata_mem_15__t, rdata_mem_14__t, rdata_mem_13__t, rdata_mem_12__t,
- rdata_mem_11__t, rdata_mem_10__t, rdata_mem_9__t, rdata_mem_8__t, rdata_mem_7__t, rdata_mem_6__t, rdata_mem_5__t, rdata_mem_4__t, rdata_mem_3__t, rdata_mem_2__t,
- rdata_mem_1__t, rdata_mem_0__t, parityb_t, rdata_reg_15__t, rdata_reg_14__t, rdata_reg_13__t, rdata_reg_12__t, rdata_reg_11__t, rdata_reg_10__t, rdata_reg_9__t,
- rdata_reg_8__t, rdata_reg_7__t, rdata_reg_6__t, rdata_reg_5__t, rdata_reg_4__t, rdata_reg_3__t, rdata_reg_2__t, rdata_reg_1__t, rdata_reg_0__t;
-
-
-
- TOP1553_lev2 top1(rst, rst_t, clk, clk_t, ext_clk, ext_clk_t, irq, irq_t, mdo_a, mdo_a_t, mdo_r_a, mdo_r_a_t, mdo_b, mdo_b_t, mdo_r_b, mdo_r_b_t, mdi_a, mdi_a_t, mdi_r_a, mdi_r_a_t,
- mdi_b, mdi_b_t, mdi_r_b, mdi_r_b_t, tr_busy_a, tr_busy_a_t, tr_busy_b, tr_busy_b_t, sel_reg, sel_reg_t, write_reg, write_reg_t, addr_reg_4_, addr_reg_4__t, addr_reg_3_, addr_reg_3__t, addr_reg_2_, addr_reg_2__t, addr_reg_1_, addr_reg_1__t,
- addr_reg_0_, addr_reg_0__t, wdata_reg_15_, wdata_reg_15__t, wdata_reg_14_, wdata_reg_14__t, wdata_reg_13_, wdata_reg_13__t, wdata_reg_12_, wdata_reg_12__t, wdata_reg_11_, wdata_reg_11__t, wdata_reg_10_, wdata_reg_10__t, wdata_reg_9_, wdata_reg_9__t, wdata_reg_8_, wdata_reg_8__t, wdata_reg_7_, wdata_reg_7__t,
- wdata_reg_6_, wdata_reg_6__t, wdata_reg_5_, wdata_reg_5__t, wdata_reg_4_, wdata_reg_4__t, wdata_reg_3_, wdata_reg_3__t, wdata_reg_2_, wdata_reg_2__t, wdata_reg_1_, wdata_reg_1__t, wdata_reg_0_, wdata_reg_0__t, sel_mem, sel_mem_t, write_mem, write_mem_t, addr_mem_11_, addr_mem_11__t,
- addr_mem_10_, addr_mem_10__t, addr_mem_9_, addr_mem_9__t, addr_mem_8_, addr_mem_8__t, addr_mem_7_, addr_mem_7__t, addr_mem_6_, addr_mem_6__t, addr_mem_5_, addr_mem_5__t, addr_mem_4_, addr_mem_4__t, addr_mem_3_, addr_mem_3__t, addr_mem_2_, addr_mem_2__t, addr_mem_1_, addr_mem_1__t,
- addr_mem_0_, addr_mem_0__t, wdata_mem_15_, wdata_mem_15__t, wdata_mem_14_, wdata_mem_14__t, wdata_mem_13_, wdata_mem_13__t, wdata_mem_12_, wdata_mem_12__t, wdata_mem_11_, wdata_mem_11__t, wdata_mem_10_, wdata_mem_10__t, wdata_mem_9_, wdata_mem_9__t, wdata_mem_8_, wdata_mem_8__t, wdata_mem_7_, wdata_mem_7__t,
- wdata_mem_6_, wdata_mem_6__t, wdata_mem_5_, wdata_mem_5__t, wdata_mem_4_, wdata_mem_4__t, wdata_mem_3_, wdata_mem_3__t, wdata_mem_2_, wdata_mem_2__t, wdata_mem_1_, wdata_mem_1__t, wdata_mem_0_, wdata_mem_0__t, rdata_mem_15_, rdata_mem_15__t, rdata_mem_14_, rdata_mem_14__t, rdata_mem_13_, rdata_mem_13__t,
- rdata_mem_12_, rdata_mem_12__t, rdata_mem_11_, rdata_mem_11__t, rdata_mem_10_, rdata_mem_10__t, rdata_mem_9_, rdata_mem_9__t, rdata_mem_8_, rdata_mem_8__t, rdata_mem_7_, rdata_mem_7__t, rdata_mem_6_, rdata_mem_6__t, rdata_mem_5_, rdata_mem_5__t, rdata_mem_4_, rdata_mem_4__t, rdata_mem_3_, rdata_mem_3__t,
- rdata_mem_2_, rdata_mem_2__t, rdata_mem_1_, rdata_mem_1__t, rdata_mem_0_, rdata_mem_0__t, parityb, parityb_t, rdata_reg_15_, rdata_reg_15__t, rdata_reg_14_, rdata_reg_14__t, rdata_reg_13_, rdata_reg_13__t, rdata_reg_12_, rdata_reg_12__t, rdata_reg_11_, rdata_reg_11__t, rdata_reg_10_, rdata_reg_10__t,
- rdata_reg_9_, rdata_reg_9__t, rdata_reg_8_, rdata_reg_8__t, rdata_reg_7_, rdata_reg_7__t, rdata_reg_6_, rdata_reg_6__t, rdata_reg_5_, rdata_reg_5__t, rdata_reg_4_, rdata_reg_4__t, rdata_reg_3_, rdata_reg_3__t, rdata_reg_2_, rdata_reg_2__t, rdata_reg_1_, rdata_reg_1__t, rdata_reg_0_, rdata_reg_0__t);
-
- initial
- begin
- rst=1'b0;
-
- clk=1'b0;
- ext_clk=1'b0;
- mdi_a=1'b0;
- mdi_r_a=1'b0;
- mdi_b=1'b0;
- mdi_r_b=1'b0;
-
- sel_mem =1'b0;
- write_mem=1'b0;
-
-
-
-
- end
-
-
- initial
- begin
- #10
- rst=1'b1;
- sel_mem =1'b1;
-
- write_mem=1'b1;
- //以下写入命令字、数据
- //addr_mem=12'b001111000010;
-
- addr_mem_11_=1'b0;
- addr_mem_10_=1'b0;
- addr_mem_9_=1'b1;
- addr_mem_8_=1'b1;
- addr_mem_7_=1'b1;
- addr_mem_6_=1'b1;
- addr_mem_5_=1'b0;
- addr_mem_4_=1'b0;
-
- addr_mem_3_=1'b0;
- addr_mem_2_=1'b0;
- addr_mem_1_=1'b1;
- addr_mem_0_=1'b0;
- //wdata_mem=16'b0000000100000000;
- wdata_mem_15_=1'b0;
- wdata_mem_14_=1'b0;
- wdata_mem_13_=1'b0;
- wdata_mem_12_=1'b0;
- wdata_mem_11_=1'b0;
- wdata_mem_10_=1'b0;
- wdata_mem_9_=1'b0;
- wdata_mem_8_=1'b1;
- wdata_mem_7_=1'b0;
- wdata_mem_6_=1'b0;
- wdata_mem_5_=1'b0;
- wdata_mem_4_=1'b0;
- wdata_mem_3_=1'b0;
- wdata_mem_2_=1'b0;
- wdata_mem_1_=1'b0;
- wdata_mem_0_=1'b0;
-
- #56
- //addr_mem=12'b001001000010;
- addr_mem_11_=1'b0;
- addr_mem_10_=1'b0;
- addr_mem_9_=1'b1;
- addr_mem_8_=1'b0;
- addr_mem_7_=1'b0;
- addr_mem_6_=1'b1;
- addr_mem_5_=1'b0;
- addr_mem_4_=1'b0;
-
- addr_mem_3_=1'b0;
- addr_mem_2_=1'b0;
- addr_mem_1_=1'b1;
- addr_mem_0_=1'b0;
- //wdata_mem=16'b0000000100000000;
- wdata_mem_15_=1'b0;
- wdata_mem_14_=1'b0;
- wdata_mem_13_=1'b0;
- wdata_mem_12_=1'b0;
- wdata_mem_11_=1'b0;
- wdata_mem_10_=1'b0;
- wdata_mem_9_=1'b0;
- wdata_mem_8_=1'b1;
- wdata_mem_7_=1'b0;
- wdata_mem_6_=1'b0;
- wdata_mem_5_=1'b0;
- wdata_mem_4_=1'b0;
- wdata_mem_3_=1'b0;
- wdata_mem_2_=1'b0;
- wdata_mem_1_=1'b0;
- wdata_mem_0_=1'b0;
- #66
- //addr_mem=12'b000110100001;
- addr_mem_11_=1'b0;
- addr_mem_10_=1'b0;
- addr_mem_9_=1'b0;
- addr_mem_8_=1'b1;
- addr_mem_7_=1'b1;
- addr_mem_6_=1'b0;
- addr_mem_5_=1'b1;
- addr_mem_4_=1'b0;
-
- addr_mem_3_=1'b0;
- addr_mem_2_=1'b0;
- addr_mem_1_=1'b0;
- addr_mem_0_=1'b1;
- //wdata_mem=16'b0000000100000000;
- wdata_mem_15_=1'b0;
- wdata_mem_14_=1'b0;
- wdata_mem_13_=1'b0;
- wdata_mem_12_=1'b0;
- wdata_mem_11_=1'b0;
- wdata_mem_10_=1'b0;
- wdata_mem_9_=1'b0;
- wdata_mem_8_=1'b1;
- wdata_mem_7_=1'b0;
- wdata_mem_6_=1'b0;
- wdata_mem_5_=1'b0;
- wdata_mem_4_=1'b0;
- wdata_mem_3_=1'b0;
- wdata_mem_2_=1'b0;
- wdata_mem_1_=1'b0;
- wdata_mem_0_=1'b0;
-
-
- //"0001 1010 0000" + r.command_word.sub_addr;
- #66
- //addr_mem=12'b000101100001;
- addr_mem_11_=1'b0;
- addr_mem_10_=1'b0;
- addr_mem_9_=1'b0;
- addr_mem_8_=1'b1;
- addr_mem_7_=1'b0;
- addr_mem_6_=1'b1;
- addr_mem_5_=1'b1;
- addr_mem_4_=1'b0;
-
- addr_mem_3_=1'b0;
- addr_mem_2_=1'b0;
- addr_mem_1_=1'b0;
- addr_mem_0_=1'b1;
- //wdata_mem=16'b0000000100000010;
- wdata_mem_15_=1'b0;
- wdata_mem_14_=1'b0;
- wdata_mem_13_=1'b0;
- wdata_mem_12_=1'b0;
- wdata_mem_11_=1'b0;
- wdata_mem_10_=1'b0;
- wdata_mem_9_=1'b0;
- wdata_mem_8_=1'b1;
- wdata_mem_7_=1'b0;
- wdata_mem_6_=1'b0;
- wdata_mem_5_=1'b0;
- wdata_mem_4_=1'b0;
- wdata_mem_3_=1'b0;
- wdata_mem_2_=1'b0;
- wdata_mem_1_=1'b1;
- wdata_mem_0_=1'b0;
-
- #66
- //addr_mem=12'b000100000010;
- addr_mem_11_=1'b0;
- addr_mem_10_=1'b0;
- addr_mem_9_=1'b0;
- addr_mem_8_=1'b1;
- addr_mem_7_=1'b0;
- addr_mem_6_=1'b0;
- addr_mem_5_=1'b0;
- addr_mem_4_=1'b0;
-
- addr_mem_3_=1'b0;
- addr_mem_2_=1'b0;
- addr_mem_1_=1'b1;
- addr_mem_0_=1'b0;
-
- //wdata_mem=16'b0000100010000100;
- wdata_mem_15_=1'b0;
- wdata_mem_14_=1'b0;
- wdata_mem_13_=1'b0;
- wdata_mem_12_=1'b0;
- wdata_mem_11_=1'b1;
- wdata_mem_10_=1'b0;
- wdata_mem_9_=1'b0;
- wdata_mem_8_=1'b0;
综合前的test...一部分如下:
- `timescale 1ns/1ps
- module test;
-
- reg rst,clk,ext_clk,mdi_a,mdi_r_a,mdi_b,mdi_r_b,sel_reg,write_reg,sel_mem ,write_mem ;
- reg [4:0] addr_reg;
- reg [15:0] wdata_reg,wdata_mem ;
- reg [11:0] addr_mem;
-
- wire irq,mdo_a,mdo_r_a ,mdo_r_b,mdo_b,tr_busy_a,tr_busy_b,parityb ;
- wire [15:0]rdata_mem ,rdata_reg ;
-
-
- TOP1553 top1(rst , clk ,ext_clk,irq, mdo_a ,mdo_r_a,mdo_b ,mdo_r_b,
- mdi_a,mdi_r_a ,mdi_b ,mdi_r_b ,
- tr_busy_a ,tr_busy_b , sel_reg ,write_reg ,addr_reg,wdata_reg ,
- sel_mem ,write_mem ,addr_mem ,wdata_mem ,rdata_mem ,parityb ,rdata_reg );
-
- initial
- begin
- rst=1'b0;
-
- clk=1'b0;
- ext_clk=1'b0;
- mdi_a=1'b0;
- mdi_r_a=1'b0;
- mdi_b=1'b0;
- mdi_r_b=1'b0;
-
- //sel_reg=1'b0;
- //write_reg=1'b0;
- sel_mem =1'b0;
- write_mem=1'b0;
-
-
-
-
- end
-
-
- initial
- begin
- #10 rst=1'b1;
- sel_mem =1'b1;
- write_mem=1'b1;
- addr_mem=12'b001111000010;
- wdata_mem=16'b0000000100000000;
- #56
- addr_mem=12'b001001000010;
- wdata_mem=16'b0000000100000000;
- #66
- addr_mem=12'b000110100001;
- wdata_mem=16'b0000000100000000;
- //"0001 1010 0000" + r.command_word.sub_addr;
- #66
- addr_mem=12'b000101100001;
- wdata_mem=16'b0000000100000010;
- #66
-
- addr_mem=12'b000100000010;
- wdata_mem=16'b0000100010000100;
以下是脚本。哪位大神帮我看看好吗。我是初学者,脚本是别人写的,我想知道是综合后确实发生了门级延时,但没生成sdf文件,还是这种综合只是不考虑延时的一种“理想网表”
#####################################
# Current Design: TOP1553
# Load up design files
# uncomment one of the following
#analyze -format verilog TOP1553.v
analyze -format vhdl {if1553.vhd sysreg.vhd fifo.vhd transmitter.vhd rt1553.vhd receiver.vhd encode10m.vhd encode.vhd dpram.vhd decode10m.vhd decode.vhd TOP1553.vhd}
# Tell dc_shell the name of the top level module
elaborate TOP1553
# set a clock
create_clock {ext_clk clk}
# Check for warnings/errorsa
check_design -multiple_designs
# ungroup everything
ungroup -flatten -all
# flatten it all, this forces all the hierarchy to be flattened out
set_flatten true -effort high
uniquify
# compile the design
compile_ultra -area_high_effort_script
#compile_ultra -timing_high_effort_script
#compile_ultra
# Now that the compile is complete report on the results
report_area
report_timing
report_power
############################### begin: renaming section
# remove the following renaming section when not needed
# define the name rules for rename
define_name_rules verilog -remove_port_bus
define_name_rules verilog -remove_internal_net_bus
# name rule for nets
define_name_rules verilog -type net -allowed "a-z A-Z 0-9 _" \
-first_restricted "_ 0-9 N" \
-replacement_char "_" \
-prefix "n"
# name rule for cells
define_name_rules verilog -type cell -allowed "a-z A-Z 0-9 _" \
-first_restricted "_ 0-9" \
-replacement_char "_" \
-prefix "u"
# name rule for ports
define_name_rules verilog -type port -allowed "a-z A-Z 0-9 _" \
-first_restricted "_ 0-9" \
-replacement_char "_" \
-prefix "p"
# change names of variables
change_names -rule verilog -hierarchy
################################ end: renaming section
# Write out the design
write -f verilog TOP1553 -output TOP1553_syn.v
remove_design -all
exit
没看懂你说综合把并行端口变成了串行端口是什么意思?DC综合是不会改变逻辑电路的功能的
DC综合不会改变端口位宽的,如果你综合前的模块为:
module( input rstn, input clk, input[2:0] din, output[2:0]dout);
综合后还是这样的,直接使用你原来的激励就可以了,不需要修改。
恩,帮忙顶起。学习。
还有啊大神,是不是只要综合为网表了,那么后仿真时这个门延时就是客观存在的,必然对测试产生影响?我以为我们综合的脚本没考虑延时,延时就是不存在呢。
求大神解答啊,不胜感激!
不是的,网表也没有延时信息,必须配合sdf