那位大哥救救我呀quartusII仿真遇到错误
出现了这样的警告
Warning: No clock transition on "count[0]" register due to stuck clock or clock enable
这样的警告是什么意思呀
你是不是有 gated clock 没有 enable ?
做仿真用modelsim啊,quartus慢死了,仿真不是它的强项
楼上的大哥什么是gated clock还有什么是 enable 呀,小弟新手不明白呀
要不我把程序贴上吧,之前写得更复杂大程序都没问题,这个不知道咋回事
LIBRARY ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_signed.all;
ENTITY tongbu IS
PORT(
CLK : IN std_logic; --晶振时钟
clks : IN std_logic; --秒脉冲输入
reset : IN std_logic;
clk_tb : OUT STD_LOGIC ;--同步信号输出
right : OUT STD_LOGIC ;
fault : OUT STD_LOGIC );
END tongbu ;
ARCHITECTURE a OF tongbu IS
SIGNAL s0 : STD_LOGIC ;
SIGNAL s1 : STD_LOGIC ;
SIGNAL s2 : STD_LOGIC ;
signal count :integer range 0 to 255;
signal pps_count :integer range 0 to 8;
signal low_count :integer range 0 to 8;
BEGIN
process(clks,s0)
begin
if(clks'event and clks='1')then
s1<='1';
end if;
if(s0='1')then
s1<='0';
end if;
end process;
process(CLK,clks,s1,count,reset)
begin
if(s1='1')then
if(CLK'event and CLK='1')then
if(count=255 or (clks='1' and count>25)or reset='0')then
count<=0;
else count<=count+1;
end if;
end if;
end if;
end process;
process(clks,count)
begin
if(clks'event and clks='0')then
if(count<25 and s2='0')then
low_count<=low_count+1;
end if;
end if;
end process;
process(low_count)
begin
if(low_count>1)then
s0<='1';
else s2<='1';
end if;
end process;
process(clks,count,pps_count)
begin
if(count>248 and count<252 and pps_count<4)then
if(clks'event and clks='1')then
pps_count<=pps_count+1;
end if;
end if;
end process;
process(pps_count)
begin
if(pps_count>2)then
right<='1';
fault<='0';
elsif(pps_count<3)then
fault<='1';
right<='0';
end if;
end process;
END a;
把count定义成std_logic试试。
楼上的大哥你好,改成std_logic怎么可以呀,count是个计数器呀
if(count=255 or (clks='1' and count>25)or reset='0')then
count<=0;
else count<=count+1;
end if;
感觉是这一段代码有问题的,你要不改成下面这样子再试试
if reset='0' then
count<=0;
elsif(count=255 or (clks='1' and count>25))then
count<=0;
else
count<=count+1;
end if;
另外,std_logic类型是可以用于计数器的
的确,quartus仿真不行
的确,quartus仿真不行
首先谢谢高手们的回答
不过还是不对劲呀,先不说仿真的事在编译时出现这样的警告应该怎么办呀
Warning: No clock transition on "count[0]" register due to stuck clock or clock enable
Warning: Reduced register "count[0]" with stuck clock_enable port to stuck value GND
Warning: No clock transition on "count[1]" register due to stuck clock or clock enable
Warning: Reduced register "count[1]" with stuck clock_enable port to stuck value GND
Warning: No clock transition on "count[2]" register due to stuck clock or clock enable
Warning: Reduced register "count[2]" with stuck clock_enable port to stuck value GND
还有很多类似的
晕,这么简单的问题。直接把内部信号拉到引脚。就是在port里面定义一个引脚。注意这样只能开功能仿真,时序仿真是没有意义的,因为引脚有额外的布线延时。
这个告警的引发原因有下,你可以对照着检查一下
1. 时钟没有正确引入,或是使能一直无效
2. 代码中出现了组合逻辑做的反馈
3. 代码中if条件永远满足不了
