From ef5da14068404900256d3f375d3b2f52d57e8f39 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Sun, 28 Dec 2008 16:55:15 +0000 Subject: [PATCH] - uses now fixed_util_pkg for common functions git-svn-id: http://moon:8086/svn/vhdl/trunk@163 cc03376c-175c-47c8-b038-4cd826a8556b --- lib/radio/cordic/src/cordic_pipe_post.vhd | 1 + lib/radio/cordic/src/cordic_pipe_pre.vhd | 1 + lib/radio/cordic/src/cordic_pipe_stage.vhd | 1 + lib/radio/cordic/src/cordic_pipe_top.vhd | 1 + lib/radio/cordic/src/cordic_pkg.vhd | 42 +--------------------- lib/radio/nco/sim/tb_mix_cordic.fdo | 1 + lib/radio/nco/sim/tb_nco_cordic.fdo | 1 + lib/radio/nco/src/mix_cordic.vhd | 2 +- lib/radio/nco/src/nco_cordic.vhd | 2 +- lib/radio/nco/src/tb_mix_cordic.vhd | 2 +- lib/radio/nco/src/tb_nco_cordic.vhd | 2 +- 11 files changed, 11 insertions(+), 45 deletions(-) diff --git a/lib/radio/cordic/src/cordic_pipe_post.vhd b/lib/radio/cordic/src/cordic_pipe_post.vhd index 71a4e86..9cf9c79 100644 --- a/lib/radio/cordic/src/cordic_pipe_post.vhd +++ b/lib/radio/cordic/src/cordic_pipe_post.vhd @@ -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 diff --git a/lib/radio/cordic/src/cordic_pipe_pre.vhd b/lib/radio/cordic/src/cordic_pipe_pre.vhd index c3d9ce1..ae90b84 100644 --- a/lib/radio/cordic/src/cordic_pipe_pre.vhd +++ b/lib/radio/cordic/src/cordic_pipe_pre.vhd @@ -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 diff --git a/lib/radio/cordic/src/cordic_pipe_stage.vhd b/lib/radio/cordic/src/cordic_pipe_stage.vhd index 178be30..300a729 100644 --- a/lib/radio/cordic/src/cordic_pipe_stage.vhd +++ b/lib/radio/cordic/src/cordic_pipe_stage.vhd @@ -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 diff --git a/lib/radio/cordic/src/cordic_pipe_top.vhd b/lib/radio/cordic/src/cordic_pipe_top.vhd index 59bec98..d9a9475 100644 --- a/lib/radio/cordic/src/cordic_pipe_top.vhd +++ b/lib/radio/cordic/src/cordic_pipe_top.vhd @@ -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 diff --git a/lib/radio/cordic/src/cordic_pkg.vhd b/lib/radio/cordic/src/cordic_pkg.vhd index 3d11534..7adfe84 100644 --- a/lib/radio/cordic/src/cordic_pkg.vhd +++ b/lib/radio/cordic/src/cordic_pkg.vhd @@ -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; diff --git a/lib/radio/nco/sim/tb_mix_cordic.fdo b/lib/radio/nco/sim/tb_mix_cordic.fdo index e445e82..1152454 100644 --- a/lib/radio/nco/sim/tb_mix_cordic.fdo +++ b/lib/radio/nco/sim/tb_mix_cordic.fdo @@ -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" diff --git a/lib/radio/nco/sim/tb_nco_cordic.fdo b/lib/radio/nco/sim/tb_nco_cordic.fdo index ce28316..68da2d6 100644 --- a/lib/radio/nco/sim/tb_nco_cordic.fdo +++ b/lib/radio/nco/sim/tb_nco_cordic.fdo @@ -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" diff --git a/lib/radio/nco/src/mix_cordic.vhd b/lib/radio/nco/src/mix_cordic.vhd index 068a46e..dd8d54c 100644 --- a/lib/radio/nco/src/mix_cordic.vhd +++ b/lib/radio/nco/src/mix_cordic.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. diff --git a/lib/radio/nco/src/nco_cordic.vhd b/lib/radio/nco/src/nco_cordic.vhd index 8536f58..da5681f 100644 --- a/lib/radio/nco/src/nco_cordic.vhd +++ b/lib/radio/nco/src/nco_cordic.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. diff --git a/lib/radio/nco/src/tb_mix_cordic.vhd b/lib/radio/nco/src/tb_mix_cordic.vhd index 684af69..d661007 100644 --- a/lib/radio/nco/src/tb_mix_cordic.vhd +++ b/lib/radio/nco/src/tb_mix_cordic.vhd @@ -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 diff --git a/lib/radio/nco/src/tb_nco_cordic.vhd b/lib/radio/nco/src/tb_nco_cordic.vhd index 4292271..fbec275 100644 --- a/lib/radio/nco/src/tb_nco_cordic.vhd +++ b/lib/radio/nco/src/tb_nco_cordic.vhd @@ -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