ccs 发表于 2010-5-31 09:04:15

新手弱问,Verilog中#可以综合吗?

下面这个模块中的#该如何理解?比如counter <= #1 8'd0;

module strobe_gen
( input clock,
    input reset,
    input enable,
    input rate, // Rate should be 1 LESS THAN your desired divide ratio
    input strobe_in,
    output wire strobe );
   
//   parameter width = 8;
   
   reg counter;
   assign strobe = ~|counter && enable && strobe_in;
   
   always @(posedge clock)
   if(reset | ~enable)
       counter <= #1 8'd0;
   else if(strobe_in)
       if(counter == 0)
   counter <= #1 rate;
       else
   counter <= #1 counter - 8'd1;
   
endmodule // strobe_gen
--

ccs 发表于 2010-5-31 09:04:29

这是USRP板子中的一段 硬件代码,是可以综合的

ccs 发表于 2010-5-31 09:04:42

#只是为仿真用的,模拟一些延时
综合时综合器会把#自动忽略

ccs 发表于 2010-5-31 09:04:59

综合没问题,#被无视了

Sunlife 发表于 2015-5-20 10:13:30

这是USRP板子中的一段 硬件代码,是可以综合的
页: [1]
查看完整版本: 新手弱问,Verilog中#可以综合吗?