4pi
Newbie
Hi there!
i have FOR LOOP (here WIDTH=8, B=3)
and i have to rewrite it using FOR GENERATE.
This is not work:
should i write ... <= ... when ... else... ?
But i dont have to do nothing in case r(i)=0.
i have FOR LOOP (here WIDTH=8, B=3)
Code:
for i in 0 to (WIDTH - 1) loop
if r(i)='1' then
bcode <= std_logic_vector(to_unsigned(i, B));
end if;
end loop;
and i have to rewrite it using FOR GENERATE.
This is not work:
Code:
for i in 0 to (WIDTH - 1) generate
bcode <= std_logic_vector(to_unsigned(i, B)) when r(i) = '1';
end generate;
Errors:
Error (10028): Can't resolve multiple constant drivers for net "bcode[2]" at ***.vhd(33)
Error (10029): Constant driver at ***.vhd(33)
Error (10028): Can't resolve multiple constant drivers for net "bcode[1]" at ***.vhd(33)
Error (10028): Can't resolve multiple constant drivers for net "bcode[0]" at ***.vhd(33)
should i write ... <= ... when ... else... ?
But i dont have to do nothing in case r(i)=0.