- 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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
vlib work
|
||||
vcom -explicit -93 "../../../fixed/fixed_pkg_c.vhd"
|
||||
vcom -explicit -93 "../../../fixed/fixed_util_pkg.vhd"
|
||||
vcom -explicit -93 "../../../PCK_FIO-2002.7/PCK_FIO_1993.vhd"
|
||||
vcom -explicit -93 "../../../PCK_FIO-2002.7/PCK_FIO_1993_BODY.vhd"
|
||||
vcom -explicit -93 "../../cordic/src/cordic_pkg.vhd"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
vlib work
|
||||
vcom -explicit -93 "../../../fixed/fixed_pkg_c.vhd"
|
||||
vcom -explicit -93 "../../../fixed/fixed_util_pkg.vhd"
|
||||
vcom -explicit -93 "../../../PCK_FIO-2002.7/PCK_FIO_1993.vhd"
|
||||
vcom -explicit -93 "../../../PCK_FIO-2002.7/PCK_FIO_1993_BODY.vhd"
|
||||
vcom -explicit -93 "../../cordic/src/cordic_pkg.vhd"
|
||||
|
||||
@@ -22,8 +22,8 @@ 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;
|
||||
use work.nco_pkg.all;
|
||||
|
||||
---- Uncomment the following library declaration if instantiating
|
||||
---- any Xilinx primitives in this code.
|
||||
|
||||
@@ -22,8 +22,8 @@ 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;
|
||||
use work.nco_pkg.all;
|
||||
|
||||
---- Uncomment the following library declaration if instantiating
|
||||
---- any Xilinx primitives in this code.
|
||||
|
||||
@@ -19,8 +19,8 @@ use std.textio.all; -- Imports the standard textio package.
|
||||
|
||||
library work;
|
||||
use work.fixed_pkg.all;
|
||||
use work.fixed_util_pkg.all;
|
||||
use work.cordic_pkg.all;
|
||||
use work.nco_pkg.all;
|
||||
use work.PCK_FIO.all;
|
||||
|
||||
ENTITY tb_mix IS
|
||||
|
||||
@@ -19,7 +19,7 @@ use std.textio.all; -- Imports the standard textio package.
|
||||
|
||||
library work;
|
||||
use work.fixed_pkg.all;
|
||||
use work.nco_pkg.all;
|
||||
use work.fixed_util_pkg.all;
|
||||
use work.PCK_FIO.all;
|
||||
|
||||
ENTITY tb_nco IS
|
||||
|
||||
Reference in New Issue
Block a user