Dustin - 2012-02-18

Well I restructured my Vector to ASCII function and do not get this error during ellaboration anymore. Here is the new code that runs fine:

function toascii(
a : in std_logic_vector) return string is
--- Locals to make the indexing easier
constant a_norm : std_logic_vector(a'length-1 downto 0) := a;
constant len : integer := a'length/4;
variable result : string (1 to a'length/4);
variable nibble : std_logic_vector(3 downto 0);
begin
assert (a'length mod 4) = 0
report "SLV must be a multiple of 4 bits"
severity FAILURE;

for i in 1 to len loop
-- Branch at beginning of loop
if( i = 1 ) then
nibble := a_norm(3 downto 0);
else
nibble := a_norm((i-1)*4+3 downto (i-1)*4);
end if;
-- Convert
case nibble is
when "0000" => result(len-i+1) := '0';
when "0001" => result(len-i+1) := '1';
when "0010" => result(len-i+1) := '2';
when "0011" => result(len-i+1) := '3';
when "0100" => result(len-i+1) := '4';
when "0101" => result(len-i+1) := '5';
when "0110" => result(len-i+1) := '6';
when "0111" => result(len-i+1) := '7';
when "1000" => result(len-i+1) := '8';
when "1001" => result(len-i+1) := '9';
when "1010" => result(len-i+1) := 'a';
when "1011" => result(len-i+1) := 'b';
when "1100" => result(len-i+1) := 'c';
when "1101" => result(len-i+1) := 'd';
when "1110" => result(len-i+1) := 'e';
when "1111" => result(len-i+1) := 'f';
when others => result(len-i+1) := 'X';
end case;
end loop;

return result;
end function toascii;