Advertisement
Guest User

VHDL

a guest
May 18th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.26 KB | None | 0 0
  1. LIBRARY ieee;
  2.  
  3. USE ieee.std_logic_1164.ALL;
  4.  
  5.  
  6.  
  7. -- Uncomment the following library declaration if using
  8.  
  9. -- arithmetic functions with Signed or Unsigned values
  10.  
  11. --USE ieee.numeric_std.ALL;
  12.  
  13.  
  14.  
  15. ENTITY TB IS
  16.  
  17. END TB;
  18.  
  19.  
  20.  
  21. ARCHITECTURE behavior OF TB IS
  22.  
  23.  
  24.  
  25.     -- Component Declaration for the Unit Under Test (UUT)
  26.  
  27.  
  28.  
  29.     COMPONENT Beep
  30.  
  31.     PORT(
  32.  
  33.          E : IN  std_logic;
  34.  
  35.          Clk : IN  std_logic;
  36.  
  37.          Start : OUT  std_logic;
  38.  
  39.          Addr : OUT  std_logic_vector(3 downto 0);
  40.  
  41.          Cmd : OUT  std_logic_vector(3 downto 0);
  42.  
  43.          DATA : OUT  std_logic_vector(11 downto 0)
  44.  
  45.         );
  46.  
  47.     END COMPONENT;
  48.  
  49.    
  50.  
  51.  
  52.  
  53.    --Inputs
  54.  
  55.    signal E : std_logic := '1';
  56.  
  57.    signal Clk : std_logic := '0';
  58.  
  59.  
  60.  
  61.     --Outputs
  62.  
  63.    signal Start : std_logic;
  64.  
  65.    signal Addr : std_logic_vector(3 downto 0);
  66.  
  67.    signal Cmd : std_logic_vector(3 downto 0);
  68.  
  69.    signal DATA : std_logic_vector(11 downto 0);
  70.  
  71.  
  72.  
  73.  
  74.  
  75. BEGIN
  76.  
  77.  
  78.  
  79.     -- Instantiate the Unit Under Test (UUT)
  80.  
  81.    uut: Beep PORT MAP (
  82.  
  83.           E => E,
  84.  
  85.           Clk => Clk,
  86.  
  87.           Start => Start,
  88.  
  89.           Addr => Addr,
  90.  
  91.           Cmd => Cmd,
  92.  
  93.           DATA => DATA
  94.  
  95.         );
  96.  
  97.        
  98.  
  99. Clk<=not Clk after 20ns;
  100.  
  101.  
  102.  
  103. END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement