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/] [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:     
6
-- Design Name: 
7
-- Module Name:     
8
-- Project Name: 
9
-- Target Devices: 
10
-- Tool versions: 
11
-- Description: 
12
--
13
-- Dependencies: 
14
--
15
-- Revision: 
16
-- Revision 0.01 - File Created
17
-- Additional Comments: 
18
--
19
----------------------------------------------------------------------------------
20
library IEEE;
21
use IEEE.STD_LOGIC_1164.ALL;
22
--use IEEE.STD_LOGIC_ARITH.ALL;
23
use IEEE.STD_LOGIC_UNSIGNED.ALL;
24
 
25
---- Uncomment the following library declaration if instantiating
26
---- any Xilinx primitives in this code.
27
--library UNISIM;
28
--use UNISIM.VComponents.all;
29
 
30
entity label8Operation is
31
generic (
32
                CODE_WIDTH      : integer := 10;
33
                NO_OF_COLS      : integer := 640;
34
                NO_OF_ROWS  : integer :=480;
35
                NO_BITS_CC  : integer := 11;
36
                NO_BITS_RC  : integer := 10
37
                );
38
        port(
39
                pclk                    : in std_logic;
40
                reset                           : in std_logic;
41
                fsync_in                        : in std_logic;
42
                rsync_in                : in std_logic;
43
                data_in                 : in std_logic_vector(7 downto 0):= (others=>'0');
44
                pbin_in                 : in std_logic;
45
                fsync_out               : out std_logic;
46
                rsync_out               : out std_logic;
47
                pdata_out               : out std_logic_vector( CODE_WIDTH-1 downto 0 );
48
                featureDataStrobe       : out std_logic;
49
                acknowledge             : in std_logic;
50
                cntObjects              : out std_logic_vector(9 downto 0);
51
                x_cog_out               : out std_logic_vector(16 downto 0);
52
                y_cog_out               : out std_logic_vector(16 downto 0)
53
                );
54
end label8Operation;
55
 
56
architecture Behavioral of label8Operation is
57
 
58
 
59
signal pointer                                                  : std_logic_vector(NO_BITS_CC-1 downto 0) := (others=>'0');
60
signal fsynch,rsynch                  : std_logic := '0';
61
signal Hbuffer_in, Lbuffer_in           : std_logic_vector(7 downto 0);
62
signal Hbuffer_out, Lbuffer_out : std_logic_vector(7 downto 0);
63
signal outputCodes                                      : std_logic_vector( CODE_WIDTH-1 downto 0 ):= (others=>'0');
64
signal ip6,ip7,ip8,ip9                          : std_logic_vector( CODE_WIDTH-1 downto 0 );
65
 
66
begin
67
 
68
 
69
 
70
        pdata_out <= outputCodes;
71
        rsync_out <= rsynch;
72
        fsync_out <= fsynch;
73
        ip6 <= outputCodes;
74
 
75
lineBuffer : entity work.line_buffer_Xb
76
   generic map (CODE_WIDTH => CODE_WIDTH, ADDRESS_BITS => NO_BITS_CC)
77
        port map(
78
                idata => outputCodes,
79
                odata => ip7,
80
                pointer => pointer,
81
                ena => rsynch,
82
                clk => pclk );
83
lblKernel : entity work.label8AndFeatures
84
        generic map( CODE_BITS => CODE_WIDTH, row=> NO_OF_ROWS,col=> NO_OF_COLS)
85
        port map (
86
                ip9 => ip9,
87
                ip8 => ip8,
88
                ip7 => ip7,
89
                ip6 => ip6,
90
                ibin => pbin_in,
91
                pdata_in => data_in,
92
                fsync_in => fsync_in,
93
                fsync_out => fsynch,
94
                pdata_o => outputCodes,
95
                rsync_in => rsync_in,
96
                rsync_out => rsynch,
97
                Reset => reset,
98
                pclk => pclk,
99
                featureDataStrobe => featureDataStrobe,
100
                acknowledge => acknowledge,
101
                cntObjects => cntObjects,
102
                y_cog => y_cog_out,
103
                x_cog => x_cog_out
104
        );
105
 
106
 
107
process(pclk)
108
begin
109
        if pclk'event and pclk = '1' then
110
 
111
                if rsynch = '1' then
112
                        if pointer < NO_OF_COLS-4 then
113
                                pointer <= pointer + 1;
114
                        else
115
                                pointer <= (others=>'0');
116
                        end if;
117
                end if;
118
 
119
           ip8 <= ip7;
120
                ip9 <= ip8;
121
 
122
        end if;
123
 
124
end process;
125
 
126
end Behavioral;
127
 

powered by: WebSVN 2.1.0

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