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

Subversion Repositories jart

[/] [jart/] [trunk/] [BLRT/] [kComparisonCell.vhd] - Blame information for rev 14

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 14 jguarin200
library ieee;
2
use ieee.std_logic_1164.all;
3
use work.powerGrid.all;
4
 
5
 
6
entity kComparisonCell is
7
        generic (       W               : integer := 32;
8
                                idW             : integer := 12
9
                        );
10
        port (
11
                                clk             : in std_logic;
12
                                rst             : in std_logic;
13
 
14
 
15
                                vdinput : in std_logic_vector (W-1 downto 0);
16
                                kinput  : in std_logic_vector (W-1 downto 0);
17
                                koutput : out std_logic_vector (W-1 downto 0);
18
 
19
                                sDP             : out std_logic_vector (W-1 downto 0); -- Selected dot product.
20
 
21
 
22
        );
23
        end port;
24
end entity;
25
 
26
 
27
architecture rtl of kComparisonCell is
28
 
29
        signal sge32    : std_logic;    -- Greater or equal signal
30
 
31
begin
32
 
33
        -- Instantiation of the compare.
34
        discriminantCompare : ge32 port map (
35
                dataa    => vdinput,
36
                datab    => kinput,
37
                AgeB     => sge32
38
        );
39
 
40
 
41
        -- When sge32 (greater or equal signal) is set then V.D > kte, thus intersection is confirmed and shifting V.D to the distance comparison grid.
42
 
43
        intersectionSelector : for i in 0 to W-1 generate
44
 
45
                selector : process (rst,clk)
46
                begin
47
 
48
                        if rst='0' then
49
 
50
                                -- At the beginning set the Maximum over Maximum distance.
51
                                if i = W-1 then
52
                                        sDP (i) <= '0';
53
                                else
54
                                        sDP (i) <= '1';
55
                                end if;
56
 
57
                        elsif rising_edge(clk) then
58
 
59
                                if i = W-1 then
60
                                        sDP (i) <= sge32 and vdinput(i);
61
                                else
62
                                        sDP (i) <= (sge32 and vdinput(i)) or not(sge32);
63
                                end if;
64
 
65
                        end if;
66
 
67
                end process;
68
 
69
        end generate;
70
 
71
        kPipeStage : process (clk,rst)
72
        begin
73
 
74
                if rst='0' then
75
 
76
                        koutput <= (others => '0');
77
 
78
                elsif rising_edge(clk) then
79
 
80
                        koutput <= kinput;
81
 
82
                end if;
83
 
84
        end process;
85
 
86
 
87
 
88
end rtl;
89
 
90
 
91
 
92
 
93
 

powered by: WebSVN 2.1.0

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