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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this