You are on page 1of 17

Beyond UVM Registers

Better, Faster, Smarter


Rich Edelman, Bhushan Safi
Mentor Graphics, US, India

© Accellera Systems Initiative 1


What are UVM Registers good for?
• Standard
– Runs on all the simulators
• High level abstraction
– Test can be “almost C code” or device driver-like
– Test doesn’t have to change
• If register address changes
• If register bit arrangements change
• If registers move into different “blocks”

© Accellera Systems Initiative 2


Does the UVM Register have issues?
Lines of Register Register
Code Size Files
• Complexity
Code Files LOC
UVM 1.2 26/158 22k/78k 16% 28%
– It’s a lot of the UVM UVM 1.1d 26/138 22k/69k 19% 32%

• Doc size (about 26% of the user guide)


• Code size (about 30% of the code base)
– VPI
– Generator – XML/CSV input
• RAM Size – modeling a 32 bit register with classes is
expensive
• Modeling Quirky Registers
• Transparency – what you see is what you get
• Monitoring DUT value changes can be hard

© Accellera Systems Initiative 3


Possible solutions
• Make classes more efficient - hard
• Make code base less complex and more transparent
- hard
• Don’t use UVM Registers – non-starter
• Think about registers again – takes time

© Accellera Systems Initiative 4


Why do UVM Register Verification?
• Registers are an abstraction
– Register tests
– Register constraints
– DUT operation modes controlled by registers
– Register tests are “portable”
– “Automatic” register function scoreboarding
– Built-in register tests
• Others ….

© Accellera Systems Initiative 5


Register Model
• typedef struct packed {
– logic [2:0] a;
– logic [3:0] b;
• } REGA_t;

• interface REGA;
– register_types::REGA_t value;
• endinterface

© Accellera Systems Initiative 6


Register Tests
class read_registers extends uvm_sequence#(bus_transaction);
virtual REGA rega;
task body();
bus_transaction t;
rega.value.a = 12;
rega.value.b = 17;
t = new(“item”);
t.data = rega.value;
t.addr = rega.get_address();
t.rw = 1;
start_item(t);
finish_item(t);
endtask
endclass

© Accellera Systems Initiative 7


Register Monitor
• Each register in the DUT has a “shadow” or model in
the testbench.
• The model is bound to the actual register values in
the DUT using SystemVerilog ‘bind’.
• All updates to the DUT register are immediately
reflected in the model.
• Backdoor loads are accomplished using this bound
model and do not require VPI.

© Accellera Systems Initiative 8


Register Scoreboard – Is my register
working?
• Scoreboard – is the functionality correct?
– Actual DUT register value always immediately available
– Model desired behavior using SystemVerilog
– Compare desired behavior against observed
• write()
• read()
• Causes a new value to be predicted.
• Implement any access routine
– peek()/poke()/set()/get()
• Use raw struct field access

© Accellera Systems Initiative 9


Modeling Quirky Registers
• Quirky registers have special behavior.
– Clear on Read, Write Once
– ID Registers, FIFO Registers, Coherent Registers, Broadcast
Registers.
• Implement using SystemVerilog. Just write the code.
– It is NOT hard code to write.
– Creating a generic framework for a library that supports all
kinds of Quirky Registers IS hard.
• Callbacks, pre_ and post_ routines, complex Boolean equations.

© Accellera Systems Initiative 10


Register Functional Coverage
• Write the covergroup
• Sample the register
• Sample the register fields
• Sample other registers and other register fields

© Accellera Systems Initiative 11


Conclusions
• UVM Register tests and models are useful and
powerful
– They should be used as widely as possible
– They should be simplified and optimized for speed and
space
• The model
• The test
• The underlying modeling infrastructure
• The proposed ideas are a good start to thinking
differently about UVM Register tests and models.
– But are not yet complete.

© Accellera Systems Initiative 12


Questions?

rich_edelman@mentor.com
bhushan_safi@mentor.com

© Accellera Systems Initiative 13


© Accellera Systems Initiative 14
Guidelines (1)
• Please keep the default font size for main lines at
28pt (or 26pt)
– And use 24pt (or 22pt) font size for the sub bullets
• Use the default bullet style and color scheme
supplied by this template
• Limited the number of bullets per page.
• Use keywords, not full sentences
• Please do not overlay Accellera or DVCon logo’s
• Check the page numbering

© Accellera Systems Initiative 15


Guidelines (2)
• Your company name and/or logo are only allowed to
appear on the title page.
• Minimize the use of product trademarks
• Page setup should follow on-screen-show (4:3)
• Do not use recurring text in headers and/or footers
• Do not use any sound effects
• Disable dynamic slide transitions
• Limit use of animations (not available in PDF export)

© Accellera Systems Initiative 16


Guidelines (3)
• Use clip-art only if it helps to state the point more
effectively (no generic clip-art)
• Use contrasting brightness levels, e.g., light-on-dark
or dark-on-light. Keep the background color white
• Avoid red text or red lines
• Use the MS equation editor or MathType to embed
formulas
• Embed pictures in vector format (e.g. Enhanced or
Window Metafile format)

© Accellera Systems Initiative 17

You might also like