OVM_RGM: multiple instances of the same ovm_rgm_register_file?

My DUT is a subsystem with multiple instances of block A. I have an ovm_rgm_register_file from block A’s OVC. Is there a correct way to add multiple instances of this register file (each at it’s own address) to the ovm_rgm_address_map for my DUT OVC?

When I add them I see name collision errors, e.g.:

OVM_ERROR @ 10000.0 ps: dut_address_map [OVMRGM] Collision during creation of the field map! Field : MY_FIELD is defined in both MY_REG and MY_REG with no user resolution provided. This field name will be unavailable.

It makes sense that these field names collide in the DUT address map, but I’m not sure how to work around this. What is a “user resolution”?

Thanks!

Hi,

I did not see this message before, however in my case multi-instance register works, maybe following information could help.

  1. declare all fileds in the first one.
  2. declare next one with different name, address offset and same verdorExtensions_type.

To clarify, this is not a multi-instance register, but a multi-instance register file. Something like this, e.g.:

class my_address_map extends ovm_rgm_address_map;
  rand my_register_file my_register_file_0;
  rand my_register_file my_register_file_1;

  `ovm_object_utils(my_address_map)

  function new(input string name="unnamed-my_address_map");
    super.new(name);
    set_size(my_size);
    // Add first instance to register map
    my_register_file_0 = my_register_file::type_id::create("my_register_file_0");
    my_register_file_0.set_hdl_path("my_register_file_0");
    add_register_file(my_base_0, my_register_file_0, "my_register_file_0");
    // Add second instance to register map
    my_register_file_1 = my_register_file::type_id::create("my_register_file_1");
    my_register_file_1.set_hdl_path("my_register_file_1");
    add_register_file(my_base_1, my_register_file_1, "my_register_file_1");
   endfunction
endclass : nandctrl_am

Hi,

Still suggest also to multi-instance the register file or memory map in ip-xact file. I would say its what ovm_rgm’s purpose, then we could reuse these spirit file from block all the way to system.

Hi,

Field level sequences were meant to be used only when fields are unique in register map. If field names are colliding, there is no way to detect the right behavior automatically. In your case, things might work in block level,but when you have similar (multiple) register file at system-level, you will see this issue. There is no way to avoid it. You will have to write sequences in different way to effectively do similar thing(field-level sequences).

-Vishal

Thanks Vishal. Do you know what a “user resolution” is, as hinted at in the error message?

I understand the limitation, but it would be nice if there was some kind of support in the OVM_RGM for this use model, as I can see it being a common occurrence. Maybe adding a suffix to the field name as a kind of index or methods that allow an index parameter.

Hi,

There is one possibility. If at system level, sequence’s container is set to same container (as you were doing in module-level [dont set container as top address map where confusion lies]) you should get away with this issue. Only limitation is, registers outside that container cant be referred. If you are re-using block level sequences, it might just work.

Please let me know if you need more clarification. 

 -Vishal