Training On Ip & Soc Functional Verification Methodology: Using Uvm
Training On Ip & Soc Functional Verification Methodology: Using Uvm
Training On Ip & Soc Functional Verification Methodology: Using Uvm
LAB2
Test Sequences & Coverage
Introduction:
The design under test (DUT) is a UART 16550 from opencores.org.
The goal of this design is to perform serial transfers on the Tx line and receive Rx
transfers from the Rx line, given registers programmable thru a APB interface.
The testbench includes a APB Verification IP which main driver class is defined and
implemented in the following two files:
- ambersoc\aedvices\vip\APB\src\sv\APB_master_driver.svh (declaration)
- ambersoc\aedvices\vip\APB\src\sv\APB_master_driver.sv (implementation)
The goal of this lab is to implement test sequences to exercise the different
functionalities of the UART.
Add random parameters for each of the char length, parity, etc.
From the existing lab4_test_sequence, cut and paste the init part doing the
register accesses (between the comments “UART Init start” and “Transmit
Data”) to the newly created lab4_uart_init_seq class.
1
GSE5 TP Verification Circuit BARRIGA_GUO
✦ In “lab4_test_sequence”
Instantiate the new init sequence
✦ The result:
Here is the waveform we generated:
2
GSE5 TP Verification Circuit BARRIGA_GUO
In order to see more details, we right click the uvn_test_top and select
uvm_details. Then we add wave in this waveform diagram. We can see the
information of the register as the picture below.
3
GSE5 TP Verification Circuit BARRIGA_GUO
4
GSE5 TP Verification Circuit BARRIGA_GUO
✦ Use uvm_do to call the newly created test sequence
✦ The result:
Here is the waveform we generated:
✦ Create a sequence B
5
GSE5 TP Verification Circuit BARRIGA_GUO
Same with before, we instantiate the test sequence and use uvm_do to call the
instance created. Then we test the sequence B, the waveform is as the picture
below. In order to see more details of the data, In order to see more details, we
right click the uvn_test_top and select uvm_details. Then we add wave of
monitor in this waveform diagram.
We can find in this picture, in tx_byte, the data increase one by one.
6
GSE5 TP Verification Circuit BARRIGA_GUO
✦ Create a sequence C
We use this sequence to select randomly one of the above two random
sequences A or B. As we can see in code, we set up the sequence C with only 8
bit char width.
Then, it will randomly select the sequence A and sequenceB when we simulate
this program. In our code, the probability of choosing A is as great as choosing
B.
Here is our simulate result of sequence C (it selected sequence B ).
7
GSE5 TP Verification Circuit BARRIGA_GUO
✦ Create a test sequence which randomly selects one of the above sequences
( A, B , C , init ) in a loop of 10 to 20 subsequences.
We add a rand case in ab_on_seq_test_sequence to randomly selects one of
the above sequences, and for init_seq, it perform with only 8 bit char width. To
make it repeat 10 to 20 times, we use a variable which called count, we use a
constraint to limite it enter 10 to 20.
Exercice
✦ In one of the previous random sequences, add a “delay” random variables that
take a random value between 1 and 20.
We add a “delay” variable in the sequence C, with a constraint to limit it
between 1 and 20.
8
GSE5 TP Verification Circuit BARRIGA_GUO
In this picture, we can find a variable called PENABLE_i which near the
PCLK_i, the variation of PENABLE_i present the random value of “delay”. So
variable “delay” will effect enable signal which can slow down this process.
uart0:
WB_interface:
9
GSE5 TP Verification Circuit BARRIGA_GUO
REGS:
DBG:
10
GSE5 TP Verification Circuit BARRIGA_GUO
uart0:
WB_interface:
11
GSE5 TP Verification Circuit BARRIGA_GUO
REGS:
DBG:
✦ Explain
Toggle coverage reports describe design activity in terms of changes in signal
values. It verifies that “did this bit of this wire/register change from a value of 0
to 1 and back from 1 to zero 0 during simulation?” . A bit is said to be fully
covered when it toggles back and forth at least once.
If a bit is never changes value, it is usually an indication that a mode is not
being exercised in the design or a data path has a stuck-at issue.
12
GSE5 TP Verification Circuit BARRIGA_GUO
13
GSE5 TP Verification Circuit BARRIGA_GUO
Functional Coverage
14
GSE5 TP Verification Circuit BARRIGA_GUO
Conclusion:
During this lab, we understand well UVM sequence design. We have also
successfully implemented the different sequences and randomised tests in order
to exercise the different functionalities of UART. Then we implemented code
coverage and functional coverage to check if the sequences cover well.
15