Advertisement
Vedro

Dzielnik_test

Mar 17th, 2019
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 2.24 KB | None | 0 0
  1. --------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date:   12:20:09 03/16/2019
  6. -- Design Name:  
  7. -- Module Name:   C:/ZapiskiStudenckie/Dzielnik/Dzielnik_test.vhd
  8. -- Project Name:  Dzielnik
  9. -- Target Device:  
  10. -- Tool versions:  
  11. -- Description:  
  12. --
  13. -- VHDL Test Bench Created by ISE for module: Dzielnik_kod
  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.  
  31. -- Uncomment the following library declaration if using
  32. -- arithmetic functions with Signed or Unsigned values
  33. --USE ieee.numeric_std.ALL;
  34.  
  35. ENTITY Dzielnik_test IS
  36. END Dzielnik_test;
  37.  
  38. ARCHITECTURE behavior OF Dzielnik_test IS
  39.  
  40.     -- Component Declaration for the Unit Under Test (UUT)
  41.  
  42.     COMPONENT Dzielnik_kod
  43.     PORT(
  44.          CLK : IN  std_logic;
  45.          RST : IN  std_logic;
  46.          LED : OUT  std_logic
  47.         );
  48.     END COMPONENT;
  49.    
  50.  
  51.    --Inputs
  52.    signal CLK : std_logic := '0';
  53.    signal RST : std_logic := '0';
  54.  
  55.     --Outputs
  56.    signal LED : std_logic;
  57.  
  58.    -- Clock period definitions
  59.    constant CLK_period : time := 10 ns;
  60.  
  61. BEGIN
  62.  
  63.     -- Instantiate the Unit Under Test (UUT)
  64.    uut: Dzielnik_kod PORT MAP (
  65.           CLK => CLK,
  66.           RST => RST,
  67.           LED => LED
  68.         );
  69.  
  70.    -- Clock process definitions
  71.    CLK_process :process
  72.    begin
  73.         CLK <= '0';
  74.         wait for CLK_period/2;
  75.         CLK <= '1';
  76.         wait for CLK_period/2;
  77.    end process;
  78.  
  79.  
  80.    -- Stimulus process
  81.    stim_proc: process
  82.    begin
  83.         RST <= '1';
  84.       -- hold reset state for 100 ns.
  85.       wait for 100 ns; 
  86.         RST <= '0';
  87.         wait for 300 ns;
  88.         RST <= '1';
  89.         wait for 5 ns;
  90.         RST <= '0';
  91.       -- insert stimulus here
  92.       wait;
  93.    end process;
  94.  
  95. END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement