Jump to content

Examples of when to use Access APIs for UVM_REG

Recommended Posts


get() and set() are used to modify the register model directly instead of doing something like reg_model.block.reg.field=1. (which I don't think you can do anyway because they should be protected).

This might be used when your testbench can predict the value of a register field based on what is happening in the testbench. For example. An interrupt status register may be a read-only register. And if you want to read that register and do a real check of the value, you would have to identify that an interrupt occurred in your testbench – and then update that desired value directly. This is how you would do it. I guess it is used to update a register in the register model when it is modified by the DUT (instead of by generating stimulus).

I hope this helps!


Link to comment
Share on other sites

What Kathleen describes is the predict() method.

The set()/get() is used when you want to do batch updates. Instead of causing a write/read operation every time to need to set or read a register, you can set its desired value or get its mirrored value in zero-time, then batch-update the model only for those values that have changed.

So you have the choice of two use models: read-write-read-write or mirror-get-set-get-set-update

Link to comment
Share on other sites

Hi Janick,

How would I know I want to use batch updates? I am assuming based on comments --- that this is related to DUT changing registers. This would be part of the monitor activity of a variety of DUT changing registers (Counters, Interrupts, One register action reflecting another .... ). The documentation is a little skimpy on this in the UG (It only shows a hard-coded path). I always have to use a hard RTL path and I want to leverage the Register Model -- it does know the backdoor path. But I cannot pass it in to wait_for_change because it's a string , not an uvm_object. What I really want to know is the Accellera use model of dealing with DUT changing registers.

Reading back on your answer. I am asking a separate question here -- unrelated to the use model of get/set -- Sorry.

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