OpenCores
URL https://opencores.org/ocsvn/patterngen/patterngen/trunk

Subversion Repositories patterngen

[/] [patterngen/] [trunk/] [sim/] [patternGen_tb.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 lfmunoz
----------------------------------------------------------------------------------
2
-- Company: ISI/Nallatech
3
-- Engineer: Luis Munoz
4
-- 
5
-- Create Date:        09:09:53 07/07/2011 
6
--
7
-- Module Name:        patternGen_tb - Behavioral 
8
--
9
-- Project Name:       Video Pattern Generator Test Bench
10
--
11
-- Target Devices:     Xilinx Spartan-LX150T-2 using Xilinx ISE 13.1 and ISIM 13.1
12
--
13
-- Description:        Test Bench for the patternGen module
14
--
15
--
16
-- Revision:           1.0 Initial Release
17
--
18
-- Additional Comments:  The assumption is that the width is larger than the height
19
--       
20
----------------------------------------------------------------------------------
21
library IEEE;
22
use IEEE.STD_LOGIC_1164.ALL;
23
 
24
 
25
entity patterGen_tb is
26
end patterGen_tb;
27
 
28
architecture Behavioral of patterGen_tb is
29
    -- toplevel constants for patterGen component
30
   constant FrameWidth      : integer := 640; -- # of pixels per line
31
   constant FrameHeight     : integer := 512; -- # of lines in a frame
32
   constant PIXEL_SIZE      : integer := 8;   -- # of bits each pixel has
33
   constant REG_SIZE        : integer := 16;   -- # size of register to store width count and heigh count
34
    -- toplevel signals for patternGen component
35
   signal CLK_i             : std_logic;
36
   signal RST_i             : std_logic;
37
   signal SEL_i             : std_logic_vector(2 downto 0);
38
   signal CLKen_i           : std_logic;
39
   signal VALID_o           : std_logic;
40
   signal ENDline_o         : std_logic;
41
   signal ENDframe_o        : std_logic;
42
   signal PIXEL_o           : std_logic_vector(7 downto 0);
43
 
44
begin
45
------------------------------------------------------
46
   ---------------------------------------------------
47
   -- stimulus 
48
   ---------------------------------------------------
49
   stim : process
50
   begin
51
       RST_i    <= '1';
52
       SEL_i    <= "010"; -- vertical line pattern
53
       CLKen_i  <= '0';
54
       wait for 80 ns;    -- wait two cycles and release reset
55
       RST_i    <= '0';
56
       wait for 80 ns;    -- wait two cycles and enable output 
57
 
58
       wait for 106000000 ns;
59
       report "End of simulation! (ignore this failure)"
60
           severity failure;
61
       wait;
62
   end process;
63
 
64
   ---------------------------------------------------
65
   -- unit under test
66
   ---------------------------------------------------
67
   Inst_patternGen: entity work.patternGen
68
    generic map(
69
      FrameWidth   => 80,  -- # of pixels per line
70
      FrameHeight  => 40,  -- # of lines in a frame
71
      PIXEL_SIZE   => 8,   -- # of bits each pixel has
72
      REG_SIZE     => 16   -- # size of register to store width count and heigh count    
73
    )
74
    port map(
75
        CLK_i       => CLK_i,
76
        RST_i       => RST_i,
77
        SEL_i       => SEL_i,
78
        CLKen_i     => CLKen_i,
79
        VALID_o     => VALID_o,
80
        ENDline_o   => ENDline_o,
81
        ENDframe_o  => ENDframe_o,
82
        PIXEL_o     => PIXEL_o
83
    );
84
   ---------------------------------------------------
85
   -- clock
86
   ---------------------------------------------------
87
   clock_gen : process
88
   begin
89
      CLK_i <= '0';
90
      wait for 20 ns;
91
      CLK_i <= '1';
92
      wait for 20 ns;
93
   end process;
94
 
95
------------------------------------------------------
96
end Behavioral;
97
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.