Advertisement
Guest User

tb

a guest
Dec 9th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.30 KB | None | 0 0
  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. use ieee.std_logic_unsigned.all;
  4.  
  5. entity sekvkola_tb is
  6. end sekvkola_tb;
  7.  
  8. architecture Test_tb of sekvkola_tb is
  9.     signal sCLK : std_logic;
  10.     signal sRST : std_logic;
  11.     signal sGO : std_logic;
  12.     signal sSTOP : std_logic;
  13.     signal sMUXROW : std_logic_vector(1 downto 0);
  14.     signal s7SEGM : std_logic_vector (6 downto 0);
  15.    
  16.     component sekvkola
  17.         port(
  18.             iCLK : in std_logic;
  19.             iRST : in std_logic;
  20.             iGO : in std_logic;
  21.             iSTOP : in std_logic;
  22.             oMUXROW : out std_logic_vector(1 downto 0);
  23.             o7SEGM : out std_logic_vector (6 downto 0)     
  24.         );
  25.     end component;
  26.    
  27.     constant iCLK_period : time := 83 ns;
  28. begin
  29.     uut : sekvkola port map (
  30.         iCLK => sCLK,
  31.         iRST => sRST,
  32.         iGO => sGO,
  33.         iSTOP => sSTOP,
  34.         oMUXROW => sMUXROW,
  35.         o7SEGM => s7SEGM
  36.     );
  37.    
  38.     iCLK_process : process
  39.     begin
  40.         sCLK <= '0';
  41.         wait for iCLK_period / 2;
  42.         sCLK <= '1';
  43.         wait for iCLK_period / 2;
  44.     end process;
  45.    
  46.     stimulus : process
  47.     begin
  48.         sGO <= '0';
  49.         sSTOP <= '0';
  50.        
  51.         sRST <= '1';
  52.         wait for 3.33 * iCLK_period;
  53.         sRST <= '0';
  54.        
  55.         sGO <= '1';
  56.         wait for 3 * iCLK_period;
  57.        
  58.         sGO <= '0';
  59.         wait for 3 * iCLK_period;
  60.        
  61.         sSTOP <= '1';
  62.         wait for 2 * iCLK_period;
  63.        
  64.         sSTOP <= '0';
  65.         sGO <= '1';
  66.        
  67.         wait;
  68.    
  69.     end process stimulus;
  70.  
  71. end architecture;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement