Jump to content

UVM Register Model Burst Access


Recommended Posts

The UVM testbench I am working on uses an I2C interface to program registers in the DUT. I currently have the register model working for basic reads and writes. However, one of the features in the design allows for burst access to registers. For example, I could send the CTL register address on the I2C bus and then send several bytes of data. The first byte would go to the CTL register, and the design would auto-increment the address so the next byte would go to the next register.

Is there a way to implement this burst access with the register model?

Link to comment
Share on other sites

  • 3 weeks later...

Hi,

The UVM RAL system doesn't provide direct burst access. A way to inject burst access is to save the address of the current transaction inside the low level driver and compare this address with the address of the next transaction. For I2C specifically, you'd need to put the item_done(), get_next_item() part right between the ACK/NACK and the potential STOP condition.

I hope this helps

Peter

Link to comment
Share on other sites

  • 1 year later...

Hi there,

 

There is an undocumented obscure argument to the uvm_reg::read and write functions called extension which is of type uvm_object.  It defaults to NULL.  While not documented in the class reference manual, the comment in the code stipulates it can be used to for user defined extensions to the read/write calls.

 

I have successfully implemented a burst read using this argument (for a spi protocol agent).  The call is the same (register.read) but i pass the extra extension argument.  I created a class called burst_extension which contains the burst size and a queue of data to be filled from the spi bus (could be used for writes as well) and a burst size.  Assuming you are using a uvm_reg_adapter, the adapter can retrieve the current uvm_reg_item by calling this.get_item() inside the reg2bus routine (can't do it inside bus2reg).  Magically, the reg_item object contains a handle to the extension object :)   From there I can access the extension which contains the burst size and the data.  I can then translate it appropriately into a burst operation on the bus.

 

From the user's point of view, it is nice because burst calls are simply the read/write calls with an extra argument.  The adapter can get a little messy, but it is one-time pain and abstracted from other users.

 

I'd be happy to provide more details.

-Jakub

Link to comment
Share on other sites

  • 1 year later...
  • 4 months later...

Hi,

I am using uvm standard register model , register adapter (bus2reg & reg2bus) to send and receive transaction to ral model and DUT.
and it is working fine if i do single read and write.(means i perform the 32 bit read n write using reg.read(status,address,data)reg.write(status,address,data))

My challange is that i have to perform the more than 32 bit transaction which performs the read and write on multiple registers,
If there any way to use the same reg.read/write method to perform more than one register

 

 

 

it seems your bus2reg implementation would be helpful , if you can share it

Link to comment
Share on other sites

  • 4 months later...

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