集成电路技术分享

 找回密码
 我要注册

QQ登录

只需一步,快速开始

搜索
楼主: ups

VERILOG中那些延时语句有什么作用

[复制链接]
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 下一条

QQ|小黑屋|手机版|Archiver|fpga论坛|fpga设计论坛 ( 京ICP备20003123号-1 )

GMT+8, 2024-12-26 02:06 , Processed in 0.066364 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表