Advertisement
Guest User

Untitled

a guest
Apr 9th, 2020
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.43 KB | None | 0 0
  1. library ieee;
  2. use IEEE.Std_Logic_1164.all;
  3. use IEEE.numeric_std.all;
  4.  
  5. entity tb_Config is
  6. end tb_Config;
  7.  
  8. architecture Test of tb_Config is
  9.  
  10. component secondDevice
  11.     port(D : in std_logic_vector ( 3 downto 0);
  12.        I, E, S, C, R: in std_logic;
  13.        Q: inout std_logic_vector ( 3 downto 0)
  14.     );
  15. end component;
  16.  
  17.  
  18. signal  in_D : std_logic_vector ( 3 downto 0) := "0000";
  19. signal  in_I, in_E, in_S, in_C,in_R: std_logic:= '0';
  20. signal  out_Q_STR, out_Q_RTL, out_Q_BEH : std_logic_vector ( 3 downto 0);
  21.  
  22. begin
  23. p1 : secondDevice port map(in_D, in_I, in_E, in_S, in_C, in_R, out_Q_STR);
  24. p2 : secondDevice port map(in_D, in_I, in_E, in_S, in_C, in_R, out_Q_RTL);
  25. p3 : secondDevice port map(in_D, in_I, in_E, in_S, in_C, in_R, out_Q_BEH);
  26. p4 : process
  27.      begin
  28.        in_D <= std_logic_vector(unsigned(in_D) + 1);
  29.        wait for 20 ns;
  30.      end process;
  31. p5 : process
  32.      begin
  33.        in_I <= '0';
  34.        wait for 800 ns;
  35.        in_I <= '1';
  36.        wait for 800 ns;
  37.      end process;
  38. p6 : process
  39.      begin
  40.        in_E <= '0';
  41.        wait for 3200 ns;
  42.        in_E <= '1';
  43.        wait for 3200 ns;
  44.      end process;
  45. p7 : in_S <= '0'after 0 ns, '1'after 1900ns, '0'after 1905 ns,'1'after 2200ns, '0'after 2205 ns;
  46. p8 : process
  47.      begin
  48.        in_C <= not in_C;
  49.        wait for 7 ns;
  50.      end process;
  51. p9 :in_R <= '0'after 0 ns, '1'after 1900ns, '0'after 1905 ns, '1'after 2700ns, '0'after 2705 ns;
  52. end Test;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement