In reply to dave_59:
Hi Dave,
Yes numeric-IDs will also do the work.I just want to avoid the duplicate keys so that I am able to get all the values because the values you see with respect to the keys are start_time and end_time of every register value window.
always @(reg)
begin
start_time <= $time;
prev_value <= reg_value;
$fdisplay(fd, " %d {%0t %0t}", prev_value,start_time,$time);
Every time the reg value changes I want to write the key=“prev_value” {start_time end_time} in associative array named as “active”. But since the reg value is repeating sometimes I want to map the key as mentioned above so that I get timing of all the windows. Well I do not have more than 26 keys and since I am bit of beginner in SystemVerilog I would like to learn the logic for both alphabetic sequence eg: a-0, b-0 , a-1 as well as numeric ids eg: 0-0, 1-0, 0-1, etc.