Advertisement
Guest User

4_1_tb

a guest
Nov 6th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.36 KB | None | 0 0
  1. LIBRARY ieee;
  2. USE ieee.std_logic_1164.ALL;
  3.  
  4. -- Uncomment the following library declaration if using
  5. -- arithmetic functions with Signed or Unsigned values
  6. --USE ieee.numeric_std.ALL;
  7.  
  8. ENTITY lab4_1_tb IS
  9. END lab4_1_tb;
  10.  
  11. ARCHITECTURE behavior OF lab4_1_tb IS
  12.  
  13.     -- Component Declaration for the Unit Under Test (UUT)
  14.  
  15.     COMPONENT lab4_1
  16.     PORT(
  17.          Syg : IN  std_logic;
  18.          Sel : IN  std_logic_vector(1 downto 0);
  19.          A : OUT  std_logic;
  20.          B : OUT  std_logic;
  21.          C : OUT  std_logic
  22.         );
  23.     END COMPONENT;
  24.    
  25.  
  26.    --Inputs
  27.    signal Syg : std_logic := '0';
  28.    signal Sel : std_logic_vector(1 downto 0) := (others => '0');
  29.  
  30.     --Outputs
  31.    signal A : std_logic;
  32.    signal B : std_logic;
  33.    signal C : std_logic;
  34.    -- No clocks detected in port list. Replace <clock> below with
  35.    -- appropriate port name
  36.  
  37. BEGIN
  38.  
  39.     -- Instantiate the Unit Under Test (UUT)
  40.    uut: lab4_1 PORT MAP (
  41.           Syg => Syg,
  42.           Sel => Sel,
  43.           A => A,
  44.           B => B,
  45.           C => C
  46.         );
  47.  
  48.  
  49.    -- Stimulus process
  50.    stim_proc: process
  51.    begin       
  52.       -- hold reset state for 100 ns.
  53.         Syg<='1';
  54.         Sel<="00"; wait for 100 ns;
  55.         Sel<="01"; wait for 100 ns;
  56.         Sel<="10"; wait for 100 ns;
  57.         Sel<="11"; wait for 100 ns;
  58.       -- insert stimulus here
  59.  
  60.       wait;
  61.    end process;
  62.  
  63. END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement