Commit 2943524e authored by Dimitris Lampridis's avatar Dimitris Lampridis

sdb: fix nibble order in commit_id field of SDB synthesis record. Closes #1399.

This was due to a bug in the f_string2bits() which took the commit ID as a string argument, assuming that the character array of the string is (32 downto 1), while in fact the commit_id is a string(1 to 32).

f_string2bits() is now  more resilient, it works with both "up" and "downto" string arguments, by checking the "ascending" attribute of the string type.
parent 4ec58596
......@@ -1794,7 +1794,11 @@ package body wishbone_pkg is
when 'F' => nibble := X"F";
when others => nibble := "XXXX";
end case;
slv(((i+1)*4)-1 downto i*4) := nibble;
if s'ascending then
slv(slv'length-(i*4)-1 downto slv'length-(i+1)*4) := nibble;
else
slv(((i+1)*4)-1 downto i*4) := nibble;
end if;
end loop;
return slv;
end f_string2bits;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment