【发布时间】:2014-11-16 03:49:08
【问题描述】:
自从我介绍 VHDL 课程以来已经 2 年了,我需要为我现在的课程项目重新学习 VHDL。我开始构建一个 4 位 CLA 加法器,并且正在开发一个测试平台。我收到以下错误,我不知道为什么。我很确定它应该是这样的,但我的记忆可能已经消失了。请帮我。
哦,作为参考,错误出现在 a 的第一个信号声明中
错误:COMP96_0019: adder_tb.vhd : (45, 53): 需要关键字“开始”。
错误:COMP96_0016: adder_tb.vhd : (45, 54): 需要设计单元声明。
我的测试平台代码:
l
ibrary IEEE;
use IEEE.STD_LOGIC_1164.all;
entity adder_tb is
end adder_tb;
architecture behavior of adder_tb is
-- Initialize the inputs/outputs of the unit to be tested
component cl_adder_4bit
port(
a : in std_logic_vector(3 downto 0);
b : in std_logic_vector(3 downto 0) ;
c_in : in std_logic := '0';
sum : out std_logic_vector(3 downto 0);
c_out : out std_logic
);
end component;
-- Signal declarations for stimulation
signal a : std_logic_vector(3 downto 0) := "0000"; //initial value will be 0;
signal b : std_logic_vector(3 downto 0) := "0000";
signal c_in : std_logic;
signal sum : std_logic_vector(3 downto 0);
signal c_out : std_logic;
begin
uut: cl_adder_4bit port map(
a <= a;
b <= b;
c_in <= c_in;
sum <= sum;
c_out <= c_out;
);
stimulate: process
begin
--This loop is for when c_in = 0
for i in 0 to 15 loop
-- This loop increments vector signal a, starting at b = 0x0
for j in 0 to 15 loop
wait for 5 ns; //wait for 5 ns
a <= a + 1;
end loop;
-- This loop increments vector signal b, starting at a = 0xF
for k in 0 to 15 loop
wait for 5 ns;
b <= b + 1;
end loop;
a <= a + 1;
b <= b + 1;
end loop;
--This second run is for when c_in is 1
for i in 0 to 15 loop
c_in <= '1';
-- This loop increments vector signal a, starting at b = 0x0
for j in 0 to 15 loop
wait for 5 ns; //wait for 5 ns
a <= a + 1;
end loop;
-- This loop increments vector signal b, starting at a = 0xF
for k in 0 to 15 loop
wait for 5 ns;
b <= b + 1;
end loop;
a <= a + 1;
b <= b + 1;
end loop;
end process;
end adder_tb;
【问题讨论】:
-
目前无法访问modelsim,但是 - 对应的实体在哪里?
-
哦,我应该包括我正在测试的加法器?
-
不,我的意思是测试台的实体。只有架构。你需要两者。此外,“end adder_tb” - 这是您应该如何结束实体的方式。你可以用“end architecture”结束的架构;
-
既然这是一个测试台,实体应该是空的吧? “实体#### is”然后“结束####”?
-
是的,完全正确。它应该被命名为 adder_tb,因为你的架构已经引用了它。
标签: compiler-errors vhdl