Hi All,
Consider the following property declaration
property param_prop( N_bit );
logic [(N_bit-1):0] val; // bit-width legal ?
(1,val=N_bit-1,$display("val is 'd%0d",val) )[*N_bit]; // [*N_bit] legal ?
endproperty
a1:assert property(@(posedge clk) param_prop(8) );
a2:assert property(@(posedge clk) param_prop(2) );
On testing it on EDA I see 2 tools accept this whereas one tool throws compilation error
Error-[TCF-CETE] Cannot evaluate the expression
testbench.sv, 10
"(N_bit - 1)"
Cannot evaluate the expression in left dimension bound.
The expression must be compile time constant.
Generally the bit width of a variable is fixed at compilation stage or elaboration stage ( using parameter / localparam ). In the above code I use the argument to set the bit width as well the repetition for the sequence expression.
(1) Is the above code legal from LRM perspective ?
(2) Are a1 & a2 similar to an instance of a parametrized module / interface or specialization of parametrized class ? ( i.e Resolved at Elaboration time )