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

Subversion Repositories raytrac

[/] [raytrac/] [trunk/] [fpbranch/] [invr/] [invr32.vhd] - Blame information for rev 121

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

Line No. Rev Author Line
1 99 jguarin200
library ieee;
2
use ieee.std_logic_1164.all;
3
use ieee.std_logic_unsigned.all;
4
 
5
 
6
 
7
 
8 104 jguarin200
entity invr32 is
9 99 jguarin200
        port (
10
 
11
                clk : in std_logic;
12 104 jguarin200
                dvd32: in std_logic_vector(31 downto 0);
13
                qout32: out std_logic_vector(31 downto 0)
14 99 jguarin200
        );
15 104 jguarin200
end invr32;
16 99 jguarin200
 
17 104 jguarin200
architecture invr32_arch of invr32 is
18 99 jguarin200
 
19
        component altsyncram
20
        generic (
21
                address_aclr_a          : string;
22
                clock_enable_input_a            : string;
23
                clock_enable_output_a           : string;
24
                init_file               : string;
25
                intended_device_family          : string;
26
                lpm_hint                : string;
27
                lpm_type                : string;
28
                numwords_a              : natural;
29
                operation_mode          : string;
30
                outdata_aclr_a          : string;
31
                outdata_reg_a           : string;
32
                widthad_a               : natural;
33
                width_a         : natural;
34
                width_byteena_a         : natural
35
        );
36
        port (
37
                        clock0  : in std_logic ;
38
                        address_a       : in std_logic_vector (9 downto 0);
39
                        q_a     : out std_logic_vector (17 downto 0)
40
        );
41
        end component;
42
 
43 103 jguarin200
        signal s0sgn                    : std_logic;
44
        signal s0uexp,s0e129    : std_logic_vector(7 downto 0);
45 99 jguarin200
        signal s0q                              : std_logic_vector(17 downto 0);
46 103 jguarin200
 
47 99 jguarin200
begin
48
 
49
        altsyncram_component : altsyncram
50
        generic map (
51
                address_aclr_a => "NONE",
52
                clock_enable_input_a => "BYPASS",
53
                clock_enable_output_a => "BYPASS",
54 104 jguarin200
                init_file => "X:/Tesis/Workspace/hw/rt_lib/arith/src/trunk/fpbranch/invr/meminvr.mif",
55 99 jguarin200
                intended_device_family => "Cyclone III",
56
                lpm_hint => "ENABLE_RUNTIME_MOD=NO",
57
                lpm_type => "altsyncram",
58
                numwords_a => 1024,
59
                operation_mode => "ROM",
60
                outdata_aclr_a => "NONE",
61 103 jguarin200
                outdata_reg_a => "UNREGISTERED",
62 99 jguarin200
                widthad_a => 10,
63
                width_a => 18,
64
                width_byteena_a => 1
65
        )
66
        port map (
67
                clock0 => clk,
68 104 jguarin200
                address_a => dvd32(22 downto 13),
69 99 jguarin200
                q_a => s0q
70
        );
71 103 jguarin200
        --! SNAN?
72 99 jguarin200
        process (clk)
73
        begin
74
                if clk'event and clk='1' then
75
 
76
                        --!Carga de Operando.
77 104 jguarin200
                        s0sgn <= dvd32(31);
78
                        s0uexp <= dvd32(30 downto 23);
79 99 jguarin200
 
80 103 jguarin200
 
81 104 jguarin200
                        --! Etapa 0: Calcular direcci&oacute;n a partir del exponente, salida y normalizaci&oacute;n de la mantissa.
82
                        qout32(31) <= s0sgn;
83
                        if s0q(17)='1' then
84
                                qout32(22 downto 7) <= (others => '0');
85
                                qout32(30 downto 23) <= s0e129+255;
86
                        else
87
                                qout32(22 downto 7) <= s0q(15 downto 0);
88
                                qout32(30 downto 23) <= s0e129+254;
89
                        end if;
90 99 jguarin200
 
91
                end if;
92
        end process;
93
 
94
        --! Combinatorial Gremlin: Etapa 0, calculo del exponente. 
95 104 jguarin200
        process(s0uexp)
96
        begin
97
                for i in 7 downto 0 loop
98
                        s0e129(i)<=not(s0uexp(i));
99
                end loop;
100
        end process;
101
        qout32(6 downto 0) <= (others => '0');
102 99 jguarin200
 
103 104 jguarin200
end invr32_arch;

powered by: WebSVN 2.1.0

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