大家好我正在尝试使用联盟工具合成VHDL代码。但我有一个非法的并发声明错误。我是VHDL的新手,我正在尝试理解并发和顺序语句,所以我真的不明白为什么我在案例中得到一个非法的并发声明。你能否帮我解决这个错误。
这是一段代码,但基本相同:
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity reg_P is
port (
A : in unsigned(7 downto 0);
CLK : in std_logic;
EstPresente : in unsigned(7 downto 0);
P : out unsigned(7 downto 0);
RI : in unsigned(7 downto 0);
RPS : in std_logic
);
end reg_P;
architecture FromVerilog of reg_P is
signal P_Reg : unsigned(7 downto 0);
begin
P <= P_Reg;
process (CLK)
begin
if (rising_edge(CLK)) then
if ((not RPS) = '1') then
P_Reg <= X"00";
else
case EstPresente is
when X"02" then
case RI is
when X"16" then
P_Reg <= A;
when X"36" then
P_Reg <= (P_Reg - X"01");
when X"26" then
P_Reg <= (P_Reg - X"01");
when others then
P_Reg <= P_Reg;
end case;
when others then
P_Reg <= P_Reg;
end case;
end if;
end if;
end process;
end architecture;
答案 0 :(得分:3)
您的案例陈述中的then
选项应该是复合分隔符=>
。
替换这6个实例并进行代码分析。
case EstePresente is
when X"02" =>
case RI is
when X"16" =>
P_Reg <= A;
when X"36" =>
P_Reg <= (P_Reg - X"01");
when X"26" =>
P_Reg <= (P_Reg - X"01");
when others =>
P_Reg <= P_Reg;
end case;
when others =>
P_Reg <= P_Reg;
end case;
ghdl -a reg_p.vhdl
reg_p.vhdl:26:19:'=&gt;'预期而不是'那么' ghdl:编译错误
从历史角度来看,合成成本太高,您需要在合成之前通过模拟验证模型。
模拟工具往往具有更好的错误报告。