- bounds check failure with GHDL
git-svn-id: http://moon:8086/svn/vhdl/trunk@1438 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
@@ -68,7 +68,7 @@ package body fixed_ja is
|
||||
-- remainder : sfixed_t;
|
||||
-- rnd_mode : round_mode_t := default_round_mode
|
||||
-- ) return sfixed_t is
|
||||
-- variable res : signed(src'length-1 downto 0);
|
||||
-- variable res : to_signed(src'length-1 downto 0);
|
||||
-- begin
|
||||
-- return src;
|
||||
--
|
||||
@@ -1108,9 +1108,9 @@ package body fixed_ja is
|
||||
|
||||
begin
|
||||
if (a'high = 0 and b'high > 0) or (a'high > 0 and b'high = 0) then
|
||||
result := to_sfixed(signed(a) * signed(b), result) sla 2;
|
||||
result := to_sfixed(to_signed(a) * to_signed(b), result) sla 2;
|
||||
else
|
||||
result := to_sfixed(signed(a) * signed(b), result) sla 1;
|
||||
result := to_sfixed(to_signed(a) * to_signed(b), result) sla 1;
|
||||
end if;
|
||||
return result;
|
||||
|
||||
@@ -1137,7 +1137,7 @@ package body fixed_ja is
|
||||
variable result : ufixed_t (uproto(a,'+',b)'high downto uproto(a,'+',b)'low);
|
||||
|
||||
begin
|
||||
result := ufixed_t(unsigned(reshape(a, result)) + unsigned(reshape(b, result)));
|
||||
result := ufixed_t(to_unsigned(reshape(a, result)) + to_unsigned(reshape(b, result)));
|
||||
return result;
|
||||
|
||||
end "+";
|
||||
@@ -1147,8 +1147,8 @@ package body fixed_ja is
|
||||
variable result : sfixed_t (sproto(a,'+',b)'high downto sproto(a,'+',b)'low);
|
||||
|
||||
begin
|
||||
result := to_sfixed(signed(reshape(a,result)) + signed(reshape(b,result)), result);
|
||||
-- result := to_sfixed(signed(a) + signed(b), result);
|
||||
result := to_sfixed(to_signed(reshape(a,result)) + to_signed(reshape(b,result)), result);
|
||||
-- result := to_sfixed(to_signed(a) + to_signed(b), result);
|
||||
return result;
|
||||
|
||||
end "+";
|
||||
@@ -1174,7 +1174,7 @@ package body fixed_ja is
|
||||
|
||||
begin
|
||||
|
||||
return ufixed_t(unsigned(a) + b);
|
||||
return ufixed_t(to_unsigned(a) + b);
|
||||
|
||||
end "+";
|
||||
|
||||
@@ -1183,7 +1183,7 @@ package body fixed_ja is
|
||||
|
||||
begin
|
||||
|
||||
return sfixed_t(signed(a) + b);
|
||||
return sfixed_t(to_signed(a) + b);
|
||||
|
||||
end "+";
|
||||
|
||||
@@ -1192,7 +1192,7 @@ package body fixed_ja is
|
||||
|
||||
begin
|
||||
|
||||
return ufixed_t(unsigned(a) + to_unsigned(b, a'length));
|
||||
return ufixed_t(to_unsigned(a) + to_unsigned(b, a'length));
|
||||
|
||||
end "+";
|
||||
|
||||
@@ -1201,7 +1201,7 @@ package body fixed_ja is
|
||||
|
||||
begin
|
||||
|
||||
return sfixed_t(signed(a) + to_signed(b, a'length));
|
||||
return sfixed_t(to_signed(a) + to_signed(b, a'length));
|
||||
|
||||
end "+";
|
||||
|
||||
@@ -1243,7 +1243,7 @@ package body fixed_ja is
|
||||
variable result : sfixed_t (sproto(a,'-',b)'high downto sproto(a,'-',b)'low);
|
||||
|
||||
begin
|
||||
result := to_sfixed(signed(reshape(a,result)) - signed(reshape(b,result)), result);
|
||||
result := to_sfixed(to_signed(reshape(a,result)) - to_signed(reshape(b,result)), result);
|
||||
return result;
|
||||
|
||||
end "-";
|
||||
@@ -1267,7 +1267,7 @@ package body fixed_ja is
|
||||
function "-" (a : ufixed_t; b : unsigned) return ufixed_t is
|
||||
|
||||
begin
|
||||
return ufixed_t(unsigned(a) - b);
|
||||
return ufixed_t(to_unsigned(a) - b);
|
||||
|
||||
end "-";
|
||||
|
||||
@@ -1275,7 +1275,7 @@ package body fixed_ja is
|
||||
function "-" (a : sfixed_t; b : signed) return sfixed_t is
|
||||
|
||||
begin
|
||||
return sfixed_t(signed(a) - b);
|
||||
return sfixed_t(to_signed(a) - b);
|
||||
|
||||
end "-";
|
||||
|
||||
@@ -1284,7 +1284,7 @@ package body fixed_ja is
|
||||
|
||||
begin
|
||||
|
||||
return ufixed_t(unsigned(a) - to_unsigned(b, a'length));
|
||||
return ufixed_t(to_unsigned(a) - to_unsigned(b, a'length));
|
||||
|
||||
end "-";
|
||||
|
||||
@@ -1293,7 +1293,7 @@ package body fixed_ja is
|
||||
|
||||
begin
|
||||
|
||||
return sfixed_t(signed(a) - to_signed(b, a'length));
|
||||
return sfixed_t(to_signed(a) - to_signed(b, a'length));
|
||||
|
||||
end "-";
|
||||
|
||||
@@ -1304,7 +1304,7 @@ package body fixed_ja is
|
||||
|
||||
begin
|
||||
buns := (a'length-1 downto 1 => '0') & b;
|
||||
result := ufixed_t(unsigned(a) - buns);
|
||||
result := ufixed_t(to_unsigned(a) - buns);
|
||||
return result;
|
||||
|
||||
end "-";
|
||||
@@ -1316,7 +1316,7 @@ package body fixed_ja is
|
||||
|
||||
begin
|
||||
bs := (a'length-1 downto 1 => '0') & b;
|
||||
result := sfixed_t(signed(a) - bs);
|
||||
result := sfixed_t(to_signed(a) - bs);
|
||||
return result;
|
||||
|
||||
end "-";
|
||||
@@ -1326,7 +1326,7 @@ package body fixed_ja is
|
||||
-------------------------------------------------------------
|
||||
function "abs" (src : sfixed_t) return sfixed_t is
|
||||
begin
|
||||
return to_sfixed(abs(signed(src)), src);
|
||||
return to_sfixed(abs(to_signed(src)), src);
|
||||
|
||||
end "abs";
|
||||
|
||||
@@ -1340,7 +1340,7 @@ package body fixed_ja is
|
||||
-------------------------------------------------------------
|
||||
function "-" (src : sfixed_t) return sfixed_t is
|
||||
begin
|
||||
return to_sfixed(-signed(src), src);
|
||||
return to_sfixed(-to_signed(src), src);
|
||||
|
||||
end "-";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user