我是一名新生,其任務是使用測試平臺構建3個組件,然後將它們排列成一個結構。我建立的所有3個組件都很好,但是當我將它們放在一起時,其中一個輸出保持未定義狀態。我試圖跟蹤名爲dat
的信號,這很好,但可能我沒有使用正確的語法將dat
信號分配給data_out
。 id_led_ind
是第二個輸出,它工作正常,但data_out
未定義。VHDL輸出在模擬中是不確定的,但編譯通過正確
下面是代碼(我認爲這個問題是在車道21 - 「DATA_OUT < = DAT」)
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
entity peak_detect is
port(
input : in std_logic_vector (7 downto 0);
data_out : out std_logic_vector (7 downto 0);
reset : in std_logic;
clock : in std_logic;
enable : in std_logic;
id_led_ind : out std_logic);
end peak_detect;
architecture dataflow of peak_detect is
signal a_big_b : std_logic;
signal en : std_logic;
signal dat : std_logic_vector (7 downto 0);
begin
en <= (enable or a_big_b);
data_out <= dat;
end dataflow;
architecture structure of peak_detect is
signal a_big_b : std_logic;
signal en : std_logic;
signal dat : std_logic_vector (7 downto 0);
component comp_8bit is
port(
A : in std_logic_vector (7 downto 0);
B : in std_logic_vector (7 downto 0);
res : out std_logic);
end component;
component dff is
port (
data : in std_logic_vector (7 downto 0);
q : out std_logic_vector (7 downto 0);
clk : in std_logic;
reset : in std_logic;
en : in std_logic);
end component;
component id_sens is
port(
data_in : in std_logic_vector (7 downto 0);
led : out std_logic);
end component;
begin
reg : dff port map (data => input, q => dat, clk => clock, reset => reset, en => enable);
comp : comp_8bit port map (A => input, B => dat, res => a_big_b);
sens : id_sens port map (data_in => dat, led => id_led_ind);
end structure;
在數據流架構中,驅動「dat」的是什麼? –
如果沒有命令行規範體系結構,並且沒有配置規範,那麼將選擇最後分析的體系結構,在這種情況下,這將是peak_detect的體系結構。如果數據流冒犯了您,請將其註釋掉。 – user1155120