Automated Generation of RAL-based UVM Sequences
Automated Generation of RAL-based UVM Sequences
Sequences
Vijayakrishnan Rousseau
Validation Lead, Intel Corporation
1900 Prairie City Road, Folsom, CA 95630
vijaykrishnan.rousseau@intel.com
Satyajit Sinari
Validation Engineer, Intel Corporation
1900 Prairie City Road, Folsom, CA 95630
satyajit.j.sinari@intel.com
Benjamin Applequist
Validation Engineer, Intel Corporation
1900 Prairie City Road, Folsom, CA 95630
benjamin.t.applequist@intel.com
Timothy McLean
Validation Engineer, Intel Corporation
1900 Prairie City Road, Folsom, CA 95630
timothy.a.mclean@intel.com
Geddy Lallathin
Validation Engineer, Intel Corporation
1900 Prairie City Road, Folsom, CA 95630
geddy.lallathin@intel.com
Abstract-This paper addresses the need for automated generation of UVM sequences for validating extensive and
complex designs. We derive a method of parsing an architect level master spec and auto-generating UVM sequences along
with the Register Automation Layer (RAL). We discuss a method to improve on simulation time by compartmentalizing
the testbench randomizations using some links between the RAL and DUT-based config objects within the config
database facilitating complex constraint definitions.
I. INTRODUCTION
In the hardware industry, the Universal Verification Methodology (UVM) is used widely for verifying designs.
Hardware behavior is typically controlled by a set of registers, and the Register Abstraction Layer (RAL) in UVM is
used for modelling the registers within a Design Under Test (DUT) on the testbench side. [1] UVM sequences are
used to provide stimulus which consists of register reads, writes and polls. The architecture specification is used to
dictate a specific order of programming the registers, in order to enable different features within a DUT. The need for
automation arises when there are multiple registers being programmed for a feature within a DUT and the hardware
supports multiple such features. Manually defining these many UVM sequences turns out to be cumbersome and
difficult to maintain, as any minor changes in a feature specification, a register definition or a programming restriction
needs to be reflected manually in the updated sequences. To solve this, we propose a way to automatically define
UVM sequences straight from the design specification. To achieve this, we define a machine readable hierarchical
‘state machine’ format to define feature programming sequences within the DUT. UVM sequences will be
autogenerated using parser scripts directly from these state machines. This paper also proposes a framework for
complex constraint definitions and partial RAL randomization through configuration objects.
II. OVERVIEW
Registers need to be programmed in a specific order to enable a feature within a DUT. The RAL in UVM is used
for modelling the registers on the testbench side, and UVM sequences are used to provide stimulus comprising of
these register reads and writes to the DUT using a UVM driver through a test. [2] This is a typical usage of the RAL
and the sequences in a UVM environment. We build on this behavior to accommodate autogenerating the UVM
sequences as well as the RAL with the appropriate links to the configuration database as explained below. This allows
us to handle validating extensive designs and constraint complexities without extensive overhead.
III. IMPLEMENTATION
As an example, we define the generic registers, SYS_CTL and FEATURE_CTL to demonstrate the strategy. The
first essential areas are the master specs. It is crucial that they are well defined and machine-readable.
Register FEATURE_CTL
Bitfields:
0:3 mode
Valid Values:
disabled 0x0
minimum 0x1
average 0xA
fancy 0xF
end
4:31 unused
end
The basic example above can be parsed by a script and reformatted into register classes to be used in the RAL. This is a made-
up one-off approach, but it would be wise to consider using more standardized formats such as JSON or XML as they are well
supported and offer various libraries for easier development.
Now, we define the sequence spec. This has similar requirements to the register spec: consistency and unambiguity
to allow the parsing scripts to do their job.
Hiding in the spec above, there’s an actual UVM sequence that can be generated:
task body();
super.body();
ral_class.feature_ctl.update(status);
if(status != UVM_IS_OK)
//Report error
ral_class.sys_ctl.update(status);
if(status != UVM_IS_OK)
//Report error
endtask
endclass
Note that we only need the call to ‘update’. The register values are set in the test either explicitly through constraints
or during the randomization of the configuration object before the sequence starts.
//Example test:
class feature_test extends uvm_test;
task run()
uvm_test_done.raise_objection();
uvm_test_done.drop_objection();
endtask
endclass
The remaining bit is the configuration object itself. The important thing here is to link the relevant registers to the
RAL. Multi-bitfield programming restrictions should also be added here in the form of constraints. If the DUT has
any subunits, its configuration object will also contain lower level configuration objects for them.
If this RAL was configured to output a log, the output of this test may look something like this:
Note that the values in the “Time” and “Value” columns can change per execution of this test depending on the
randomization, but the “Register” and “Action” columns will be consistent.
V. CONCLUSION
These state machines will give architects the ability to directly define and maintain the spec, and generation of the
UVM sequences keeps the test-benches at all levels of verification in sync with the spec without any manual
intervention. This will remove the extra effort needed from the test-writers to manually check the spec periodically
to generate valid stimuli to their DUT. Such a sequence generation script can even be integrated into testbench
compilation process to guarantee up-to-date sequences any time a verification environment is built. This not only
eliminates the man-hours required for spec to code translation, but also allows a direct architect to RTL control point,
thus reducing the chance for human error. There is a significant onetime startup cost with the development of the spec
languages and their corresponding parser scripts, though it will eventually be overshadowed by the time saved from
automating the recurring task of manual sequence generation. Though this strategy falls short in supplying actual
register values, the proposal addresses this by referencing the RAL directly which provides an intuitive way of defining
complex constraints and adds DUT level randomization to the RAL.
REFERENCES
[1] IEEE Standard for Universal Verification Methodology Language Reference Manual," in IEEE Std 1800.2-2017, 26 May 2017
[2] IEEE Standard for SystemVerilog--Unified Hardware Design, Specification, and Verification Language," in IEEE Std 1800-2017 (Revision
of IEEE Std 1800-2012), 22 Feb. 2018