Advertisement
alien1337

Untitled

Dec 16th, 2019
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.42 KB | None | 0 0
  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. use ieee.std_logic_unsigned.all;
  4.  
  5. entity Domaci4_tb is
  6. end entity;
  7.  
  8. architecture Behavioral of Domaci4_tb is
  9.     signal sCLK : std_logic;
  10.     signal sRST : std_logic;
  11.     signal sOK : std_logic;
  12.     signal sHAZ : std_logic;
  13.     signal sRED : std_logic;
  14.     signal sGREEN : std_logic;
  15.     signal sYELLOW : std_logic;
  16.    
  17. component Domaci4
  18. port(iCLK : in std_logic;
  19.       iRST : in std_logic;
  20.       iOK : in std_logic;
  21.       iHAZ : in std_logic;
  22.       oRED : out std_logic;
  23.       oYELLOW : out std_logic;
  24.       oGREEN : out std_logic
  25.         );
  26. end component;
  27.  
  28.     constant iCLK_period : time := 10 ns;
  29.    
  30. begin
  31.     uut: Domaci4 port map(
  32.                         iCLK => sCLK,
  33.                         iRST => sRST,
  34.                         iOK => sOK,
  35.                         iHAZ => sHAZ,
  36.                         oRED => sRED,
  37.                         oYELLOW => sYELLOW,
  38.                         oGREEN => sGREEN
  39.                                     );
  40. iCLK_process : process
  41. begin
  42.     sCLK <= '0';
  43.     wait for iCLK_period/2;
  44.     sCLK <= '1';
  45.     wait for iCLK_period/2;
  46. end process;
  47.  
  48. stimulus : process
  49. begin
  50.     sOK <= '0';
  51.     sHAZ <= '0';
  52.     sRST <= '1';
  53.     wait for 5.25 * iCLK_period;
  54.     sRST <= '0';
  55.     wait for 2.25 * iCLK_period;
  56.     sOK <= '1';
  57.     wait for 2.25 * iCLK_period;
  58.     sOK <= '0';
  59.     wait for 29000 ns;
  60.     sHAZ <= '1';
  61.     wait for 2.25 * iCLK_period;
  62.     sHAZ <= '0';
  63.     wait for 130000 ns;
  64.     sOK <= '1';
  65.     wait for 2.25 * iCLK_period;
  66.     sOK <= '0';
  67.     wait for 60000 ns;
  68.     sRST <= '1';
  69.     wait for 5.25 * iCLK_period;
  70.     sRST <= '0';
  71.     wait;
  72.  
  73. end process stimulus;
  74. end architecture;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement