L
Leow Yuan Yeow
Guest
Hi, for a program such as
case state is
when S0=>
A <= B + C;
when S1=>
Z <= X + Y;
does it mean that 2 adders are generated, or will the synthesis recognize
the adder can be shared?
Or to I have to specifically write a multiplexor for the adder? Thanks!
"Mike Treseler" <mike_treseler@comcast.net> wrote in message
news:480fvpFhqii0U1@individual.net...
case state is
when S0=>
A <= B + C;
when S1=>
Z <= X + Y;
does it mean that 2 adders are generated, or will the synthesis recognize
the adder can be shared?
Or to I have to specifically write a multiplexor for the adder? Thanks!
"Mike Treseler" <mike_treseler@comcast.net> wrote in message
news:480fvpFhqii0U1@individual.net...
Leow Yuan Yeow wrote:
Does resource sharing also apply for a + sign in different states? It
appears the synthesizer doesn't like my code then.
If you want to share an adder,
it is best to describe exactly how in your code.
Resource sharing by synthesis requires
duplicated descriptions or a selection
that can be made either by muxing
inputs or outputs, like this:
if op1 then
q_v := A + B;
else
q_v := C + D;
end if;
I might duplicate a register description by mistake and
be happy about a silent band-aid from synthesis.
Or I might prefer just a warning so I can clean up my code.
Then again, I might duplicate a register just to buffer the signal
and prefer that synthesis keeps hands off.
-- Mike Treseler