Advertisement
Guest User

Untitled

a guest
Nov 26th, 2015
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 3.22 KB | None | 0 0
  1. --------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date:   07:20:43 11/26/2015
  6. -- Design Name:  
  7. -- Module Name:   C:/Users/student.RTRKW426/Desktop/godra najveci jadnik/pomreg/tb.vhd
  8. -- Project Name:  pomreg
  9. -- Target Device:  
  10. -- Tool versions:  
  11. -- Description:  
  12. --
  13. -- VHDL Test Bench Created by ISE for module: pomreg
  14. --
  15. -- Dependencies:
  16. --
  17. -- Revision:
  18. -- Revision 0.01 - File Created
  19. -- Additional Comments:
  20. --
  21. -- Notes:
  22. -- This testbench has been automatically generated using types std_logic and
  23. -- std_logic_vector for the ports of the unit under test.  Xilinx recommends
  24. -- that these types always be used for the top-level I/O of a design in order
  25. -- to guarantee that the testbench will bind correctly to the post-implementation
  26. -- simulation model.
  27. --------------------------------------------------------------------------------
  28. LIBRARY ieee;
  29. USE ieee.std_logic_1164.ALL;
  30.  
  31. -- Uncomment the following library declaration if using
  32. -- arithmetic functions with Signed or Unsigned values
  33. --USE ieee.numeric_std.ALL;
  34.  
  35. ENTITY tb IS
  36. END tb;
  37.  
  38. ARCHITECTURE behavior OF tb IS
  39.  
  40.     -- Component Declaration for the Unit Under Test (UUT)
  41.  
  42.     COMPONENT pomreg
  43.     PORT(
  44.          iARITH : IN  std_logic;
  45.          iLOAD : IN  std_logic;
  46.          iDATA : IN  std_logic_vector(7 downto 0);
  47.          iSHL : IN  std_logic;
  48.          iSHR : IN  std_logic;
  49.          iCLK : IN  std_logic;
  50.          inRST : IN  std_logic;
  51.          oSHREG : OUT  std_logic_vector(7 downto 0)
  52.         );
  53.     END COMPONENT;
  54.    
  55.  
  56.    --Inputs
  57.    signal iARITH : std_logic := '0';
  58.    signal iLOAD : std_logic := '0';
  59.    signal iDATA : std_logic_vector(7 downto 0) := (others => '0');
  60.    signal iSHL : std_logic := '0';
  61.    signal iSHR : std_logic := '0';
  62.    signal iCLK : std_logic := '0';
  63.    signal inRST : std_logic := '0';
  64.  
  65.     --Outputs
  66.    signal oSHREG : std_logic_vector(7 downto 0);
  67.  
  68.    -- Clock period definitions
  69.    constant iCLK_period : time := 10 ns;
  70.  
  71. BEGIN
  72.  
  73.     -- Instantiate the Unit Under Test (UUT)
  74.    uut: pomreg PORT MAP (
  75.           iARITH => iARITH,
  76.           iLOAD => iLOAD,
  77.           iDATA => iDATA,
  78.           iSHL => iSHL,
  79.           iSHR => iSHR,
  80.           iCLK => iCLK,
  81.           inRST => inRST,
  82.           oSHREG => oSHREG
  83.         );
  84.  
  85.    -- Clock process definitions
  86.    iCLK_process :process
  87.    begin
  88.         iCLK <= '0';
  89.         wait for iCLK_period/2;
  90.         iCLK <= '1';
  91.         wait for iCLK_period/2;
  92.    end process;
  93.  
  94.  
  95.    -- Stimulus process
  96.    stim_proc: process
  97.    begin       
  98.       inRST <= '0';
  99.       wait for 100 ns;
  100.             inRST <= '1';
  101.             iLOAD <= '0';
  102.             iSHL <= '1';
  103.             iSHR <= '0';
  104.             iARITH <= '0';
  105.             iDATA <= "10101010";
  106.       wait for iCLK_period*10;
  107.  
  108.      
  109.     inRST <= '1';
  110.             iLOAD <= '1';
  111.             iSHL <= '0';
  112.             iSHR <= '0';
  113.             iARITH <= '0';
  114. iDATA <= "10101010";
  115.       wait for iCLK_period*10; 
  116.     inRST <= '1';
  117.             iLOAD <= '0';
  118.             iSHL <= '1';
  119.             iSHR <= '0';
  120.             iARITH <= '0';
  121. iDATA <= "10101010";
  122.       wait for iCLK_period*10;     
  123.        
  124.         inRST <= '1';
  125.             iLOAD <= '0';
  126.             iSHL <= '0';
  127.             iSHR <= '1';
  128.             iARITH <= '1';
  129. iDATA <= "10101010";
  130.       wait for iCLK_period*10; 
  131.  
  132.       wait;
  133.    end process;
  134.  
  135. END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement