Advertisement
Guest User

Untitled

a guest
Dec 8th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. use ieee.STD_LOGIC_UNSIGNED.all;
  4. entity priprema2_tb is
  5. end priprema2_tb;
  6. architecture Test_tb of priprema2_tb is
  7. signal sLOAD : std_logic;
  8. signal sCLK: std_logic;
  9. signal sRST : std_logic;
  10. signal sD : std_logic_vector(7 downto 0);
  11. signal sONES: std_logic_vector(7 downto 0);
  12. signal sEVEN: std_logic_vector(2 downto 0);
  13. signal sODD: std_logic_vector(2 downto 0);
  14. component priprema2
  15. port(
  16. iLOAD : in std_logic;
  17. iCLK: in std_logic;
  18. iRST : in std_logic;
  19. iD : in std_logic_vector(7 downto 0);
  20. oONES: out std_logic_vector(7 downto 0);
  21. oEVEN: out std_logic_vector(2 downto 0);
  22. oODD: out std_logic_vector(2 downto 0)
  23. );
  24. end component;
  25.  
  26. constant iCLK_period : time := 10 ns;
  27.  
  28.  
  29. begin
  30. uut: priprema2 port map (
  31. iLOAD => sLOAD,
  32. iCLK => sCLK,
  33. iRST => sRST,
  34. iD => sD,
  35. oONES => sONES,
  36. oEVEN => sEVEN,
  37. oODD => sODD
  38.  
  39. );
  40.  
  41. iCLK_process: process
  42. begin
  43. sCLK <= '0';
  44. wait for iCLK_period / 2;
  45. sCLK <= '1';
  46. wait for iCLK_period / 2;
  47. end process;
  48.  
  49.  
  50. process
  51. begin
  52. sRST <= '0';
  53. wait for 5.25 * iCLK_period;
  54. sRST <= '1';
  55.  
  56. sD <= "00101010";
  57. sLOAD <= '1';
  58. wait for iCLK_period;
  59. sLOAD <= '0';
  60. wait for 8 * iCLK_period;
  61. sD <= "00100011";
  62. sLOAD <= '1';
  63. wait for iCLK_period;
  64. sLOAD <= '0';
  65. wait for 8 * iCLK_period;
  66. sD <= "00010011";
  67. sLOAD <= '1';
  68. wait for iCLK_period;
  69. sLOAD <= '0';
  70. wait for 8 * iCLK_period;
  71. sD <= "10000010";
  72. sLOAD <= '1';
  73. wait for iCLK_period;
  74. sLOAD <= '0';
  75. wait for 8 * iCLK_period;
  76. sD <= "00110011";
  77. sLOAD <= '1';
  78. wait for iCLK_period;
  79. sLOAD <= '0';
  80.  
  81.  
  82.  
  83. wait;
  84.  
  85. end process;
  86.  
  87. end architecture;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement