How to check if a specified address is in an address map

hi forks:

Recently I am doing a reserved address test using uvm. As register and memory are modeled using ral model and the address are managed by uvm_reg_map, what I want to know if a certain address is include in the address map. Is there a way to do that ?

Expected uvm code may be like this:

regmodel.default_map.exists(my_address)

.

In reply to hungtaowu:

You may want to look into get_reg_by_offset and get_mem_by_offset and use them in your code if they return null then there is no register or memory in the specified offset/addr

Get register mapped at offset

Identify the register located at the specified offset within this address map for the specified type of access. Returns null if no such register is found.

Get memory mapped at offset

Identify the memory located at the specified offset within this address map. The offset may refer to any memory location in that memory. Returns null if no such memory is found.

HTH,
-R