initial语句中,为什么这个时延没有出现呢?
刚学CPLD,用verilog,照着书上的例子写initial语句。代码如下:`timescale 1ns/1ns
module led (Pop, Pid) ;
output Pop, Pid ;
reg Pop, Pid ;
initial
begin
Pop = 0; // 语句 1。
Pop = #5 1; // 语句 3。
Pid = #3 1; // 语句 4。
Pop = #6 0; // 语句 5。
Pid = #2 0; // 语句 6。
end
endmodule
用quartus 9.0 来编译,然后生成波形文件后,结果看到的波形和书上的波形不一样。波形如下:
http://cache.amobbs.com/bbs_upload782111/files_30/ourdev_566495NAEMSW.jpg
(原文件名:仿真波形.jpg)
http://cache.amobbs.com/bbs_upload782111/files_30/ourdev_566496DPOD4K.jpg
(原文件名:书上波形.jpg)
我现在就奇怪了,为什么时延没有效果呢?而且quartus生成仿真波形时候还发出如下警告:
Warning: Waveform settings file D:/FPGA/EPM240/test1/db/wed.wsf at (line:76, col:20) has warning : no such channel in waveform file, ignore display line settings for this signal
Warning: Waveform settings file D:/FPGA/EPM240/test1/db/wed.wsf at (line:84, col:20) has warning : no such channel in waveform file, ignore display line settings for this signal
Warning: Waveform settings file D:/FPGA/EPM240/test1/db/wed.wsf at (line:92, col:20) has warning : no such channel in waveform file, ignore display line settings for this signal
Warning: Waveform settings file D:/FPGA/EPM240/test1/db/wed.wsf at (line:100, col:20) has warning : no such channel in waveform file, ignore display line settings for this signal 这个应该是很简单的问题吧,就是时延没产生效果啊,一般入门了的人都肯定可以搞定的啊,为什么就没个人给俺解答下呢! 楼主哥是要写testbench测试代码还是rtl可综合代码?如果是后者,您的代码initial部分是不可综合的,所以仿真看不出想要结果。
当然如果是testbench,使用modelsim之类的软件就可以仿真到想要的波形。
此外,rtl代码没有延时这种说法,你试着编写定时器,使用状态标志来实现顺序的行为。
[原创].怎样在有限状态机中延时.
http://www.cnblogs.com/yuphone/archive/2010/05/12/1733867.html 汗,多谢楼上的高手指点。
页:
[1]