You are on page 1of 26

A Generic Approach to Handling Sideband

Signals
Markus Brosch, Salman Tanvir

© Accellera Systems Initiative 1


Agenda
• What is a Sideband UVC ?
• Advantages
• Motivation
• Architecture
• Code
• Conclusion
• Q&A

© Accellera Systems Initiative 2


What is a Sideband UVC ?
Protocol independent signals, so called Sideband Signals
Protocol related signals e.g. Reset, HW-Config, IRQ/Alarms

DUV n
AHB/SPI integral
integral
real

Sideband-UVC:
A generic interface UVC that encapsulates the infrastructure
for driving/monitoring protocol independent signals

© Accellera Systems Initiative 3


Advantages
• Unified sideband signal handling
• Fosters reusability/portability
• Time saving
• High code quality

© Accellera Systems Initiative 4


Motivation
• Propose a SV UVM Sideband UVC Architecture
– Signal Genericity: Support for multiple data types/sideband interfaces
– Reusability: Efficient reuse across multiple projects
– Out of the box monitoring/driving capability
– Minimal code set

© Accellera Systems Initiative 5


Architecture
• Split transactors (transaction level/BFM)
• Testbench to DUV connection (Abstract class approach)
• Transaction modelling
• Driving
• Monitoring
• Checks

© Accellera Systems Initiative 6


Split Transactors
HVL
• A sideband UVC needs to be Env

extended by the user Agent


C

• Propose to split the UVC into: SEQ

– Reusable transactional class based Utility


C MON DRV
component library

– User extendable (generated)


HDL
interface based BFM part
CHK BFM BFM

IF
Referenced

Generated

© Accellera Systems Initiative 7


Testbench to DUV connection
• Virtual interface connections are type specific
– Different interface types cannot be referenced
• Support of different interfaces is key for a Sideband UVC.
• The abstract class construct of SV solves the type specificity problem
Handle of base type can reference object of any derived type

DRIVER/MON BFM (IF)

Concrete class
Abstract class extends abstract class

Abstract class Concrete class


• Defines accesor (Get/Set) API • Implements accessor API
• Scoped within BFM/IF
 Direct access to BFM/IF

© Accellera Systems Initiative 8


Architecture
HVL Env
Abstract Class

Agent task drive (trans tr);


C
endtask;
SEQ

Utility MON DRV


C
library AC AC

HDL CC CC
Concrete Class
CHK BFM BFM
task drive (trans tr);
drive if.signal..
IF endtask;

© Accellera Systems Initiative 9


Transaction modelling
• Common data structure required to store the value of all signals of
interest

Dynamic arrays Parameterized classes


Concise code base Larger code base
Single transaction item Every signal type needs a parametrized extension
Single line encode/decode Casting required for encode/decode

Additional string field needed for representation Values are immediately visible

© Accellera Systems Initiative 10


Transaction modelling
• Dynamics arrays

How can signal data be encoded into and decoded from dynamic arrays?

© Accellera Systems Initiative 11


Driver Encoding/Decoding
Integral Real

Encoding tr.data[] = {<<{seq.signal_value}}; tr.data[] = {<<{$realtobits(seq.signal_value)}};

Decoding s_if.signal = {<<{tr.data[]}}; logic[63:0] real_bits;


real_bits = {<<{tr.data[]}};
s_if.signal = $bitstoreal(real_bits);

• Streaming operator used for encoding/decoding of signal data


• User does not need to take care of streaming the data
– Driver: generated macros/sequences automate this

© Accellera Systems Initiative 12


Monitor Encoding/Decoding
Integral Real

Encoding tr.data[] = {<<{s_if.signal}}; tr.data[] = {<<{$realtobits(s_if.signal)}};

Decoding mon.signal_mirror = {<<{tr.data[]}}; logic[63:0] real_bits;


real_bits = {<<{tr.data[]}};
mon.signal_mirror = $bitstoreal(real_bits);

• Encoding handled automatically in monitor BFM


• Monitored transactions can be decoded:
– Manually
– Using a generated helper class

© Accellera Systems Initiative 13


Monitor Encoding/Decoding

mirror object encapsulates


all monitored fields

mirror method automatically


decodes transaction

© Accellera Systems Initiative 14


Driving and Monitoring
• Driving
– Synchronous to another sideband signal
– Asynchronous (immediate)
• Monitoring
– Synchronous
– Asynchronous
– Waiting tasks (to wait until a specified trigger event)
– Sampling function (return immediate sample)

© Accellera Systems Initiative 15


Checks
• Basic integrity assertions can be generated
– Proper reset behavior
– Valid signals (e.g. not X/Z)
• Help finding bugs very early in the design cycle

© Accellera Systems Initiative 16


Code
• Code generation
– Driving Sequence/Macro
– Monitoring Helper Class
• Usage examples

© Accellera Systems Initiative 17


Code generation
• UVC is structured into a re-usable and a project specific part.
• Reusable part referenced from a library.
– Class based UVC (HVL environment, transaction, abstract class, agent, monitor, driver)
• Project specific part is generated.
– HDL interfaces.
– Checker interface.
– Monitor/driver BFM’s.
– Driving sequence/macro library.
– Monitoring helper class.
• Code generator based on Python (Mako).
• Excel/Json input specification file.

© Accellera Systems Initiative 18


Excel Input

© Accellera Systems Initiative 19


Driving Sequence (integral)

© Accellera Systems Initiative 20


Driving Sequence (real)

© Accellera Systems Initiative 21


Driving Macro (integral)

Reference base macro

Generated macros
(per signal)

© Accellera Systems Initiative 22


Monitoring Helper Class

Mirrored interface signals

Automated mirroring

© Accellera Systems Initiative 23


Usage Examples

© Accellera Systems Initiative 24


Conclusion
• Fully functional SV Sideband UVC developed
– Genericity (Support for multiple data types/sideband interfaces)
– Concise code set (HVL referenced, HDL regenerated only)
• HVL referenced
• HDL regenerated only
– Out of the box monitoring/driving capability
• Split transactor/abstract class concept can be reused to develop generic
interface UVC’S
– Adapt base transaction per interface protocol
– Extend base transaction/BFMS to support other protocol flavors

© Accellera Systems Initiative 25


Questions

© Accellera Systems Initiative 26

You might also like