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

Subversion Repositories raytrac

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

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 15 jguarin200
                registered : string := "YES"
28 11 jguarin200
        );
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 14 jguarin200
                CPX,CPY,CPZ,DP0,DP1 : out std_logic_vector(31 downto 0)
34 11 jguarin200
 
35 14 jguarin200
 
36 11 jguarin200
        );
37
end raytrac;
38
 
39
architecture raytrac_arch of raytrac is
40
        signal SA,SB,SC,SD                      : std_logic_vector(18*3-1 downto 0);
41
        signal sopcode,saddcode         : std_logic;
42
        signal smf00,smf01,smf10,smf11,smf20,smf21,smf30,smf31,smf40,smf41,smf50,smf51  : std_logic_vector(17 downto 0);
43
 
44
begin
45
 
46
        -- Registered or unregistered inputs?
47
        notreg:
48
        if registered="NO" generate
49
                SA <= A;
50
                SB <= B;
51
                SC <= C;
52
                SD <= D;
53
                sopcode <= opcode;
54
                saddcode <= addcode;
55
        end generate notreg;
56
        reg:
57
        if registered="YES" generate
58 14 jguarin200
                procReg:
59 11 jguarin200
                process(clk,rst)
60
                begin
61
                        if rst=rstMasterValue then
62
                                SA <= (others => '0');
63
                                SB <= (others => '0');
64
                                SC <= (others => '0');
65
                                SD <= (others => '0');
66 14 jguarin200
                                sopcode <= '0';
67
                                saddcode <= '0';
68 11 jguarin200
                        elsif clk'event and clk='1' then
69
                                if ena <= '1' then
70
                                        SA <= A;
71
                                        SB <= B;
72
                                        SC <= C;
73
                                        SD <= D;
74
                                        sopcode <= opcode;
75
                                        saddcode <= addcode;
76
                                end if;
77
                        end if;
78 14 jguarin200
                end process procReg;
79 11 jguarin200
        end generate reg;
80
        -- Instantiate Opcoder 
81
        opcdr : opcoder
82
        port map (
83
                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),
84
                smf00,smf01,smf10,smf11,smf20,smf21,smf30,smf31,smf40,smf41,smf50,smf51,
85
                sopcode,saddcode
86
        );
87
        -- Instantiate uf, cross product and dot product functional unit.
88
        uf0 : uf
89
        port map (
90
                sopcode,
91
                smf00,smf01,smf10,smf11,smf20,smf21,smf30,smf31,smf40,smf41,smf50,smf51,
92
                CPX,CPY,CPZ,DP0,DP1,
93
                clk,rst
94
        );
95
 
96
end raytrac_arch;
97
 
98
 
99
 

powered by: WebSVN 2.1.0

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