if reset='1' and rising_edge(clk) then
if h="001" then
s1<='1'; ------------------s1,s2,s3为信号的
end if;
if h="010" then
s2<='1';
end if;
if h="011" then
s3<='1';
end if; end if;
上面的程序可以实现功能仿真,但是时序仿真s1,s2,s3始终为0,请大家帮我看看是什么原因啊?
if reset='1' and rising_edge(clk) then
if h="001" then
s1<='1'; ------------------s1,s2,s3为信号的
end if;
if h="010" then
s2<='1';
end if;
if h="011" then
s3<='1';
end if; end if;
上面的程序可以实现功能仿真,但是时序仿真s1,s2,s3始终为0,请大家帮我看看是什么原因啊?
从程序上看没有问题,你需要reset=1,上升沿并h满足条件时才为1,而且你的if不完整,没有else,所以会生成latch,锁存else的条件。故一旦满足条件对应的s就会为1 了。
问题解决了 ,谢谢!
现有程序:
if reset='0' then
d1<="000000";
elsif rising_edge(s1) then
d1<=q;
end if;
d1为输出端口,s1,reset,q为输入引脚,进程中就它一个process
可是还有错误:Error (10629): VHDL error at b.vhd(25): can't synthesize logic for statement with conditions that test for the edges of multiple clocks
这是为什么啊
"可是还有错误:Error (10629): VHDL error at b.vhd(25): can't synthesize logic for statement with conditions that test for the edges of multiple clocks
这是为什么啊"
你将rising_edge(s1)放在reset=‘0’条件的外面,这相当于将同步信号条件放在外层if中,就可以了。
你这样的设计会让系统产生edges of multiple clocks。
恩,我觉得程序的外围应该还有一个同步信号的上升沿驱动,不然不会有edges of multiple clocks的警告。
而我在7楼的回复的意思是使用同步信号可以减少系统的误解,因为如果在
的程序中,如果其触发条件为@(posedge reset or posedge s1)的话,reset从0变到1就会比系统综合为另一个时钟,也会有edges of multiple clocks的警告。
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |