1 of 82

EE 198: EECS151 Tapeout

Lecture 5: SoC Verification

University of California, Berkeley

IEEE Student Branch

University of California, Berkeley

IEEE Student Branch

2 of 82

Permanent Logistics Slide

  • Logistics Reminders
    • Class time: Monday 3-5pm, BWRC
    • Office hours & Work sessions: Check the bCal! Ping on Discord!
      • Calendar | EECS151 Tapeout
  • Site: 151t.berkie.ee
  • Discord link: http://berkie.ee/151t-discord
  • Email: 151tapeout@ieee.berkeley.edu
  • Add/Drop deadline (has passed)
  • Planning Guest Lecture with NVIDIA Memory Architect

University of California, Berkeley

IEEE Student Branch

3 of 82

Timeline Reminders

Happy Halloween!!

University of California, Berkeley

IEEE Student Branch

4 of 82

Last Last Last (??) Week Tonight

  • Not quite like Arduino - peripherals in an SoC
    • Hardware accelerators
    • Peripheral interfaces
    • Communication & debugging peripherals
      • Example: GPIO

Last last week: project “lecture” & support

  • Hopefully the last two weeks gave plenty of time!
  • How are the labs going?

University of California, Berkeley

IEEE Student Branch

5 of 82

Summary of Today

  • Verification the “Right Way”
    • A little history
    • Unit Testing & resume boosting (System Verilog)
    • What to do in EE194
    • System tests at the SoC level
    • Speaking in “Vectors” and ATPG
    • Randomness vs Algorithms
    • Formal verification
    • Metrics of success: coverage
    • Analog - we gotchu! (AMS Sims)

University of California, Berkeley

IEEE Student Branch

6 of 82

Verification.. The Right Way

University of California, Berkeley

IEEE Student Branch

7 of 82

Verification The Right Way Is Hard

  • Which is why demand is so high! (foot in the door for many)

University of California, Berkeley

IEEE Student Branch

8 of 82

You will see this graph a dozen times

The gap has only grown!!

University of California, Berkeley

IEEE Student Branch

9 of 82

And this one

University of California, Berkeley

IEEE Student Branch

10 of 82

Most of industry time is spent on it..

Although we don’t have that luxury here..

University of California, Berkeley

IEEE Student Branch

11 of 82

.. yet they’re always behind schedule (relatable xd)

University of California, Berkeley

IEEE Student Branch

12 of 82

Why does it matter?

Why bother with verification when you can:

✅ Let your customers find the bugs for free!

University of California, Berkeley

IEEE Student Branch

13 of 82

Read more: https://www.righto.com/2024/12/this-die-photo-of-pentium-shows.html

<<<Just a few missing entries from their look up table …..

University of California, Berkeley

IEEE Student Branch

14 of 82

Summary of Today

  • Verification the “Right Way”
    • ✅ A little history
    • Unit Testing & resume boosting (System Verilog)
    • UVM Preview
    • System tests at the SoC level
    • Speaking in “Vectors” and ATPG
    • Randomness vs Algorithms
    • Formal verification
    • Metrics of success: coverage
    • Analog - we gotchu! (AMS Sims)

University of California, Berkeley

IEEE Student Branch

15 of 82

Key Components of a Plan

“Functional verification”

  • Can we reach 100% functional coverage at the SoC level?
  • Can we reuse IP-level verification at SoC level?
  • Primarily simulation driven

“Constraints verification”

  • Can we verify area, power, timing, Design For Test, etc at the SoC level?
  • Simulation and a lot of human review..

“Prototype validation”

  • Validate system-level requirements pre-silicon (often on FPGAs)
  • Hardware-software co-verification, co-validation
    • Write + test firmware, operating system, etc

University of California, Berkeley

IEEE Student Branch

16 of 82

IP-Level Functional Testing

What people may be most familiar with from 151/SW..

  • Develop testbenches
  • Write test cases to run on tb
  • Simulate & debug
  • Evaluate success
  • Identify failure modes

University of California, Berkeley

IEEE Student Branch

17 of 82

The Resume Booster: System Verilog

University of California, Berkeley

IEEE Student Branch

18 of 82

System Verilog (In One Slide)

Verilog was initially developed as a simulation language..

  • Leads to synthesis-simulation mismatch

SystemVerilog is the de-facto industry standard

  • SV/UVM is used for (nearly) all industry verification
    • Universal Verification Methodology (UVM)
  • Massive Verilog extension for design and verification

University of California, Berkeley

IEEE Student Branch

19 of 82

System Verilog for Design

Take 251b (or intern in DV) to learn more..

University of California, Berkeley

IEEE Student Branch

20 of 82

System Verilog for Design

Take 251b (or intern in DV) to learn more..

University of California, Berkeley

IEEE Student Branch

21 of 82

System Verilog for Verification

Take 251b (or intern in DV) to learn more..

University of California, Berkeley

IEEE Student Branch

22 of 82

System Verilog for Verification

Take 251b (or intern in DV) to learn more..

University of California, Berkeley

IEEE Student Branch

23 of 82

System Verilog for Verification

Take 251b (or intern in DV) to learn more..

University of California, Berkeley

IEEE Student Branch

24 of 82

System Verilog for Verification

Take 251b (or intern in DV) to learn more..

University of California, Berkeley

IEEE Student Branch

25 of 82

Try yourself!

Here’s a sample interview question I had before.

https://www.edaplayground.com/x/TiUL

And more! https://www.edaplayground.com/x/CK

University of California, Berkeley

IEEE Student Branch

26 of 82

Summary of Today

  • Verification the “Right Way”
    • ✅ A little history
    • Unit Testing & resume boosting (System Verilog)
    • UVM Preview
    • System tests at the SoC level
    • Speaking in “Vectors” and ATPG
    • Randomness vs Algorithms
    • Formal verification
    • Metrics of success: coverage
    • Analog - we gotchu! (AMS Sims)

University of California, Berkeley

IEEE Student Branch

27 of 82

The (Im)Perfect Testbench..

A testbench is made up of multiple interconnected components..

  • A stimulus generator creates test scenarios / input vectors
  • A driver drives the DUT, and a monitor monitors it (.....)

University of California, Berkeley

IEEE Student Branch

28 of 82

A (SV) UVM Testbench Architecture

UVM is a method for architecting modular, reusable testbenches

  • SV Library of classes for monitors, scorecards, etc…
  • Implements scoreboard checks, assertions..

University of California, Berkeley

IEEE Student Branch

29 of 82

A UVM Testbench Architecture

Test: Top-Level UVM component (instantiates top-level & env)

Environment: groups hierarchically other components

  • Often one per IP: USB IP Env, Memory Controller Env..

Scorecard: check a DUT’s behavior

  • Compares with a predictor

Sequence: stimulus-generating behavior

Driver: takes stimulus, drives DUT

Monitor: samples DUT interface

Agent: groups a DUT’s verif components

University of California, Berkeley

IEEE Student Branch

30 of 82

Want more? There’s more.. And more..

Way more. Way way more. But let’s move on for now.

(get an internship and get paid to learn it!)

University of California, Berkeley

IEEE Student Branch

31 of 82

Are there alternatives? Yeah! Kinda

Languages: e/Specman (Verisity), VERA (Synopsys), Rave (Chronology..)

  • Verilog & VHDL are simulation languages, not verif (or even synthesis)
    • VHDL was designed for very large teams: strict interfaces, strong info encapsulation..
    • But that gets in the way of verification
      • Ex: how to integrate with C models?

Methods:

  • OVM (Open Verif. Method.)
  • RVM (Ref. Verif. Method.)
  • OVL (Open Verif. Lang.)
  • OS-VVM (open source VHDL verif)

Ever heard of them?

University of California, Berkeley

IEEE Student Branch

32 of 82

Language-level guarantees/’correct by construction’

“Modular Hardware Design with Timeline Types” PLDI 2023

Proves that a design compiles = (most) modules only read semantically valid values

University of California, Berkeley

IEEE Student Branch

33 of 82

Either way.. You can’t escape the testbench

And regressions (ie running the test suite over and over again..)

Typically in the form of constrained / exhaustive randomized testing

University of California, Berkeley

IEEE Student Branch

34 of 82

What about Constraints Verification?

NOT the same as constrained verification / SV constraint blocks

  • That’s stimulus constraints:

We also need to verify, generate, and manage SDC constraints

  • Synopsys® Design Constraints File - timing specifications!
  • (Hammer saves us a lot of headaches but..)

University of California, Berkeley

IEEE Student Branch

35 of 82

Constraints Files - It’s “Just” Files (and TCL)

Clock latency, false paths (or not), max fanout, in/out delays..

From synthesis to PaR, all tools eat them up!

Nom nom nom

University of California, Berkeley

IEEE Student Branch

36 of 82

Wait, so it’s all software? Well, so far..

But simulators only approximate reality: discrete, semantical..

Event driven sims: Never as fast as light :(

  • Outputs only change when inputs change
    • We optimize by not simulating things that “don’t need it” but..
  • Not continuously executing model - only on event

What if we do cycle-based? No timing info at all :(

  • But the performance! Although only for synchronous circuits..
    • No multi-clock, latches, etc (same as static timing analysis-do STA for timing)

A lot of “co-simulators” today are both

University of California, Berkeley

IEEE Student Branch

37 of 82

Not just software: Prototype Validation

Miss EECS151LB FPGAs? We’re (you’re) so back (again)!

FPGA are great for parallel processing - great functional verif speeds

But also enable software co-development & complex emulation

  • But not without a lot of engineering: partitioning, interface bridges, memory wrappers, synthesis issues..

University of California, Berkeley

IEEE Student Branch

38 of 82

Some would say Prototyping is Peak Perf

But maybe FPGAs are just really cool and we are biased :)

University of California, Berkeley

IEEE Student Branch

39 of 82

Can we really test everything?

University of California, Berkeley

IEEE Student Branch

40 of 82

How Do We Verify??

University of California, Berkeley

IEEE Student Branch

41 of 82

Let’s consider an example

For example, let’s consider a 2D Convolution Engine

X

=

Source: https://github.com/npcarter2025/TileAlgorithms

Input Matrix

Output Matrix

University of California, Berkeley

IEEE Student Branch

42 of 82

Plan

  • Reference Model (aka Golden Model)
  • Constrained Randomized Tests
  • Directed Edge Cases (Corner Cases)
  • Assertions
  • Coverage Closure

University of California, Berkeley

IEEE Student Branch

43 of 82

High Level Approaches

  1. Formal Verification
  2. IP-Level Functional Verification
    1. C-Tests, End-to-End Functional Tests
    2. Universal Verification Methodology (UVM)
  3. System-Level Verification

University of California, Berkeley

IEEE Student Branch

44 of 82

University of California, Berkeley

IEEE Student Branch

45 of 82

Insert Example of JasperGold

University of California, Berkeley

IEEE Student Branch

46 of 82

C-Test IP-Level Verification

(what we do in EE194)

University of California, Berkeley

IEEE Student Branch

47 of 82

Golden Model with Constrained Randomized

  1. Python Script to generate input matrices
  2. C-template that runs the hardware engine
  3. Compare hardware output with golden model

University of California, Berkeley

IEEE Student Branch

48 of 82

Directed Edge Cases

  • Max / Min Values: overflow/underflow, saturation logic

  • Test that your Hardware’s error/status flags are correct
  • Back-to-Back Convolutions:
    • Make sure that values are repeatedly propagating to/from engine as expected

- Boundary Conditions:

- Explicitly test padding, stride values,

University of California, Berkeley

IEEE Student Branch

49 of 82

Sounds Easy. What’s the Challenge here?

Any Ideas?

University of California, Berkeley

IEEE Student Branch

50 of 82

Sounds Easy. What’s the Challenge here?

  • Scalability!
  • Time to run Sims
    • If sims are 300 Hz, and FPGA is 300MHz, will take a lot of extra time.
  • Thinking of every possible Edge Case
  • IP Level Block Testing only indicates that this specific block works, but DOES NOT guarantee compatibility with the system.

University of California, Berkeley

IEEE Student Branch

51 of 82

Summary of Today

  • Verification the “Right Way”
    • ✅ A little history
    • Unit Testing & resume boosting (System Verilog)
    • UVM Preview
    • System tests at the SoC level
    • Speaking in “Vectors” and ATPG
    • Randomness vs Algorithms
    • Formal verification
    • Metrics of success: coverage
    • Analog - we gotchu! (AMS Sims)

University of California, Berkeley

IEEE Student Branch

52 of 82

SoC-level Verification

(~Integration Testing)

University of California, Berkeley

IEEE Student Branch

53 of 82

University of California, Berkeley

IEEE Student Branch

54 of 82

Reusing IP-level VIP as much as possible..

We talked so much about functional testing & testbenches..

A bit about “constraints verification”, “prototype validation”..

Can we reuse any of it?

We definitely want to (and people will sell you their VIP solutions to help..)

University of California, Berkeley

IEEE Student Branch

55 of 82

…but is hard

How long are you willing to wait for build & compilation & sim?

T_T

University of California, Berkeley

IEEE Student Branch

56 of 82

And it only seems to get worse :(

Multi-physics, hardware and software, system, board, IC package, interposer, chip, and IP block issues all at once...

  • Can’t “divide-and-conquer” anymore
    • Still (kind of) a separate tool for each category..
  • “Hierarchically” is no longer a magic word (rip 2000s)
    • Ex: clock domain crossings used to isolate issues, not cause them..

System-level issues now include security, performance, power…

  • Ex: interconnects between IP & system impact signal integrity

University of California, Berkeley

IEEE Student Branch

57 of 82

Interconnects and Intercommunication

Interconnect delay dominates - timing closure & estimation hard :(

But verification of data movement between modules is also hard

  • Ex: From CPU to memory to GPU

Those sub-blocks and IP also need to be stitched together at the top-level for both sim and tapeout (sometimes not the same)

  • Connectivity checks need to test integration

Sometimes referred to as subsystem verification or gray-box testing

University of California, Berkeley

IEEE Student Branch

58 of 82

Are we doomed to gamble with our chips?

With only 50-50 chances?!

University of California, Berkeley

IEEE Student Branch

59 of 82

Not if industry has anything to say about it!

Formal and static verification - not just weird math

  • C/C++ and RTL level verification
  • Mandatory now w/ Machine Learning moment (Cadence Jasper)

Automated Test Generation

  • Ex: Cadence Perspec System Verifier

FPGA+HW acceleration for simulations

(More) Prototyping & Emulation

Mixed Signal Simulators

etc

*stockholders

University of California, Berkeley

IEEE Student Branch

60 of 82

Formal Verification

University of California, Berkeley

IEEE Student Branch

61 of 82

An Algorithmic Perspective..

University of California, Berkeley

IEEE Student Branch

62 of 82

Formal Verification

How do we verify every possibility without a testbench?

And how in the world do we make this scalable for SoC-level when non-exhaustive testbenches are too much even for IP-level?

The answer: Math

University of California, Berkeley

IEEE Student Branch

63 of 82

Formal Verification (and pseudo-formal..)

Formal places its bets on early detection and optimization

“Yeah, in the worst case these problems are NP-hard*… But I’m not a pessimist. I will be the lucky one.” - my imaginary friend Forma L

*shoutout to Lucy for the jokes

University of California, Berkeley

IEEE Student Branch

64 of 82

Formal Verification in Reality

In reality “formal” ecompasses a huge amount of methods

They make use of models - mathematical representations of the system, to be analyzed by an algorithm

  • Often a state machine (take 144!)
  • Or automata (take 149!)
  • Or boolean equations (take 219C!)

University of California, Berkeley

IEEE Student Branch

65 of 82

Combinational SAT algorithms

To apply these, some methods convert circuits (CircuitSAT) to boolean expressions and apply satisfiability (SAT) algorithms

  • “Can this output ever be high?”->“Is this expression ever true?”

University of California, Berkeley

IEEE Student Branch

66 of 82

Combinational SAT algorithms

While NP-hard in the worst case, most industry SoC problems happen to fall into very solvable, and very efficiently, classes

  • Spoiler alert: search and prune trees in different ways..

So the impossible exhaustive search.. Becomes the secret sauce?!

  • Don’t get too excited, Cadence / Synopsys have been doing this for decades.. synthesis uses these same exact methods
  • In particular, equivalence checking is the heart of many modern algorithms
  • But that and assertion property modeling (that something bad should never happen) + temporal logic are readings for a very rainy day home!

University of California, Berkeley

IEEE Student Branch

67 of 82

Equivalence Checking with Golden Models

The two are a (sometimes) hidden part of most verification

University of California, Berkeley

IEEE Student Branch

68 of 82

What’s the point?

Okay, so I can model my circuit as a graph and do magic algorithmic math to verify circuits faster even for SoC level testing

(let’s pretend it’s that simple)

Is that all I can do?

Of course not!

University of California, Berkeley

IEEE Student Branch

69 of 82

Another problem: test search space

More gates - more toggling - more test vector possibilities

University of California, Berkeley

IEEE Student Branch

70 of 82

Automatic Test Pattern Generation (ATPG)

Wouldn’t it be great if I could apply these same methods to my traditional verification, like testbenches?

The same deterministic algorithm (branch and bound), in a new data structure, allows you to generate test vectors for your circuit

  • Again you traverse a tree .. but it can learn
  • Not just randomized testing

Can be hard to scale though (industry secrets)

University of California, Berkeley

IEEE Student Branch

71 of 82

Emulation & Prototyping & Regressions..

You can still apply IP-level methods with less granularity

  • More blackboxes - especially for external IP
    • Might need DSMs (Design Simulation Model) if encrypted

Firmware & UVM hybrid sequences at the chip level are possible

Hardware emulation is preferred

  • For faster on complex SoCs

Now verif engineers work more with designers!

University of California, Berkeley

IEEE Student Branch

72 of 82

SystemC - the SoC-level test language

It’s not just the choice of HDL: workloads + kernels in industry are often written in SystemC, an event-driven sim extension of C++

  • You don’t have to worry about it until your work uses it tho :D

SystemC is a set of C++ classes and macros which provide an event-driven simulation interface (see also discrete event simulation). These facilities enable a designer to simulate concurrent processes, each described using plain C++ syntax. SystemC processes can communicate in a simulated real-time environment, using signals of all the datatypes offered by C++, some additional ones offered by the SystemC library, as well as user defined. In certain respects, SystemC deliberately mimics the hardware description languages VHDL and Verilog, but is more aptly described as a system-level modeling language. -> https://en.wikipedia.org/wiki/SystemC

University of California, Berkeley

IEEE Student Branch

73 of 82

Analog Macro Verification at SoC Level

We briefly mentioned golden models before

  • A source of truth for digital inputs -> output of a block

At the SoC level, a digital reference model is needed for analog blocks to do SoC-level functional tests

  • Analog mixed signal (AMS) simulations take a lot of time!
  • But options exist: Xcelium, etc
    • The analog team is usually in charge of AMS sims at the IP level

University of California, Berkeley

IEEE Student Branch

74 of 82

Analog Mixed Signal (AMS) Sims

You can’t create digital models for everything .. studies show that SoC interfaces have significantly contributed to chip failures

University of California, Berkeley

IEEE Student Branch

75 of 82

A ‘real’ AMS verification setup (Spectre AMS + Xcelium)

RTL required to drive the PHY

University of California, Berkeley

IEEE Student Branch

76 of 82

Quick Note on Validation

Verification vs Validation - what’s the difference?

University of California, Berkeley

IEEE Student Branch

77 of 82

Of course, everyone’s also adding ML to everything, verification included

tru story

University of California, Berkeley

IEEE Student Branch

78 of 82

Closure & Sign-off

University of California, Berkeley

IEEE Student Branch

79 of 82

Final Sign-Off - remember that verif plan?

Fulfill all the initial criteria

  • ~98+% functional coverage, ~98% code coverage
    • Functional Coverage: How much of the intended functionality has been tested?
    • Code Coverage: Which parts of the RTL code with executed during simulation?
  • Consecutive # of of clean regressions
  • All bugs fixed / closed / acknowledged

University of California, Berkeley

IEEE Student Branch

80 of 82

The Most Familiar Metric: Coverage

The amount my testing covers, right? But what does that mean?

Functional + code coverage closure is one of the major milestones

  • At SoC-level, cumulative regression results / merging of the consecutive regression results are used to close

Functional =/= code coverage - why?

  • Need to justify why functional doesn’t cover it or why it’s there

University of California, Berkeley

IEEE Student Branch

81 of 82

Infrastructure IP (I^2P)

Separate from functional verification - Design for Test techniques

University of California, Berkeley

IEEE Student Branch

82 of 82

Summary of Today

  • Verification the “Right Way”
    • A little history
    • Unit Testing & resume boosting (System Verilog)
    • UVM Preview
    • What to do in EE194
    • System tests at the SoC level
    • Speaking in “Vectors” and ATPG
    • Randomness vs Algorithms
    • Formal verification
    • Metrics of success: coverage
    • Analog - we gotchu! (AMS Sims)

University of California, Berkeley

IEEE Student Branch