I have a top level uvm_reg_block with 2 maps, A and B. I add a subblock of type uvm_reg_block named C to both using add_submap(see below)
this.A= create_map(“A”, UVM_REG_ADDR_WIDTH'h0, 4, UVM_LITTLE_ENDIAN, 1); this.B= create_map("B",
UVM_REG_ADDR_WIDTH’h0, 4, UVM_LITTLE_ENDIAN, 1);
this.A.add_submap(this.C.default_map,UVM_REG_ADDR_WIDTH'h0); this.B.add_submap(this.C.default_map,
UVM_REG_ADDR_WIDTH’h0);
I see the following error reported:
UVM_ERROR : reporter [RegModel] Map ‘m_reg.C.default_map’ is already a child of map ‘m_reg.A’. Cannot also be a child of map ‘m_reg.B’
Is there a way to get around this issue? Does UVM not support having the same uvm_reg_block in multiple maps?
I tried to create multiple instances of subblock C namely C_A and C_B:
this.A.add_submap(this.C_A.default_map,UVM_REG_ADDR_WIDTH'h0); this.B.add_submap(this.C_B.default_map,
UVM_REG_ADDR_WIDTH’h0);
The issue with the above code is - when a register is accessed in C_A reg block, the ral mirror is updated only for C_A and hence C_B’s ral mirror is outdated even if both the reg blocks C_A and C_B point to same registers in the design.
Thanks!