0
线62:信号s不能合成,坏的同步描述。 当前软件 版本中不支持用于描述同步元素 (寄存器,内存等)的说明风格。VHDL:信号s不能合成
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity clock is
Port (start : in STD_LOGIC;
reset : in STD_LOGIC;
CLOCK : in STD_LOGIC;
setH, setM, setS : in STD_LOGIC;
alarmH, alarmM, alarmS : in STD_LOGIC;
Alarm_On : in STD_LOGIC;
Buzzer_Stop : in STD_LOGIC;
BUZZER : out STD_LOGIC;
hh, mm, ss : out INTEGER);
end clock;
architecture Behavioral of clock is
signal h, m, s : INTEGER range 0 to 60 := 0;
signal hA, mA, sA : INTEGER range 0 to 60 := 0;
signal clk : std_logic :='0';
signal count : integer :=1;
begin
Frequency_Reducer : process(CLOCK) --Reducing Frequency From 40MHz to 1Hz
begin
if rising_edge(CLOCK) then
count <= count + 1;
if(count = 20000000) then
clk <= not clk;
count <=1;
end if;
end if;
end process;
Clock_Logic : process(start, reset, clk)
begin
if reset = '1' then
h <= 00;
m <= 00;
s <= 0;
end if;
if start = '1' then
if rising_edge(clk) then --Clock Logic Start
s <= s + 1;
end if;
end if;
if s = 60 then
s <= 0;
m <= m + 1;
end if;
if m = 60 then
m <= 0;
h <= h + 1;
end if;
if h = 24 then
h <= 0;
end if; --Clock Logic End
if setH = '1' then --Set Time Logic Start
h <= h + 1;
end if;
if setM = '1' then
m <= m + 1;
end if;
if setS = '1' then
s <= s + 1;
end if; -- Set Time Logic End
end process;
hh <= h;
mm <= m;
ss <= s;
end Behavioral;
并非所有的任务,以's'是同步的上升沿时钟。而你的代码也不是闩锁的描述。请在支持的寄存器样式上查看综合工具手册。似乎低于复位的所有分配应该与时钟的上升沿同步。 –
@MartinZabel我试过了,它没有解决问题 –
使用一秒时钟不能设置时钟运行的秒数,这需要一个负载。您可以考虑使用寄存器从时钟加载的秒,分钟和小时,并通过一个按钮增加,完成后重新加载到时钟(设置模式)。额外的寄存器也可以用于报警。或者,您可以简单地重置秒并按照[vhdl手动时钟小时集](https://stackoverflow.com/questions/27207698/vhdl-manual-clock-hour-set)递增分钟和小时。检查答案,它显示了所有钟表并且合成合格。 – user1155120