I have defined a structure with three integers, then created a dynamic array of the structure. Later in the code, I want to increment some of the integer values in the structure:
typedef struct {
integer tc;
integer pass;
integer fail;
} score_t;
score_t scorecard[];
integer tc_count;
initial
....
scorecard = new[`MAX_TC];
....
scorecard[tc_count].fail = 0;
....
scorecard[tc_count].fail++;
However, when I compile in Aldec Active-HDL I get the following error:
Error: VCP2615 ../../../m3_test_load_tb.sv : (283, 33):
scorecard[tc_count].fail is not l-value.
Is this a limitation of the language? I can assign to a temporary variable to do the increment operation and then put the value back in the struct, but that seems clumsy.