Implementation and Functional Verification of RISC-V Core For Secure IoT Applications
Implementation and Functional Verification of RISC-V Core For Secure IoT Applications
Email: [email protected]
978-1-6654-0839-4/21/$31.00 ©2021
Authorized licensed use limited to: ANNA IEEE
UNIVERSITY. Downloaded254
on August 24,2022 at 08:29:04 UTC from IEEE Xplore. Restrictions apply.
2021 International Conference on Microelectronics (ICM)
The problem with these designs is testing all possible combinations of TABLE II. TEST FEATURES
their signals, which takes too long to simulate. UVM addresses this Unit Test. Description
issue by constraining the stimulus to certain values and randomizing
(UT_1) Testing of each type’s basic operation separately.
them. Accordingly, some advantages of the UVM are:
(UT_2) Testing of the M-extension basic operation with a
• Reduction of coding effort and enabling a high level of code reuse combination of different inputs and testing the data
• Support of constrained random verification methodology hazard (forwarding unit stage 3).
• Extensive stimulus generation (UT_3) Testing of the division by zero.
• Decrease of verification cycle (UT_4) Testing of the data hazard (forwarding unit stage 4).
A. UVM components and objects (UT_5) Testing of the data hazard (stalls generation) for two
dependent instructions as in Load -> Add.
• Driver: drives transactions from the sequencer to the DUT.
(UT_6) Testing of the data hazard with M-extension.
• Monitor: captures signals from the DUT and converts them from (UT_7) Testing of two consecutive stalls (Load -> Add ->
pin level to transaction level. Input monitor ensures that the
Load -> Add).
transaction has been sent correctly to the DUT.
(UT_8) Testing of the Conditional jump and Unconditional
• Sequencer: controls the flow of transactions. jump, check the flush, and the PC value updates.
• Sequence: generates a transaction and randomizes it. (UT_9) Testing of a combination of hazards like control
• C++ reference model: mimics the functionality of the DUT. hazards (B-type/ J-type) with data hazards (stall)
• Scoreboard: checks that everything has worked by comparing the and checking FLUSH and the PC value updates.
output signals from the DUT and the reference model. (UT_10) Testing Branch instructions with M-extension
B. Reactive Agent instructions.
Stalls should prevent the core from fetching a new instruction. So, (UT_11) Fault injection with wrong opcodes (corner case).
the randomization of the sequence items in the sequence needs to be
stalled and no new instructions should be driven to the DUT. A similar The reactive agent-based verification approach is used to verify a
case is when the MULDIV instructions enter the core, the core is frozen design that works as follows: Device-1 and Device-2 are
for multiple clock cycles. This randomization process of the sequence communicating with each other, where Device-2 is generating a request
items sent to the DUT is controlled by a signal monitored from the DUT (which is the stall signal) whereas Device-1 is responding to the request
itself. A Reactive Agent should be used in this case instead of an Active (By sending a new random sequence item if no stalls occurred or by
Agent to control when exactly an instruction should be sent to the DUT freezing the randomization process if stalls occurred). Device-2 is the
[8]. DUT and Device-1 is the Reactive Agent. There are several approaches
to implement a reactive agent. In this work, the Monitor-sequencer
approach is used. The monitor serves as the sampler in this method. The
monitor delivers the request to the sequencer after sampling it. After
sampling the stall from the DUT, the sequence could stop the
randomization process according to the value of the sampled stall
signal.
VI. THE BEAUTY OF VERIFICATION
At first, a test plan was implemented for direct testing to hit specific
interesting cases, which is illustrated in Table I and Table II, and then
the UVM environment is implemented as shown in fig.3.