Advertisement
Guest User

Untitled

a guest
May 21st, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 3.18 KB | None | 0 0
  1. --------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date:   18:39:17 05/21/2018
  6. -- Design Name:  
  7. -- Module Name:   /home/ise/shared_ise/Projekt/VGA_Mouse/image_tb.vhd
  8. -- Project Name:  VGA_Mouse
  9. -- Target Device:  
  10. -- Tool versions:  
  11. -- Description:  
  12. --
  13. -- VHDL Test Bench Created by ISE for module: image1
  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. use ieee.numeric_std.all;
  31.  
  32. -- Uncomment the following library declaration if using
  33. -- arithmetic functions with Signed or Unsigned values
  34. --USE ieee.numeric_std.ALL;
  35.  
  36. ENTITY image_tb IS
  37. END image_tb;
  38.  
  39. ARCHITECTURE behavior OF image_tb IS
  40.  
  41.     -- Component Declaration for the Unit Under Test (UUT)
  42.  
  43.     COMPONENT image1
  44.     PORT(
  45.          clk : IN  std_logic;
  46.          x : IN  std_logic_vector(10 downto 0);
  47.          y : IN  std_logic_vector(9 downto 0);
  48.          datardy : IN  std_logic;
  49.          b1_stat : IN  std_logic_vector(7 downto 0);
  50.          b_x : IN  std_logic_vector(7 downto 0);
  51.          b_y : IN  std_logic_vector(7 downto 0);
  52.          rgb : OUT  std_logic_vector(2 downto 0)
  53.         );
  54.     END COMPONENT;
  55.    
  56.  
  57.    --Inputs
  58.    signal clk : std_logic := '0';
  59.    signal x : std_logic_vector(10 downto 0) := (others => '0');
  60.    signal y : std_logic_vector(9 downto 0) := (others => '0');
  61.    signal datardy : std_logic := '0';
  62.    signal b1_stat : std_logic_vector(7 downto 0) := (others => '0');
  63.    signal b_x : std_logic_vector(7 downto 0) := (others => '0');
  64.    signal b_y : std_logic_vector(7 downto 0) := (others => '0');
  65.  
  66.     --Outputs
  67.    signal rgb : std_logic_vector(2 downto 0);
  68.  
  69.    -- Clock period definitions
  70.    constant clk_period : time := 2 ns;
  71.  
  72. BEGIN
  73.  
  74.     -- Instantiate the Unit Under Test (UUT)
  75.    uut: image1 PORT MAP (
  76.           clk => clk,
  77.           x => x,
  78.           y => y,
  79.           datardy => datardy,
  80.           b1_stat => b1_stat,
  81.           b_x => b_x,
  82.           b_y => b_y,
  83.           rgb => rgb
  84.         );
  85.  
  86.    -- Clock process definitions
  87.    clk_process :process
  88.    begin
  89.         clk <= '0';
  90.         wait for clk_period/2;
  91.         clk <= '1';
  92.         wait for clk_period/2;
  93.    end process;
  94.  
  95.  
  96.    -- Stimulus process
  97.    stim_proc: process
  98.    begin       
  99.       -- hold reset state for 100 ns.
  100.        
  101.         y <= std_logic_vector ( unsigned ( y ) + 10 );
  102.        
  103.        
  104.         for i in 1 to 600 loop
  105.             datardy <= '1';
  106.            x <= std_logic_vector ( unsigned ( x ) + 1 );
  107.             --y <= std_logic_vector ( unsigned ( y ) + 1 );
  108.             b_x <= std_logic_vector ( unsigned ( y ) + 1 );
  109.             --b_y <= std_logic_vector ( unsigned ( y ) + 1 );
  110.             wait for 2ns;
  111.             datardy <= '0';
  112.         end loop;
  113.  
  114.  
  115.       wait;
  116.    end process;
  117.  
  118. END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement