Advertisement
Guest User

Untitled

a guest
Oct 16th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. --------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date: 10:42:52 04/12/2016
  6. -- Design Name:
  7. -- Module Name: C:/Designs/Klimek_Wisniewski6/tb1.vhd
  8. -- Project Name: Klimek_Wisniewski6
  9. -- Target Device:
  10. -- Tool versions:
  11. -- Description:
  12. --
  13. -- VHDL Test Bench Created by ISE for module: cw6
  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 tb1 IS
  34. END tb1;
  35.  
  36. ARCHITECTURE behavior OF tb1 IS
  37.  
  38. -- Component Declaration for the Unit Under Test (UUT)
  39.  
  40. COMPONENT cw6
  41. PORT(
  42. clk_i : IN std_logic;
  43. led7_seg_o : OUT std_logic_vector(7 downto 0);
  44. led7_an_o : OUT std_logic_vector(3 downto 0);
  45. sw_i : IN std_logic_vector(7 downto 0);
  46. btn_i : IN std_logic_vector(3 downto 0)
  47. );
  48. END COMPONENT;
  49.  
  50.  
  51. --Inputs
  52. signal clk_i : std_logic := '0';
  53. signal sw_i : std_logic_vector(7 downto 0) := (others => '0');
  54. signal btn_i : std_logic_vector(3 downto 0) := (others => '0');
  55.  
  56. --Outputs
  57. signal led7_seg_o : std_logic_vector(7 downto 0);
  58. signal led7_an_o : std_logic_vector(3 downto 0);
  59.  
  60. -- Clock period definitions
  61. constant clk_i_period : time := 1ms;
  62.  
  63. BEGIN
  64.  
  65. -- Instantiate the Unit Under Test (UUT)
  66. uut: cw6 PORT MAP (
  67. clk_i => clk_i,
  68. led7_seg_o => led7_seg_o,
  69. led7_an_o => led7_an_o,
  70. sw_i => sw_i,
  71. btn_i => btn_i
  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. -- hold reset state for 100ms.
  88. wait for 10 ms;
  89. sw_i <= "11110011";
  90. wait for 5 ms;
  91. btn_i <= "1000";
  92. wait for 5 ms;
  93. btn_i <= "0000";
  94. wait for 10 ms;
  95. sw_i <= "11000001";
  96. wait for 10 ms;
  97. sw_i <= "11110011";
  98. wait for 5 ms;
  99. btn_i <= "0001";
  100. wait for 5 ms;
  101. btn_i <= "0000";
  102. wait for 10 ms;
  103.  
  104.  
  105.  
  106.  
  107. wait for 50 ms;
  108.  
  109. -- insert stimulus here
  110.  
  111. wait;
  112. end process;
  113.  
  114. END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement