Advertisement
Guest User

Coffee Fsm Testbench

a guest
Oct 5th, 2017
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.76 KB | None | 0 0
  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3.  
  4. entity F_tb is
  5. end F_tb;
  6.  
  7. architecture arch of F_tb is
  8.  
  9.     component F is
  10.     port(
  11.         clk, input, areset: in std_logic;
  12.         output: out std_logic_vector(2 downto 0)
  13.     );
  14.     end component;
  15.  
  16.     signal input, areset, clk: std_logic:='0';
  17.  
  18.     signal output: std_logic_vector(2 downto 0);
  19.  
  20.     constant clk_period: time:= 100ps;
  21.  
  22.     begin
  23.  
  24.     F_circuit: F port map(clk, input, areset, output);
  25.    
  26.     process
  27.     begin
  28.         clk<='0';
  29.         wait for clk_period/2;
  30.         clk<='1';
  31.         wait for clk_period/2;
  32.     end process;
  33.    
  34.     process
  35.         begin
  36.         areset <= '1';
  37.         input <= '1';
  38.         wait for clk_period*3/4;
  39.         areset <= '0';
  40.         wait for clk_period*21/4;
  41.         input <= '0';
  42.         wait for clk_period*2;
  43.         input <= '1';
  44.         wait;
  45.     end process;
  46.    
  47. end arch;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement