我是一名新生,其任务是使用测试平台构建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