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

Subversion Repositories image_component_labeling_and_feature_extraction

[/] [image_component_labeling_and_feature_extraction/] [trunk/] [test_LabelOperation.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 malikpearl
--------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer:
4
--
5
-- Create Date:   16:39:28 05/13/2008
6
-- Design Name:   mean3x3Operation
7
-- Module Name:   C:/Documents and Settings/bentho/Mina dokument/VHDL/Pegasus/studentVideo/test_mean3x3Operation.vhd
8
-- Project Name:  studentVideo
9
-- Target Device:  
10
-- Tool versions:  
11
-- Description:   
12
-- 
13
-- VHDL Test Bench Created by ISE for module: mean3x3Operation
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.std_logic_unsigned.all;
31
USE ieee.numeric_std.ALL;
32
 
33
ENTITY test_labelOperation IS
34
END test_labelOperation;
35
 
36
ARCHITECTURE behavior OF test_labelOperation IS
37
 
38
 
39
        SIGNAL clk :  std_logic := '0';
40
        SIGNAL fsync_in :  std_logic := '0';
41
        SIGNAL rsync_in :  std_logic := '0';
42
        SIGNAL pdata_in :  std_logic_vector(7 downto 0) := (others=>'0');
43
        SIGNAL outputCodes : std_logic_vector(9 downto 0);
44
        SIGNAL componentCnt : std_logic_vector(9 downto 0);
45
        SIGNAL fsync_out :  std_logic;
46
        SIGNAL rsync_out :  std_logic;
47
        SIGNAL pdata_out :  std_logic_vector(7 downto 0);
48
        SIGNAL pdata_inter :  std_logic_vector(7 downto 0);
49
        SIGNAL reset : std_logic;
50
        SIGNAL fsync_inter, rsync_inter, bindata : std_logic;
51
 
52
        SIGNAL features : std_logic_vector(34 downto 0);
53
        SIGNAL featureDataStrobe, commReady : std_logic;
54
        SIGNAL x_cog, y_cog : std_logic_vector(16 downto 0);
55
 
56
        SIGNAL RX_DATA, RTS_IN, DSR_OUT, TX_DATA, CTS_OUT : std_logic := '0';
57
 
58
BEGIN
59
 
60
        -- Instantiate the Unit Under Test (UUT)
61
        uut: entity work.label8Operation
62
        port map(
63
                                pclk => clk,
64
                                reset => reset,
65
                                fsync_in => fsync_inter,
66
                                rsync_in        => rsync_inter,
67
                                data_in => pdata_inter,
68
                                pbin_in => bindata,
69
                                fsync_out => fsync_out,
70
                                rsync_out => rsync_out,
71
                                pdata_out => outputCodes,
72
                                featureDataStrobe => featureDataStrobe,
73
                                acknowledge => commReady,
74
                                cntObjects => componentCnt,
75
                                x_cog_out => x_cog,
76
                                y_cog_out => y_cog
77
        );
78
 
79
        features <= '0' & x_cog & y_cog; -- x and y coordinates are merged into one single vector
80
                                                                                                -- for transmission over the serial link
81
 
82
        transmit: entity work.SendFeatures
83
        PORT MAP (
84
          features => features,
85
                         fsync => fsync_out,
86
          wstrobe => featureDataStrobe,
87
                         ready => commReady,
88
          clk => clk,
89
          reset => reset,
90
          RX_DATA => RX_DATA,
91
          RTS_IN => RTS_IN,
92
          DSR_OUT => DSR_OUT,
93
          TX_DATA => TX_DATA,
94
          CTS_OUT => CTS_OUT
95
        );
96
 
97
                  RX_DATA <= TX_DATA;
98
 
99
 
100
 
101
        fsync_inter <= fsync_in;
102
        rsync_inter <= rsync_in;
103
        pdata_inter <= "11111111" - pdata_in;
104
        bindata <= '1' when pdata_in < 110 else '0';
105
 
106
-----------------------------------------------------------------
107
 
108
        img_read : entity work.img_testbench
109
        port map (
110
      pclk_i    => clk,
111
                reset_i  => reset,
112
      fsync_i   => fsync_out,
113
      rsync_i   => rsync_out,
114
      pdata_i   => pdata_out,
115
                cols_o   => open,
116
                rows_o   => open,
117
                col_o            => open,
118
                row_o            => open,
119
      fsync_o   => fsync_in,
120
      rsync_o   => rsync_in,
121
                pdata_o   => pdata_in);
122
 
123
        clock_generate: process (clk)
124
                constant T_pw : time := 37 ns;      -- Clock frequency is 27/2 MHz
125
        begin  -- process img
126
                if clk = '0' then
127
                        clk <= '1' after T_pw, '0' after 2*T_pw;
128
                end if;
129
        end process clock_generate;
130
 
131
        pdata_out <= outputCodes(7 downto 0);
132
--      pdata_out <= bindata&bindata&bindata&bindata&bindata&bindata&bindata&bindata;
133
        reset <= '1', '0' after 60 ns;
134
 
135
END;

powered by: WebSVN 2.1.0

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