Advertisement
Guest User

licznik_testbench

a guest
May 20th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. --------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date: 17:53:09 05/20/2019
  6. -- Design Name:
  7. -- Module Name: C:/Users/Student/Desktop/fpga_lab_t_s/Licznik1/licznik1_testbench.vhd
  8. -- Project Name: Licznik1
  9. -- Target Device:
  10. -- Tool versions:
  11. -- Description:
  12. --
  13. -- VHDL Test Bench Created by ISE for module: module1
  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.  
  31. -- Uncomment the following library declaration if using
  32. -- arithmetic functions with Signed or Unsigned values
  33. --USE ieee.numeric_std.ALL;
  34.  
  35. ENTITY licznik1_testbench IS
  36. END licznik1_testbench;
  37.  
  38. ARCHITECTURE behavior OF licznik1_testbench IS
  39.  
  40. -- Component Declaration for the Unit Under Test (UUT)
  41.  
  42. COMPONENT module1
  43. PORT(
  44. clk : IN std_logic;
  45. res : IN std_logic;
  46. outmod : OUT std_logic_vector(3 downto 0)
  47. );
  48. END COMPONENT;
  49.  
  50.  
  51. --Inputs
  52. signal clk : std_logic := '0';
  53. signal res : std_logic := '0';
  54.  
  55. --Outputs
  56. signal outmod : std_logic_vector(3 downto 0);
  57.  
  58. -- Clock period definitions
  59. constant clk_period : time := 10 ns;
  60.  
  61. BEGIN
  62.  
  63. -- Instantiate the Unit Under Test (UUT)
  64. uut: module1 PORT MAP (
  65. clk => clk,
  66. res => res,
  67. outmod => outmod
  68. );
  69.  
  70. -- Clock process definitions
  71. clk_process :process
  72. begin
  73. clk <= '0';
  74. wait for 10 ns;
  75. clk <= '1';
  76. wait for 10 ns;
  77. end process;
  78.  
  79.  
  80. -- Stimulus process
  81. stim_proc: process
  82. begin
  83. -- hold reset state for 100 ns.
  84. res <= '1';
  85. wait for 20 ns;
  86. res <= '0';
  87.  
  88. wait;
  89. end process;
  90.  
  91. END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement