Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. --------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date: 11:20:09 03/21/2019
  6. -- Design Name:
  7. -- Module Name: C:/Designs/OlcenLaszczuk/Projekt7/test.vhd
  8. -- Project Name: Projekt7
  9. -- Target Device:
  10. -- Tool versions:
  11. -- Description:
  12. --
  13. -- VHDL Test Bench Created by ISE for module: projekt7
  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. USE ieee.std_logic_unsigned.all;
  31. USE ieee.numeric_std.ALL;
  32.  
  33. ENTITY test IS
  34. END test;
  35.  
  36. ARCHITECTURE behavior OF test IS
  37.  
  38. -- Component Declaration for the Unit Under Test (UUT)
  39.  
  40. COMPONENT projekt7
  41. PORT(
  42. start_stop_button_i : IN std_logic;
  43. clk_i : IN std_logic;
  44. rst_i : IN std_logic;
  45. led7_an_o : OUT std_logic_vector(3 downto 0);
  46. led7_seg_o : OUT std_logic_vector(7 downto 0)
  47. );
  48. END COMPONENT;
  49.  
  50.  
  51. --Inputs
  52. signal start_stop_button_i : std_logic := '0';
  53. signal clk_i : std_logic := '0';
  54. signal rst_i : std_logic := '0';
  55.  
  56. --Outputs
  57. signal led7_an_o : std_logic_vector(3 downto 0);
  58. signal led7_seg_o : std_logic_vector(7 downto 0);
  59.  
  60. -- Clock period definitions
  61. constant clk_i_period : time := 20ns;
  62.  
  63. BEGIN
  64.  
  65. -- Instantiate the Unit Under Test (UUT)
  66. uut: projekt7 PORT MAP (
  67. start_stop_button_i => start_stop_button_i,
  68. clk_i => clk_i,
  69. rst_i => rst_i,
  70. led7_an_o => led7_an_o,
  71. led7_seg_o => led7_seg_o
  72. );
  73.  
  74. -- Clock process definitions
  75. clk_i_process :process
  76. begin
  77. clk_i <= '0';
  78. wait for clk_i_period/2;
  79. clk_i <= '1';
  80. wait for clk_i_period/2;
  81. end process;
  82.  
  83.  
  84. -- Stimulus process
  85. stim_proc: process
  86. begin
  87. wait for 10ns;
  88. start_stop_button_i <= '1';
  89. wait for 50ns;
  90. start_stop_button_i <= '0';
  91. wait for 450ns;
  92. start_stop_button_i <= '1';
  93. wait for 50ns;
  94. start_stop_button_i <= '0';
  95. wait;
  96. end process;
  97.  
  98. END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement