- uses now fixed_util_pkg for common functions

git-svn-id: http://moon:8086/svn/vhdl/trunk@163 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
2008-12-28 16:55:15 +00:00
parent f3c6c4c644
commit ef5da14068
11 changed files with 11 additions and 45 deletions
@@ -21,6 +21,7 @@ library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
USE ieee.numeric_std.ALL;
use work.fixed_pkg.all;
use work.fixed_util_pkg.all;
use work.cordic_pkg.all;
---- Uncomment the following library declaration if instantiating
+1
View File
@@ -21,6 +21,7 @@ library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
USE ieee.numeric_std.ALL;
use work.fixed_pkg.all;
use work.fixed_util_pkg.all;
use work.cordic_pkg.all;
---- Uncomment the following library declaration if instantiating
@@ -21,6 +21,7 @@ library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
USE ieee.numeric_std.ALL;
use work.fixed_pkg.all;
use work.fixed_util_pkg.all;
use work.cordic_pkg.all;
---- Uncomment the following library declaration if instantiating
+1
View File
@@ -22,6 +22,7 @@ use IEEE.STD_LOGIC_1164.ALL;
use IEEE.MATH_REAL.ALL;
USE ieee.numeric_std.ALL;
use work.fixed_pkg.all;
use work.fixed_util_pkg.all;
use work.cordic_pkg.all;
---- Uncomment the following library declaration if instantiating
+1 -41
View File
@@ -3,6 +3,7 @@ library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use ieee.numeric_std.all;
use work.fixed_pkg.all;
use work.fixed_util_pkg.all;
package cordic_pkg is
@@ -19,9 +20,6 @@ package cordic_pkg is
constant cordic_saturate_mode : boolean := false;
constant max_iteration : integer := 80;
constant pi : real := 3.141592653589793e+000;
constant sqrt2 : real := 1.414213562373095e+000;
constant sqrt2_inv : real := 7.071067811865475e-001;
type real_tbl_t is array (natural range <>) of real;
@@ -199,47 +197,9 @@ package cordic_pkg is
6.072529350088813e-001
);
-------------------------------------------------------------
-- Constructor helpers
-- Use: variable v8u6 : ufixed_t(ufixed(8,6)'range);
function uproto (nbits : integer; nbits_frac : integer) return ufixed;
-- Use: variable v8s6 : sfixed_t(sfixed(8,6)'range);
function sproto (nbits : integer; nbits_frac : integer) return sfixed;
function shi (nbits : integer; nbits_frac : integer) return integer;
function slo (nbits : integer; nbits_frac : integer) return integer;
end; -- package cordic_pkg;
-------------------------------------------------------------------------------
package body cordic_pkg is
-------------------------------------------------------------
-- Constuctor helpers
function uproto (nbits : integer; nbits_frac : integer) return ufixed is
constant result : ufixed (nbits-nbits_frac-1 downto -nbits_frac) := (others => '0');
begin
return result(nbits-nbits_frac-1 downto -nbits_frac);
end uproto;
-------------------------------------------------------------
function sproto (nbits : integer; nbits_frac : integer) return sfixed is
constant result : sfixed (nbits-nbits_frac downto -nbits_frac+1) := (others => '0');
begin
return result(nbits-nbits_frac downto -nbits_frac+1);
end sproto;
-------------------------------------------------------------
function shi (nbits : integer; nbits_frac : integer) return integer is
begin
return nbits-nbits_frac;
end shi;
-------------------------------------------------------------
function slo (nbits : integer; nbits_frac : integer) return integer is
begin
return -nbits_frac+1;
end slo;
end; -- package body cordic_pkg;