Professional Documents
Culture Documents
Ieee 7 2020
Ieee 7 2020
Abstract—Verification of Integrated Circuits using Verilog lacks been designed in this paper for UART interface. It is compliant to
the flexibility and reusability of the environment. System Verilog UART specification [6] and can be easily used to verify any
provides building blocks and OOP concepts to work with. That device that has UART interface. Let’s describe the advantages of
allows to create much more flexible test environment with reusable SystemVerilog that the VIP is using.
components. This paper presents a verification architecture of
One of such advantages is the functional coverage model [7].
configurable Verification IP for UART interface. The Verification IP
presented in this paper provides complete functionality of an System Verilog allows to do what’s called functional coverage-
operating UART interface and can be used to test any UART device. driven verification. In order to do that you need to “translate” the
A functional coverage model has been developed to determine if the technical documentation into set of cover points and create the
verification process covers all possible scenarios or not. Each testcase coverage model. The coverage model will determine which
reports coverage which is later used to analyze the effectiveness of features have been tested by the environment and which have not.
the testcase. Full coverage has been achieved using both random and That will help to understand the verification holes and cover them
directed test cases. The coding is done using System Verilog and the to assure in completely verified product.
simulation is done using VCS. Other than the Coverage model SystemVerilog has the
object-oriented programming (OOP) concepts integrated into the
Keywords—UART, Verification, Functional Coverage, System
Verilog language too. That allows to separate the verification environment
into smaller parts. Those smaller parts or how you separate those
I. INTRODUCTION are the base of verification methodologies like VMM and UVM.
System on Chip design nowadays uses many reusable IP In general, the components are generators, for generate certain
cores and requires a lot of effort for the functional verification of packets, drivers to send those packets, receiver to receive,
the system [1]. Since the systems are becoming bigger and bigger monitors to monitor the interfaces and scoreboard to check the
the requirements for speed on the verification environment is correctness of the operation. There are other components, but
increasing. Not only speed but also the effectiveness of the these are the widely used ones.
environment should increase in order to cover most functionality This paper concentrates on developing of configurable VIP
in least time possible. Verilog is one of the ways to describe the for UART interfaces. In upcoming chapters, the UART interface
hardware, but Verilog is designed for hardware modeling and overview is given to have general idea of the interface. The VIP
lacks the features that are required for verification of complex and test environment architectures are described, and everything
SoC designs. To fix those issues SystemVerilog has been is concluded with the functional coverage results of the VIP.
introduced with its specialized methodologies like Universal
II. UART OVERVIEW
Verification Methodology (UVM) and Verification Methodology
Manual (VMM). Those methodologies are currently widely used Universal Asynchronous Receiver-Transmitter is one of the
in verification [2]-[5]. Other than methodologies in the widely used interfaces. It is a single TX and single RX line
verification there are reusable IP blocks which are called interface. It can be configured to send and received data of 5-8
Verification Intellectual Properties (VIP). One of such VIP has bits long with and without parity bit. Parity can be either even
Authorized licensed use limited to: UNIVERSITY OF BIRMINGHAM. Downloaded on May 10,2020 at 08:47:42 UTC from IEEE Xplore. Restrictions apply.
Fig. 1 The operating model of UART
parity or odd parity. Also, the stop bit count can be 1, 1.5 and 2 line is being checked each BCLK and if on any of those the TX
bits. Let’s quickly go over the UART operating model. line doesn’t have logic 0 value it is considered as glitch and no
The UART bit clock is derived from an input clock of the sampling happens. This wraps up the operation of the UART.
UART. Each data slot consists of either 13 or 16 BCLKs. The Next chapter shows how the UART VIP was designed to support
operating model of the UART is presented in Fig 1. all these features.
When the data is being sent first the START bit should be
sent. In the idle state the TX line has logic high value and in order
to transmit the data TX line is being deasserted. On the receiver III. VIP ARCITECTURE
side it is being considered as the beginning of START bit. After As mentioned earlier System Verilog has been used to create
the START bit, DATA bits are being sampled. Depending on the the VIP. Unlike Verilog, System Verilog supports OOP which
configuration the data length can be from 5 to 8 bits long. After helps to create the verification environment much more
the DATA bits, there may or may not be the PARITY bit. And at faster and the components created for the current application may
the end, there are the STOP bits. Just like the START bit deasserts be used in others also, in other words the components are reusable.
the TX line the STOP bits assert the TX line. After that, the packet Since OOP concepts came into verification, the components
sending part has been completed and the process can be restarted. of the environment are split up. Fig. 2 shows the components that
When, the data is being sampled depends if each data lasts 13 the VIP consist of:
or 16 BCLKs. For 13 BCLK the data is being sampled at the 6th Generator: The generator is used to generate UART packets
BCLK and for 16 BCLK on the 8th. according to the DUT configuration. At the beginning of
simulation, before sending packets the VIP is being configured.
During that part generator is configured also and when Data
should be sent, packets with correct data format are being created.
CLK_GEN: This module is used both in driver and receiver.
It is used to generate the BCLK and is responsible for all
operations related to data sampling and glitch checking. It uses
EVENT mechanism to trigger data sampling and state changes.
Driver: Driver is the component that controls the TX line.
When the generator creates a packet, it is being passed to driver
through mailbox and driver starts to send it. Driver doesn’t check
the configuration, it is done on earlier stage inside the generator.
The Driver simply sends the data. It has an instance of CLK_GEN
class which controls the timing.
Receiver: This block is used for RX purposes. It monitors the
RX line and is also responsible for glitch checking on RX line.
This block also has an instance of CLK_GEN class. This module
in combination with its CLK_GEN module is also responsible for
glitch checking.
In order to pass the data objects from one class to another a
Fig. 2 VIPs Block Diagram
special class for data has been created. All mentioned components
Another thing to consider is the possible glitches that may are working with “uart_pkt” type. This is special type which
occur. To make sure that possible glitch on the TX line may not encapsulates all the info needed to describe a full packet. This
cause any non-valid data sampling, debounce mechanism is datatype is also used in Scoreboard to compare received and
implemented. Each time the TX line is being deasserted for the transmitted packets. Additionally, this data type includes special
first time (START bit) that mechanism comes into play. The TX variables which are sampled to determine functional coverage.
2020 IEEE 40th International Conference on Electronics and Nanotechnology (ELNANO) 235
Authorized licensed use limited to: UNIVERSITY OF BIRMINGHAM. Downloaded on May 10,2020 at 08:47:42 UTC from IEEE Xplore. Restrictions apply.
IV. TESTBENCH ARCHITECTURE object are used to sample coverage, those variables are set inside
the generator. When the coverage percentage reached certain
The Testbench architecture is presented in Fig. 3. It shows
level, the simulation is completed. That level is determined by
that the environment consists not only from DUT and the VIP but
user and shows how much of the functionality has been checked.
also has application and scoreboard.
In general, the test environment works in loopback mode.
Application (APP): is the application side of the UART, the
When the environment starts the application configures the DUT.
other side, that needs to use the received data or sends the data to
After that VIP is configured, and generator starts to create packets.
VIP through DUT. Application has control over the DUT, at the
Packets are put into send mailbox and VIP automatically sends
beginning of the test application reconfigures the DUT and resets
those. At the same time application monitors the DUT signals.
to prepare it for normal operation.
When the DUT receives data, the application reads it and moves
it into the TX buffer of the DUT. DUT sends it back to VIP. Using
this mechanism both TX and RX sides are being tested. The idea
mentioned here is shown in Fig. 4.
Whenever the DUT received data it generates the
“uart_rx_fifo_read” signal. After one clock cycle the data is being
reported to the “uart_rx_fifo_data_out”. Data is being taken from
that port, moved to “uart_tx_fifo_write_data” and
“uart_tx_fifo_write” is being pulsed. It completes the loop and the
data is already in the TX fifo of the DUT. Since the TX is enabled
DUT starts to send that data back to VIP. Before sending the
packet is being sent to the Scoreboard to compare with the packet
that VIP will receive. In general, the Scoreboard has 4 packet
queues. It is separated 2 by 2 to compare data that VIP sent and
Fig. 3 Test Environment Diagram
APP received and vice versa.
The Verification process is separated into couple phases, one
Scoreboard: This component is responsible for multiple of them is random testcases to cover most of the functionality.
things. First of all, it is used to compare sent and received data. It After that directed testcases are written to hit scenarios that
has 4 mailboxes which are used to compare data sent in both randomization-based testing hasn’t hit. Same process was used for
directions. When VIP sends data, it puts sent packet into this environment also. In the random testcase the application was
scoreboard and when the DUT received that exact packet it puts reconfiguring the DUT, VIP was reconfigured after that and
it into scoreboard too. Those two packets are than compared to certain number of packets were being sent in the loopback mode.
make sure data was not corrupted. It was being done until a coverage of 90% was reached. When that
was done the results have been analyzed and remaining part has
been covered using directed testcases. These test cases allowed to
achieve 100% coverage on UART functionality.
2020 IEEE 40th International Conference on Electronics and Nanotechnology (ELNANO) 236
Authorized licensed use limited to: UNIVERSITY OF BIRMINGHAM. Downloaded on May 10,2020 at 08:47:42 UTC from IEEE Xplore. Restrictions apply.
To achieve the full coverage both random and directed TABLE I. TEST CASE DISCRIPTIONS
testcases have been developed. Table 1 shows the summary of the Coverage Simulation
Test Name Config Name
testcases. Table contains the test case name, configuration of the TX/RX Time(s)
UART, Coverage percentage in both TX and RX (all the testcases Directed 01 8-EN-ODD-1 51.6 / 51.38 7.18s
were using the loopback mode) and the simulation time. Directed 02 7-EN-ODD-1 51.6 / 51.38 6.88s
Directed 03 6-EN-ODD-1 51.6 / 51.38 6.65s
Directed 04 5-EN-ODD-1 51.6 / 51.38 6.40s
Directed 05 8-EN-EVEN-1 51.6 / 51.38 7.22s
Directed 06 8-DIS-ODD-1 51.6 / 51.38 6.84s
Directed 07 8-EN-ODD-2 51.6 / 51.38 7.48s
Directed 08 8-EN-ODD-1.5 51.6 / 51.38 7.28s
Directed 09 8-EN-ODD-1 41.66 / 43.05 4.23s
Random 01 -Random- 95/83.33 65.8s
2020 IEEE 40th International Conference on Electronics and Nanotechnology (ELNANO) 237
Authorized licensed use limited to: UNIVERSITY OF BIRMINGHAM. Downloaded on May 10,2020 at 08:47:42 UTC from IEEE Xplore. Restrictions apply.