Jump to content
Sign in to follow this  

(Possible) Bug in uvm_mem

Recommended Posts

I'm trying to declare a memory like this:

class some_mem extends uvm_mem;
  function new(string name = "some_mem");
    super.new(name, 2 ** 24, 8, "RO");

Later on, I'm trying to add this memory to an address map that was created like this:

default_map = create_map("some_map", 0, 4, UVM_NO_ENDIAN);

By using the default value for the byte_addressing argument I want each address to represent a one byte location. The problem I'm seeing is that the uvm_reg_map_info associated with this memory shows an end address of 32'03ff_ffff and a stride of 4, instead of 32'00ff_ffff and a stride of 1. I've narrowed it down to the function uvm_reg_map::get_physical_address(...), at line 1378 of uvm_reg_map.svh:

int multiplier = m_byte_addressing ? bus_width : 1;

I guess this should be the other way around:

int multiplier = m_byte_addressing ? 1: bus_width;

Even better would be to use:

int multiplier = get_addr_unit_bytes();

Share this post

Link to post
Share on other sites

We had the same problem. Our map was 512b wide. The memory was 16K x 8B. The address that got generated was multiple of 64B.

Our fix is to create a map just for the memory with 8B width. Then added this to the original map as a submap.


Share this post

Link to post
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.

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.

Sign in to follow this  

  • Create New...