Jump to content

UVM RAL memory access


Recommended Posts


We are using UVM-1.1 and trying to deploy RAL for modelling memory/register space.

We have to implement a write to a slave module (memory write) where the interface width (64) is smaller than the memory width(512). The transactions will have a single address phase and a multiple data phases. We have multiple memory with different widths (64, 128, 256, 512 etc).

For a memory with width 256 should have one address phase and 4 data phase, anything other than 4 data phase is illegal transaction. So the ral mem is modelled as 256 bits wide and the default map is set as 64bit .

When calling model.mem.write(), the "do_bus_write" task inside uvm_reg_map.svh is splitting the memory width (say 256 bit) data to multiple data of 64 bits (set in default map) and address cycles. These appear in the executeSingle task in the adapter as four individual transactions and we are not able to interpret it as a part of a burst (access to a memory width of 256) or 4 individual access to memory/register width of 64.

So, in the RAL adapter file, we would like to see the data as such (not split up to multiple transactions) so that we could implement the driver accordingly. Is there any way (functions to be overridden/callbacks/flags ??) to get this behavior?



Link to comment
Share on other sites

  • 3 weeks later...

Just before adding the memory to your map, re-"create" the map with the width that corresponds to the width of your memory block. If you have many blocks with multiple widths then you would have create the map multiple times with different widths (n_bits).

this.default_map = create_map("", 0, 64, UVM_LITTLE_ENDIAN); // For your memory

this.default_map.add_mem(this.DMA_RAM1, `UVM_REG_ADDR_WIDTH'h2000, "RW", 0);

this.default_map = create_map("", 0, 128, UVM_LITTLE_ENDIAN); // For your memory

this.default_map.add_mem(this.DMA_RAM2, `UVM_REG_ADDR_WIDTH'h2000, "RW", 0);

this.default_map = create_map("", 0, 256, UVM_LITTLE_ENDIAN); // For your memory

this.default_map.add_mem(this.DMA_RAM3, `UVM_REG_ADDR_WIDTH'h2000, "RW", 0);

this.default_map = create_map("", 0, 512, UVM_LITTLE_ENDIAN); // For your memory

this.default_map.add_mem(this.DMA_RAM4, `UVM_REG_ADDR_WIDTH'h2000, "RW", 0);



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.

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...