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 2 to Rev 3
- ↔ Reverse comparison
Rev 2 → Rev 3
/vhdl/cordic_iterative_pkg.vhd
61,8 → 61,13
|
|
|
<<<<<<< HEAD |
constant I_FLAG_VEC_ROT : natural := 3; -- bit index |
constant I_FLAG_ATAN_3 : natural := 2; -- bit index (for future usage) |
======= |
constant FLAG_VEC_ROT : natural := 3; -- bit index |
constant FLAG_ATAN_3 : natural := 2; -- bit index |
>>>>>>> initial commit |
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
251,6 → 251,7
y_ex /= y_o or |
a_ex /= a_o then |
assert x_ex = x_o report |
<<<<<<< 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 ) ) ); |
260,6 → 261,17
& integer'image( to_integer( signed( y_ex ) ) ); |
assert a_ex = a_o report |
integer'image( stim_cnt ) & ": Serial Cordic Failed: expected a result:" |
======= |
" Serial Cordic Failed: expected x result:" |
& 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( tmp_value(6) ) & ", but got:" |
& integer'image( to_integer( signed( y_ex ) ) ); |
assert a_ex = a_o report |
" Serial Cordic Failed: expected a result:" |
>>>>>>> initial commit |
& integer'image( tmp_value(7) ) & ", but got:" |
& integer'image( to_integer( signed( a_ex ) ) ); |
err_cnt := err_cnt + 1; |
/vhdl/cordic_iterative_int.vhd
92,6 → 92,7
|
-- Internal angle width |
constant A_WIDTH_I : natural := A_WIDTH+2; |
<<<<<<< HEAD |
|
|
constant SQRT2_REAL : real := 1.4142135623730951454746218587388284504413604; |
101,6 → 102,12
constant SQRT2 : integer := natural( SQRT2_REAL * real( 2**( XY_WIDTH-1 ) ) + 0.5 ); |
constant XY_MAX : integer := natural( 2**( XY_WIDTH-1)-1); |
|
======= |
|
constant PI_REAL : real := 3.1415926535897931159979634685441851615905762; |
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 |
|
constant XY_WIDTH_G : natural := XY_WIDTH + GUARD_BITS; |
|
224,6 → 231,7
state.a <= resize( signed( a_i ), state.a'length ); |
state.i <= ( others => '0' ); |
|
<<<<<<< HEAD |
elsif state.st = ST_INIT then |
-- |
-- initialization state |
231,12 → 239,25
-- -> check special situations / miss-configurations (TODO) |
-- |
|
======= |
-- |
-- initialization state |
-- -> do initial rotation (alignment) |
-- -> check special situations / miss-configurations (TODO) |
-- |
elsif state.st = ST_INIT then |
>>>>>>> initial commit |
state.st <= ST_ROTATE; |
state.do_shift <= '1'; |
|
|
<<<<<<< HEAD |
if state.mode( 1 downto 0 ) = VAL_MODE_HYP then |
-- if we do a hyperbolic rotation, we start with 1 |
======= |
-- if we do a hyperbolic rotation, we start with 1 |
if state.mode( 1 downto 0 ) = VAL_MODE_HYP then |
>>>>>>> initial commit |
state.i(0) <= '1'; |
end if; |
|
243,6 → 264,7
|
|
|
<<<<<<< HEAD |
if state.mode( I_FLAG_VEC_ROT ) = '0' |
and state.mode( 1 downto 0 ) = VAL_MODE_CIR then |
-- circular vector mode |
254,11 → 276,25
state.y <= - state.y; |
elsif state.a > PI_H then |
-- move from second quadrant to fourth |
======= |
-- circular vector mode |
if state.mode( FLAG_VEC_ROT ) = '0' |
and state.mode( 1 downto 0 ) = VAL_MODE_CIR then |
|
-- move from third quadrant to first |
if state.a < - PI_H then |
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 |
>>>>>>> initial commit |
state.a <= state.a - PI; |
state.x <= - state.x; |
state.y <= - state.y; |
end if; |
|
<<<<<<< HEAD |
elsif state.mode( I_FLAG_VEC_ROT ) = '1' |
and state.mode( 1 downto 0 ) = VAL_MODE_CIR then |
-- circular rotation mode |
328,7 → 364,39
state.y <= - state.y; |
end if; |
state.a <= to_signed( 0, state.a'length ); |
======= |
-- circular rotation mode |
elsif state.mode( FLAG_VEC_ROT ) = '1' |
and state.mode( 1 downto 0 ) = VAL_MODE_CIR then |
|
-- move from second quadrant to fourth |
if state.x < 0 and state.y > 0 then |
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 |
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' |
and state.mode( 1 downto 0 ) = VAL_MODE_LIN then |
|
if state.x < 0 then |
state.x <= - state.x; |
state.y <= - state.y; |
end if; |
state.a <= to_signed( 0, state.a'length ); |
>>>>>>> initial commit |
|
end if; |
|
|
348,7 → 416,11
elsif state.st = ST_ROTATE then |
|
-- get the sign |
<<<<<<< HEAD |
if state.mode( I_FLAG_VEC_ROT ) = '0' then |
======= |
if state.mode( FLAG_VEC_ROT ) = '0' then |
>>>>>>> initial commit |
if state.a < 0 then |
sign := '0'; |
else |
417,6 → 489,7
state.do_shift <= '0'; |
|
-- abort condition |
<<<<<<< HEAD |
if( state.mode( I_FLAG_VEC_ROT ) = '0' and |
state.a = 0 ) then |
state.st <= ST_RM_GAIN; |
430,6 → 503,21
state.st <= ST_RM_GAIN; |
state.i <= ( others => '0' ); |
elsif( state.mode( I_FLAG_VEC_ROT ) = '1' and |
======= |
if( state.mode( FLAG_VEC_ROT ) = '0' and |
( state.a = 0 or state.a = -1 ) ) then |
state.st <= ST_RM_GAIN; |
state.i <= ( others => '0' ); |
elsif( state.mode( 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 |
state.st <= ST_RM_GAIN; |
state.i <= ( others => '0' ); |
elsif( state.mode( FLAG_VEC_ROT ) = '1' and |
>>>>>>> initial commit |
( state.y = state.ylst ) ) then |
state.st <= ST_RM_GAIN; |
state.i <= ( others => '0' ); |