LucaSkywalker

TrafficLight_tb.vhd

Nov 7th, 2020
116
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. library IEEE;
  2. use IEEE.std_logic_1164.all;
  3. use IEEE.std_logic_arith.all;
  4. use IEEE.std_logic_misc.all;
  5. use IEEE.std_logic_unsigned.all;
  6.  
  7. ENTITY TrafficLight_tb IS
  8. END TrafficLight_tb;
  9.  
  10. ARCHITECTURE behavior OF TrafficLight_tb IS
  11.     COMPONENT TrafficLight PORT(    E:      IN      STD_LOGIC;
  12.                                             N:  IN      STD_LOGIC;
  13.                                             Rst:    IN      STD_LOGIC;
  14.                                             Clk:    IN      STD_LOGIC;
  15.                                             R:  OUT     STD_LOGIC;
  16.                                             Y:  OUT     STD_LOGIC;
  17.                                             G:  OUT     STD_LOGIC);
  18.     END COMPONENT;
  19.     signal E : std_logic := '1';
  20.     signal N : std_logic := '1';
  21.     signal Clk : std_logic := '0';
  22.     signal Rst : std_logic := '0';
  23.  
  24.     constant Clk_period : time := 10 ns;
  25.     BEGIN
  26.    uut: TrafficLight PORT MAP (
  27.           E => E,
  28.           N => N,
  29.           Rst => Rst,
  30.           Clk => Clk);
  31.              
  32.    Clk_process :process
  33.    begin
  34.         Clk <= '0';
  35.         wait for Clk_period/2;
  36.         Clk <= '1';
  37.         wait for Clk_period/2;
  38.    end process;
  39.  
  40.  
  41.    stim_proc: process
  42.    begin       
  43.       RST <= '1';
  44.         WAIT FOR 8 NS;
  45.         RST <= '0';
  46.         WAIT;
  47.    end process;
  48.  
  49. END;
  50.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×