# How to support multiple register maps in a SOC system for a block with only one register map?

**URL:** <https://verificationacademy.com/forums/t/how-to-support-multiple-register-maps-in-a-soc-system-for-a-block-with-only-one-register-map/30934>\
**Category:** UVM\
**Tags:** UVM, uvm\_reg, UVM-reuse\
**Created:** [August 7, 2015, 4:56am UTC](https://verificationacademy.com/forums/t/how-to-support-multiple-register-maps-in-a-soc-system-for-a-block-with-only-one-register-map/30934 "2015-08-07T04:56:55Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Tudor\_Timi](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/tudor_timi/32/1897_2.png) [@Tudor\_Timi](https://verificationacademy.com/forums/u/Tudor_Timi)\
**Post date:** [August 7, 2015, 7:21am UTC](https://verificationacademy.com/forums/t/how-to-support-multiple-register-maps-in-a-soc-system-for-a-block-with-only-one-register-map/30934/2 "2015-08-07T07:21:38Z")

</div>

_In reply to [pinegreen](https://verificationacademy.com/forums/t/how-to-support-multiple-register-maps-in-a-soc-system-for-a-block-with-only-one-register-map/30934):_

I remember trying this out too. The documentation was out of sync, stating that this should be possible, but the BCL gave the nice error message. You could go the long way of mapping all registers/memories into the top level maps and forget the map defined in the module register block:

```verilog

class module_reg_block extends uvm_reg_block;
  // ...
  
  virtual function void build();
    default_map.add_mem(...);
    some_reg_file.map(default_map, ...);
  endfunction
endclass

```

Since we can’t add default map to multiple other maps, we’ll just have to remap:

```verilog

class system_reg_block extends uvm_reg_block;
  module_reg_block module_block;

  // ...
  
  virtual function void build();
    master0_map.add_mem(module_block.mem, ...);
    module_block.some_reg_file.map(master0_map, ...);
    
    master1_map.add_mem(module_block.mem, ...);
    module_block.some_reg_file.map(master1_map, ...);
  endfunction
endclass

```

You could also refactor mapping register elements into a single function that takes the map as an argument to avoid duplication.

---

_[View the full topic](https://verificationacademy.com/forums/t/how-to-support-multiple-register-maps-in-a-soc-system-for-a-block-with-only-one-register-map/30934)._
