Given this code:
regfile a #(longint unsigned NUM_REGS = 1, bit reg_present = 1){
regfile b {
reg some_reg { field {} nested_field;} some_reg[NUM_REGS];
reg other_reg { field {} nested_field; ispresent = ~reg_present;} other_reg;
} b;
};
When the type is instantiated with default params the value of
ispresent = ~reg_present
is (2^64 - 1) which is not false as clearly intended by the author.
The fix is to instead use
ispresent = !reg_present
My question: is this a feature or a bug? The standard is not clear on whether bit-type param fields are supposed to be full-width (64-bits) or minimum-width required to hold the default value (1-bit).
Thanks.