In reply to sohan_b:
Hi Sohan,
I tried with first,next traversing method. And found that Associatve array stores everything in Ascending order if the index is string. I ran the code in ncverilog.
1 module tb();
2
3 int tcb_field[string] = '{
4 “capture” : 1,
5 “scan” : 0,
6 “jtag_pins_param” : 0,
7 “cs_1” : 0,
8 “cs_0” : 0,
9 “DDSI1_0” : 0,
10 “DDSI1_1” : 0,
11 “FEFSI2_0” : 0,
12 “SDSI2_1” : 0,
13 “GPIO0_0” : 1,
14 “GPIO0_1” : 1};
15
16 bit [10:0] tcb_seq;
17
18
19 string f_idx;
20 string n_idx;
21 int i = 0;
22
23 initial begin
24
25 tcb_field.first(n_idx);
26 for(i = 0; i < tcb_field.num() ; i=i+1 ) begin
27 $display(“tcb_field[%0s]:%0d”,n_idx,tcb_field[n_idx]);
28 tcb_seq[i] = tcb_field[n_idx];
29 tcb_field.next(n_idx);
30 end
31
32 $display(“tcb_seq : %0bb”,tcb_seq);
33
34 end
35
36 endmodule