Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 2.93 KB | None | 0 0
  1. --------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date:   10:56:14 03/19/2019
  6. -- Design Name:  
  7. -- Module Name:   /home/adam/ISE/projekty/lcdddd/stoper/test.vhd
  8. -- Project Name:  stoper
  9. -- Target Device:  
  10. -- Tool versions:  
  11. -- Description:  
  12. --
  13. -- VHDL Test Bench Created by ISE for module: stoper
  14. --
  15. -- Dependencies:
  16. --
  17. -- Revision:
  18. -- Revision 0.01 - File Created
  19. -- Additional Comments:
  20. --
  21. -- Notes:
  22. -- This testbench has been automatically generated using types std_logic and
  23. -- std_logic_vector for the ports of the unit under test.  Xilinx recommends
  24. -- that these types always be used for the top-level I/O of a design in order
  25. -- to guarantee that the testbench will bind correctly to the post-implementation
  26. -- simulation model.
  27. --------------------------------------------------------------------------------
  28. LIBRARY ieee;
  29. USE ieee.std_logic_1164.ALL;
  30. USE ieee.std_logic_unsigned.all;
  31. USE ieee.numeric_std.ALL;
  32.  
  33. ENTITY test IS
  34. END test;
  35.  
  36. ARCHITECTURE behavior OF test IS
  37.  
  38.     -- Component Declaration for the Unit Under Test (UUT)
  39.  
  40.     COMPONENT stoper
  41.     PORT(
  42.          clk_i : IN  std_logic;
  43.          led7_an_o : OUT  std_logic_vector(3 downto 0);
  44.          led7_seg_o : OUT  std_logic_vector(7 downto 0);
  45.          start_stop_button_i : IN  std_logic;
  46.          rst_i : IN  std_logic
  47.         );
  48.     END COMPONENT;
  49.    
  50.  
  51.    --Inputs
  52.    signal clk_i : std_logic := '0';
  53.    signal start_stop_button_i : std_logic := '0';
  54.    signal rst_i : std_logic := '0';
  55.  
  56.     --Outputs
  57.    signal led7_an_o : std_logic_vector(3 downto 0);
  58.    signal led7_seg_o : std_logic_vector(7 downto 0);
  59.  
  60.    -- Clock period definitions
  61.    constant clk_i_period : time := 20ns;
  62.  
  63. BEGIN
  64.  
  65.     -- Instantiate the Unit Under Test (UUT)
  66.    uut: stoper PORT MAP (
  67.           clk_i => clk_i,
  68.           led7_an_o => led7_an_o,
  69.           led7_seg_o => led7_seg_o,
  70.           start_stop_button_i => start_stop_button_i,
  71.           rst_i => rst_i
  72.         );
  73.  
  74.    -- Clock process definitions
  75.    clk_i_process :process
  76.    begin
  77.         clk_i <= '0';
  78.         wait for clk_i_period/2;
  79.         clk_i <= '1';
  80.         wait for clk_i_period/2;
  81.    end process;
  82.  
  83.  
  84.    -- Stimulus process
  85.    stim_proc: process
  86.    begin       
  87.       -- hold reset state for 100ms.
  88.       wait for 100ns;
  89.             start_stop_button_i <= '1';
  90.             wait for 200ns;
  91.             start_stop_button_i <= '0';
  92.         wait for 100ns;
  93.             start_stop_button_i <= '1';
  94.             wait for 2500ns;
  95.             start_stop_button_i <= '0';
  96.             wait for 1000ns;
  97.             start_stop_button_i <= '1';
  98.             wait for 2500ns;
  99.             start_stop_button_i <= '0';
  100.             wait for 1000ns;
  101.             start_stop_button_i <= '1';
  102.             wait for 2500ns;
  103.             start_stop_button_i <= '0';
  104.             wait for 1000ns;
  105.             start_stop_button_i <= '1';
  106.             wait for 2500ns;
  107.             start_stop_button_i <= '0';
  108.  
  109.       wait for clk_i_period*1000000000;
  110.  
  111.       -- insert stimulus here
  112.  
  113.       wait;
  114.    end process;
  115.  
  116. END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement