Layering Protocol Verif
Layering Protocol Verif
Layering Protocol Verif
Using UVM
Rahul Chauhan ([email protected])
Gurpreet Kaire ([email protected])
Broadcom, Inc. San Diego, CA - USA
www.broadcom.com
ABSTRACT
Layering protocols are modeled using layering structures that mirror the protocol layers.
There are significant challenges in modelling verification components for layering protocols
such as (1) reuse, (2) scalability, (3) controllability, and (4)observability. Furthermore, there
may be requirements for complex test scenarios where a great deal of interaction is required
between test sequence execution and response. It is important that the test sequences be provided
with fine grain control of the desired verification components to execute the required complex
test patterns for protocol verification at various layers. In this work, we present a pragmatic
approach using Universal Verification Methodology that we developed for layering protocol
verification to address the challenges mentioned above. This framework provides (1) a rich set of
controls for layering drivers and sequencers to allow interactive complex test pattern generation
and verification, (2) the ability to inject errors at any given layer without having to modify the
underlying sequences, (3) the ability to run any given layer test sequence from a top-level virtual
sequencer, and (4) the ability to perform peer-to-peer and complete protocol stack verification.
Keywords UVM; protocol; layering; message; packet; frame; sequence; passthru-sequence;
peer-to-peer, LLC; MAC; delayering; ACK.
Table of Contents
I.
Introduction .............................................................................................................................. 3
List of Figures
Figure 1. Layered Protocol Data Flow ............................................................................................ 3
Figure 2. Upstream and Downstream Connection in Layered Architecture ................................... 3
Figure 3. Transaction Class Code Block......................................................................................... 4
Figure 4. Driver Class Code Block ................................................................................................. 5
Figure 5. Alt. Driver Class Code Block .......................................................................................... 6
Figure 6. Virtual Sequencer Class Code Block .............................................................................. 7
Figure 7. Virtual Sequence Class Code Block ................................................................................ 7
Figure 8. Effort Bars during Execution Phase ................................................................................ 7
SNUG 2014
I. Introduction
Communication protocols are modeled
as layers, and these layers are often labelled
using the popular Open systems interconnection model. For transmission, the information flows from upper layers downstream
to lower layers and for reception, the information flows upstream from lower layers to
upper layers. Each layer services the upper
layer and performs certain tasks based on
the protocol defined for the respective layer.
The information that flows through the various layers is subjected to (1) Segmentation,
(2) Encapsulation, (3) Transformation, and
so forth. For example, as illustrated in Figure 1, user-defined data in the form of messages can first be segmented into packets.
The packets can then be transformed into
LLC frames. LLC frames can, inturn, be
transformed into MAC frames, then transmitted over a physical interface.
sequencer to execute any underlying sequences selectively, and (4) provide the
flexibility to inject errors at any given layer
without having to modify underlying sequences.
Application Layer
Message
Application Layer
Message
Sequence
Sequencer
Packets
Driver
Monitor
Packets
LLC LAYER
Configuration
Pass-thru
Sequence
Sequencer
Driver
Monitor
Physical Interface
MAC LAYER
While modelling the protocol Verification IP, the following items have to be considered: (1) maintain independent structure
for layers so that each layer can be controlled and observed independently [1], (2)
make drivers adaptive for each layer to be
able to enable/disable selective portions of
the transmission and reception process, (3)
provide flexibility from the top-level virtual
SNUG 2014
Sequencer
Driver
Monitor
Physical Interface
SNUG 2014
endtask: rx_driver
endclass: llc_driver
SNUG 2014
The virtual sequencer used in this approach allowed us to manipulate the flow
control as per our requirements. The philosophy behind this approach was to allow the
user to test scenarios which were either directed or random. This flow control was
achieved by monitoring the implementation
ports of each layer in the virtual sequencer.
This gave us visibility into all the transactions at each layer, from either side. The
trick is to create wrap-around tasks for these
monitor port transactions which could be
manipulated to allow the flow control to be
stalled until a certain protocol state is
reached in the simulation.
endclass : app_seq
class app_drv extends uvm_component;
task main_phase();
forever begin
seq_item_port.get(req);
send(req);
...
// Checking if response is expected
if(req.expect_response) begin
wait(rsp_recd_ev);
$cast(rsp, rsp_recd_tr);
rsp.set_id_info(rsp_recd_tr);
end
else
// Send the req back, kind of
dummy
rsp.set_id_info(req);
...
item_done(rsp);
end
endtask : main_phase
endclass : app_drv
The virtual sequencer also had the capability of injecting errors at any level directly from the sequences. Since we were
following the layering driver [1] approach,
we only had access to higher-layer sequences from the virtual sequence. In order to
overcome this and allow the user to inject
errors at any level without modifying the
underlying sequence, a virtual sequence was
provided a handle the pass through sequence
of each lower layer. We could then fine-tune
the lower layer packets to inject errors as per
our needs without modifying the flow control. The error injection technique along
with capturing monitor state information,
provides great flexibility in verifying complex scenarios. The code snippet in Figure 6
describes how the virtual sequencer is
modelled, and the code snippet in Figure 7
describes how the virtual sequence is modeled to achieve the flexible behaviour.
SNUG 2014
endtask : body
//Use the monitor port to create wait
conditions for the sequences
endclass : virtual_sequence
//Wait task for waiting on one particular frame_kind from the monitor ports
task wait_for_frame(frame_kind_e
frame_kind);
wait_for_frame_event(frame_kind);
.
process_frame_for_sequence();
endtask : wait_for_frame
V. Results
Use of these techniques improved the
efficiency of testbench verification and test
case creation, ultimately delivering a modular, reusable, and robust testbench. The
highlights of this approach were to show
how seamlessly everything fell in place with
good planning and architecture. Figure 8
shows how different development tasks
were shared and executed.
Overall:
o Five test environments were created
Three peer-to-peer; one each for
stack-to-stack and design.
o ~220 man-days of development time
with three engineers working at three
different locations and in two time
zones.
o Two standard test suites implemented with more than 100 directed and
random sequences.
sequence on ap-
app_seq_1.start(p_sequencer.app_sqr);
app_seq_2.start(p_sequencer.app_sqr);
//Wait for frame response for second
application seq by calling parent
sequencer task
p_sequencer.
wait_for_frame(app_frame_kind);
//Optionally inject llc error using
pass through sequence in third
application sequence
fork
llc_passthru_seq.inject_error = 1;
join_none
app_seq_3.start(p_sequencer.app_sqr)
SNUG 2014
VI. Conclusion
The motivation for this paper is to
share the concepts and simple techniques
that were implemented and also share the
benefits we achieved with the methodology.
The techniques described in this paper can
be extended to create even more robust and
complex test pattern scenarios. The focus of
this methodology was to have maximum
controllability at every layer of abstraction
while still having an automated test flow.
VII. References
[1] Synopsys, Inc., Beyond UVM: Creating
Truly Reusable Protocol Layering.
[2] Accellera, Universal Verification Methodology (UVM) 1.1 Users Guide.
SNUG 2014