R
rickman
Guest
I looked this up once in the VHDL spec, but I don't recall the details.
I seem to remember that the definition of a locally static expression
is rather complex with a lot of little details. But a tool is flagging
warnings on some code which seems to be due to the use of conversion
from SLV to integer.
constant SWAP : IRSLV := to_slv(FIXOP + 16#00#, 8); -- E0 (1110 0000)
type INSTDSPLY is (RST, IACK, LTR, JMP, JUMZ, JUMC, JUMO, CALA, CALR,
SWP, OVR, RUP, DUP, SHFL, SHFC, ZFLG, RFTC,
RDRP, RTN, FTCH, FCHB, RFRM, RSB, RCM, FCHP, FHPB, RARS,
DDRP, TOR, CPNC, CPC, ADNC, ADC, SBNC, SBC,
BFL, RTI, STOR, STRB, BLAN, RADT, BLOR, STRP, STPB, BLXR);
when TO_INTEGER(UNSIGNED(SWAP)) => return SWP;
The warning comes from lines like this last one, allegedly from the
value returned by the TO_INTEGER conversion. "Choice TO_INTEGER is not
a locally static expression."
I do this in a lot of places in some existing code. My MO is to avoid
warning messages, so I can't believe that I would have done this and
lived with the dozens of warnings I am getting. But then the older
tool may not have been as true to the spec as it could have been.
Rather than make me go dig up my copy of the VHDL spec and read all
those cross-referenced paragraphs to re-learn what this really means,
can anyone give me the 25 cent explanation and an easy cure?
I seem to remember that the definition of a locally static expression
is rather complex with a lot of little details. But a tool is flagging
warnings on some code which seems to be due to the use of conversion
from SLV to integer.
constant SWAP : IRSLV := to_slv(FIXOP + 16#00#, 8); -- E0 (1110 0000)
type INSTDSPLY is (RST, IACK, LTR, JMP, JUMZ, JUMC, JUMO, CALA, CALR,
SWP, OVR, RUP, DUP, SHFL, SHFC, ZFLG, RFTC,
RDRP, RTN, FTCH, FCHB, RFRM, RSB, RCM, FCHP, FHPB, RARS,
DDRP, TOR, CPNC, CPC, ADNC, ADC, SBNC, SBC,
BFL, RTI, STOR, STRB, BLAN, RADT, BLOR, STRP, STPB, BLXR);
when TO_INTEGER(UNSIGNED(SWAP)) => return SWP;
The warning comes from lines like this last one, allegedly from the
value returned by the TO_INTEGER conversion. "Choice TO_INTEGER is not
a locally static expression."
I do this in a lot of places in some existing code. My MO is to avoid
warning messages, so I can't believe that I would have done this and
lived with the dozens of warnings I am getting. But then the older
tool may not have been as true to the spec as it could have been.
Rather than make me go dig up my copy of the VHDL spec and read all
those cross-referenced paragraphs to re-learn what this really means,
can anyone give me the 25 cent explanation and an easy cure?