martaczaska

Untitled

Apr 1st, 2019
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. LIBRARY ieee;
  2. USE ieee.std_logic_1164.ALL;
  3. USE ieee.std_logic_unsigned.all;
  4. USE ieee.numeric_std.ALL;
  5.  
  6. ENTITY dzielnik_test IS
  7. END dzielnik_test;
  8.  
  9. ARCHITECTURE behavior OF dzielnik_test IS
  10.  
  11. -- Component Declaration for the Unit Under Test (UUT)
  12.  
  13. COMPONENT dzielnik_main
  14. PORT(
  15. clk_i : IN std_logic;
  16. rst_i : IN std_logic;
  17. clk_o : OUT std_logic
  18. );
  19. END COMPONENT;
  20.  
  21.  
  22. --Inputs
  23. signal clk_i : std_logic := '0';
  24. signal rst_i : std_logic := '0';
  25.  
  26. --Outputs
  27. signal clk_o : std_logic;
  28.  
  29. -- Clock period definitions
  30. constant clk_i_period : time := 50ns;
  31. constant clk_o_period : time := 50ns;
  32.  
  33. BEGIN
  34.  
  35. -- Instantiate the Unit Under Test (UUT)
  36. uut: dzielnik_main PORT MAP (
  37. clk_i => clk_i,
  38. rst_i => rst_i,
  39. clk_o => clk_o
  40. );
  41.  
  42. -- Clock process definitions
  43. clk_i_process :process
  44. begin
  45. clk_i <= '0';
  46. wait for clk_i_period/2;
  47. clk_i <= '1';
  48. wait for clk_i_period/2;
  49. end process;
  50.  
  51.  
  52. -- Stimulus process
  53. stim_proc: process
  54. begin
  55. -- hold reset state for 100ms.
  56. wait for 100ns;
  57.  
  58. wait for clk_i_period*10;
  59.  
  60. -- insert stimulus here
  61.  
  62. wait;
  63. end process;
  64.  
  65. END;
Advertisement
Add Comment
Please, Sign In to add comment