Rolling The Dice With Random Instructions Is The Safe Bet On Risc V Verification
Rolling The Dice With Random Instructions Is The Safe Bet On Risc V Verification
Abstract- The traditional SoC verification approach has until now been based on the fundamental assumption of
known good processor IP from the mainstream semiconductor IP providers. With Open ISAs such as RISC-V, developers
can exploit a greater degree of implementation flexibility but must also assume a greater role in the verification task.
To complement established techniques, this paper illustrates the approach of using an open source random instruction
generator for RISC-V with a cloud-based environment for capacity flexibility to compare implementation RTL against a
reference simulation model.
This latest framework covers the needs of specialist core designers and all SoC adopters.
I. INTRODUCTION
The verification of an open Instruction Set Architecture (ISA) is a new industry challenge brought about by the
growing adoption of the RISC-V ISA [1]. In contrast to other ISAs with a single source for processor IP, the RISC-V
community has more than ten (fast approaching one hundred) processor IP providers, with both open source and
proprietary implementations and both commercial and free business models, plus there are SoC design teams that are
developing their own RISC-V processor implementations. As an open ISA, RISC-V allows developers freedom of
implementation choices, optional features, extension and the opportunity to add optimized extensions or custom
instructions.
A processor verification approach needs to cover the range of requirements from basic ISA compliance tests
through to functional coverage and microarchitectural details, and the orthogonal range from the ISA specification to
the addition of custom instructions and other features. While a single method may be unrealistic, many of the
traditional SoC verification methods and tools can be employed and used successfully. Verification methodology for
an open ISA, specifically RISC-V, is the focus of this paper.
Starting with an instruction stream generator, initially developed by Google, and now available on GitHub, the
starting point for this verification process is a random instruction sequence. This can be compiled and used to drive
the cloud-based environment from Metrics to simulate the RTL. In addition, the same instruction sequence can be
used on the reference Imperas RISC-V simulator, riscvOVPsim. The design flow includes a comparison of the two
log files to identify areas of discrepancy that should be investigated further.
While the concept of an open ISA is not new, this is the first time it has been considered and adopted by broad
market segments, as both large established suppliers and new startups are embracing the freedoms and flexibility
offered by an open ISA. While specialist design teams that are building a custom RISC-V core will be attracted to the
verification methodology discussed in this paper, the intention is to make the usability suitable for a wide range of
SoC developers. Given the range of ISA options, both technical aspects and business models, every SoC development
project will need to consider as mandatory verification of any core considered to be integrated into a complex SoC
design.
A. Compliance
The RISC-V Compliance Suite is developed within the RISC-V Foundation Working Group on Compliance
(“Compliance WG”), and the latest test suites are available from the RISC-V compliance GitHub repository [2].
While the Compliance Suite contains tests for all the specification options and configurations, it is possible to test
a target implementation with just the subset of tests that are targeted at that particular configuration. However, there
is discussion within the Compliance WG that all cases of all tests should be performed, as it is more reliable to conclude
a test failure was due to an intended unsupported feature than have the risk of omitting a required test. In addition, this
may be a useful way to inspect an initial processor IP delivery and confirm the features are present as expected.
While compliance does not exhaustively test all functional operations, it does confirm the correct operands and
registers over a sample set of functional exercises.
B. Verification
The verification flow discussed in this paper has as its goal finding the hard corner cases related to the processor
implementation that may not be easily uncovered with traditional verification methods. This is not intended to be a
replacement for well-established verification methods such as the Universal Verification Methodology (UVM) [3],
but should be seen as a useful and complementary extension.
Fig. 1 shows the basic verification flow. Starting with an instruction stream generator, initially developed by
Google, and now available as open source, the starting point for this verification process is a random instruction
sequence. This can be compiled and used to drive the cloud-based environment from Metrics to simulate the RTL. In
addition, the same instruction sequence can be used on the reference Imperas RISC-V simulator, riscvOVPsim, which
is available via the RISC-V compliance GitHub repository. The design flow includes a comparison of the two log files
to identify areas of discrepancy that should be investigated further by the RTL development team.
Detailed failure reporting shows the mismatching instructions, as in Fig. 4. Full traces and additional information
are kept for review. Also, a VCD file can be dumped for full waveform analysis. Functional coverage can be analyzed
using the Metrics Cloud Platform, as shown in Fig. 5.
Fig. 2a. Shell in cloud for running verification flow.
IV. RESULTS
A. Results
The first core implementation that was tested using the flow outlined in this paper is the popular Ibex core that
was originally developed by ETH Zurich under the name “Zero-riscy” [6], and more recently adopted by LowRISC
as Ibex [7]. Ibex implements the RISC-V RV32IMC instructions, which is the 32-bit RISC-V with integer (I),
multiplier/divider (M) and compressed (C) instructions. Fig. 6 shows a block diagram of the Ibex.
Fig. 7 shows the categories of bugs found using the verification flow discussed in this paper, while Fig. 8 shows
examples of the specific bugs.
B. Future Work
The flow outlined in this paper can be extended to cover the future extensions and additions of the RISC-V ISA.
In 2020, the RISC-V Foundation is expected to complete the ratification process of both the Bit Manipulation and
Vector extensions. Work to support these extensions in the flow outlined in this paper is already underway.
Fig. 6. Block diagram of the Ibex core.
Fig. 7. Categories of bugs found in the Ibex core using the verification flow described in this paper.
ACKNOWLEDGMENTS
The authors would like to thank all the voluntary members of the RISC-V Foundation Compliance Working Group
for their efforts.
The authors would like to thank all the voluntary members of the Chips Alliance Verification Working Group for
their efforts.
The authors would like to thank all the voluntary members of the OpenHW Group Verification Working Group
for their efforts.
The authors wish to acknowledge the help and support from the Ibex development team at LowRISC.
REFERENCES
[1] https://riscv.org/specifications/
[2] https://github.com/riscv/riscv-compliance
[3] https://accellera.org/downloads/standards/uvm
[4] https://github.com/google/riscv-dv
[5] Open Virtual Platforms (OVP) API specifications are publicly available at http://www.ovpworld.org
[6] Schiavone, Pasquale Davide et al. “Slow and steady wins the race? A comparison of ultra-low-power RISC-V cores for Internet-of-Things
applications.” 27th International Symposium on Power and Timing Modeling, Optimization and Simulation (PATMOS 2017)
[7] https://github.com/lowRISC/ibex