How to get index of an Associative array for a value?

All:

Is there any way, we can get index of an associative array for a particular value?

Thanks,
ovmboy

Yes, use the
array.find_index with (item == value)
method. For example, if you have

typedef bit [15:0] index_t;

int array[index_t];

index_t keys[$];

...

keys = array.find_index with (item = *value*);

The find_index command returns a queue of index_t keys that match value.

Dave Rich

Thanks Dave. :-)