簡體   English   中英

處理中的 VHDL 指令未執行

[英]VHDL instruction in process isn't executed

我的任務是設計緩存和緩存 controller。 我正在從 memory 讀取塊的 16 個字節並將其寫入緩存。 僅在塊的最后一個字節上,data_array 沒有更新並且保持為 0。 我設法將意外行為隔離到一條奇怪地沒有執行的指令。

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;

這是 output。

# ** 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

output 顯示將 m_readdata 分配給 data_array 的行沒有以某種方式執行。 沒有其他地方正在修改數據數組。

這是超級奇特的。 顯然這是因為 VHDL 在下一次運行之前不會更新進程內的值。 這里解釋得更清楚https://stackoverflow.com/a/13956532/7923070

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM