ATA 发表于 2010-6-26 11:07:28

这样坦也太空洞了吧?谁能举个例子说明。先谢了!!

FFT 发表于 2010-6-26 11:32:44

希望楼上的能举例子说明一下,谢谢!

tim 发表于 2010-6-26 13:03:08

举两个延时在testbench中的简单例子。<br>
<br>
1。 时钟发生器<br>
// 产生一个周期为10,占空比为50%的时钟信号<br>
parameter TCLK = 10;<br>
reg clk;<br>
<br>
initial begin<br>
&nbsp;&nbsp;clk = 1'b0;<br>
&nbsp;&nbsp;forever #(TCLK/2) clk = !clk;<br>
end<br>
<br>
2。 产生时序激励信号<br>
initial begin<br>
&nbsp;&nbsp;din = 1'b0;<br>
#1 din = 1'b1;<br>
#4 din = 1'b0;<br>
...<br>
end

ups 发表于 2010-6-26 14:34:54

不错哦。呵呵。学到了

interig 发表于 2010-6-26 15:11:18

大家讲的不错

longtime 发表于 2010-6-26 16:35:01

大家都很好,很热情,谢谢

HDL 发表于 2010-6-26 17:24:51

写综合的代码的确不起作用

usd 发表于 2010-6-26 19:17:48

最好不要在设计模块的时候加延迟的语句,因为综合出来跟不加是一个结果。一般加延时的语句都是在testbench的时候用来测试的时候加的。

encounter 发表于 2010-6-26 20:53:13

Not only for testbench, also for RTL simulation.<br>
ex.<br>
<br>
always @(negedge rstn or posedge PPC_LCLK1) begin&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>
&nbsp; &nbsp; &nbsp; &nbsp; if (~rstn) uPD_USB_INTCn_D = #1 1'b1;<br>
&nbsp; &nbsp; &nbsp; &nbsp; else uPD_USB_INTCn_D = #1 uPD_USB_INTCn;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>
end<br>
<br>
#1 means data delay 1 time unit after clock changed. If no #1 you will find data and clk change at the same edge , it is not real world.<br>
For a D type FF, you can find the a parameter that is CLK to Q&nbsp;&nbsp;propagation delay. You can implement ck-&gt; q delay here.<br>
#N let your RTL design more close to real world. Just more close, Synthesizer will ignore #N, but you will get a delay #M at gate level.<br>
The delay between RTL and gate level&nbsp;&nbsp;is different (#N/#M) but they all have dealy. If no #N, that means no delay, it is quite different.

ATA 发表于 2010-6-26 22:05:17

原帖由 dexterchn 于 2006-6-21 15:09 发表<br>
举两个延时在testbench中的简单例子。<br>
<br>
1。 时钟发生器<br>
// 产生一个周期为10,占空比为50%的时钟信号<br>
parameter TCLK = 10;<br>
reg clk;<br>
<br>
initial begin<br>
&nbsp;&nbsp;clk = 1'b0;<br>
&nbsp;&nbsp;forever #(TCLK/2) clk = !clk;<br>
e ... 呵呵!<br>
看懂了!
页: 1 [2] 3
查看完整版本: VERILOG中那些延时语句有什么作用