How to set_sequencer & adapter for the default maps present in the sub-blocks, which is instanced inside top level register blocks?

In reply to desperadorocks:

I had a look in the code and it seems to me that the map you’ll get is implementation specific. There’s a ‘get_default_map()’ function in ‘uvm_reg’. If a register is mapped in multiple maps, it will do a loop over all maps:


foreach (m_maps[l]) begin
  // ...

‘m_maps’ is an associative array that contains all maps a register is mapped in. The IEEE 1800-2012 standard says in Section 7.8.5 Other user-defined types:

If the relational operator is defined for the index type, the ordering is as defined in the preceding
clauses. If not, the relative ordering of any two entries in such an associative array can vary, even
between successive runs of the same tool. However, the relative ordering shall remain the same
within the same simulation run while no indices have been added or deleted.

This means you can’t rely on which map gets selected. You have to always supply a map when a register is mapped multiple times.

N.B. I guess they implemented ‘m_maps’ as an associative array and not a normal array so they can use the ‘exists(…)’ method to check if a map exists or not. Since they only use SV 2009 code, they couldn’t use the new SV 2012 array locator methods.