Advertisement
Guest User

Untitled

a guest
Jan 10th, 2021
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.17 KB | None | 0 0
  1. library IEEE;
  2. use IEEE.Std_logic_1164.all;
  3. use IEEE.Numeric_Std.all;
  4.  
  5. entity FSM_tb is
  6. end;
  7.  
  8. architecture bench of FSM_tb is
  9.  
  10.   component FSM
  11.   port (CLK : in std_logic;
  12.    RSTn : in std_logic;
  13.    CoinIn : in std_logic_vector (1 downto 0);
  14.    Soda : out std_logic;
  15.    CoinOut : out std_logic_vector (1 downto 0)
  16.    );
  17.   end component;
  18.  
  19.   signal CLK: std_logic;
  20.   signal RSTn: std_logic;
  21.   signal CoinIn: std_logic_vector (1 downto 0);
  22.   signal Soda: std_logic;
  23.   signal CoinOut: std_logic_vector (1 downto 0) ;
  24.  
  25.   constant clock_period: time := 10 ns;
  26.   signal stop_the_clock: boolean;
  27.  
  28. begin
  29.  
  30.   uut: FSM port map ( CLK     => CLK,
  31.                       RSTn    => RSTn,
  32.                       CoinIn  => CoinIn,
  33.                       Soda    => Soda,
  34.                       CoinOut => CoinOut );
  35.  
  36.   stimulus: process
  37.   begin
  38.  
  39.     -- Put initialisation code here
  40.  
  41.  
  42.  
  43.  
  44.     -- Put test bench stimulus code here
  45.  
  46.     stop_the_clock <= true;
  47.     wait;
  48.   end process;
  49.  
  50.   clocking: process
  51.   begin
  52.     while not stop_the_clock loop
  53.       clk <= '0', '1' after clock_period / 2;
  54.       wait for clock_period;
  55.     end loop;
  56.     wait;
  57.   end process;
  58.  
  59. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement