2020-09-20 16:13:06 +08:00
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
-- Company:
|
|
|
|
-- Engineer:
|
|
|
|
--
|
|
|
|
-- Create Date: 21:25:23 09/18/2020
|
|
|
|
-- Design Name:
|
|
|
|
-- Module Name: /home/jan/Projekte/VNA2/FPGA/VNA/Test_DFT.vhd
|
|
|
|
-- Project Name: VNA
|
|
|
|
-- Target Device:
|
|
|
|
-- Tool versions:
|
|
|
|
-- Description:
|
|
|
|
--
|
|
|
|
-- VHDL Test Bench Created by ISE for module: DFT
|
|
|
|
--
|
|
|
|
-- 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;
|
|
|
|
|
|
|
|
-- Uncomment the following library declaration if using
|
|
|
|
-- arithmetic functions with Signed or Unsigned values
|
|
|
|
--USE ieee.numeric_std.ALL;
|
|
|
|
|
|
|
|
ENTITY Test_DFT IS
|
|
|
|
END Test_DFT;
|
|
|
|
|
|
|
|
ARCHITECTURE behavior OF Test_DFT IS
|
|
|
|
|
|
|
|
-- Component Declaration for the Unit Under Test (UUT)
|
|
|
|
|
|
|
|
COMPONENT DFT
|
|
|
|
GENERIC(BINS : integer);
|
|
|
|
PORT(
|
|
|
|
CLK : IN std_logic;
|
|
|
|
RESET : IN std_logic;
|
2020-11-08 00:10:41 +08:00
|
|
|
PORT1 : IN std_logic_vector(17 downto 0);
|
|
|
|
PORT2 : IN std_logic_vector(17 downto 0);
|
2020-09-20 16:13:06 +08:00
|
|
|
NEW_SAMPLE : IN std_logic;
|
2020-11-07 07:50:59 +08:00
|
|
|
NSAMPLES : in STD_LOGIC_VECTOR (12 downto 0);
|
2020-09-20 16:13:06 +08:00
|
|
|
BIN1_PHASEINC : IN std_logic_vector(15 downto 0);
|
|
|
|
DIFFBIN_PHASEINC : IN std_logic_vector(15 downto 0);
|
|
|
|
RESULT_READY : OUT std_logic;
|
|
|
|
OUTPUT : out STD_LOGIC_VECTOR (191 downto 0);
|
|
|
|
NEXT_OUTPUT : IN std_logic
|
|
|
|
);
|
|
|
|
END COMPONENT;
|
|
|
|
|
|
|
|
|
|
|
|
--Inputs
|
|
|
|
signal CLK : std_logic := '0';
|
|
|
|
signal RESET : std_logic := '0';
|
2020-11-08 00:10:41 +08:00
|
|
|
signal PORT1 : std_logic_vector(17 downto 0) := (others => '0');
|
|
|
|
signal PORT2 : std_logic_vector(17 downto 0) := (others => '0');
|
2020-09-20 16:13:06 +08:00
|
|
|
signal NEW_SAMPLE : std_logic := '0';
|
|
|
|
signal BIN1_PHASEINC : std_logic_vector(15 downto 0) := (others => '0');
|
|
|
|
signal DIFFBIN_PHASEINC : std_logic_vector(15 downto 0) := (others => '0');
|
|
|
|
signal NEXT_OUTPUT : std_logic := '0';
|
2020-11-07 07:50:59 +08:00
|
|
|
signal NSAMPLES : STD_LOGIC_VECTOR (12 downto 0);
|
2020-09-20 16:13:06 +08:00
|
|
|
|
|
|
|
--Outputs
|
|
|
|
signal RESULT_READY : std_logic;
|
|
|
|
signal OUTPUT : STD_LOGIC_VECTOR (191 downto 0);
|
|
|
|
|
|
|
|
-- Clock period definitions
|
|
|
|
constant CLK_period : time := 10 ns;
|
|
|
|
|
|
|
|
BEGIN
|
|
|
|
|
|
|
|
-- Instantiate the Unit Under Test (UUT)
|
|
|
|
uut: DFT
|
2020-11-05 05:22:02 +08:00
|
|
|
GENERIC MAP(BINS => 64)
|
2020-09-20 16:13:06 +08:00
|
|
|
PORT MAP (
|
|
|
|
CLK => CLK,
|
|
|
|
RESET => RESET,
|
|
|
|
PORT1 => PORT1,
|
|
|
|
PORT2 => PORT2,
|
|
|
|
NEW_SAMPLE => NEW_SAMPLE,
|
2020-11-05 05:22:02 +08:00
|
|
|
NSAMPLES => NSAMPLES,
|
2020-09-20 16:13:06 +08:00
|
|
|
BIN1_PHASEINC => BIN1_PHASEINC,
|
|
|
|
DIFFBIN_PHASEINC => DIFFBIN_PHASEINC,
|
|
|
|
RESULT_READY => RESULT_READY,
|
|
|
|
OUTPUT => OUTPUT,
|
|
|
|
NEXT_OUTPUT => NEXT_OUTPUT
|
|
|
|
);
|
|
|
|
|
|
|
|
-- Clock process definitions
|
|
|
|
CLK_process :process
|
|
|
|
begin
|
|
|
|
CLK <= '0';
|
|
|
|
wait for CLK_period/2;
|
|
|
|
CLK <= '1';
|
|
|
|
wait for CLK_period/2;
|
|
|
|
end process;
|
|
|
|
|
|
|
|
|
|
|
|
-- Stimulus process
|
|
|
|
stim_proc: process
|
|
|
|
begin
|
|
|
|
-- hold reset state for 100 ns.
|
|
|
|
RESET <= '1';
|
2020-11-08 00:10:41 +08:00
|
|
|
PORT1 <= "100000000000000000";
|
|
|
|
PORT2 <= "010000000000000000";
|
2020-09-20 16:13:06 +08:00
|
|
|
BIN1_PHASEINC <= "0100000000000000";
|
|
|
|
DIFFBIN_PHASEINC <= "0010000000000000";
|
2020-11-08 00:10:41 +08:00
|
|
|
NSAMPLES <= "0000000000011";
|
2020-09-20 16:13:06 +08:00
|
|
|
wait for 100 ns;
|
|
|
|
RESET <= '0';
|
|
|
|
wait for CLK_period*10;
|
|
|
|
NEW_SAMPLE <= '1';
|
|
|
|
wait for CLK_period;
|
|
|
|
NEW_SAMPLE <= '0';
|
2020-11-05 05:22:02 +08:00
|
|
|
while True loop
|
2020-11-07 07:50:59 +08:00
|
|
|
wait for CLK_period * 79;
|
2020-11-05 05:22:02 +08:00
|
|
|
NEW_SAMPLE <= '1';
|
|
|
|
wait for CLK_period;
|
|
|
|
NEW_SAMPLE <= '0';
|
|
|
|
end loop;
|
2020-09-20 16:13:06 +08:00
|
|
|
|
|
|
|
wait;
|
|
|
|
end process;
|
|
|
|
|
|
|
|
END;
|