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 Tudor Timi:

All I said above is valid, but I don’t think it actually pertains to your situation. Your registers are only mapped in one map. This means you’re always getting the same ‘default_map’, the one your register is mapped in. The access isn’t started on the sequencer associated with this map, but on the one associated with the system level map (i.e. the topmost level map). Since your top level ‘default_map’ doesn’t have any sequencer, you get the error message.

I guess you only need the top level map to set the offsets your sub-maps are at. What you could do is have 2 top level maps, one for each interface.


class top_reg_block extends uvm_reg_block;
  uvm_reg_map map0, map1;

  function void build();
    map0.add_submap(block0.default_map, 'h0);
    map1.add_submap(block1.default_map, 'h100);
  endfunction
endblock

You still need to set the sequencers for these two maps:


class top_reg_block extends uvm_reg_block;
  uvm_reg_map map0, map1;

  function void build();
    // ...
    map0.set_sequencer(block0.default_map.get_sequencer());
    map1.set_sequencer(block1.default_map.get_sequencer());
  endfunction
endblock

At the same time, instead of mapping your 2 sub-block maps inside other higher level maps, you could fiddle their offsets in the top reg block using ‘set_base_addr(…)’.


class top_reg_block extends uvm_reg_block;
  function void build();
    block0.default_map.set_base_addr('h0);
    block1.default_map.set_base_addr('h100);
  endfunction
endblock