Advertisement
Guest User

Untitled

a guest
Nov 3rd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.97 KB | None | 0 0
  1. LIBRARY ieee;
  2. USE ieee.std_logic_1164.all;
  3. USE ieee.std_logic_arith.all;
  4. ENTITY test_bench IS
  5. END ENTITY test_bench;
  6.  
  7. ARCHITECTURE a OF test_bench IS
  8. signal tbclk : std_logic;
  9. signal tbrst : std_logic:= '1';
  10. signal tbdout : std_logic_vector(1 downto 0);
  11. signal syncro : std_logic;
  12. signal info : std_logic:= '1';
  13. component lab91 IS
  14.     port( clk : in STD_LOGIC;
  15.         srst : in STD_LOGIC;
  16.         info : in STD_LOGIC;
  17.         coded : out STD_LOGIC_VECTOR (1 downto 0));
  18. END component;
  19. BEGIN
  20. generate_clk : process begin
  21.     loop
  22.         tbclk <= '0';
  23.         wait for 25 ns;
  24.         tbclk <= '1';
  25.         wait for 25 ns;
  26.         end loop;
  27. end process;
  28. generate_rst : process begin
  29.     tbrst <= '1', '0' after 125 ns;
  30.     wait;
  31. end process;
  32. process(tbclk) begin
  33.     if rising_edge(tbclk) then
  34.         syncro <= tbrst;
  35.     end if;
  36. end process;
  37. b : lab91
  38. port map ( clk => tbclk,
  39.     srst => syncro,
  40.     info => info,
  41.     coded => tbdout);
  42. END ARCHITECTURE a;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement