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/vhdl
- from Rev 7 to Rev 13
- ↔ Reverse comparison
Rev 7 → Rev 13
/cordic_iterative_pkg.vhd
61,18 → 61,8
|
|
|
<<<<<<< HEAD |
<<<<<<< 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 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 |
/cordic_iterative_tb.vhd
249,8 → 249,6
y_ex /= y_o or |
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(3) ) & ", but got:" |
& integer'image( to_integer( signed( x_o ) ) ); |
260,31 → 258,8
& integer'image( to_integer( signed( y_o ) ) ); |
assert a_ex = a_o report |
integer'image( stim_cnt ) & ": Serial Cordic Failed: expected a result:" |
<<<<<<< HEAD |
======= |
" 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 |
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 ) ) ); |
======= |
& integer'image( tmp_value(5) ) & ", but got:" |
& integer'image( to_integer( signed( a_o ) ) ); |
>>>>>>> Removed some bugs regarding pre-rotation and negative numbers in the wb wrapper |
err_cnt := err_cnt + 1; |
writeline( error_pattern_file, input_line_bak ); |
|
/cordic_iterative_int.vhd
92,15 → 92,7
|
-- Internal angle width |
constant A_WIDTH_I : natural := A_WIDTH+2; |
<<<<<<< HEAD |
<<<<<<< HEAD |
<<<<<<< HEAD |
======= |
>>>>>>> Updated C and RTL model as well as the documentation |
|
======= |
|
>>>>>>> Removed some bugs regarding pre-rotation and negative numbers in the wb wrapper |
|
constant SQRT2_REAL : real := 1.4142135623730951454746218587388284504413604; |
constant PI_REAL : real := 3.1415926535897931159979634685441851615905762; |
109,15 → 101,6
constant SQRT2 : integer := natural( round( SQRT2_REAL * real( 2**( XY_WIDTH-1 ) ) ) ); |
constant XY_MAX : integer := natural( 2**( XY_WIDTH-1)-1); |
|
<<<<<<< HEAD |
======= |
|
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 |
======= |
>>>>>>> Updated C and RTL model as well as the documentation |
|
constant XY_WIDTH_G : natural := XY_WIDTH + GUARD_BITS; |
|
239,30 → 222,8
state.y <= resize( signed( y_i ), state.y'length ); |
state.a <= resize( signed( a_i ), state.a'length ); |
state.i <= ( others => '0' ); |
<<<<<<< HEAD |
|
<<<<<<< HEAD |
<<<<<<< HEAD |
elsif state.st = ST_INIT then |
-- |
-- initialization state |
-- -> do initial rotation (alignment) |
-- -> 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.alst <= ( others => '0' ); |
state.ylst <= ( others => '0' ); |
>>>>>>> Removed some bugs regarding pre-rotation and negative numbers in the wb wrapper |
elsif state.st = ST_INIT then |
-- |
-- initialization state |
270,34 → 231,10
-- -> 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 |
<<<<<<< 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 |
======= |
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; |
|
|
|
|
<<<<<<< HEAD |
<<<<<<< HEAD |
if state.mode( I_FLAG_VEC_ROT ) = '0' |
======= |
if state.mode( 1 downto 0 ) = VAL_MODE_HYP then |
-- if we do a hyperbolic rotation, we start with 1 |
state.i(0) <= '1'; |
319,7 → 256,6
state.st <= ST_DONE; |
|
elsif state.mode( I_FLAG_VEC_ROT ) = '0' |
>>>>>>> Removed some bugs regarding pre-rotation and negative numbers in the wb wrapper |
and state.mode( 1 downto 0 ) = VAL_MODE_CIR then |
-- circular vector mode |
|
330,111 → 266,15
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' |
======= |
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 |
|
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; |
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; |
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 |
|
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 ); |
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 ); |
else |
state.a <= ( others => '0' ); |
end if; |
elsif state.mode( I_FLAG_VEC_ROT ) = '1' |
and state.mode( 1 downto 0 ) = VAL_MODE_LIN then |
-- 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 ); |
======= |
-- 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 |
|
if state.y = 0 then |
-- zero-input |
state.x_sum <= state.x; |
495,15 → 335,6
end if; |
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; |
state.y <= - state.y; |
end if; |
state.a <= to_signed( 0, state.a'length ); |
>>>>>>> initial commit |
======= |
-- linear rotation mode |
|
if state.x < 0 then |
511,7 → 342,6
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; |
|
532,15 → 362,7
elsif state.st = ST_ROTATE then |
|
-- 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 |
610,8 → 432,6
end if; |
|
-- abort condition |
<<<<<<< HEAD |
<<<<<<< HEAD |
if( state.mode( I_FLAG_VEC_ROT ) = '0' and |
state.a = 0 ) then |
state.st <= ST_RM_GAIN; |
625,29 → 445,6
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 |
======= |
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( I_FLAG_VEC_ROT ) = '0' and |
state.a = state.alst ) then |
state.st <= ST_RM_GAIN; |
state.i <= ( others => '0' ); |
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' ); |