首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >进程中的VHDL指令未执行

进程中的VHDL指令未执行
EN

Stack Overflow用户
提问于 2021-03-08 12:33:49
回答 1查看 50关注 0票数 0

我的任务是设计一个缓存和缓存控制器。我正在从内存中读取一个块的16个字节,并将其写入缓存。仅在块的最后一个字节上,data_array不会更新,并保持为0。我已经成功地将意外行为隔离为一条奇怪的不执行的指令。

代码语言:javascript
复制
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

entity cache is
...
port(
    ...
    m_readdata : in std_logic_vector (7 downto 0);
    ...
);
end cache;

architecture arch of cache is

...
type Data_Array_Type is array (31 downto 0) of std_logic_vector(127 downto 0);
signal data_array : Data_Array_Type := (others=> (others=>'0'));
...

begin
  process(clock, reset)
    begin
      ...
      data_array (index) (127 downto 120) <= m_readdata;
      report "m_readdata: " & integer'image(to_integer(unsigned(m_readdata)));
      report "data_array (index) (127 downto 120): " & integer'image(to_integer(unsigned(data_array (index) (127 downto 120))));
      ...
    end process;
end arch;

这是输出。

代码语言:javascript
复制
# ** Note: m_readdata: 255
#    Time: 195500 ps  Iteration: 0  Instance: /cache_tb/dut
# ** Note: data_array (index) (127 downto 120): 0
#    Time: 195500 ps  Iteration: 0  Instance: /cache_tb/dut

输出显示了将m_readdata分配给data_array的这行代码没有以某种方式执行。其他任何地方都不会修改数据数组。

EN

回答 1

Stack Overflow用户

发布于 2021-03-08 12:52:06

这太奇怪了。很明显,这是因为VHDL直到下一次运行才会更新进程内部的值。在这里https://stackoverflow.com/a/13956532/7923070解释得更清楚了。

票数 -2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66524344

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档