我在用 JK 触发器编码 3 位计数器时遇到了这个问题,我碰巧在 XILINX VHDL 自动编写的 34 行中有一个错误,所以我对实际错误感到困惑。
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_unsigned.all;
USE ieee.numeric_std.ALL;
ENTITY 3bitBrojacTest_vhd IS
END 3bitBrojacTest_vhd;
ARCHITECTURE behavior OF 3bitBrojacTest_vhd IS
-- Component Declaration for the Unit Under Test (UUT)
COMPONENT Asinhroni3BitBrojacModule
PORT(
Clk : IN std_logic;
High : IN std_logic;
Q0 : INOUT std_logic;
Q1 : INOUT std_logic;
Q2 : INOUT std_logic;
Q2neg : INOUT std_logic
);
END COMPONENT;
--Inputs
SIGNAL Clk : std_logic := '0';
SIGNAL High : std_logic := '0';
--BiDirs
SIGNAL Q0 : std_logic;
SIGNAL Q1 : std_logic;
SIGNAL Q2 : std_logic;
SIGNAL Q2neg : std_logic;
BEGIN
-- Instantiate the Unit Under Test (UUT)
uut: Asinhroni3BitBrojacModule PORT MAP(
Clk => Clk,
High => High,
Q0 => Q0,
Q1 => Q1,
Q2 => Q2,
Q2neg => Q2neg
);
clk_proc: process
begin
Clk <= '1';
wait for 10ns;
Clk <= '0';
wait for 10ns;
end process;
tb : PROCESS
BEGIN
-- Wait 100 ns for global reset to finish
wait for 100ns;
High <= '1';
wait for 160ns;
High <= '0';
wait; -- will wait forever
END PROCESS;
END;
所以,错误说:
错误:HDLParsers:164 - 第 34 行。解析错误,意外 INTEGER_LITERAL,期待 IDENTIFIER 解析“3bitBrojacTest_vhd_stx.prj”:1.27
如果有人知道如何解决这个问题,我会很高兴得到这个答案。多谢你们!