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

Subversion Repositories yac

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /yac/trunk/rtl
    from Rev 3 to Rev 4
    Reverse comparison

Rev 3 → Rev 4

/vhdl/cordic_iterative_pkg.vhd
62,6 → 62,7
<<<<<<< HEAD
<<<<<<< HEAD
constant I_FLAG_VEC_ROT : natural := 3; -- bit index
constant I_FLAG_ATAN_3 : natural := 2; -- bit index (for future usage)
=======
68,6 → 69,10
constant FLAG_VEC_ROT : natural := 3; -- bit index
constant FLAG_ATAN_3 : natural := 2; -- bit index
>>>>>>> initial commit
=======
constant I_FLAG_VEC_ROT : natural := 3; -- bit index
constant I_FLAG_ATAN_3 : natural := 2; -- bit index (for future usage)
>>>>>>> Updated C and RTL model as well as the documentation
constant VAL_MODE_CIR : std_logic_vector( 1 downto 0 ) := "00"; -- value
constant VAL_MODE_LIN : std_logic_vector( 1 downto 0 ) := "01"; -- value
constant VAL_MODE_HYP : std_logic_vector( 1 downto 0 ) := "10"; -- value
/vhdl/cordic_iterative_tb.vhd
252,6 → 252,7
a_ex /= a_o then
assert x_ex = x_o report
<<<<<<< HEAD
<<<<<<< HEAD
integer'image( stim_cnt ) & ": Serial Cordic Failed: expected x result:"
& integer'image( tmp_value(5) ) & ", but got:"
& integer'image( to_integer( signed( x_ex ) ) );
263,15 → 264,22
integer'image( stim_cnt ) & ": Serial Cordic Failed: expected a result:"
=======
" Serial Cordic Failed: expected x result:"
=======
integer'image( stim_cnt ) & ": Serial Cordic Failed: expected x result:"
>>>>>>> Updated C and RTL model as well as the documentation
& integer'image( tmp_value(5) ) & ", but got:"
& integer'image( to_integer( signed( x_ex ) ) );
assert y_ex = y_o report
" Serial Cordic Failed: expected y result:"
integer'image( stim_cnt ) & ": Serial Cordic Failed: expected y result:"
& integer'image( tmp_value(6) ) & ", but got:"
& integer'image( to_integer( signed( y_ex ) ) );
assert a_ex = a_o report
<<<<<<< HEAD
" Serial Cordic Failed: expected a result:"
>>>>>>> initial commit
=======
integer'image( stim_cnt ) & ": Serial Cordic Failed: expected a result:"
>>>>>>> Updated C and RTL model as well as the documentation
& integer'image( tmp_value(7) ) & ", but got:"
& integer'image( to_integer( signed( a_ex ) ) );
err_cnt := err_cnt + 1;
/vhdl/cordic_iterative_int.vhd
93,6 → 93,9
-- Internal angle width
constant A_WIDTH_I : natural := A_WIDTH+2;
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> Updated C and RTL model as well as the documentation
 
constant SQRT2_REAL : real := 1.4142135623730951454746218587388284504413604;
102,6 → 105,7
constant SQRT2 : integer := natural( SQRT2_REAL * real( 2**( XY_WIDTH-1 ) ) + 0.5 );
constant XY_MAX : integer := natural( 2**( XY_WIDTH-1)-1);
 
<<<<<<< HEAD
=======
constant PI_REAL : real := 3.1415926535897931159979634685441851615905762;
108,6 → 112,8
constant PI : integer := natural( PI_REAL * real( 2**( A_WIDTH-1 ) ) + 0.5 );
constant PI_H : integer := natural( PI_REAL * real( 2**( A_WIDTH-2 ) ) + 0.5 );
>>>>>>> initial commit
=======
>>>>>>> Updated C and RTL model as well as the documentation
 
constant XY_WIDTH_G : natural := XY_WIDTH + GUARD_BITS;
 
232,6 → 238,7
state.i <= ( others => '0' );
<<<<<<< HEAD
<<<<<<< HEAD
elsif state.st = ST_INIT then
--
-- initialization state
247,11 → 254,21
--
elsif state.st = ST_INIT then
>>>>>>> initial commit
=======
elsif state.st = ST_INIT then
--
-- initialization state
-- -> do initial rotation (alignment)
-- -> check special situations / miss-configurations (TODO)
--
 
>>>>>>> Updated C and RTL model as well as the documentation
state.st <= ST_ROTATE;
state.do_shift <= '1';
 
 
<<<<<<< HEAD
<<<<<<< HEAD
if state.mode( 1 downto 0 ) = VAL_MODE_HYP then
-- if we do a hyperbolic rotation, we start with 1
=======
258,6 → 275,10
-- if we do a hyperbolic rotation, we start with 1
if state.mode( 1 downto 0 ) = VAL_MODE_HYP then
>>>>>>> initial commit
=======
if state.mode( 1 downto 0 ) = VAL_MODE_HYP then
-- if we do a hyperbolic rotation, we start with 1
>>>>>>> Updated C and RTL model as well as the documentation
state.i(0) <= '1';
end if;
 
265,6 → 286,7
 
 
<<<<<<< HEAD
<<<<<<< HEAD
if state.mode( I_FLAG_VEC_ROT ) = '0'
and state.mode( 1 downto 0 ) = VAL_MODE_CIR then
-- circular vector mode
279,16 → 301,23
=======
-- circular vector mode
if state.mode( FLAG_VEC_ROT ) = '0'
=======
if state.mode( I_FLAG_VEC_ROT ) = '0'
>>>>>>> Updated C and RTL model as well as the documentation
and state.mode( 1 downto 0 ) = VAL_MODE_CIR then
-- circular vector mode
 
-- move from third quadrant to first
if state.a < - PI_H then
-- move from third quadrant to first
state.a <= state.a + PI;
state.x <= - state.x;
state.y <= - state.y;
-- move from second quadrant to fourth
elsif state.a > PI_H then
<<<<<<< HEAD
>>>>>>> initial commit
=======
-- move from second quadrant to fourth
>>>>>>> Updated C and RTL model as well as the documentation
state.a <= state.a - PI;
state.x <= - state.x;
state.y <= - state.y;
295,6 → 324,7
end if;
 
<<<<<<< HEAD
<<<<<<< HEAD
elsif state.mode( I_FLAG_VEC_ROT ) = '1'
and state.mode( 1 downto 0 ) = VAL_MODE_CIR then
-- circular rotation mode
367,28 → 397,72
=======
-- circular rotation mode
elsif state.mode( FLAG_VEC_ROT ) = '1'
=======
elsif state.mode( I_FLAG_VEC_ROT ) = '1'
>>>>>>> Updated C and RTL model as well as the documentation
and state.mode( 1 downto 0 ) = VAL_MODE_CIR then
-- circular rotation mode
 
-- move from second quadrant to fourth
if state.x < 0 and state.y > 0 then
if state.x = 0 and state.y = 0 then
-- zero-input
state.a <= ( others => '0' );
state.y <= ( others => '0' );
state.st <= ST_DONE;
 
elsif state.x = XY_MAX and state.y = XY_MAX then
-- all-max 1
state.a <= resize( angular_lut( 0, state.mode( 1 downto 0 ), A_WIDTH ), A_WIDTH_I );
state.x <= to_signed( SQRT2, state.x'length );
state.y <= (others => '0' );
state.st <= ST_DONE;
elsif state.x = -XY_MAX and state.y = -XY_MAX then
-- all-max 2
state.a <= resize( angular_lut( 0, state.mode( 1 downto 0 ), A_WIDTH ), A_WIDTH_I ) - PI;
state.x <= to_signed( SQRT2, state.x'length );
state.y <= (others => '0' );
state.st <= ST_DONE;
elsif state.x = XY_MAX and state.y = -XY_MAX then
-- all-max 3
state.a <= resize( -angular_lut( 0, state.mode( 1 downto 0 ), A_WIDTH ), A_WIDTH_I );
state.x <= to_signed( SQRT2, state.x'length );
state.y <= (others => '0' );
state.st <= ST_DONE;
elsif state.x = -XY_MAX and state.y = XY_MAX then
-- all-max 4
state.a <= PI- resize( angular_lut( 0, state.mode( 1 downto 0 ), A_WIDTH ), A_WIDTH_I );
state.x <= to_signed( SQRT2, state.x'length );
state.y <= (others => '0' );
state.st <= ST_DONE;
 
elsif state.x = 0 and state.y > 0 then
-- fixed rotation of pi/2
state.a <= to_signed( PI_H, state.a'length );
state.x <= state.y;
state.y <= ( others => '0' );
state.st<= ST_DONE;
elsif state.x = 0 and state.y < 0 then
-- fixed rotation of -pi/2
state.a <= to_signed( -PI_H, state.a'length );
state.x <= -state.y;
state.y <= ( others => '0' );
state.st<= ST_DONE;
 
elsif state.x < 0 and state.y >= 0 then
-- move from second quadrant to fourth
state.x <= - state.x;
state.y <= - state.y;
state.a <= to_signed( PI, state.a'length );
-- move from third quadrant to first
elsif state.x < 0 and state.y < 0 then
-- move from third quadrant to first
state.x <= - state.x;
state.y <= - state.y;
state.a <= to_signed( -PI, state.a'length );
-- y=0 condition
elsif state.x < 0 and state.y = 0 then
state.a <= to_signed( PI, state.a'length );
state.st<= ST_DONE;
else
state.a <= ( others => '0' );
end if;
-- linear rotation mode
elsif state.mode( FLAG_VEC_ROT ) = '1'
elsif state.mode( I_FLAG_VEC_ROT ) = '1'
and state.mode( 1 downto 0 ) = VAL_MODE_LIN then
<<<<<<< HEAD
 
if state.x < 0 then
state.x <= - state.x;
396,6 → 470,14
end if;
state.a <= to_signed( 0, state.a'length );
>>>>>>> initial commit
=======
-- linear rotation mode
if state.x < 0 then
state.x <= - state.x;
state.y <= - state.y;
end if;
state.a <= to_signed( 0, state.a'length );
>>>>>>> Updated C and RTL model as well as the documentation
 
end if;
 
417,10 → 499,14
 
-- get the sign
<<<<<<< HEAD
<<<<<<< HEAD
if state.mode( I_FLAG_VEC_ROT ) = '0' then
=======
if state.mode( FLAG_VEC_ROT ) = '0' then
>>>>>>> initial commit
=======
if state.mode( I_FLAG_VEC_ROT ) = '0' then
>>>>>>> Updated C and RTL model as well as the documentation
if state.a < 0 then
sign := '0';
else
490,6 → 576,7
 
-- abort condition
<<<<<<< HEAD
<<<<<<< HEAD
if( state.mode( I_FLAG_VEC_ROT ) = '0' and
state.a = 0 ) then
state.st <= ST_RM_GAIN;
506,18 → 593,26
=======
if( state.mode( FLAG_VEC_ROT ) = '0' and
( state.a = 0 or state.a = -1 ) ) then
=======
if( state.mode( I_FLAG_VEC_ROT ) = '0' and
state.a = 0 ) then
>>>>>>> Updated C and RTL model as well as the documentation
state.st <= ST_RM_GAIN;
state.i <= ( others => '0' );
elsif( state.mode( FLAG_VEC_ROT ) = '0' and
( state.a = state.alst ) ) then
elsif( state.mode( I_FLAG_VEC_ROT ) = '0' and
state.a = state.alst ) then
state.st <= ST_RM_GAIN;
state.i <= ( others => '0' );
elsif( state.mode( FLAG_VEC_ROT ) = '1' and
( state.y = 0 or state.y = -1 ) ) then
elsif( state.mode( I_FLAG_VEC_ROT ) = '1' and
state.y = 0 ) then
state.st <= ST_RM_GAIN;
state.i <= ( others => '0' );
<<<<<<< HEAD
elsif( state.mode( FLAG_VEC_ROT ) = '1' and
>>>>>>> initial commit
=======
elsif( state.mode( I_FLAG_VEC_ROT ) = '1' and
>>>>>>> Updated C and RTL model as well as the documentation
( state.y = state.ylst ) ) then
state.st <= ST_RM_GAIN;
state.i <= ( others => '0' );

powered by: WebSVN 2.1.0

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