int tcb_field[string] = '{
“capture” : 1,
“scan” : 0,
“jtag_pins_param” : 0,
“cs_1” : 0,
“cs_0” : 0,
“DDSI1_0” : 0,
“DDSI1_1” : 0,
“FEFSI2_0” : 0,
“SDSI2_1” : 0,
“GPIO0_0” : 1,
“GPIO0_1” : 1}
bit [10:0] tcb_seq;
I want to convert this into 11’b10000000011 and bit order must be same.
I know the order of string associative array is lexicographical so I tried as shown below but it’s not working
You can try foreach (tcb_field[key]), but SV LRM does not gurantee order in which a foreach elements will be visited. it just requires all of them to be visited once in a foreach.
I would say use first(), next() to traverse the AA .
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.