Vhdl 盲/接地未使用的测试台端口

Vhdl 盲/接地未使用的测试台端口,vhdl,xilinx,vivado,Vhdl,Xilinx,Vivado,我得到了顶层模块,包括在测试台文件中实例化的子模块。子模块本身非常自由,因此当我测试顶部模块时,我只需要引入很少的信号和跟踪很少的输出,但是顶部模块有许多其他端口 我是否可以为这些引脚提供一些“默认”/“未定义”信号(和接收器)(不考虑其大小、类型) 我现在有两种方法来解决这个问题,要么拿出子模块来测试它(好吧,但我想在顶部模块中测试它),要么为输入写入适当的“零”输入,并为输出引入信号(也需要大量工作) 在Vivado 2015中使用VHDL 好的,这就是测试台 library IEEE; u

我得到了顶层模块,包括在测试台文件中实例化的子模块。子模块本身非常自由,因此当我测试顶部模块时,我只需要引入很少的信号和跟踪很少的输出,但是顶部模块有许多其他端口

我是否可以为这些引脚提供一些“默认”/“未定义”信号(和接收器)(不考虑其大小、类型)

我现在有两种方法来解决这个问题,要么拿出子模块来测试它(好吧,但我想在顶部模块中测试它),要么为输入写入适当的“零”输入,并为输出引入信号(也需要大量工作)

在Vivado 2015中使用VHDL

好的,这就是测试台

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use ieee.numeric_std.all;

entity tb_FIR_v0_3 is
end tb_FIR_v0_3;

architecture Behavioral of tb_FIR_v0_3 is   
shared variable C_S00_AXI_DATA_WIDTH : integer := 32;
shared variable C_S00_AXI_ADDR_WIDTH : integer := 7;

component FIR_v0_3 is
    generic (
        C_S00_AXI_DATA_WIDTH    : integer   := 32;
        C_S00_AXI_ADDR_WIDTH    : integer   := 7
    );
    port (
        fir_clk     : in  std_logic;
        fir_x_in    : in  std_logic_vector(C_S00_AXI_DATA_WIDTH-1 downto 0);
        fir_y_out   : out std_logic_vector(C_S00_AXI_DATA_WIDTH-1 downto 0);
        fir_d_out   : out std_logic_vector(C_S00_AXI_DATA_WIDTH-1 downto 0);
        -- User ports ends

        s00_axi_aclk    : in std_logic;
        s00_axi_aresetn : in std_logic;
        s00_axi_awaddr  : in std_logic_vector(C_S00_AXI_ADDR_WIDTH-1 downto 0);
        s00_axi_awprot  : in std_logic_vector(2 downto 0);
        s00_axi_awvalid : in std_logic;
        s00_axi_awready : out std_logic;
        s00_axi_wdata   : in std_logic_vector(C_S00_AXI_DATA_WIDTH-1 downto 0);
        s00_axi_wstrb   : in std_logic_vector((C_S00_AXI_DATA_WIDTH/8)-1 downto 0);
        s00_axi_wvalid  : in std_logic;
        s00_axi_wready  : out std_logic;
        s00_axi_bresp   : out std_logic_vector(1 downto 0);
        s00_axi_bvalid  : out std_logic;
        s00_axi_bready  : in std_logic;
        s00_axi_araddr  : in std_logic_vector(C_S00_AXI_ADDR_WIDTH-1 downto 0);
        s00_axi_arprot  : in std_logic_vector(2 downto 0);
        s00_axi_arvalid : in std_logic;
        s00_axi_arready : out std_logic;
        s00_axi_rdata   : out std_logic_vector(C_S00_AXI_DATA_WIDTH-1 downto 0);
        s00_axi_rresp   : out std_logic_vector(1 downto 0);
        s00_axi_rvalid  : out std_logic;
        s00_axi_rready  : in std_logic
    );
end component FIR_v0_3;

signal e_clk     : std_logic := '1' ;
signal e_reset   : std_logic := '1' ;
signal e_x_in    : std_logic_vector (31 downto 0);
signal e_y_out   : std_logic_vector (31 downto 0);
signal e_d_out   : std_logic_vector (31 downto 0);

signal s00_axi_awready   : std_logic;
signal s00_axi_wready    : std_logic;
signal s00_axi_bresp     : std_logic_vector(1 downto 0);
signal s00_axi_bvalid    : std_logic;
signal s00_axi_arready   : std_logic;
signal s00_axi_rdata     : std_logic_vector(32-1 downto 0);
signal s00_axi_rresp     : std_logic_vector(1 downto 0);
signal s00_axi_rvalid    : std_logic;

signal s00_axi_aclk     : std_logic := '0';
signal s00_axi_aresetn  : std_logic;
signal s00_axi_awaddr   : std_logic_vector(C_S00_AXI_ADDR_WIDTH-1 downto 0);
signal s00_axi_awprot   : std_logic_vector(2 downto 0);
signal s00_axi_awvalid  : std_logic := '0';
signal s00_axi_wdata    : std_logic_vector(C_S00_AXI_DATA_WIDTH-1 downto 0);
signal s00_axi_wstrb    : std_logic_vector((C_S00_AXI_DATA_WIDTH/8)-1 downto 0);
signal s00_axi_wvalid   : std_logic := '0';
signal s00_axi_bready   : std_logic := '0';
signal s00_axi_araddr   : std_logic_vector(C_S00_AXI_ADDR_WIDTH-1 downto 0);
signal s00_axi_arprot   : std_logic_vector(2 downto 0);
signal s00_axi_arvalid  : std_logic := '0';
signal s00_axi_rready   : std_logic := '0';

begin   
inst_FIR_v0_3 : FIR_v0_3
generic map (
    C_S00_AXI_DATA_WIDTH => 32,
    C_S00_AXI_ADDR_WIDTH => 7
)
port map (
    -- Users to add ports here
    fir_clk     => e_clk,
    fir_x_in    => e_x_in,
    fir_y_out   => e_y_out,
    fir_d_out   => e_d_out,

    -- Ports of Axi Slave Bus Interface S00_AXI
    s00_axi_aclk     => s00_axi_aclk,
    s00_axi_aresetn  => e_reset,
    s00_axi_awaddr   => ( others => '0' ),
    s00_axi_awprot   => ( others => '0' ),
    s00_axi_awvalid  => s00_axi_awvalid,
    s00_axi_awready  => s00_axi_awready,
    s00_axi_wdata    => ( others => '0' ),
    s00_axi_wstrb    => ( others => '0' ),
    s00_axi_wvalid   => s00_axi_wvalid,
    s00_axi_wready   => s00_axi_wready,
    s00_axi_bresp    => s00_axi_bresp,
    s00_axi_bvalid   => s00_axi_bvalid,
    s00_axi_bready   => s00_axi_bready,
    s00_axi_araddr   => ( others => '0' ),
    s00_axi_arprot   => ( others => '0' ),
    s00_axi_arvalid  => s00_axi_arvalid,
    s00_axi_arready  => s00_axi_arready,
    s00_axi_rdata    => s00_axi_rdata,
    s00_axi_rresp    => s00_axi_rresp,
    s00_axi_rvalid   => s00_axi_rvalid,
    s00_axi_rready   => s00_axi_rready
);

process
    variable count : integer := 0;
begin

    if ( count = 0 ) then
        -- e_reset <= '0'; -- VALUES NOT INITIATED PROPERLY, FUCKER ? ... With the non-stop, pop pop and stainless steel (DMX)
        e_x_in <= x"00000000";
    end if;

    if ( count = 3 ) then
        -- e_reset <= '1';
    end if;

    if ( count = 3 ) then
        e_x_in <= x"00000001";
    end if;

    if ( count = 5 ) then
        e_x_in <= x"00000000";
    end if;

    if ( count = 8 ) then
        e_x_in <= x"00000000";
    end if;

    e_clk <= not(e_clk);
    wait for 0.5 ns;
    count := count + 1;
    if( (count = 60) ) then
        count := 0;
    end if;
end process;


end Behavioral;
然后连接它们?像这样

s00_axi_wvalid   => s00_axi_wvalid,
s00_axi_wready   => s00_axi_wready,
s00_axi_bresp    => s00_axi_bresp,
s00_axi_bvalid   => s00_axi_bvalid,
s00_axi_bready   => s00_axi_bready,

是否有任何“通用”输入/输出信号可以连接到不重要的管脚,因为我不能让实例的端口保持未连接状态(据我所知并尝试过)。

如果我正确理解了问题,则
端口定义中的输入可以有默认值,在实例化中,输出可以保持不连接。例如:

entity ShiftRegister is
    Generic (
        WIDTH : integer
    );
    Port (
        clk : in  STD_LOGIC;
        enable : in  STD_LOGIC := '1';
        serial_in : in  STD_LOGIC := '0';
        parallel_out : out  STD_LOGIC_VECTOR (WIDTH-1 downto 0);
    );
end ShiftRegister;


在本例中,寄存器将始终处于启用状态,实体不会输出任何内容。在这种情况下,这不是一个非常有用的实例,但我认为这回答了您的问题

如果我正确理解了这个问题,那么
端口
定义中的输入可以有默认值,而在实例化中输出可以保持不连接。例如:

entity ShiftRegister is
    Generic (
        WIDTH : integer
    );
    Port (
        clk : in  STD_LOGIC;
        enable : in  STD_LOGIC := '1';
        serial_in : in  STD_LOGIC := '0';
        parallel_out : out  STD_LOGIC_VECTOR (WIDTH-1 downto 0);
    );
end ShiftRegister;


在本例中,寄存器将始终处于启用状态,实体不会输出任何内容。在这种情况下,这不是一个非常有用的实例,但我认为这回答了您的问题

按照我的示例,在不声明组件的情况下尝试它。使用
库.entity\u name
技术实例化。不幸的是,我使用的软件使用的是VHDL 87标准,因此我需要声明组件。。。。但我还是要试试。VHDL'87!那个软件当然应该得到一个名字和耻辱!按照我的示例,在不声明组件的情况下尝试它。使用
库.entity\u name
技术实例化。不幸的是,我使用的软件使用的是VHDL 87标准,因此我需要声明组件。。。。但我还是要试试。VHDL'87!那个软件当然应该得到一个名字和耻辱!
    SR : entity work.ShiftRegister
    Generic map (
        WIDTH : integer => 8
    )
    Port map(
        clk => serial_clk,
        serial_in => serial_data_in
    );