M
mag
Guest
I haven't found this from looking through the IEEE specs. Please
correct me if there is a way to do this in both synthesizable and non-
synthesizeable code. It would be nice if there was a build-in task or
method to check whether an identifier has been defined.
For example if I were trying to configure something via a generate
statement I could do this:
import my_parameter_package::*;
generate
if (HAS_ADDER.defined)
adder(...);
endgenerate
where the package my_parameter_package may sometimes have
parameter HAS_ADDER = 1
and sometime it does not.
Right now it seems I have to either have "parameter HAS_ADDER=1" or
"paramter HAS_ADDER=0" in my_parameter_package. Seems life would be
simpler if I could just omit the parameter if I don't intend to
positively define it.
correct me if there is a way to do this in both synthesizable and non-
synthesizeable code. It would be nice if there was a build-in task or
method to check whether an identifier has been defined.
For example if I were trying to configure something via a generate
statement I could do this:
import my_parameter_package::*;
generate
if (HAS_ADDER.defined)
adder(...);
endgenerate
where the package my_parameter_package may sometimes have
parameter HAS_ADDER = 1
and sometime it does not.
Right now it seems I have to either have "parameter HAS_ADDER=1" or
"paramter HAS_ADDER=0" in my_parameter_package. Seems life would be
simpler if I could just omit the parameter if I don't intend to
positively define it.