Advertisement
Guest User

VHDL BMSTU HW

a guest
May 18th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.42 KB | None | 0 0
  1. LIBRARY ieee;
  2. USE ieee.std_logic_1164.ALL;
  3. USE ieee.std_logic_unsigned.all;
  4. USE ieee.numeric_std.ALL;
  5.  
  6. ENTITY test IS
  7. END test;
  8.  
  9. ARCHITECTURE behavior OF test IS
  10.  
  11. -- Component Declaration for the Unit Under Test (UUT)
  12. COMPONENT control_unit
  13. PORT(
  14.    U : IN std_logic_vector(5 downto 0);
  15.    clk : IN std_logic;
  16.    rst : IN std_logic;
  17.    V : OUT std_logic_vector(7 downto 0)
  18. );
  19. END COMPONENT;
  20.  
  21. --Inputs
  22. signal U : std_logic_vector(5 downto 0) := (others => '0');
  23. signal clk : std_logic := '0';
  24. signal rst : std_logic := '0';
  25. --Outputs
  26. signal V : std_logic_vector(7 downto 1);
  27. -- Clock period definitions
  28. constant clk_period : time := 10ns;
  29.  
  30. BEGIN
  31.    -- Instantiate the Unit Under Test (UUT)
  32.    uut: control_unit PORT MAP (
  33.       U => U,
  34.       clk => clk,
  35.       rst => rst,
  36.       V => V
  37.    );
  38.  
  39.    -- Clock process definitions
  40.    clk_process : process
  41.    begin
  42.       clk <= '0';
  43.       wait for clk_period/2;
  44.       clk <= '1';
  45.       wait for clk_period/2;
  46.    end process;
  47.  
  48.    -- Stimulus process
  49.    stim_proc: process
  50.    begin
  51.       -- hold reset state for 100ns.
  52.       rst<='1';
  53.       wait for 100ns;
  54.       rst<='0';
  55.       wait for clk_period*10;
  56.       -- insert stimulus here
  57.       U<="000000";
  58.       wait for clk_period;
  59.       U<="110100";
  60.       wait for clk_period;
  61.       U<="111111";
  62.       wait for clk_period;
  63.       U<="111111";
  64.       wait for clk_period;
  65.       wait;
  66.    end process;
  67. END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement