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

Subversion Repositories jart

[/] [jart/] [trunk/] [BLRT/] [dotCell.vhd] - Blame information for rev 15

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
entity dotCell is
6
        generic (       levelW  : integer := 18;        -- Actual Level Width
7
                                nLevelW : integer := 32);       -- Next Level Width
8
        port    (       clk             : in std_logic;
9
                                rst             : in std_logic;
10
 
11
                                -- Object control.
12
                                nxtSphere       : in std_logic; -- This bit controls when the sphere center goes to the next row.
13
                                -- First Side.
14
                                vxInput         : in std_logic_vector(levelW-1 downto 0);
15
                                vyInput         : in std_logic_vector(levelW-1 downto 0);
16
                                vzInput         : in std_logic_vector(levelW-1 downto 0);
17
 
18
                                -- Second Side (Opposite to the first one)
19
                                vxOutput                : out std_logic_vector(levelW-1 downto 0);
20
                                vyOutput                : out std_logic_vector(levelW-1 downto 0);
21
                                vzOutput                : out std_logic_vector(levelW-1 downto 0);
22
 
23
                                -- Third Side (Perpendicular to the first and second ones)
24
                                dxInput         : in std_logic_vector(levelW-1 downto 0);
25
                                dyInput         : in std_logic_vector(levelW-1 downto 0);
26
                                dzInput         : in std_logic_vector(levelW-1 downto 0);
27
 
28
                                --Fourth Side (Opposite to the third one)
29
                                dxOutput                : in std_logic_vector(levelW-1 downto 0);
30
                                dyOutput                : in std_logic_vector(levelW-1 downto 0);
31
                                dzOutput                : in std_logic_vector(levelW-1 downto 0);
32
 
33
                                --Fifth Side (Going to the floor right upstairs!)
34
                                vdOutput                : out std_logic_vector(nLevelW-1 downto 0); -- Dot product.
35
 
36
        )
37
        end port;
38
end entity;
39
 
40
 
41
architecture rtl of rtCell is
42
 
43
 
44
        signal svd      : std_logic_vector (nLevelW - 1 downto 0);
45
 
46
begin
47
 
48
        -- The Dotprod Machine
49
        vd      : dp18 port map (
50
                clock0  => clk,
51
                dataa_0 => dxInput,
52
                dataa_1 => dyInput,
53
                dataa_2 => dzInput,
54
                datab_0 => vxInput,
55
                datab_1 => vyInput,
56
                datab_2 => vzInput,
57
                result  => svd
58
                );
59
 
60
        -- Ray PipeLine
61
        rayPipeStage : process (clk,rst)
62
        begin
63
                if rst = '0' then
64
                        -- There is no ray load yet.
65
                        dxOutput <= (others => '0');
66
                        dyOutput <= (others => '0');
67
                        dzOutput <= (others => '0');
68
 
69
                elsif rising_edge (clk) then
70
 
71
                        -- Set 
72
                        dxOutput <= dxInput;
73
                        dyOutput <= dyInput;
74
                        dzOutput <= dzInput;
75
 
76
                end if;
77
 
78
        end process;
79
 
80
        -- Sphere Pipe Line
81
        spherePipeStage : process (clk,rts)
82
        begin
83
                if rst = '0' then
84
 
85
                -- There is no object center yet.
86
                        vxOutput <= (others => '0');
87
                        vyOutput <= (others => '0');
88
                        vzOutput <= (others => '0');
89
 
90
                elsif rising_edge (clk) and nxtSphere ='1' then
91
 
92
                        -- Shift sphere to the next row.
93
                        vxOutput <= vxInput;
94
                        vyOutput <= vyInput;
95
                        vzOutput <= vzInput;
96
 
97
                end if;
98
 
99
        end process;
100
 
101
        -- Upper Level
102
        vdPipeStage     : process (clk,rst)
103
        begin
104
 
105
                if rst='0' then
106
 
107
                        vdOutput <= (others => '0');
108
 
109
                elsif rising_edge(clk) then
110
 
111
                        vdOutput  <= svd;
112
 
113
                end if;
114
 
115
        end process;
116
 
117
 
118
end rtl;
119
 
120
 
121
 
122
 
123
 
124
 

powered by: WebSVN 2.1.0

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