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

Subversion Repositories raytrac

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

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

Line No. Rev Author Line
1 16 jguarin200
-- RAYTRAC
2
-- Author Julian Andres Guarin
3
-- opcoder.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 3 jguarin200
library ieee;
19
use ieee.std_logic_1164.all;
20
 
21
entity opcoder is
22 7 jguarin200
        port (
23 3 jguarin200
                Ax,Bx,Cx,Dx,Ay,By,Cy,Dy,Az,Bz,Cz,Dz : in std_logic_vector (17 downto 0);
24 12 jguarin200
                m0f0,m0f1,m1f0,m1f1,m2f0,m2f1,m3f0,m3f1,m4f0,m4f1,m5f0,m5f1 : out std_logic_vector (17 downto 0);
25 14 jguarin200
 
26 3 jguarin200
                opcode,addcode : in std_logic
27
        );
28
end entity;
29
 
30
architecture opcoder_arch of opcoder is
31
 
32
 
33
begin
34
 
35 14 jguarin200
        procOpcoder:
36 3 jguarin200
        process (Ax,Bx,Cx,Dx,Ay,By,Cy,Dy,Az,Bz,Cz,Dz,opcode,addcode)
37
                variable scoder : std_logic_vector (1 downto 0);
38
        begin
39
                scoder := opcode & addcode;
40
                case (scoder) is
41
                        when "10" =>
42
                                m0f0 <= Ay;
43
                                m0f1 <= Bz;
44
                                m1f0 <= Az;
45
                                m1f1 <= By;
46
                                m2f0 <= Az;
47
                                m2f1 <= Bx;
48
                                m3f0 <= Ax;
49
                                m3f1 <= Bz;
50
                                m4f0 <= Ax;
51
                                m4f1 <= By;
52
                                m5f0 <= Ay;
53
                                m5f1 <= Bx;
54
                        when "11" =>
55
                                m0f0 <= Cy;
56
                                m0f1 <= Dz;
57
                                m1f0 <= Cz;
58
                                m1f1 <= Dy;
59
                                m2f0 <= Cz;
60
                                m2f1 <= Dx;
61
                                m3f0 <= Cx;
62
                                m3f1 <= Dz;
63
                                m4f0 <= Cx;
64
                                m4f1 <= Dy;
65
                                m5f0 <= Cy;
66
                                m5f1 <= Dx;
67
                        when others =>
68 14 jguarin200
                                m0f0 <= Ax;
69
                                m0f1 <= Bx;
70
                                m1f0 <= Ay;
71
                                m1f1 <= By;
72
                                m2f0 <= Az;
73
                                m2f1 <= Bz;
74
                                m3f0 <= Cx;
75
                                m3f1 <= Dx;
76
                                m4f0 <= Cy;
77
                                m4f1 <= Dy;
78
                                m5f0 <= Cz;
79
                                m5f1 <= Dz;
80
 
81 3 jguarin200
                end case;
82 4 jguarin200
 
83 3 jguarin200
 
84
 
85
 
86
 
87 14 jguarin200
        end process procOpcoder;
88 3 jguarin200
 
89
 
90 4 jguarin200
end opcoder_arch;

powered by: WebSVN 2.1.0

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