How to assign multidimensional array with default value in systemverilog

In reply to cgales:

Hi cgales,

I know this assignment method, but I am wondering what the value would be if index string is found, but index int is not found?

For example, I just assign A[ABC][0] = 1, A[DEF][1] = 1

I hope that

A[ABC][1] = default value (index string found, but index int not found)
A[BCD][0] = default value (index string not found, but index int found)

will

rand int A[string][int] = '{default : '{default : -1}};

achieve this ?

I assume this implies that “if index string not found, and index int also not found, then the value will be -1”

Isn’t it?

Thanks