Files
2026-06-29 13:23:36 -04:00

160 lines
5.6 KiB
VHDL

--------------------------------------------------------------------------------
-- Company:
-- Engineer:
--
-- Create Date: 16:53:22 03/24/2017
-- Design Name:
-- Module Name:
-- Project Name: xem7350
-- Target Device:
-- Tool versions:
-- Description:
--
-- VHDL Test Bench Created by ISE for module: dac_interface
--
-- Dependencies:
--
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
-- Notes:
-- This testbench has been automatically generated using types std_logic and
-- std_logic_vector for the ports of the unit under test. Xilinx recommends
-- that these types always be used for the top-level I/O of a design in order
-- to guarantee that the testbench will bind correctly to the post-implementation
-- simulation model.
--------------------------------------------------------------------------------
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE IEEE.STD_LOGIC_arith.ALL;
USE IEEE.STD_LOGIC_unsigned.ALL;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--USE ieee.numeric_std.ALL;
entity test_bench is
end test_bench;
architecture behavior of test_bench is
constant C_M_AXI_DATA_WIDTH : integer := 32;
constant C_M_AXI_ADDR_WIDTH : integer := 32;
-- Clock period definitions
constant CLK_125_PERIOD : time := 8 ns; -- 125 MHz
constant CLK_250_PERIOD : time := 4 ns; -- 250 MHz
constant S_AXI_ACLK_PERIOD : time := 10 ns; -- 100 MHz
constant M_AXI_ACLK_PERIOD : time := 4 ns; -- 250 MHz 2.58 ns; -- 387 MHz
constant QSFP4_AXIS_ACLK_PERIOD : time := 5.12 ns; -- 195.310 MHz 5.12 ns;
constant QSFP1_AXIS_ACLK_PERIOD : time := 5.12 ns; -- 195.310 MHz 5.12 ns;
signal clk_125 : std_logic := '0';
signal clk_125_aresetn : std_logic_vector(0 to 15) := (others => '0');
signal clk_125_reset : std_logic;
signal clk_250 : std_logic := '0';
signal clk_250_aresetn : std_logic_vector(0 to 15) := (others => '0');
signal clk_250_areset : std_logic;
signal tx_device_clk_1 : std_logic := '0';
signal tx_device_clk_aresetn_r : std_logic_vector(0 to 15) := (others => '0');
signal tx_device_clk_aresetn : std_logic;
signal rx_device_clk_1 : std_logic := '0';
signal rx_device_clk_aresetn_r : std_logic_vector(0 to 15) := (others => '0');
signal rx_device_clk_aresetn : std_logic;
signal rx_device_clk_areset : std_logic;
signal qsfp4_axis_aclk : std_logic := '0';
signal qsfp4_axis_aresetn_r : std_logic_vector(0 to 15) := (others => '0');
signal qsfp4_axis_aresetn : std_logic;
signal qsfp1_axis_aclk : std_logic := '0';
signal qsfp1_axis_aresetn_r : std_logic_vector(0 to 15) := (others => '0');
signal qsfp1_axis_aresetn : std_logic;
--
signal tick_1ms : std_logic;
signal clk_125_tick_1ms_r : std_logic_vector(0 to 2) := (others => '0');
signal clk_125_freq_r : std_logic_vector(31 downto 0) := (others => '0');
signal clk_125_cnt_r : std_logic_vector(31 downto 0) := (others => '0');
signal clk_250_tick_1ms_r : std_logic_vector(0 to 2) := (others => '0');
signal clk_250_freq_r : std_logic_vector(31 downto 0) := (others => '0');
signal clk_250_cnt_r : std_logic_vector(31 downto 0) := (others => '0');
signal cmac_0_rx_tdata_512b : std_logic_vector(511 downto 0) := (others => '0');
signal cmac_0_rx_tvalid_512b_en : std_logic := '1';
signal cmac_0_rx_tready_512b : std_logic;
begin
clk_125 <= not clk_125 after CLK_125_PERIOD/2;
clk_250 <= not clk_250 after CLK_250_PERIOD/2;
tx_device_clk_1 <= not tx_device_clk_1 after CLK_250_PERIOD/2;
rx_device_clk_1 <= not rx_device_clk_1 after CLK_250_PERIOD/2;
qsfp4_axis_aclk <= not qsfp4_axis_aclk after QSFP4_AXIS_ACLK_PERIOD/2;
qsfp1_axis_aclk <= not qsfp1_axis_aclk after QSFP1_AXIS_ACLK_PERIOD/2;
--
process(clk_125)
begin
if (rising_edge(clk_125)) then
clk_125_aresetn <= clk_125_aresetn(1 to 15) & '1';
end if;
end process;
process(clk_125)
begin
if (rising_edge(clk_125)) then
clk_125_aresetn <= clk_125_aresetn(1 to 15) & '1';
end if;
end process;
clk_125_reset <= not clk_125_aresetn(0);
--
process(clk_250)
begin
if (rising_edge(clk_250)) then
clk_250_aresetn <= clk_250_aresetn(1 to 15) & '1';
end if;
end process;
clk_250_areset <= not clk_250_aresetn(0);
--
process(tx_device_clk_1)
begin
if (rising_edge(tx_device_clk_1)) then
tx_device_clk_aresetn_r <= tx_device_clk_aresetn_r(1 to 15) & '1';
end if;
end process;
tx_device_clk_aresetn <= tx_device_clk_aresetn_r(0);
i_axis_dwidth_converter_512b_to_128b_cmac_0 : entity work.axis_dwidth_converter_512b_to_128b
port map (
aclk => tx_device_clk_1, -- in
aresetn => tx_device_clk_aresetn, -- in
s_axis_tdata => cmac_0_rx_tdata_512b, -- in
s_axis_tvalid => cmac_0_rx_tvalid_512b_en, -- in
s_axis_tready => cmac_0_rx_tready_512b, -- out
m_axis_tdata => open, -- out
m_axis_tvalid => open, -- out
m_axis_tready => '1' -- in
);
end;