Vertical Reuse of functional verification from subsystem to SoC … · 2017-12-29 · Testbench...

23
Vertical Reuse of functional verification from subsystem to SoC level (with seamless SoC emulation) Pranav Kumar, Staff Engineer Digvijaya Pratap SINGH, Sr. Staff Engineer STMicroelectronics , Greater NOIDA, INDIA Ankur Jain, Verification Technologist Mentor Graphics, Bangalore, INDIA © Accellera Systems Initiative 1

Transcript of Vertical Reuse of functional verification from subsystem to SoC … · 2017-12-29 · Testbench...

Page 1: Vertical Reuse of functional verification from subsystem to SoC … · 2017-12-29 · Testbench Architecture • LVP (Lightweight Virtual Platform) –A processer subsystem (SystemC/TLM)

Vertical Reuse of functional verification from subsystem to SoC level

(with seamless SoC emulation)

Pranav Kumar, Staff Engineer

Digvijaya Pratap SINGH, Sr. Staff Engineer STMicroelectronics, Greater NOIDA, INDIA

Ankur Jain, Verification Technologist

Mentor Graphics, Bangalore, INDIA

© Accellera Systems Initiative 1

Page 2: Vertical Reuse of functional verification from subsystem to SoC … · 2017-12-29 · Testbench Architecture • LVP (Lightweight Virtual Platform) –A processer subsystem (SystemC/TLM)

Introduction• Ever increasing SoC complexity

– Verification challenge

• Two levels of verification

– IP/Subsystem Level

– SoC Level (integration aspects)

• Full application scenarios

– FPGA prototyping

– Emulation

• Verification methodology standardization

– UVM

© Accellera Systems Initiative 2

Page 3: Vertical Reuse of functional verification from subsystem to SoC … · 2017-12-29 · Testbench Architecture • LVP (Lightweight Virtual Platform) –A processer subsystem (SystemC/TLM)

Typical verification Environments

© Accellera Systems Initiative 3

IP/Subsystem

BusFunctio

nal model

VIPBus IF

CentralControl

/CPU

ModelInterrup

t controll

er

Clock/Reset

control

Tests

Subsystem Level

SoC Level

SoC

VIP1

C-Tests

TopClock/Reset IP1

IP3

IP4

IP2 VIP2

VIP3

VIP4CPU

DMA

ROM

RAM

VIC

Page 4: Vertical Reuse of functional verification from subsystem to SoC … · 2017-12-29 · Testbench Architecture • LVP (Lightweight Virtual Platform) –A processer subsystem (SystemC/TLM)

© Accellera Systems Initiative 4

Standardizing subsystem level verification Env

IP/Subsystem

BusFunctio

nal model

VIPBus IF

CentralControl

/CPU

ModelInterrup

t controll

er

Clock/Reset

control

Tests

SoC

VIP1

C-Tests

TopClock/Reset IP1

IP3

IP4

IP2 VIP2

VIP3

VIP4CPU

DMA

ROM

RAM

VIC

LVP

Page 5: Vertical Reuse of functional verification from subsystem to SoC … · 2017-12-29 · Testbench Architecture • LVP (Lightweight Virtual Platform) –A processer subsystem (SystemC/TLM)

LVP – Lightweight Virtual Platform

© Accellera Systems Initiative 5

• Processer subsystem in SystemC/TLM

– TLM ARM ISS

– Abstracted TLM interconnect

– C++ Memory models integrated in SystemC

– VIC and DMAC TLM models

– Bus interface bridges AMBA and STBus

Page 6: Vertical Reuse of functional verification from subsystem to SoC … · 2017-12-29 · Testbench Architecture • LVP (Lightweight Virtual Platform) –A processer subsystem (SystemC/TLM)

Emulation Env

© Accellera Systems Initiative 6

• External interface now driven by real hardware or external device models– Addressing the simulation speed bottleneck

– Useful for concurrent/full application verification scenarios

– Early software development, e.g. boot rom code, etc.

DUT(e.g. PCIeEnd-point)

Apps codeincl DUT

driver layer

CPU(e.g. ARM RTLor ISS model)

Interconnect

Instrument or real device(iSolve PCIe or PC)

VAL

Page 7: Vertical Reuse of functional verification from subsystem to SoC … · 2017-12-29 · Testbench Architecture • LVP (Lightweight Virtual Platform) –A processer subsystem (SystemC/TLM)

Reuse – simulation to emulation

© Accellera Systems Initiative 7

Page 8: Vertical Reuse of functional verification from subsystem to SoC … · 2017-12-29 · Testbench Architecture • LVP (Lightweight Virtual Platform) –A processer subsystem (SystemC/TLM)

Reuse – major challenges• Easy portability of VIP

– Consider VIP as another IP with Custom registers set

VIP driver in ‘C’

Standard bus interface

• C & SV/UVM Synchronization

– VIP env in SV/UVM

– VIP driver in ‘C’

© Accellera Systems Initiative 8

solution

Develop custom VIPs

OR

Interface VIPs with intermediary layer mentioned here as

VAL (Verification Abstraction Layer)

Page 9: Vertical Reuse of functional verification from subsystem to SoC … · 2017-12-29 · Testbench Architecture • LVP (Lightweight Virtual Platform) –A processer subsystem (SystemC/TLM)

VAL – Central Idea• Control on complete verification environment

– VIP reset and config

– IP config

– VIP and IP activities synchronization

• Allow SW-driven constrained test randomization– Configuration parameters

– Data

• Control score-boarding

– Enable / disable

– Reference data and configuration values transfer

• Initiate backdoor operations

– Accesses to LVP and VIP memories

© Accellera Systems Initiative 9

Page 10: Vertical Reuse of functional verification from subsystem to SoC … · 2017-12-29 · Testbench Architecture • LVP (Lightweight Virtual Platform) –A processer subsystem (SystemC/TLM)

• A generic configurable component with two sub-layers:a) VAL_FE (VAL FrontEnd)

Interface to

— any standard (AMBA, STBus, etc.) bus, or

— proprietary bus or

— TLM model

b) The VAL_BE (VAL BackEnd)

Interface between VAL_FE and VIP

converts instructions from VAL_FE to

— configuration or data packets and

— sequence generation or control of existing sequences

© Accellera Systems Initiative 10

VAL - Implementation

Page 11: Vertical Reuse of functional verification from subsystem to SoC … · 2017-12-29 · Testbench Architecture • LVP (Lightweight Virtual Platform) –A processer subsystem (SystemC/TLM)

VAL – In verification environment

© Accellera Systems Initiative 11

Page 12: Vertical Reuse of functional verification from subsystem to SoC … · 2017-12-29 · Testbench Architecture • LVP (Lightweight Virtual Platform) –A processer subsystem (SystemC/TLM)

Val Flow - Steps

Understanding VAL flow1. VAL trigger from C

2. Cfg randomization (constrained, ….)

3. Cfg updated in Memory model

4. C test reads Cfginformation from Memory

5. C test programs Subsystem/IP in according configurations

© Accellera Systems Initiative 12

VAL BE

…….

valTrig();…….

…………………

DriverSequencer

Monitor

seq

s

SubSys.

(RTL)

C

Page 13: Vertical Reuse of functional verification from subsystem to SoC … · 2017-12-29 · Testbench Architecture • LVP (Lightweight Virtual Platform) –A processer subsystem (SystemC/TLM)

Testbench Architecture• LVP (Lightweight Virtual Platform)

– A processer subsystem (SystemC/TLM) with multiple AMBA interfaces to control the DUT & VIP.

• VAL (Verification Abstraction Layer)– C to SV/UVM interface– Provides control, triggering and synchronization of UVM VIP -

configuration, randomization and sequences from a C testcase running on the LVP.

– Provides control of other testbench components e.g. scoreboard.– TLM ports to trigger and synchronize

• VIP – Connected to LVP through VAL via AMBA interface– Where AMBA i/f can be replaced with any other bus i/f– Providing APIs for controlling QVIP configuration and sequences– Triggering above QVIP APIs from C, and synchronizing using TLM

© Accellera Systems Initiative 13

Page 14: Vertical Reuse of functional verification from subsystem to SoC … · 2017-12-29 · Testbench Architecture • LVP (Lightweight Virtual Platform) –A processer subsystem (SystemC/TLM)

Example Testbench

© Accellera Systems Initiative 14

Test

fram

e.sv

DUT

LightweightVirtual Platform

(LVP)

PCIe VIP

ControllerCore

Regs Memory

AXI

Master

Interrupts

PHYxtal

PCSAPBto

Micro

T3

Slave

VAL

A

S

Y

N

C

A

S

Y

N

C

N

o

d

e

Master

Cfg

AHB S

C

o

n

v

ScoreBoard

Clock

Reset

ActiveRC/EP

PassiveEP/RC

C

o

n

v

A

S

Y

N

C

MMU

SSReg

A

A

APB

APB

AXI

Master

Page 15: Vertical Reuse of functional verification from subsystem to SoC … · 2017-12-29 · Testbench Architecture • LVP (Lightweight Virtual Platform) –A processer subsystem (SystemC/TLM)

VIP as an IP

• Identify configuration parameters of the VIP

• Define C data-structure for them – custom registers set

• Develop VIP driver using above data structures– configuration/control functions – read/write transactions functions– Interrupt handlers

© Accellera Systems Initiative 15

Page 16: Vertical Reuse of functional verification from subsystem to SoC … · 2017-12-29 · Testbench Architecture • LVP (Lightweight Virtual Platform) –A processer subsystem (SystemC/TLM)

Example: VIP registers description in C

© Accellera Systems Initiative 16

typedef union {

struct {

uint32_t tlp_type : 8; // [7:0]

uint32_t reserved : 7; // [14:8]

uint32_t bar_size : 1; // [15]

uint32_t unused_0 : 16; // [31:16]

} BitI;

uint32_t RegI;

} t_PCIe_QVIP_TLP_ID_REG;

typedef union {

struct {

uint32_t seq_id : 32; // [31:0]

} BitI;

uint32_t RegI;

} t_PCIe_QVIP_SEQ_ID_REG;

….

typedef struct {

#ifdef BLOCK_LEVEL

uint32_t* VAL_TRIG; // @0

#else

uint32_t VAL_TRIG; // @0

#endif

t_PCIe_QVIP_SEQ_ID_REG PCIe_QVIP_SEQ_ID_REG; // @4

t_PCIe_QVIP_SEQ_ADDRL_REG PCIe_QVIP_SEQ_ADDRL_REG; // @8

t_PCIe_QVIP_SEQ_ADDRH_REG PCIe_QVIP_SEQ_ADDRH_REG; // @12

t_PCIe_QVIP_SEQ_DATA_LEN_REG PCIe_QVIP_SEQ_DATA_LEN_REG; // @16

t_PCIe_QVIP_SEQ_DATA_REF_REG PCIe_QVIP_SEQ_DATA_REF_REG; // @20

t_PCIe_QVIP_PLP_REG PCIe_QVIP_PLP_REG; // @24

t_PCIe_QVIP_END_SEQ_REG PCIe_QVIP_END_SEQ_REG; // @28

t_PCIe_QVIP_SYNC_FLAG PCIe_QVIP_SYNC_FLAG; // @32

t_PCIe_QVIP_MSI_OFF PCIe_QVIP_MSI_OFF; // @36

t_PCIe_QVIP_DLLP_REG PCIe_QVIP_DLLP_REG; // @40

} PCIe_QVIP_registers;

The Verification component configuration has been arranged in register set and made word addressable ‘C’ declaration for registers

The register set for Verification IP are mapped to consecutive addresses in memory, reserving 0th for VAL triggers.

Page 17: Vertical Reuse of functional verification from subsystem to SoC … · 2017-12-29 · Testbench Architecture • LVP (Lightweight Virtual Platform) –A processer subsystem (SystemC/TLM)

C & SV/UVM Synchronization

• Synchronization needed so that VIP and IP are configured before test is initiated (SV env)

• VIP’s sequencer should wait and not flow-in– Blocking port used to block sequencer

• VIP configuration based on SV/UVM config classes– VAL provides trigger for the configuration

• Sequences to be run on the VIP sequencer also controlled from VAL

© Accellera Systems Initiative 17

Page 18: Vertical Reuse of functional verification from subsystem to SoC … · 2017-12-29 · Testbench Architecture • LVP (Lightweight Virtual Platform) –A processer subsystem (SystemC/TLM)

Example - Synchronization

© Accellera Systems Initiative 18

typedef struct {uint32_t* VAL_TRIG; // @0

t_PCIe_QVIP_SEQ_ID_REG PCIe_QVIP_SEQ_ID_REG; // @4t_PCIe_QVIP_SEQ_ADDRL_REG PCIe_QVIP_SEQ_ADDRL_REG;

// @8t_PCIe_QVIP_DLLP_REG PCIe_QVIP_DLLP_REG; //

@40} PCIe_QVIP_registers;

void PCIe_QVIP_init(PCIe_QVIP_desc* p, uint32_t base_addr) {PCIe_QVIP_REGMAP = (PCIe_QVIP_registers*) base_addr;

#ifdef BLOCK_LEVELPCIe_QVIP_REGMAP->VAL_TRIG = (uint32_t*)

PCIE_QVIP_START;#endif

}

Sequencer:class pcie_qvip_sequencer extends uvm_sequencer;

`uvm_sequencer_utils(pcie_qvip_sequencer)uvm_blocking_get_port #(pcie_qvip_data) val_port;….mvc_sequencer pcie_vip_sqr;function new (string name = "pcie__sequencer", ….);

super.new(name,parent);val_port = new("val_port", this);

endfunction: newendclass: pcie_qvip_sequencer

Sequence:

virtual task body();forever beginp_sequencer.val_port.get(d);

….….

endtask: body

“C” header for VIP [TRIG]

Trigger from “C” to unblock

Blocking port to stop VIP

Called from sequence to

un-block

Page 19: Vertical Reuse of functional verification from subsystem to SoC … · 2017-12-29 · Testbench Architecture • LVP (Lightweight Virtual Platform) –A processer subsystem (SystemC/TLM)

Example - Configuration and Data Flow Control via VAL

© Accellera Systems Initiative 19

VAL

ENV

QVIPVALBE

TESTVALBE

SCOREBOARD

MONITOR

SEQUENCERDRIVER

Coverage

Seq FIFO

Write FnConfig

Data

Cfg_port

Uvm_analysis_imp

ana_exp get_exp

val_portUvm_blocking_get_port

end_seq_port

Uvm_analysis_port

Test_config

Test_data

Mem_data

VIP ENV

Seq_data_port

Uvm_analysis_portUvm_blocking_get_port

Uvm_analysis_port

Page 20: Vertical Reuse of functional verification from subsystem to SoC … · 2017-12-29 · Testbench Architecture • LVP (Lightweight Virtual Platform) –A processer subsystem (SystemC/TLM)

Configuration and Data Flow Control via VAL (cont …)

• Two VAL_BE interfaces –a) QVIP_VAL_BE

Two portsi. Config

– configuration/control packets

ii. Data– data transactions along with required control of sequence

b) TEST_VAL_BE

Two portsi. test_config

– randomization of the test/config parameters– transfer to main memory and coverage-collector

ii. test_data– providing reference and test data to scoreboard

© Accellera Systems Initiative 20

Page 21: Vertical Reuse of functional verification from subsystem to SoC … · 2017-12-29 · Testbench Architecture • LVP (Lightweight Virtual Platform) –A processer subsystem (SystemC/TLM)

IP-Xact

Description

of IP

S/W Framework layers for Reuse

© Accellera Systems Initiative 21

LowLevel

Driver (API)

SS Header

Files

SS Header

Files

SS Header

Files

SS cmpHeader

Files

Interrupt Handler

(API)

Call Test*()SoC APIs

For clock/reset

SoC APIs for IP/Subsystem level signals control and

status

HAL (Hardware Abstraction Layer) operating directly on IP Registers

Low Level Drivers for subsystem, interrupt handlers, etc.

Test definition layer

Test impl.SS levelTo SoC level

Page 22: Vertical Reuse of functional verification from subsystem to SoC … · 2017-12-29 · Testbench Architecture • LVP (Lightweight Virtual Platform) –A processer subsystem (SystemC/TLM)

Conclusion

• Testplan and coverage shared with SoC team

– Reused for SoC verification plan.

• Subsystem LLD, Testcases successfully re-used from sub-system level to SoC level

– Re-used further in emulation (thanks to VAL)

• Subsystem LLD re-used for silicon validation

© Accellera Systems Initiative 22

Page 23: Vertical Reuse of functional verification from subsystem to SoC … · 2017-12-29 · Testbench Architecture • LVP (Lightweight Virtual Platform) –A processer subsystem (SystemC/TLM)

Questions

© Accellera Systems Initiative 23