lisakb1963 Posted October 26, 2012 Report Share Posted October 26, 2012 Experts, I understand basic Read and Write API (FRONTDOOR/BACKDOOR) I understand why we need update() and mirror() -- for the SV Randomize. Why would we want the get() and set() that just modifies the desired value. Under what circumstances is it desirable to use these? Quote Link to comment Share on other sites More sharing options...
KathleenMeade Posted October 26, 2012 Report Share Posted October 26, 2012 Hello, 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! Kathleen Quote Link to comment Share on other sites More sharing options...
janick Posted October 26, 2012 Report Share Posted October 26, 2012 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 Quote Link to comment Share on other sites More sharing options...
lisakb1963 Posted October 27, 2012 Author Report Share Posted October 27, 2012 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.