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

Subversion Repositories raytrac

[/] [raytrac/] [branches/] [fp_sgdma/] [raytrac.vhd] - Blame information for rev 209

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

Line No. Rev Author Line
1 150 jguarin200
--! @file raytrac.vhd
2
--! @brief Archivo con el RTL que describe al RayTrac en su totalidad.
3
 
4
--! @author Julián Andrés Guarín Reyes
5
--------------------------------------------------------------
6
-- RAYTRAC
7
-- Author Julian Andres Guarin
8 151 jguarin200
-- Rytrac.vhd
9 150 jguarin200
-- This file is part of raytrac.
10
-- 
11
--     raytrac is free software: you can redistribute it and/or modify
12
--     it under the terms of the GNU General Public License as published by
13
--     the Free Software Foundation, either version 3 of the License, or
14
--     (at your option) any later version.
15
-- 
16
--     raytrac is distributed in the hope that it will be useful,
17
--     but WITHOUT ANY WARRANTY; without even the implied warranty of
18
--     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
--     GNU General Public License for more details.
20
-- 
21
--     You should have received a copy of the GNU General Public License
22
--     along with raytrac.  If not, see <http://www.gnu.org/licenses/>.
23
 
24
 
25
library ieee;
26
use ieee.std_logic_1164.all;
27 151 jguarin200
use work.arithpack.all;
28 150 jguarin200
 
29
entity raytrac is
30
        port (
31
 
32
                clk : in std_logic;
33
                rst : in std_logic;
34
 
35
 
36 202 jguarin200
                --! Interface Avalon Master
37
                address_master  : out   std_logic_vector(31 downto 0);
38
                begintransfer   : out   std_logic;
39
                read_master             : out   std_logic;
40
                readdata_master : in    std_logic_vector (31 downto 0);
41
                write_master    : out   std_logic;
42
                writedata_master: out   std_logic_vector (31 downto 0);
43
                waitrequest             : in    std_logic_vector;
44
                readdatavalid_m : in    std_logic_vector;
45
 
46
                --! Interface Avalon Slave
47
                address_slave   : in    std_logic_vector(3 downto 0);
48
                read_slave              : in    std_logic;
49
                readdata_slave  : in    std_logic_vector(31 downto 0);
50
                write_slave             : in    std_logic;
51
                writedata_slave : in    std_logic_vector(31 downto 0);
52
                readdatavalid_s : out   std_logic;
53
 
54
                --! Interface Interrupt Sender
55
                irq     : out std_logic
56 150 jguarin200
 
57
 
58
 
59
        );
60
end entity;
61
 
62
architecture raytrac_arch of raytrac is
63
 
64 202 jguarin200
        --!Se&ntilde;ales de State Machine -> Memblock
65 151 jguarin200
        --!TBXSTART:SM
66
        signal s_adda                   : std_logic_vector (8 downto 0);
67
        signal s_addb                   : std_logic_vector (8 downto 0);
68
        signal s_iq_rd_ack              : std_logic;
69 202 jguarin200
        --!Se&ntilde;ales de State Machine -> DataPathControl
70 151 jguarin200
        signal s_dpc_uca                : std_logic_vector(2 downto 0);
71
        signal s_eoi                    : std_logic;
72 163 jguarin200
        signal s_sign                   : std_logic;
73 161 jguarin200
        --!TBXEND
74
 
75 151 jguarin200
        --!TBXSTART:MBLK
76 202 jguarin200
        --!Se&ntilde;ales de Memblock -> State Machine
77
        signal sqresult_e               : std_logic_vector(3 downto 0);
78
        signal sqparams_e               : std_logic;
79
        --!Se&ntilde;ales de Memblock -> DPC.
80
        signal sparaminput              : vectorblock06;
81
        signal sqresult_q               : vectorblock04;
82
        --!Se&ntilde;ales de Memblock -> DPC.
83
        signal s_sync_chain_0   : std_logic;
84 151 jguarin200
        --!TBXEND
85 202 jguarin200
 
86 160 jguarin200
        --!TXBXSTART:DPC
87 150 jguarin200
        --! Se&ntilde que va desde DPC -> Memblock
88 202 jguarin200
        signal sqresult_d               : vectorblock04;
89
        signal sqresult_w               : std_logic_vector (3 downto 0);
90
        signal sqresult_rdec    : std_logic_vector (3 downto 0);
91
 
92 151 jguarin200
        --! Se&ntilde;ales de DPC a ArithBlock
93 202 jguarin200
        signal sprd32blki               : vectorblock12;
94
        signal sadd32blki               : vectorblock06;
95
 
96 151 jguarin200
        --!TBXEND
97 172 jguarin200
 
98 202 jguarin200
        --!TBXSTART:ARITHBLOCK
99
        --! Se&ntilde;ales de Arithblock a DPC
100
        signal sadd32blko               : vectorblock03;
101
        signal sprd32blko               : vectorblock06;
102
        signal ssq32o                   : xfloat32;
103
        signal sinv32o                  : xfloat32;
104
        --!TBXEND
105
 
106
        --!TBXSTART:SM
107
        --! Se&ntilde;ales de State Machine a DPC
108
        signal sqresult_sel             : std_logic_vector(1 downto 0);
109
        signal sdataread                : std_logic;
110
        signal sd                               : std_logic;
111
        signal sc                               : std_logic;
112
        signal ss                               : std_logic;
113
 
114
        --! Se&ntilde;ales de State Machine a Memblock
115
        signal sgo                              : std_logic;
116
        signal scomb                    : std_logic;
117
        signal sload                    : std_logic;
118
        signal sload_chain              : std_logic_vector(1 downto 0);
119 151 jguarin200
        --!TBXEND       
120 202 jguarin200
 
121
 
122
 
123 150 jguarin200
begin
124 202 jguarin200
        --!TBXINSTANCESTART
125
        state_machine : raytrac_control
126
        port map (
127
                clk                     => clk,
128
                rst                     => rst,
129
                adda                    => s_adda,
130
                addb                    => s_addb,
131
                sync_chain_0    => s_sync_chain_0,
132
                instrRdAckd             => s_iq_rd_ack,
133
                full_r                  => s_full_r,
134
                eoi                             => s_eoi,
135
                dpc_uca                 => s_dpc_uca,
136
                state                   => s_smState
137
 
138
        );
139
        --!TBXINSTANCEEND
140 177 jguarin200
 
141 152 jguarin200
        --!TBXINSTANCESTART
142 150 jguarin200
        MemoryBlock : memblock
143
        port map (
144
                clk                                     => clk,
145
                rst                                     => rst,
146 202 jguarin200
                go                                      => sgo,
147
                comb                            => scomb,
148
                load                            => sload,
149
 
150
                readdatavalid           => readdatavalid,
151
                readdata_master         => readdata_master,
152
                qparams_e                       => sqparams_e,
153
                qresult_d                       => sqresult_d,
154
                paraminput                      => sparaminput,
155
                sync_chain_0            => s_sync_chain_0,
156
                qresult_e                       => sqresult_e,
157
                qresult_w                       => sqresult_w,
158
                qresult_rdec            => sqresult_rdec
159
 
160 150 jguarin200
        );
161 152 jguarin200
        --!TBXINSTANCEEND
162 150 jguarin200
 
163
        --! Instanciar el bloque DPC
164 152 jguarin200
        --!TBXINSTANCESTART
165 150 jguarin200
        DataPathControl_And_Syncronization_Block: dpc
166
        port map (
167
 
168
                clk                             => clk,
169
                rst                             => rst,
170 202 jguarin200
 
171
                paraminput              => sparaminput,
172
 
173
                prd32blko               => sprd32blko,
174
                add32blko               => sadd32blko,
175
                inv32blko               => sinv32o,
176
                sqr32blko               => ssq32o,
177
 
178
                d                               => sd,
179
                c                               => sc,
180
                s                               => ss,
181
 
182 150 jguarin200
                sync_chain_0    => s_sync_chain_0,
183 202 jguarin200
 
184
                qresult_q               => sqresult_q,
185
                qresult_sel             => sqresult_sel,
186
                qresult_rdec    => sqresult_rdec,
187
                qresult_w               => sqresult_w,
188
                qresult_d               => sqresult_d,
189
 
190
                dataread                => sdataread,
191
 
192
                prd32blki               => sprd32blki,
193
                add32blki               => sadd32blki,
194
 
195
                dataout                 => writedata_master
196 150 jguarin200
 
197
 
198
        );
199 152 jguarin200
        --!TBXINSTANCEEND
200 151 jguarin200
        --! Instanciar el bloque aritm&eacute;tico.
201 152 jguarin200
        --!TBXINSTANCESTART
202 150 jguarin200
        arithmetic_block : arithblock
203
        port map (
204 202 jguarin200
                clk             => clk,
205
                rst             => rst,
206
                sign            => ss,
207
                prd32blki       => sprd32blki,
208
                add32blki       => sadd32blki,
209
                add32blko       => sadd32blko,
210
                prd32blko       => sprd32blko,
211
                sq32o           => ssq32o,
212
                inv32o          => sinv32o
213 150 jguarin200
        );
214 152 jguarin200
        --!TBXINSTANCEEND
215 150 jguarin200
 
216
        --!Instanciar la maquina de estados
217 152 jguarin200
 
218 150 jguarin200
 
219
end architecture;

powered by: WebSVN 2.1.0

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