No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CPU_test.vhd 911B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. LIBRARY ieee;
  2. USE ieee.std_logic_1164.ALL;
  3. USE ieee.numeric_std.ALL;
  4. ENTITY CPU_test IS
  5. END CPU_test;
  6. ARCHITECTURE behavior OF CPU_test IS
  7. -- Component Declaration for the Unit Under Test (UUT)
  8. COMPONENT CPU
  9. PORT(
  10. clk : in STD_LOGIC;
  11. rst : IN std_logic
  12. );
  13. END COMPONENT;
  14. --Inputs
  15. signal clk : std_logic := '0';
  16. signal rst : std_logic := '0';
  17. -- Clock period definitions
  18. constant clk_period : time := 10 ns;
  19. BEGIN
  20. -- Instantiate the Unit Under Test (UUT)
  21. uut: CPU PORT MAP (
  22. clk => clk,
  23. rst => rst
  24. );
  25. -- Clock process definitions
  26. clk_process :process
  27. begin
  28. clk <= '0';
  29. wait for clk_period/2;
  30. clk <= '1';
  31. wait for clk_period/2;
  32. end process;
  33. -- Stimulus process
  34. stim_proc: process
  35. begin
  36. rst <= '1' after 2*clk_period;
  37. wait for 10*clk_period;
  38. wait;
  39. end process;
  40. END;