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

Subversion Repositories raytrac

[/] [raytrac/] [trunk/] [sqrtdiv/] [funcsqrt.vhd] - Blame information for rev 253

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

Line No. Rev Author Line
1 73 jguarin200
------------------------------------------------
2
--! @file func.vhd
3
--! @brief Functions for calculating x**-1, x**0.5, 2x**0.5 
4
--! @author Julián Andrés Guarín Reyes
5
--------------------------------------------------
6
 
7
 
8
-- RAYTRAC
9
-- Author Julian Andres Guarin
10
-- func.vhd
11
-- This file is part of raytrac.
12
-- 
13
--     raytrac is free software: you can redistribute it and/or modify
14
--     it under the terms of the GNU General Public License as published by
15
--     the Free Software Foundation, either version 3 of the License, or
16
--     (at your option) any later version.
17
-- 
18
--     raytrac is distributed in the hope that it will be useful,
19
--     but WITHOUT ANY WARRANTY; without even the implied warranty of
20
--     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
--     GNU General Public License for more details.
22
-- 
23
--     You should have received a copy of the GNU General Public License
24
--     along with raytrac.  If not, see <http://www.gnu.org/licenses/>
25
 
26
 
27
 
28
library ieee;
29
use ieee.std_logic_1164.all;
30
 
31
 
32
library altera_mf;
33
use altera_mf.all;
34
 
35
entity func is
36
        generic (
37 74 jguarin200
 
38 73 jguarin200
                memoryfilepath : string :="X:/Tesis/Workspace/hw/rt_lib/arith/src/trunk/sqrtdiv/memsqrt.mif";
39 74 jguarin200
                awidth : integer := 9;
40
                qwidth : integer := 18
41
 
42 73 jguarin200
        );
43
        port (
44 74 jguarin200
                ad0,ad1 : in std_logic_vector (awidth-1 downto 0) := (others => '0');
45
                clk     : in std_logic;
46
                q0,q1   : out std_logic_vector(qwidth-1 downto 0)
47 73 jguarin200
        );
48
end func;
49
 
50
architecture func_arch of func is
51
 
52
        COMPONENT altsyncram
53
        GENERIC (
54
                address_reg_b           : STRING;
55
                clock_enable_input_a            : STRING;
56
                clock_enable_input_b            : STRING;
57
                clock_enable_output_a           : STRING;
58
                clock_enable_output_b           : STRING;
59
                indata_reg_b            : STRING;
60
                init_file               : STRING;
61
                intended_device_family          : STRING;
62
                lpm_type                : STRING;
63
                numwords_a              : NATURAL;
64
                numwords_b              : NATURAL;
65
                operation_mode          : STRING;
66
                outdata_aclr_a          : STRING;
67
                outdata_aclr_b          : STRING;
68
                outdata_reg_a           : STRING;
69
                outdata_reg_b           : STRING;
70
                power_up_uninitialized          : STRING;
71
                ram_block_type          : STRING;
72
                widthad_a               : NATURAL;
73
                widthad_b               : NATURAL;
74
                width_a         : NATURAL;
75
                width_b         : NATURAL;
76
                width_byteena_a         : NATURAL;
77
                width_byteena_b         : NATURAL;
78
                wrcontrol_wraddress_reg_b               : STRING
79
        );
80
        PORT (
81
                        clock0  : IN STD_LOGIC ;
82
                        wren_a  : IN STD_LOGIC ;
83
                        address_b       : IN STD_LOGIC_VECTOR (8 DOWNTO 0);
84
                        data_b  : IN STD_LOGIC_VECTOR (17 DOWNTO 0);
85
                        q_a     : OUT STD_LOGIC_VECTOR (17 DOWNTO 0);
86
                        wren_b  : IN STD_LOGIC ;
87
                        address_a       : IN STD_LOGIC_VECTOR (8 DOWNTO 0);
88
                        data_a  : IN STD_LOGIC_VECTOR (17 DOWNTO 0);
89
                        q_b     : OUT STD_LOGIC_VECTOR (17 DOWNTO 0)
90
        );
91
        END COMPONENT;
92
 
93
begin
94
 
95
        altsyncram_component : altsyncram
96
        generic map (
97
                address_reg_b => "CLOCK0",
98
                clock_enable_input_a => "BYPASS",
99
                clock_enable_input_b => "BYPASS",
100
                clock_enable_output_a => "BYPASS",
101
                clock_enable_output_b => "BYPASS",
102
                indata_reg_b => "CLOCK0",
103
                --init_file => "X:/Tesis/Workspace/hw/rt_lib/arith/src/trunk/sqrtdiv/memsqrt.mif",
104
                init_file => memoryfilepath,
105
                intended_device_family => "Cyclone III",
106
                lpm_type => "altsyncram",
107
                numwords_a => 512,
108
                numwords_b => 512,
109
                operation_mode => "BIDIR_DUAL_PORT",
110
                outdata_aclr_a => "NONE",
111
                outdata_aclr_b => "NONE",
112
                outdata_reg_a => "UNREGISTERED",
113
                outdata_reg_b => "UNREGISTERED",
114
                power_up_uninitialized => "FALSE",
115
                ram_block_type => "M9K",
116
                widthad_a => 9,
117
                widthad_b => 9,
118
                width_a => 18,
119
                width_b => 18,
120
                width_byteena_a => 1,
121
                width_byteena_b => 1,
122
                wrcontrol_wraddress_reg_b => "CLOCK0"
123
        )
124
        port map (
125 74 jguarin200
                clock0 => clk,
126 73 jguarin200
                wren_a => '0',
127
                address_b => ad1,
128
                data_b => (others=>'0'),
129
                wren_b => '0',
130
                address_a => ad0,
131
                data_a => (others=>'0'),
132
                q_b => q1,
133
                q_a => q0
134
        );
135
 
136
 
137
 
138
end func_arch;
139
 
140
 
141
 
142
 

powered by: WebSVN 2.1.0

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