【发布时间】:2022-12-09 17:39:44
【问题描述】:
我真的很困惑,因为它是一个简单的代码,我没有发现错误。语法很好,但在模拟中 Dready 和 acc_value 的值不会改变。
这是我的模块 MVM.vhd:
entity MVM is
port (
CLK: IN std_logic;
RST: IN std_logic;
DREADY: OUT std_logic
);
end entity MVM;
architecture base of MVM is
begin
process(CLK)
variable acc_value : signed(15 downto 0);
begin
IF rising_edge(CLK) then
IF RST='1' THEN
acc_value := (OTHERS => '0'); -- reset
DREADY <= '0';
END IF;
END IF;
END process;
end base;
如果 Reset 为高电平,则应将 Dready 和 acc_value 的值设置为“0”
我的测试台:
entity tb_MVM is
-- Port ( );
end tb_MVM;
architecture TEST of tb_MVM is
Component MVM
port (
CLK: IN std_logic;
RST: IN std_logic;
DREADY: OUT std_logic
);
End component;
signal CLK: std_logic;
signal RST: std_logic;
signal DREADY: std_logic;
BEGIN
uut: MVM Port Map(
CLK=>CLK,
RST=>RST,
DREADY => DREADY
);
tb: process
BEGIN
wait for 100ns;
CLK <= '1';
RST <= '1';
wait for 100ns;
CLK <= '0';
wait for 100ns;
CLK <= '1';
RST <= '0';
END PROCESS;
end TEST;
在模拟中,DREADY 和 acc_value 未定义('X')
【问题讨论】: