addressing soc/ip verification framework creation with uvm ... · pdf fileaddressing soc/ip...

67
Addressing SOC/IP Verification Framework Creation with UVM Centric Mechanisms Adiel Khan, Amit Sharma Synopsys © Accellera Systems Initiative 1

Upload: doankiet

Post on 09-Mar-2018

290 views

Category:

Documents


11 download

TRANSCRIPT

Page 1: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Addressing SOC/IP Verification Framework Creation with UVM

Centric Mechanisms

Adiel Khan, Amit Sharma

Synopsys

© Accellera Systems Initiative 1

Page 2: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Agenda

• IP SOC Verification Tests/Tasks

• Quick UVM Introduction and Typical Usage scenarios

• Using UVM for mixed-AMS SOC verification

• Leveraging UVM TLM for System Level Verification

• Unified Register modeling between C and SV

• Enabling an UVM Testbench for simulation acceleration

© Accellera Systems Initiative 2

Page 3: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Verification & Test Tasks

BFM C/VPI tests Initialize +

Basic Driver

BFM + VPI/C C/Bare OS Initialize +

Basic Driver

SW Limited Functionality

Initialize + Small Test

Boot OS Applications

Real Software

Boot OS Applications

Real Software

Block Sim SoC Sim Gate Sim Emulation Silicon

CRV Perf SW Perf

Back to back frames

SW Bare Metal OS

Block to Block None

Performance Test

Verify Peak Performance

Boot OS Applications Performance Stress Tests

CRV Block Level Functional

Bugs

BFM CRV SW Simple

Block to Block

SW Limited Functionality Minimal Boot

Code

SW Driver Functionality

Bring Up Tests

C/SWSilicon Bringup

Bring Up Tests

CRV Interface Protocol

Compliance

SW Register Sweep Reset

Registers

SW Limited Reg Sweep Reset Some

Registers

Full Register Sweep

Multiple Configs

Full Register Sweep

Multiple

Software

Performance

Functionality

Connectivity

Verification Tasks

Page 4: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

HW Based & SW Based Methodology

• Software Development • Software Drivers • Application Software

• Virtual Platform • Hardware Prototype • Silicon

• RTL Block Verification • SoC Connectivity • SoC Block Traffic

• RTL Simulation • CPU is Bus BFM • UVM Methodology

• SoC Register sweeps • SoC Performance • SoC Bare Metal OS

• RTL Simulation • Test runs on

embeded RTL CPU

• SoC driver testing • Bare Metal OS • Minimal Real OS

• Emulation • Test runs on embedded

CPU

Hardware Verification

Software Development

Software Team & Skills move down towards hardware

Hardware Team & Skills move up towards software

M

ix d

epends o

n te

am

skills

Page 5: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

UVM INTRODUCTION

© Accellera Systems Initiative 5

Page 6: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Complete UVM Ecosystem

Protocol Debug

Template Generators

Verification Planning

UVM-Aware Debug

Constraint Solver

Coverage & Analysis

Native UVM VIP

UVM TLM/SC Adaptors

UVM AMS Testbench

Reg Model generators

Page 7: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Verification Goal • Ensure full conformance with specification:

– Must avoid false passes

??? Pass

Fail

Good Bad(bug)

RTL code

Tape out!

Debug

testbench

Debug

RTL code

Testbench

Simulation

result

False pass

results in shipping

a bad design

How do we achieve this goal?

Page 8: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Coverage-Driven Verification • Focus on uncovered areas

• Trade-off authoring time for run-time

• Progress measured using functional coverage metrics

Time

% C

overa

ge

Goal

Self-checking

random environment

development time

Productivity

gain

Directed

Methodology

Coverage-Driven

Methodology

Page 9: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Phases of Verification Start with fully random environment. Continue with more and more focused guided tests

Time

Goal

Build verification

environment

Broad-Spectrum

Verification

Preliminary

Verification

Difficult to reach

Corner-case

Verification

Corner-case

Verification

% C

overa

ge

Page 10: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

• SystemVerilog testbench structure

Test

Typical Testbench Architecture

RTL

Interface

Self Check

Reacts to

transactions

Coverage

Sequencer

DUT

Collection of testcases Testcase

Monitor Monitor

Sequencer

Process

transactions

Creates

random

transactions

Driver Driver

Testcase Testcase Testcase

Page 11: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Program

Test

Environment

Master Agent

Harness Module

UVM Testbench Architecture

interface

reg

interface

reg

Driver Monitor

Sequencer

DUT

reg reg

Slave Agent

Monitor Driver

Sequencer

Scoreboard

Coverage

Physical

Layer

Container

Layer

Test

Layer

Transaction

Layer

Test Entry

18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1

Page 12: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

• Structure should be architected for reuse

UVM Encourages Encapsulate for Reuse

Top Level Harness

Test

Environment

DUT

Slave Agent

Sequencer

Bus

Monitor Driver

Sequencer, driver

and monitor

associated with an

interface should be

encapsulated as

an agent for that

interface

Agents, coverage

and scoreboard

should be

encapsulated in

an environment

Test instantiates

the environment

and modifies the

environment on a

testcase by

testcase basis

Master Agent

Sequencer

Driver Bus

Monitor

Scoreboard

Coverage

Page 13: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

• Agents are the building blocks across test/projects

UVM Structure is Scalable

Program

Test

DUTB DUTB DUTB DUTB

Environment

Passive A g e n t

Monitor

Slave Agent

Sequencer

Bus

Monitor Driver

Slave Agent

Sequencer

Bus

Monitor Driver

Slave Agent

Sequencer

Monitor Driver

Scoreboard

Coverage

Scoreboard

Master Agent

Sequencer

Driver Monitor

DUTA

Page 14: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

• Structural & Behavioral – uvm_component

• uvm_test

• uvm_env

• uvm_agent

• uvm_sequencer

• uvm_driver

• uvm_monitor

• uvm_scoreboard

• Communication – uvm_*_port

– uvm_*_socket

• Data

– uvm_sequence_item

Top Level Harness

Test

Environment

DUT

Slave Agent

Sequencer

Bus

Monitor Driver

Master Agent

Sequencer

Driver Bus

Monitor

Scoreboard

Coverage

Structural Support in UVM

Page 15: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Typical UVM Usage scenarios

• UVM based Constrained Random Verification (CRV) for RTL Block/IP Verification using UVM based VIPs with Constrained Random tests

Usage of standard 3rd Party UVM VIPs in IP/Subsystem Verification

• Generating SoC Block Traffic

• IP verification using Re-use of IP level testbench at SOC/System level – UVM VIPs as peripherals

– UVM VIPs as passive monitors

– Reuse of UVM Register layer from block to SOC level

© Accellera Systems Initiative 15

Page 16: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

UVM Coverage Driven Verification

Testcase A

Sequencer

Driver

Driver

Monitor

Monitor

DUT

Fun

ction

al Co

verage Mo

de

l Driver Monitor

Monitor

System-level transactions

Low-level transactions

Block to System Seqeunces/Cover Group reuse

Block-level transactions

Refer to existing coverage object no need to do rewrites of coverpoints or covergroups

Page 17: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

UVM Constrained Random Verification Quick tracing of sequences through phases and sequencers

Page 18: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Enables Next-Generation VIP Architecture

Native UVM

Sequence Collection

Configuration Creator

Customization

Coverage Database

User Verification

Plan

Protocol Test Plan

Coverage

Protocol Analyzer

VIP

Sou

rce V

isibility

DVE

Debug

Testbench

Native SystemVerilog Protocol VIP

Test Suite

User Tests

DUT Monitor

Coverage Model

Sequencer

Protocol L2

Link L1

Physical Driver

Virtu

al Sequ

encer

Configuration

AIP

Time to 1st Test

• Configuration

Creation GUI

• Built-in test plan

• Sequence Collection

Time to Verify

• Native SystemVerilog

• No wrappers

• Up to 4x faster

Time to Debug

• Protocol-aware debug

• Source code visibility

• Error Diagnostics

Time to Coverage

• Built-in coverage

• Verification Plan

• Test Suite

• Sequence Library

Page 19: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Performance Validation for AXI Protocol Using UVM testbench Measure bus bandwidth based on traffic profiles

Specification

Final Silicon and Applications Performance Requirements

System

Architects

Verification

Engineers

Performance Constraints

Page 20: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Performance Analysis

• User sets

– Performance constraints

– Recording interval

• Registration using UVM callbacks

• UVM_ERROR for violation

• Dynamically Configurable

• Prints Performance Summary

************************************************************************

PERFORMANCE REPORT FOR MASTER 0:

************************************************************************

================================================

Interval Start Time:0.000000; Interval End Time: 5425.000000

Configured avg_max read xact latency:15000.000000;

Observed avg_max read xact latency: 360.000000

=================================================

Page 21: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Metric Compliance Checking • Visualize Performance Data in Graphs/charts/spreadsheets

• Performance constraints can be fed into spreadsheets/EDA tools for checking performance data

TCL TCL File:

CSV CSV File:

Constraint Editor:

Apply

Page 22: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

LEVERAGING UVM TLM FOR SYSTEM LEVEL VERIFICATION

Architecture Exploration, TLM Verification, leveraging System C reference models

© Accellera Systems Initiative 22

Page 23: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

VCS

SystemVerilog

SystemC

==?

Function

Command DUT

HDL

Ref

Scenario

Testbench

Mixed language/abstraction level Challenge

• Single, golden testbench for TL and RTL

• Transaction-level models in SystemC or SystemVerilog

• Verification in a mixed language with different abstraction levels

Signal interface

Transaction interface TLM

Page 24: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

• TLM 2.0 – Standard for interoperability between memory

mapped Bus model – Loosely timed and Approximately timed model – Used for Virtual platform, Architectural analysis,

Golden model for Hardware verification – Provided Sockets(Transport, DMI and Debug

interfaces) – Generic payload and extension mechanism

• TLM 1.0 is included inside TLM 2.0 standard (put, get, nb_put, nb_get, transport).

What is OSCI TLM?

Page 25: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Reasons for Using TLM

25

Software development Firmware / software

Accelerates product release schedule

Available before RTL

Test bench

Hardware verification

RTL

TLM = golden model

Architectural modeling TLM

Fast enough

Ready before RTL

Represents key architectural components of

hardware platform

Simulates much faster than RTL

Page 26: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

TLM-2.0 across SV and SC • Tool-specific mechanism

– Not part of UVM

– VCS: TLI-4

– Open Source: UVM-Connect SystemVerilog SystemC

Copy across at method call

and return

Page 27: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Methodology Overview : How does it work

Ref model with OSCI

TLM 2.0 Interface

SystemC model

TLI Adaptor

UVM Testbench

Architecture

Sequence

Function

Channel SC SV PIN IF SC-SV TLI SV-SC TLI

tlm Initiator socket tlm target socket

Typ

e co

nve

rter

Data

TLI bind function connects the

env.master.channel/env.master.socket to

TLI adaptor Channel /Socket

Also Work from SC to UVM direction

TLI bind function for connecting the SC

intiator/target with TLI adaptor

initiator/socket

Data Pkt is user-

defined/TLM2.0 Generic Payload

Page 28: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

DUT

DUT

Leveraging TLM2.0 for HW/SW Integration

RTL

Virtual Prototype

Dri

ver

Mo

nit

or

Coverage Self-Check

Test Cases Scenarios

Test Bench

Early Test Bench Development

1. Develop test bench infrastructure

2. Develop early test cases and scenarios

HW/SW Co-Verification

1. SW Driven Verification

2. SoC HW/SW integration

CPU ISS

Mem Ctrl

Periph Periph

System IO

System IO

Flash Mem

Camera USB

SoC

System/Device

Transactor

RTL (Sub)-System

Interconnect

System Software

Transactor

Page 29: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Virtual Platforms and TLM-2.0

• Virtual Platform written in SystemC

• Bus-based SoC

• TLM-2.0 models bus operations

– Independent of bus protocol

CPU

A

B

C

Inte

rco

nn

ect

A

B

C

ISS

TLM-2.0

Generic Payload SoC

Virtual

Platform

Page 30: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

RTL & Fast Models

• Speed and accuracy tradeoff

– RTL – full cycle accuracy

– TLM – transaction accuracy

– Some intermediate points also available (consider ROI) Model TLM

Virtualizer TLM Co-Sim

RTL Co-Sim

RTL Backdoor

RTL

Speed Fast Fast Slow Slow/Med Slow

Accuracy TLM TLM TLM TLM Cycle

Need to consider ROI for each of these environments

Faster Speed (more TLM)

Accuracy (More RTL)

Page 31: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

RTL in Virtual Platforms

Inte

rco

nn

ect

A

VIP

C

ISS B

Page 32: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Co-Simulation: Virtualizer TLM & RTL

ARM FastModel

(TLM)

ARM FastModel

(TLM)

Soc

Fab

ric

(TLM

)

TLM/RTL Co-Simulation

• Transaction level accuracy

• Fast until RTL is touched

• Minimal RTL to maintain speed

• Minimal design changes, only when RTL is inserted

Trace Log

Trace Log

USB USB VIP Pin IFC

Memory Model (TLM)

USB (TLM) USB VIP (TLM)

ELF File

Page 33: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Co-Simulation: TLM & RTL

ARM FastModel

(TLM)

ARM FastModel

(TLM)

Memory Model

Ethernet

USB

Eth VIP

USB VIP

TLM/RTL Co-Simulation

• Transaction level accuracy

• Mostly RTL

• Simulation performance similar magnitude range as RTL

simulation speed,

• Design change required to add Pin Interfaces/Adapters

Trace Log

Trace Log Pin IFC

Pin IFC

Soc

Fab

ric

ELF File

Page 34: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Protocol-Agnostic Tests • Test written using Generic Payload

• Can work on any bus

AHB VIP A

HB

A

B

C

SoC A

Test Sequence

VIP

GP layer

AXI VIP A

XI

X

B

Z

SoC B

Test Sequence

VIP

GP layer

DUT DUT

Page 35: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

VIP ARCHITECTURE FOR TLM GP

Page 36: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

AMBA Sequences in SV

Driver

Sequencer

AMBA Sequences req

rsp

SNOOP Sequencer

snoop request

sequence req

rsp

AMBA Tests

AMBA Transactions

Snoop request reactive sequence

Page 37: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

GP-Based Sequences in SV

Driver

Sequencer

GP-to-AMBA Layering req

rsp GP Sequencer

req

rsp

SNOOP Sequencer

snoop request

sequence req

rsp

GP Sequences

GP Tests

AMBA Transactions

uvm_tlm_generic_payload +

svt_amba_pv_extension

GP to AMBA layering sequence

Snoop request reactive sequence

Page 38: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

SystemC-Based Tests

Driver

Sequencer

GP-to-AMBA Layering req

rsp GP Sequencer

req

rsp

SNOOP Sequencer

snoop request

sequence req

rsp

Directed GP Sequence

b_snoop

To

FastModel b_fwd

AMBA Transactions

GP to AMBA layering sequence

Snoop request reactive sequence

uvm_tlm_generic_payload +

svt_amba_pv_extension

Page 39: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

FastModel Connection

GP Sequencer

SNOOP Sequencer

AXI-to-GP Layering

One GP Sequence

ARM FastModel

Code Memory

AMBA-PV Slave

AMBA-PV Bridge

UV

Mco

nn

ect

/ TL

I-4

SystemVerilog SystemC

b_snoop

b_fwd

Page 40: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

UVM Transaction Debug

FSDB Trans, Attributes,

Relations

VIPs Test-

bench User Code

Library-Embedded Recording Interface

VIP-Embedded Recording Interface

PLI task-based

API

Verification Platform

New Transaction Based Debug Apps

SoC/ Processor

C function API

Page 41: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Transaction Debug Apps Enhancing Post Process Testbench Debug

Browser

Analyzer Relation Navigator

Sequencer Transactions

User Messages

System Messages

TLM Port Transactions

Sync and D&D

Page 42: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Transaction Analyzer Analysis and data mining tool for abstract data

Streams, virtual streams or empty containers (D&D)

Sorting

Relationship highlighting

Quick filter

Page 43: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Unified register Modeling between C an SV

Page 44: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

• To enhance register model interaction between C and

UVM , a new mechanism is needed such that an identical

and consistent register model can be accessed from either

side

• This framework can alleviate the need to maintain and

verify two separate and disjointed models

• Updates to this common register model from one side

need to be immediately visible to the other and vice versa

Unified Register Model for C and SV Challenges and Motivation

Stimulus/

Sequences

C++ Testbench

Unified UVM+C

Register Model Compare

Output

SV Testbench

Page 45: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Implementing a Unified Model

• The standard UVM RAL(Register Abstraction Layer) models the registers and memories of the Design Under Test(DUT) in System Verilog(SV)

• A C-model of the design exists and has a C++ based environment. The APIs provided allow access of the register fields and memories in the SV-RAL model from the application level C code

• The RAL-SV model can be updated from the C side or the SV testbench. Any updates in the RAL-SV model from the SV side are reflected in the C side

Page 46: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Introduction to RAL-C++ interface

• Allows firmware and application-level code to be developed and debugged in VCS

• Preserve abstraction offered by the RAL – Hide physical address, field positions

• Provides C++ API to access RAL components – Fields, Registers

• Two versions of the RAL C++ API can be generated – Interface to RAL model using DPI – Stand-alone C++ code targeted to S/W

Page 47: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

RAL C API

RTL DUT

Spec

Register Abstraction ralgen

Low-Power

Tests

SV

Cosim API Firmware

C Code

Pure C API

gcc

C

.o

C

Interrupts or

transition requests

VCS

DPI

Unmodified

Embedded

SW Application level code can now be verified

against a simulation and then used,

unmodified, in the final application

Page 48: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Execution timeline • Execution non concurrent unlike code

• Rest of Simulation frozen when ‘C’ code is running

• Entire execution in ‘C’ is in ‘0’ time in the simulation timeline

• ‘Polling’ strategy can impact overall performance

• Interrupt driven service strategy more ideal

Page 49: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Using UVM for mixed-AMS SOC

verification

© Accellera Systems Initiative 49

Page 50: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

• No clear methodology for mixed-AMS SoC verification – Need interaction between all IPs, including AMS

– Need signal access between analog IPs and others (xmrs/oomrs)

• Holes in mixed-AMS Block-level verification – Synchronous verification is not enough, Ref models, Flow automation

needed for characterization, regression

• The solution for self-checking verification environment

Need for a UVM-AMS Testbench?

A D

A

A

D

D

D

D

D D

D

D

D

D

D

D

UVM UVM AMS TB

Page 51: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

UVM-AMS Testbench Overview Technology for mixed-signal SoC functional verification

• Electrical Real conversion

• Asynchronous analog events

• AMS toggle coverage

Basic Usage

• AMS SystemVerilog assertions

• AMS SystemVerilog testbench

• AMS Checker Library

• SystemVerilog Real Number Modeling

Intermediate usage

• UVM AMS testbench

• AMS Source generators

Advanced usage

DUT (Analog IP)

Self Chk

~ ~

real

SPICE or Verilog-AMS

Electrical

r2e System Verilog

real

SPICE or Verilog-AMS

Electrical

e2r System Verilog

top.ev

top.vref

VDD=1.8V

0.6V

Vref

-Tol

+Tol

AMS

Page 52: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Real Analog Conversion

Easy XMR read access to internal analog signal voltage and current

$snps_get_volt(anode)

$snps_get_port_current(anode)

anode: full hierarchical analog node name

Example: real r;

always @(posedge clk)

r <=$snps_get_volt(top.i1.ctl);

real

SPICE or Verilog-AMS

Electrical

r2e System Verilog

real

SPICE or Verilog-AMS

Electrical

e2r System Verilog

Easy XMR write access to internal analog signal voltage.

$snps_force_volt(anode,val|real)

$snps_release_volt(anode)

anode: full hierarchical analog node name val|real: absolute value or real variable

Example: real r;

initial

$snps_force_volt(top.i1.ctl,0.0);

always @(posedge clk) begin

r <= r+0.1;

$snps_force_volt(top.i1.ctl,r);

Page 53: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

LogicAnalog Conversion

Example:

assign verilog_wire =

top.i1.i2.x1.clk;

initial begin

verilog_reg =

top.i1.i2.x1.strb;

...

logic

SPICE or Verilog-AMS

Electrical

d2a System Verilog

logic

SPICE or Verilog-AMS

Electrical

a2d System Verilog

Automatic insertion of d2a connect models between SystemVerilog and SPICE.

User can re-define the threshold

Example: reg rst_reg;

assign top.i1.i2.x1.rst = rst_reg;

initial begin

...

rst_reg = 1'b0;

#5 rst_reg = 1'b1;

...

end

Automatic insertion of a2d connect models between SystemVerilog and SPICE.

User can re-define the threshold

Page 54: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Asynchronous Analog Events

$snps_cross(aexpr[,dir[,time_tol [,expr_tol]]]);

aexpr: analog expression based on system function

Example:

always

@(snps_cross($snps_get_volt(

top.i1.ctl)–0.6,1))

begin

$display(“Signal ctl is raising

above 0.6V”);

event

SPICE or Verilog-AMS

Electrical

event System Verilog

event

SPICE or Verilog-AMS

Electrical

event System Verilog

$snps_above(aexpr[,time_tol [,expr_tol]]]);

aexpr: analog expression based on system function

Example:

always

@(snps_above($snps_get_volt(

top.i1.ctl)–0.6))

begin

$display(“Signal ctl is above

0.6V”);

Page 55: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

• DUT and testbench are instantiated and connected using SV interface

• VCS automatically inserts necessary e2r and r2e models

Instantiation of Analog DUT & Testbench

module tb;

logic clk=1'b0;

ana_comp_if ana_if(clk);

A2DConverter DUT(ana_if.vin,

ana_if.o1, ana_if.o2,

ana_if.o3, ana_if.o4);

ana_test tst(ana_if);

always #10 clk = ~clk;

ADC

Clock generation

SV Testbench

Common

synchronous

interface

Page 56: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

AMS Testbench Generators UVM

...

class my_env extends uvm_component;

...

sv_ams_sine_voltage_gen#(-1.0, +1.0, 1.0E6) sGen_IN;

function void build_phase(uvm_phase phase);

super.build_phase(phase);

uvm_resource_db#(virtual ams_src_if)::

set("*", "uvm_ams_src_if", aif, this);

sGen_IN = sv_ams_sine_voltage_gen#

(-1.0, +1.0, 1.0E6)::type_id::create("sine", this);

endfunction

Construct sin Wave

generator.

Default is auto-run

throughout

run_phase()

Sine Voltage Gen

• Vmax=1.0V,

• Vmin=-1.0V

• F=1.0MHz

Page 57: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Immediate Assertions Asynchronous

always @(snps_cross($snps_get_volt(top.ev)–0.6,1))

assert(top.vref.analog_node <= 1.8)

else $error("Node is greater than VDD");

Asynchronous

immediate

assertion of

analog node

top.ev

top.vref.analog_node

VDD=1.8V

0.6V

“Node is greater

than VDD”

Page 58: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

AMS Testbench Checkers

module test;

ana_vref_if ana_if();

spice_clk_ref ckref(ana_if.clk_out);

sv_ams_frequency_checker#(-2.25,+2.25, 2.5E6)

freq_meas = new(“Freq Meas", "0", 0,

ana_if.clk_out);

initial begin

@(posedge rst); // Wait end of reset

saw_freq_meas.start_xactor();

#2000 saw_freq_meas.stop_xactor();

saw_freq_meas.set_params(-1.8, +1.8, 2.5E6);

saw_freq_meas.start_xactor();

endmodule

SV interface containing

the Clock generator

Clock generator

instance

Checks:

• Vmax=2.25V,

• Vmin=-2.25V

• F=2.5MHz

• Tolerance: +-1.0%

Change vmin,

vmax

Start/stop frequency

checking

Restart frequency

checking

Page 59: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Checkers

sv_ams_threshold_checker Checks that analog signal remains within a given high and low threshold. Can perform this check synchronously or asynchronously

sv_ams_stability_checker Checks that analog signal remains below or above a given threshold. Can perform this check synchronously or asynchronously

sv_ams_slew_checker Checks that analog signal rises/falls with a given slew rate(+/- tolerance). Can perform this check synchronously or asynchronously

sv_ams_frequency_checker Checks that analog signal frequency is within a given tolerance

AMS Testbench Checkers

High

Low

Vref

-Tol

+Tol

dV/dt

VMax VMax

Vmin Vmin

Page 60: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

UVM AMS Verification of A+D SoC

DUT

CHECK

TEST

A

Covera

ge

D D

D

A

D

D

AMS TB contain analog blocks

...

class my_env extends uvm_component;

...

sv_ams_sine_voltage_gen#(-1.0, +1.0, 1.0E6) sGen_IN;

function void build_phase(uvm_phase phase);

super.build_phase(phase);

uvm_resource_db#(virtual ams_src_if)::

set("*", "uvm_ams_src_if", aif, this);

sGen_IN = sv_ams_sine_voltage_gen#

(-1.0, +1.0, 1.0E6)::type_id::create("sine", this);

endfunction Construct sin

Wave generator.

Default is auto-run

throughout

run_phase()

Sine Voltage

Gen

• Vmax=1.0V,

• Vmin=-1.0V

• F=1.0MHz

Page 61: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Other use: Verifying Analog IP before SoC

integration

DUT (Analog IP)

Self Chk

Testcase

~ ~

Covera

ge

sv_ams_real

sv_ams_voltage

components

Checkers

Page 62: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Enabling an UVM Testbench for simulation acceleration

© Accellera Systems Initiative 62

Page 63: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Typical UVM Testbench Environment

DUT

Monitor

Inte

rface

Scoreboard/Checker

Inte

rface

Monitor

Testcase

Driver Driver

Sequen

cer

Sequences Reactive

Sequences

Sequen

cer

Coverage Collector

• Stimulus Generation: Constrained Random, Object-Oriented

• Testcase: Simulation Control

• Bus Functional Models (BFM’s)

• Responder, Slave (Memory)

• Result Analyzers

• Coverage Driven Verification

• Scoreboards

COVERGROUPS

Page 64: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Environment Transformations for TBA

Two-Top Entity Approach

Partitioning the Active & Passive BFM’s

Page 65: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Low Power

AMS-Testbench

SCEMI/HAL

UVM REG

DesignerTestbench

Perf Analyzer

UVM VIP UVM Base Classes

Planner

TLM

SoC

UVM-LP Base Classes

AMS Base Classes

RTL SPICE

Digital Spec

Analog Spec

Methodology Investment - Direction

Firmware Verification

Synthesis

STA Gate Sim Physical

Verification

Eqv. Chk P&R

FPGA Prototyping, Emulation,

Product Specification

SW/FW Development

TLM Models

HW IP

TLM Architecture

Assertions

LP Intent

UVM

UVM

UVM

UVM

UVM

UVM

UVM

UVM

UVM Native SV transactors

Verification Plans UVM _SC

Base Classes TLM Verification

VIPs & Scenarios

Coverage Analysis

Debug

Constraints

Digital Verification

AMS Verification

UVM

Page 66: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Complete UVM Ecosystem

Protocol Debug

Template Generators

Verification Planning

UVM-Aware Debug

Constraint Solver

Coverage & Analysis

Native UVM VIP

UVM TLM/SC Adaptors

UVM AMS Testbench

Reg Model generators

Page 67: Addressing SOC/IP Verification Framework Creation with UVM ... · PDF fileAddressing SOC/IP Verification Framework Creation with UVM ... • IP verification using Re-use of IP level

Questions

© Accellera Systems Initiative 67