Line 1503... |
Line 1503... |
--
|
--
|
-- function to_ascending(
|
-- function to_ascending(
|
-- constant s : signed
|
-- constant s : signed
|
-- ) return signed;
|
-- ) return signed;
|
--
|
--
|
-- Converts a signal to ascending range ( "to"-range ).
|
-- Converts a signal or variable to ascending range ("to-range").
|
-- The argument s can have ascending or descending range.
|
-- The argument s can have ascending or descending range.
|
----------------------------------------------------------------------------
|
----------------------------------------------------------------------------
|
function to_ascending(
|
function to_ascending(
|
constant s : std_logic_vector
|
constant s : std_logic_vector
|
) return std_logic_vector is
|
) return std_logic_vector is
|
variable r : std_logic_vector(0 to s'length-1);
|
variable r : std_logic_vector(s'low to s'high);
|
begin
|
begin
|
for i in r'range loop
|
for i in r'range loop
|
r(i) := s(i);
|
r(i) := s(i);
|
end loop;
|
end loop;
|
return r;
|
return r;
|
end function to_ascending;
|
end function to_ascending;
|
|
|
function to_ascending(
|
function to_ascending(
|
constant s : unsigned
|
constant s : unsigned
|
) return unsigned is
|
) return unsigned is
|
variable r : unsigned(0 to s'length-1);
|
variable r : unsigned(s'low to s'high);
|
begin
|
begin
|
for i in r'range loop
|
for i in r'range loop
|
r(i) := s(i);
|
r(i) := s(i);
|
end loop;
|
end loop;
|
return r;
|
return r;
|
end function to_ascending;
|
end function to_ascending;
|
|
|
function to_ascending(
|
function to_ascending(
|
constant s : signed
|
constant s : signed
|
) return signed is
|
) return signed is
|
variable r : signed(0 to s'length-1);
|
variable r : signed(s'low to s'high);
|
begin
|
begin
|
for i in r'range loop
|
for i in r'range loop
|
r(i) := s(i);
|
r(i) := s(i);
|
end loop;
|
end loop;
|
return r;
|
return r;
|
Line 1554... |
Line 1554... |
--
|
--
|
-- function to_descending(
|
-- function to_descending(
|
-- constant s : signed
|
-- constant s : signed
|
-- ) return signed;
|
-- ) return signed;
|
--
|
--
|
-- Converts a signal to descending range ( "downto"-range ).
|
-- Converts a signal or variable to descending range ("downto-range").
|
-- The argument s can have ascending or descending range.
|
-- The argument s can have ascending or descending range.
|
----------------------------------------------------------------------------
|
----------------------------------------------------------------------------
|
function to_descending(
|
function to_descending(
|
constant s : std_logic_vector
|
constant s : std_logic_vector
|
) return std_logic_vector is
|
) return std_logic_vector is
|
variable r : std_logic_vector(s'length-1 downto 0);
|
variable r : std_logic_vector(s'high downto s'low);
|
begin
|
begin
|
for i in r'range loop
|
for i in r'range loop
|
r(i) := s(i);
|
r(i) := s(i);
|
end loop;
|
end loop;
|
return r;
|
return r;
|
end function to_descending;
|
end function to_descending;
|
|
|
function to_descending(
|
function to_descending(
|
constant s : unsigned
|
constant s : unsigned
|
) return unsigned is
|
) return unsigned is
|
variable r : unsigned(s'length-1 downto 0);
|
variable r : unsigned(s'high downto s'low);
|
begin
|
begin
|
for i in r'range loop
|
for i in r'range loop
|
r(i) := s(i);
|
r(i) := s(i);
|
end loop;
|
end loop;
|
return r;
|
return r;
|
end function to_descending;
|
end function to_descending;
|
|
|
function to_descending(
|
function to_descending(
|
constant s : signed
|
constant s : signed
|
) return signed is
|
) return signed is
|
variable r : signed(s'length-1 downto 0);
|
variable r : signed(s'high downto s'low);
|
begin
|
begin
|
for i in r'range loop
|
for i in r'range loop
|
r(i) := s(i);
|
r(i) := s(i);
|
end loop;
|
end loop;
|
return r;
|
return r;
|