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

Subversion Repositories raytrac

[/] [raytrac/] [trunk/] [raytrac.vhd] - Blame information for rev 11

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

Line No. Rev Author Line
1 11 jguarin200
-- RAYTRAC
2
-- Author Julian Andres Guarin
3
-- raytrac.vhd
4
-- This file is part of raytrac.
5
-- 
6
--     raytrac is free software: you can redistribute it and/or modify
7
--     it under the terms of the GNU General Public License as published by
8
--     the Free Software Foundation, either version 3 of the License, or
9
--     (at your option) any later version.
10
-- 
11
--     raytrac is distributed in the hope that it will be useful,
12
--     but WITHOUT ANY WARRANTY; without even the implied warranty of
13
--     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
--     GNU General Public License for more details.
15
-- 
16
--     You should have received a copy of the GNU General Public License
17
--     along with raytrac.  If not, see <http://www.gnu.org/licenses/>.
18
 
19
library ieee;
20
use ieee.std_logic_1164.all;
21
use work.arithpack.all;
22
 
23
 
24
 
25
entity raytrac is
26
        generic (
27
                registered : string := "NO"
28
        );
29
        port (
30
                A,B,C,D                 : in std_logic_vector(18*3-1 downto 0);
31
                opcode,addcode  : in std_logic;
32
                clk,rst,ena             : in std_logic;
33
                CPX,CPY,CPZ,DP0,DP1 : out std_logic_vector(31 downto 0);
34
 
35
        );
36
end raytrac;
37
 
38
architecture raytrac_arch of raytrac is
39
        signal SA,SB,SC,SD                      : std_logic_vector(18*3-1 downto 0);
40
        signal sopcode,saddcode         : std_logic;
41
        signal smf00,smf01,smf10,smf11,smf20,smf21,smf30,smf31,smf40,smf41,smf50,smf51  : std_logic_vector(17 downto 0);
42
 
43
begin
44
 
45
        -- Registered or unregistered inputs?
46
        notreg:
47
        if registered="NO" generate
48
                SA <= A;
49
                SB <= B;
50
                SC <= C;
51
                SD <= D;
52
                sopcode <= opcode;
53
                saddcode <= addcode;
54
        end generate notreg;
55
        reg:
56
        if registered="YES" generate
57
                _oreg:
58
                process(clk,rst)
59
                begin
60
                        if rst=rstMasterValue then
61
                                SA <= (others => '0');
62
                                SB <= (others => '0');
63
                                SC <= (others => '0');
64
                                SD <= (others => '0');
65
                                sopcode <= (others =>'0');
66
                                saddcode <= (others => '0');
67
                        elsif clk'event and clk='1' then
68
                                if ena <= '1' then
69
                                        SA <= A;
70
                                        SB <= B;
71
                                        SC <= C;
72
                                        SD <= D;
73
                                        sopcode <= opcode;
74
                                        saddcode <= addcode;
75
                                end if;
76
                        end if;
77
                end process _oreg;
78
        end generate reg;
79
        -- Instantiate Opcoder 
80
        opcdr : opcoder
81
        port map (
82
                SA(17 downto 0),SB(17 downto 0),SC(17 downto 0),SD(17 downto 0),SA(35 downto 18),SB(35 downto 18),SC(35 downto 18),SD(35 downto 18),SA(53 downto 36),SB(53 downto 36),SC(53 downto 36),SD(53 downto 36),
83
                smf00,smf01,smf10,smf11,smf20,smf21,smf30,smf31,smf40,smf41,smf50,smf51,
84
                sopcode,saddcode
85
        );
86
        -- Instantiate uf, cross product and dot product functional unit.
87
        uf0 : uf
88
        port map (
89
                sopcode,
90
                smf00,smf01,smf10,smf11,smf20,smf21,smf30,smf31,smf40,smf41,smf50,smf51,
91
                CPX,CPY,CPZ,DP0,DP1,
92
                clk,rst
93
        );
94
 
95
end raytrac_arch;
96
 
97
 
98
 

powered by: WebSVN 2.1.0

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