Advertisement
Guest User

Untitled

a guest
Oct 16th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. ----------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date: 10:35:26 04/12/2016
  6. -- Design Name:
  7. -- Module Name: cw6 - Behavioral
  8. -- Project Name:
  9. -- Target Devices:
  10. -- Tool versions:
  11. -- Description:
  12. --
  13. -- Dependencies:
  14. --
  15. -- Revision:
  16. -- Revision 0.01 - File Created
  17. -- Additional Comments:
  18. --
  19. ----------------------------------------------------------------------------------
  20. LIBRARY ieee;
  21. USE ieee.std_logic_1164.ALL;
  22. USE ieee.std_logic_unsigned.all;
  23. USE ieee.numeric_std.ALL;
  24.  
  25. ENTITY disp_tb IS
  26. END disp_tb;
  27.  
  28. ARCHITECTURE behavior OF disp_tb IS
  29.  
  30. -- Component Declaration for the Unit Under Test (UUT)
  31.  
  32. COMPONENT cw6
  33. PORT(
  34. clk_i : IN std_logic;
  35. led7_seg_o : OUT std_logic_vector(7 downto 0);
  36. led7_an_o : OUT std_logic_vector(3 downto 0);
  37. sw_i : IN std_logic_vector(7 downto 0);
  38. btn_i : IN std_logic_vector(3 downto 0)
  39. );
  40. END COMPONENT;
  41.  
  42.  
  43. --Inputs
  44. signal clk_i : std_logic := '0';
  45. signal sw_i : std_logic_vector(7 downto 0) := (others => '0');
  46. signal btn_i : std_logic_vector(3 downto 0) := (others => '0');
  47.  
  48. --Outputs
  49. signal led7_seg_o : std_logic_vector(7 downto 0);
  50. signal led7_an_o : std_logic_vector(3 downto 0);
  51.  
  52. -- Clock period definitions
  53. constant clk_i_period : time := 1 ns;
  54.  
  55. BEGIN
  56.  
  57. -- Instantiate the Unit Under Test (UUT)
  58. uut: top PORT MAP (
  59. clk_i => clk_i,
  60. led7_seg_o => led7_seg_o,
  61. led7_an_o => led7_an_o,
  62. sw_i => sw_i,
  63. btn_i => btn_i
  64. );
  65.  
  66. -- Clock process definitions
  67. clk_i_process :process
  68. begin
  69. clk_i <= '0';
  70. wait for clk_i_period/2;
  71. clk_i <= '1';
  72. wait for clk_i_period/2;
  73. end process;
  74.  
  75.  
  76. -- Stimulus process
  77. stim_proc: process
  78. begin
  79. -- hold reset state for 100ms.
  80. wait for 100 ns;
  81. sw_i <= "11110011";
  82. wait for 10 ns;
  83. btn_i <= "1000";
  84. wait for 10 ns;
  85. btn_i <= "0000"
  86. wait for 100 ns;
  87. swi_i <= "11000001";
  88. wait for 10 ns;
  89. btn_i <= "0100";
  90. wait for 10 ns;
  91. btn_i <= "0000";
  92. wait for 10 ns;
  93.  
  94.  
  95. wait;
  96. end process;
  97.  
  98. END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement