微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 嵌入式设计讨论 > FPGA,CPLD和ASIC > 源代码仿真和dc综合后仿真的差异

源代码仿真和dc综合后仿真的差异

时间:10-02 整理:3721RD 点击:
各位大神  最近我做一个项目,因为测试文件需要模拟一种符合时序的输入,所以先Modelsim对源代码仿真,试验出一个可行的test文件。然后用dc综合后,使用这个test文件对综合出来的门级网表激励。因为综合后把并行端口打成了串行端口,所以只需要修改对应的输入激励,貌似不应该有什么区别,但问题来了。波形不对!
求问各位大拿们有没有经过这类问题,是什么原因大概,还有。怎么解决啊?

你带SDF了吗?反标成功了没?

没生成sdf文件。我综合没做延时。



   没做延时。没生成sdf

可以把对应的test文件、综合前仿真接口、综合后仿真接口贴上来,更清楚些。


后仿不带SDF没有时延的,达不到你想要的结果


//这是test文件,包括了综合后的接口。太长了,因为牵扯按时序赋值,mdi_开头的那四个接口是曼彻斯特编码,连续输入很多很多组。

  1. `timescale 1ns/1ps
  2. module test;


  3. reg rst, clk, ext_clk, mdi_a, mdi_r_a, mdi_b, mdi_r_b, sel_reg, write_reg, addr_reg_4_,
  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_,
  5.         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_,
  6.         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_,
  7.         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_,
  8.         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_;

  9. 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,
  10.         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,
  11.         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,
  12.         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,
  13.         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,
  14.         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;

  15. 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_,
  16.         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_,
  17.         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_,
  18.         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_;

  19. 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,
  20.         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,
  21.         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,
  22.         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;



  23. 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,
  24.         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,
  25.         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,
  26.         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,
  27.         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,
  28.         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,
  29.         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,
  30.         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,
  31.         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,
  32.         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);
  33.        
  34.         initial
  35.         begin
  36.         rst=1'b0;
  37.        
  38.         clk=1'b0;
  39.         ext_clk=1'b0;
  40.         mdi_a=1'b0;
  41.         mdi_r_a=1'b0;
  42.         mdi_b=1'b0;
  43.         mdi_r_b=1'b0;
  44.        
  45.         sel_mem        =1'b0;
  46.         write_mem=1'b0;
  47.        

  48.        
  49.        
  50.         end
  51.        
  52.        
  53.         initial
  54.         begin
  55.         #10
  56.         rst=1'b1;
  57.                 sel_mem        =1'b1;
  58.                
  59.         write_mem=1'b1;
  60.         //以下写入命令字、数据
  61.         //addr_mem=12'b001111000010;
  62.        
  63.         addr_mem_11_=1'b0;
  64.         addr_mem_10_=1'b0;
  65.         addr_mem_9_=1'b1;
  66.         addr_mem_8_=1'b1;
  67.         addr_mem_7_=1'b1;
  68.         addr_mem_6_=1'b1;
  69.         addr_mem_5_=1'b0;
  70.         addr_mem_4_=1'b0;
  71.        
  72.         addr_mem_3_=1'b0;
  73.         addr_mem_2_=1'b0;
  74.         addr_mem_1_=1'b1;
  75.         addr_mem_0_=1'b0;
  76.         //wdata_mem=16'b0000000100000000;
  77.         wdata_mem_15_=1'b0;
  78.         wdata_mem_14_=1'b0;
  79.         wdata_mem_13_=1'b0;
  80.         wdata_mem_12_=1'b0;
  81.         wdata_mem_11_=1'b0;
  82.         wdata_mem_10_=1'b0;
  83.         wdata_mem_9_=1'b0;
  84.         wdata_mem_8_=1'b1;
  85.         wdata_mem_7_=1'b0;
  86.         wdata_mem_6_=1'b0;
  87.         wdata_mem_5_=1'b0;
  88.         wdata_mem_4_=1'b0;
  89.         wdata_mem_3_=1'b0;
  90.         wdata_mem_2_=1'b0;
  91.         wdata_mem_1_=1'b0;
  92.         wdata_mem_0_=1'b0;
  93.        
  94.         #56
  95.         //addr_mem=12'b001001000010;
  96.         addr_mem_11_=1'b0;
  97.         addr_mem_10_=1'b0;
  98.         addr_mem_9_=1'b1;
  99.         addr_mem_8_=1'b0;
  100.         addr_mem_7_=1'b0;
  101.         addr_mem_6_=1'b1;
  102.         addr_mem_5_=1'b0;
  103.         addr_mem_4_=1'b0;
  104.        
  105.         addr_mem_3_=1'b0;
  106.         addr_mem_2_=1'b0;
  107.         addr_mem_1_=1'b1;
  108.         addr_mem_0_=1'b0;
  109.         //wdata_mem=16'b0000000100000000;
  110.         wdata_mem_15_=1'b0;
  111.         wdata_mem_14_=1'b0;
  112.         wdata_mem_13_=1'b0;
  113.         wdata_mem_12_=1'b0;
  114.         wdata_mem_11_=1'b0;
  115.         wdata_mem_10_=1'b0;
  116.         wdata_mem_9_=1'b0;
  117.         wdata_mem_8_=1'b1;
  118.         wdata_mem_7_=1'b0;
  119.         wdata_mem_6_=1'b0;
  120.         wdata_mem_5_=1'b0;
  121.         wdata_mem_4_=1'b0;
  122.         wdata_mem_3_=1'b0;
  123.         wdata_mem_2_=1'b0;
  124.         wdata_mem_1_=1'b0;
  125.         wdata_mem_0_=1'b0;
  126.         #66
  127.         //addr_mem=12'b000110100001;
  128.         addr_mem_11_=1'b0;
  129.         addr_mem_10_=1'b0;
  130.         addr_mem_9_=1'b0;
  131.         addr_mem_8_=1'b1;
  132.         addr_mem_7_=1'b1;
  133.         addr_mem_6_=1'b0;
  134.         addr_mem_5_=1'b1;
  135.         addr_mem_4_=1'b0;
  136.        
  137.         addr_mem_3_=1'b0;
  138.         addr_mem_2_=1'b0;
  139.         addr_mem_1_=1'b0;
  140.         addr_mem_0_=1'b1;
  141.         //wdata_mem=16'b0000000100000000;
  142.         wdata_mem_15_=1'b0;
  143.         wdata_mem_14_=1'b0;
  144.         wdata_mem_13_=1'b0;
  145.         wdata_mem_12_=1'b0;
  146.         wdata_mem_11_=1'b0;
  147.         wdata_mem_10_=1'b0;
  148.         wdata_mem_9_=1'b0;
  149.         wdata_mem_8_=1'b1;
  150.         wdata_mem_7_=1'b0;
  151.         wdata_mem_6_=1'b0;
  152.         wdata_mem_5_=1'b0;
  153.         wdata_mem_4_=1'b0;
  154.         wdata_mem_3_=1'b0;
  155.         wdata_mem_2_=1'b0;
  156.         wdata_mem_1_=1'b0;
  157.         wdata_mem_0_=1'b0;
  158.        
  159.        
  160.                         //"0001 1010 0000" + r.command_word.sub_addr;
  161.         #66
  162.         //addr_mem=12'b000101100001;
  163.         addr_mem_11_=1'b0;
  164.         addr_mem_10_=1'b0;
  165.         addr_mem_9_=1'b0;
  166.         addr_mem_8_=1'b1;
  167.         addr_mem_7_=1'b0;
  168.         addr_mem_6_=1'b1;
  169.         addr_mem_5_=1'b1;
  170.         addr_mem_4_=1'b0;
  171.        
  172.         addr_mem_3_=1'b0;
  173.         addr_mem_2_=1'b0;
  174.         addr_mem_1_=1'b0;
  175.         addr_mem_0_=1'b1;
  176.         //wdata_mem=16'b0000000100000010;
  177.         wdata_mem_15_=1'b0;
  178.         wdata_mem_14_=1'b0;
  179.         wdata_mem_13_=1'b0;
  180.         wdata_mem_12_=1'b0;
  181.         wdata_mem_11_=1'b0;
  182.         wdata_mem_10_=1'b0;
  183.         wdata_mem_9_=1'b0;
  184.         wdata_mem_8_=1'b1;
  185.         wdata_mem_7_=1'b0;
  186.         wdata_mem_6_=1'b0;
  187.         wdata_mem_5_=1'b0;
  188.         wdata_mem_4_=1'b0;
  189.         wdata_mem_3_=1'b0;
  190.         wdata_mem_2_=1'b0;
  191.         wdata_mem_1_=1'b1;
  192.         wdata_mem_0_=1'b0;
  193.        
  194.         #66
  195.         //addr_mem=12'b000100000010;
  196.         addr_mem_11_=1'b0;
  197.         addr_mem_10_=1'b0;
  198.         addr_mem_9_=1'b0;
  199.         addr_mem_8_=1'b1;
  200.         addr_mem_7_=1'b0;
  201.         addr_mem_6_=1'b0;
  202.         addr_mem_5_=1'b0;
  203.         addr_mem_4_=1'b0;
  204.        
  205.         addr_mem_3_=1'b0;
  206.         addr_mem_2_=1'b0;
  207.         addr_mem_1_=1'b1;
  208.         addr_mem_0_=1'b0;
  209.        
  210.         //wdata_mem=16'b0000100010000100;
  211.         wdata_mem_15_=1'b0;
  212.         wdata_mem_14_=1'b0;
  213.         wdata_mem_13_=1'b0;
  214.         wdata_mem_12_=1'b0;
  215.         wdata_mem_11_=1'b1;
  216.         wdata_mem_10_=1'b0;
  217.         wdata_mem_9_=1'b0;
  218.         wdata_mem_8_=1'b0;

复制代码


综合前的test...一部分如下:

  1. `timescale 1ns/1ps
  2. module test;

  3. reg rst,clk,ext_clk,mdi_a,mdi_r_a,mdi_b,mdi_r_b,sel_reg,write_reg,sel_mem        ,write_mem        ;
  4. reg [4:0] addr_reg;
  5. reg [15:0] wdata_reg,wdata_mem ;
  6. reg [11:0] addr_mem;

  7. wire irq,mdo_a,mdo_r_a        ,mdo_r_b,mdo_b,tr_busy_a,tr_busy_b,parityb ;
  8. wire [15:0]rdata_mem ,rdata_reg ;


  9. TOP1553 top1(rst        ,        clk        ,ext_clk,irq, mdo_a        ,mdo_r_a,mdo_b        ,mdo_r_b,
  10.     mdi_a,mdi_r_a        ,mdi_b        ,mdi_r_b        ,
  11.         tr_busy_a        ,tr_busy_b        , sel_reg        ,write_reg ,addr_reg,wdata_reg         ,
  12.         sel_mem        ,write_mem         ,addr_mem        ,wdata_mem         ,rdata_mem         ,parityb ,rdata_reg );
  13.        
  14.         initial
  15.         begin
  16.         rst=1'b0;
  17.        
  18.         clk=1'b0;
  19.         ext_clk=1'b0;
  20.         mdi_a=1'b0;
  21.         mdi_r_a=1'b0;
  22.         mdi_b=1'b0;
  23.         mdi_r_b=1'b0;
  24.        
  25.         //sel_reg=1'b0;
  26.         //write_reg=1'b0;
  27.         sel_mem        =1'b0;
  28.         write_mem=1'b0;
  29.        
  30.        
  31.        
  32.        
  33.         end
  34.        
  35.        
  36.         initial
  37.         begin
  38.         #10 rst=1'b1;
  39.                 sel_mem        =1'b1;
  40.         write_mem=1'b1;
  41.         addr_mem=12'b001111000010;
  42.         wdata_mem=16'b0000000100000000;
  43.         #56
  44.         addr_mem=12'b001001000010;
  45.         wdata_mem=16'b0000000100000000;
  46.         #66
  47.         addr_mem=12'b000110100001;
  48.         wdata_mem=16'b0000000100000000;
  49.                         //"0001 1010 0000" + r.command_word.sub_addr;
  50.         #66
  51.         addr_mem=12'b000101100001;
  52.         wdata_mem=16'b0000000100000010;
  53.         #66
  54.        
  55.         addr_mem=12'b000100000010;
  56.         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

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top