Guest User

Untitled

a guest
Mar 17th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 2.26 KB | None | 0 0
  1. --------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date:   12:59:11 11/14/2011
  6. -- Design Name:  
  7. -- Module Name:   C:/Users/RPOD/Documents/Studium/Technische Informatik/Aufgabe1/test.vhd
  8. -- Project Name:  Aufgabe1
  9. -- Target Device:  
  10. -- Tool versions:  
  11. -- Description:  
  12. --
  13. -- VHDL Test Bench Created by ISE for module: DECODER
  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 test IS
  36. END test;
  37.  
  38. ARCHITECTURE behavior OF test IS
  39.  
  40.     -- Component Declaration for the Unit Under Test (UUT)
  41.  
  42.     COMPONENT DECODER
  43.     PORT(
  44.          input : IN  bit_vector(3 downto 0);
  45.          output : OUT  bit_vector(6 downto 0)
  46.         );
  47.     END COMPONENT;
  48.    
  49.  
  50.    --Inputs
  51.    signal input : bit_vector(3 downto 0) := (others => '0');
  52.  
  53.     --Outputs
  54.    signal output : bit_vector(6 downto 0);
  55.    -- No clocks detected in port list. Replace <clock> below with
  56.    -- appropriate port name
  57.  
  58.    signal clock: std_logic;
  59.     constant clock_period : time := 10 ns;
  60.  
  61. BEGIN
  62.  
  63.     -- Instantiate the Unit Under Test (UUT)
  64.    uut: DECODER PORT MAP (
  65.           input => input,
  66.           output => output
  67.         );
  68.  
  69.    -- Clock process definitions
  70.    clock_process :process
  71.    begin
  72.         clock <= '0';
  73.         wait for clock_period/2;
  74.         clock <= '1';
  75.         wait for clock_period/2;
  76.    end process;
  77.  
  78.  
  79.    -- Stimulus process
  80.    stim_proc: process
  81.    begin       
  82.       -- hold reset state for 100 ns.
  83.       wait for 100 ns; 
  84.  
  85.       wait for clock_period*10;
  86.  
  87.       -- insert stimulus here
  88.  
  89.       wait;
  90.    end process;
  91.  
  92. END;
Add Comment
Please, Sign In to add comment