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

Subversion Repositories raytrac

[/] [raytrac/] [trunk/] [fpbranch/] [sqrt/] [sqrt32.vhd] - Blame information for rev 99

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
entity sqrt32 is
9
        port (
10
 
11
                clk : in std_logic;
12
                rd32: in std_logic_vector(31 downto 0);
13
 
14
                sq32: out std_logic_vector(31 downto 0)
15
        );
16
end sqrt32;
17
 
18
architecture sqrt32_arch of sqrt32 is
19
 
20
        component altsyncram
21
        generic (
22
                address_aclr_a          : string;
23
                clock_enable_input_a            : string;
24
                clock_enable_output_a           : string;
25
                init_file               : string;
26
                intended_device_family          : string;
27
                lpm_hint                : string;
28
                lpm_type                : string;
29
                numwords_a              : natural;
30
                operation_mode          : string;
31
                outdata_aclr_a          : string;
32
                outdata_reg_a           : string;
33
                widthad_a               : natural;
34
                width_a         : natural;
35
                width_byteena_a         : natural
36
        );
37
        port (
38
                        clock0  : in std_logic ;
39
                        address_a       : in std_logic_vector (9 downto 0);
40
                        q_a     : out std_logic_vector (17 downto 0)
41
        );
42
        end component;
43
 
44
        signal s0nexp,s0uexp,s0e129,s0e1292     : std_logic_vector(30 downto 23);
45
        signal s0q                              : std_logic_vector(17 downto 0);
46
begin
47
 
48
        altsyncram_component : altsyncram
49
        generic map (
50
                address_aclr_a => "NONE",
51
                clock_enable_input_a => "BYPASS",
52
                clock_enable_output_a => "BYPASS",
53
                init_file => "../../../MinGW/msys/1.0/home/julian/code/testbench/trunk/fpbranch/sqrt/memsqrt.mif",
54
                intended_device_family => "Cyclone III",
55
                lpm_hint => "ENABLE_RUNTIME_MOD=NO",
56
                lpm_type => "altsyncram",
57
                numwords_a => 1024,
58
                operation_mode => "ROM",
59
                outdata_aclr_a => "NONE",
60
                outdata_reg_a => "CLOCK0",
61
                widthad_a => 10,
62
                width_a => 18,
63
                width_byteena_a => 1
64
        )
65
        port map (
66
                clock0 => clk,
67
                address_a => s0uexp(0)&s0umr(22 downto 14),
68
                q_a => s0q
69
        );
70
                --! SNAN?
71
        process (clk)
72
        begin
73
                if clk'event and clk='1' then
74
 
75
                        --!Carga de Operando.
76
                        s0sgn<=rd(31);
77
                        s0uexp<=rd(30 downto 23);
78
                        s0umr<=rd(22 downto 0);
79
 
80
                        --! Etapa 0: Calcular direcci&oacute;n a partir del exponente y el exponente.
81
                        sq32(31)<=s0sgn;
82
                        sq32(22 downto 0)<=s0q(16 downto 0) & "000000";
83
 
84
 
85
                end if;
86
        end process;
87
 
88
        --! Combinatorial Gremlin: Etapa 0, calculo del exponente. 
89
        s0e129<=s0uexp+129;
90
        s0e1292<=s0uexp(s0uexp'high)&s0uexp(7 downto 1);
91
 
92
end sqrt32_arch;

powered by: WebSVN 2.1.0

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