Jump to content

Register Package: get_mem_by_offset


Recommended Posts

Hello How to use uvm_reg_by_offset if i have address but not the register name ? can you show me some example

Here's the code I use the get_reg_by_offset

mybus_rdb_pkg::mybus_am model;

uvm_reg_map maps[$];

uvm_reg current_reg;

...

...

model.get_maps(maps);

current_reg = maps[0].get_reg_by_offset(reg_addr, (rw.kind == UVM_READ));

I was not able to use get the get_mem_by_offset to work. My workaround is the following :

uvm_mem uvmmems[$];

model.get_memories(uvmmems);

foreach (uvmmems)

begin

base_addr = uvmmems.get_address;

if ((rw.addr >= base_addr) &&

(rw.addr <= base_addr + uvmmems.get_size() - 1)) 1))

current_mem = uvmmems;

end

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...