我正在尝试实现一个输入基本时钟的组件,并根据此方案输出一个模式:
我收到了这个错误,并且我已经尝试通过stackoverflow的各种建议以多种方式修复它,但没有...
错误:Xst:827 - “E:/Progetti/nuovi/Clock_generator/CG_ex_3/clock_ex3.vhd”第34行:信号 check_0 无法合成,同步描述不好。当前软件版本不支持您用于描述同步元素(寄存器,内存等)的描述样式。
有时相同的错误指的是 pre_forma_clk
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity clock_ex3 is
Port ( base_clk : in STD_LOGIC;
forma_clk : out STD_LOGIC);
end clock_ex3;
architecture Behavioral of clock_ex3 is
signal pre_forma_clk : std_logic := '0';
begin
forma_clk <= pre_forma_clk;
pattern_generator : process(base_clk) --line 34
variable check_0 : natural := 0;
variable check_1 : natural := 0;
variable check_2 : natural := 0;
variable check_3 : natural := 0;
begin
if (rising_edge(base_clk)) then
check_0 := check_0 + 1;
if (check_0 = 15) then
pre_forma_clk <= not pre_forma_clk;
end if;
end if;
if (falling_edge(base_clk) and check_0 >= 15) then
check_1 := check_1 + 1;
if (check_1 = 10) then
pre_forma_clk <= not pre_forma_clk;
end if;
end if;
if (falling_edge(base_clk) and check_1 >= 10) then
check_2 := check_2 + 1;
if (check_2 = 15) then
pre_forma_clk <= not pre_forma_clk;
end if;
end if;
if (rising_edge(base_clk) and check_2 >= 15) then
check_3 := check_3 + 1;
if (check_3 = 10) then
pre_forma_clk <= not pre_forma_clk;
check_0 := 0;
check_1 := 0;
check_2 := 0;
check_3 := 0;
end if;
end if;
end process;
end Behavioral;
我已经尝试在不同的IF中分离IF条件...... 谢谢你的帮助
答案 0 :(得分:2)
你的问题得到了很好的回答here。该问题与您的问题之间的区别在于,代码中的特定错误是您在一个进程中有多个if (rising_edge(clk)) then
结构;符合条件的合成过程只能包含一个这种类型的边缘检测器。
考虑一下您的功能需求,我将使用两个独立的上升沿和下降沿计数器实现这一点,每个计数器都有自己的进程,然后编写另一个实现状态机的进程,该状态机与这些计数器一起工作以实现所需的状态转换和计数器重置