c-through-uvm-effectively-using-c-based-models-with-uvm-based-verification-ip
c-through-uvm-effectively-using-c-based-models-with-uvm-based-verification-ip
based Verification IP
Chris Spear, Kevork Dikramanjian,
Abhisek Verma Senay Haile
Synopsys Qualcomm
[email protected] [email protected]
[email protected],
[email protected]
Develop the SystemVerilog Direct Programming Interface
(DPI-C) code to transfer data from C to SystemVerilog side of
1. INTRODUCTION testbench
Based on widely used and emerging protocols, standards-compliant
Transfer data between the C and SystemVerilog parts of the
third-party Verification IP (VIP) is rapidly being adopted to
testbench with DPI-C
accelerate the development of a complete verification environment.
Establish the connectivity between the C testbench, the UVM
Since the High definition Multimedia Interface (HDMI) supports a
based VIP (source) and the DUT (sink)
wide variety of audio and video formats, one of the major challenges
in verifying it is to create all kinds of stimulus responsible to Configure the HDMI VIP to run tests
generate various types of frames. At Qualcomm we chose Synopsys
HDMI VIP as it was compliant with the HDMI-1.4b specification, The C testbench acts as a stimulus generator and creates the frame as
adheres to the latest verification methodologies such as Universal per the HDMI protocol. The frame data is passed to the UVM based
Verification Methodology (UVM) and was developed using VIP, which drives them on signal interface as per the protocol.
SystemVerilog. The flow below outlines how we established handshaking to
The challenge for this project was to integrate the legacy C synchronize the flow between the C test and the SV testbench:
models/testbench mainly used for HDMI stimulus generation with The UVM VIP enters build phase, deliberately skips the
the HDMI VIP UVM code effectively. The HDMI VIP would then randomization of the configuration class and then enters the
hook onto the design under test (DUT). With careful planning and connect and run phases where it polls the test_done flag, set by
execution we were successfully connected these three pieces. This the C model.
ensured complete reuse of the C-based models and efficient usage of The C model initializes and then calls test library functions to
the HDMI VIP. The DUT is a video capture and processing set high-level knobs. DPI-C functions are used to set fields
subsystem used as a front-end to various video interfaces, including which eventually go into SystemVerilog constraint blocks
HDMI. within the configuration class. Constraints include video, audio
The HDMI VIP uses UVM-compliant classes to represent protocol and packet mode and traffic profile.
activity and the characteristics of that activity. For example, a The C model calls a SystemVerilog function which builds and
transaction object has members that define the audio and video randomizes the configuration class with the applied constraints
information being transmitted. A set of base classes provide common The C model reads back low-level constraints which were
functionality and structure to form the foundation for the entire solved by HDMI VIP and then configures the DUT with same
HDMI VIP. constraints.
In a testbench, an HDMI VIP agent can be a source in active mode or C model starts HDMI traffic sequence in the VIP. In the
as a sink with EDID enabled optionally. Stimulus is created as a SystemVerilog testbench or the UVM VIP, the sequence
UVM sequence with constrained random values for frame line values generates N transactions and sends it to driver and then to the
of R, G and B components during video active period. These values DUT
can be randomized either independently or could depend on certain
HDMI VIP configuration parameters. A test would run many Categories and Subject Descriptors
standard HDMI frames from source to sink of a certain format type. HDMI, UVM, Re-use philosophy
The HDMI VIP has a default functional coverage model
implemented as user extensions or callbacks to the HDMI monitor. It
has a rich set of covergroups on HDMI configuration and HDMI
General Terms
Verification, Design
frame line class for comprehensive functional coverage. Enhanced
debug and validation is provided by allowing the user to read in
audio video data, by-passing the built-in generation infrastructure. It
incorporates place-holders for hooking the DUT on one side and C Keywords
based model on the other thus enabling reuse of C based models for HDMI, VIP, UVM, CEA-861-D, VESA, DMT, HDCP.
stimulus generation. To increase throughput per test, the UVM
phasing mechanism is leveraged to revert to the post-configure 2. HDMI PROTOCOL OVERVIEW
phases to line up multiple tests in one simulation. The HDMI is the de-facto standard for digital connection for
consumer electronics and PC products. It delivers highest quality
This paper demonstrates how a UVM compliant VIP enabled us to audio/video signal over a single cable. HDMI system architecture is
create a highly configurable testbench. defined as consisting of Sources, Sinks, Repeaters, and Cable
The project was divided into the following milestones: Assemblies. A given device may have one or more HDMI inputs,
Define the communication between the C testbench and the and one or more HDMI outputs. The HDMI cables and connectors
UVM based VIP carry four differential pairs that make up the TMDS data and clock
channels as shown in Figure-3. These channels are used to carry
video, audio and auxiliary data. Note that this paper doesn’t talk Transaction level Interfaces: UVM analysis ports broadcast the
about the Consumer Electronics Control (CEC) protocol associated required parameters to the coverage and scoreboard models.
with a typical HDMI device.
A HDMI source is responsible to send frames onto the Transition- Extension points: The VIP provides a rich set of UVM based
minimized differential signaling (TMDS) interface, while a HDMI callbacks across the different layers so we can add in project or test
sink receive them. The sink never responds back to the data from specific extensions.
source. As shown in Figure 3, an HDMI link includes three TMDS
data channels and a single TMDS clock channel. Each frame consists Data Exceptions: The extension points can also be used for changing
of a set of lines as per the HDMI specification. Each line is further the default stimulus and generate appropriate conditions for negative
segmented into video data audio data and control periods. The tests. A number of exception data classes are defined within the VIP
complete feature list can be referred from [2]. library for this purpose.
Factory Infrastructure: The VIP provides the user with the benefit of
overriding the default behavior of VIP components by providing user
specified extensions. This allows the user to meet the unpredictable
needs of different tests.
Since the HDMI protocol supports a wide variety of audio and video
formats, one of the major challenges is verifying all the different
frames across all the different configurations.
Here are some of the features of the UVM VIP which are in our VIP
adoption guidelines.
4.2 Configuration
5. Feature Verification
Hooking up of the Protocol Analyzer helped a lot in debugging
purposes as shown in Figure [8]. It provided a GUI based view of the
transaction and its synchronization with the waveforms helped a lot
in debugging at the transaction level.
from the C-Side and set either to VESA or CEA as shown in
Figure[11] below.