Bugfix in gen_fill_mask_rom (wrong result on zero shift amounts due to width mismatch)

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@509 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
2009-10-14 21:15:31 +00:00
parent 47c0a1b682
commit 9a1a5579bf
+4 -2
View File
@@ -54,10 +54,12 @@ architecture Behavioral of shifter is
function gen_fill_mask_rom(data_width : natural) return fill_mask_rom_t is function gen_fill_mask_rom(data_width : natural) return fill_mask_rom_t is
variable result : fill_mask_rom_t; variable result : fill_mask_rom_t;
begin begin
for i in 0 to data_width-1 loop result(0) := (data_width-1 downto 0 => '0');
for i in 1 to data_width-1 loop
result(i) := (data_width-1-i downto 0 => '0') & (i-1 downto 0 => '1'); result(i) := (data_width-1-i downto 0 => '0') & (i-1 downto 0 => '1');
end loop; end loop;
for i in 0 to data_width-1 loop result(data_width) := (data_width-1 downto 0 => '0');
for i in 1 to data_width-1 loop
result(data_width+i) := (i-1 downto 0 => '1') & (data_width-1-i downto 0 => '0'); result(data_width+i) := (i-1 downto 0 => '1') & (data_width-1-i downto 0 => '0');
end loop; end loop;
return result; return result;