24
Giovanni Squillero [email protected] Copyright is held by the author/owner(s). GECCO’08, July 12–16, 2008, Atlanta, Georgia, USA. ACM 978-1-60558-131-6/08/07. Giovanni Squillero [email protected] Electronic circuit Levels of descriptions Gate, RT, Behavioral Comparison with programs Verification, Validation and Test Part I - Background G. Squillero 3 Electric signals represent logical values Discrete set of values (0, 1, X, …) Simplified timing information Logic gates Logical operation on one or more inputs Single output Part I - Background G. Squillero 4 1 1 1 AND GECCO 2008 Tutorial / EA-based Test and Verification of Microprocessors 2665

Giovanni Squillero - University of Birminghamwbl/biblio/gecco2008/docs/p2665.pdf · Giovanni Squillero [email protected] Electronic circuit Levels of descriptions Gate,

Embed Size (px)

Citation preview

Giovanni [email protected]

Copyright is held by the author/owner(s).

GECCO’08, July 12–16, 2008, Atlanta, Georgia, USA.

ACM 978-1-60558-131-6/08/07.

Giovanni [email protected]

�Electronic circuit

�Levels of descriptions

�Gate, RT, Behavioral

� Comparison with programs

�Verification, Validation and Test

Part I - Background G. Squillero 3

�Electric signals represent logical values

�Discrete set of values (0, 1, X, …)

� Simplified timing information

�Logic gates

� Logical operation on one or more inputs

� Single output

Part I - Background G. Squillero 4

11 1

AND

GECCO 2008 Tutorial / EA-based Test and Verification of Microprocessors

2665

Part I - Background G. Squillero 5

1

1 0

0

Part I - Background G. Squillero 6

11

11 1011

01

10

Part I - Background G. Squillero 7

1

1 0

0

if anything can go wrong, it will…

Part I - Background G. Squillero 8

GECCO 2008 Tutorial / EA-based Test and Verification of Microprocessors

2666

Part I - Background G. Squillero 9

� Industry goal:

�Detect bad devices just after production

�Apply a set of input stimuli able to discriminate

malfunctioning devices from working ones

�Problems:

�How to devise a suitable “set of input stimuli”?

Part I - Background G. Squillero 10

�Fault vs. Defect vs. Error

�Fault models

� Stuck-at, stuck open

� Bridging

�Delay (path, gate, transitional, …)

�…

�Single vs. Multiple

�Permanent vs. Transient

Part I - Background G. Squillero 11

ab

cy

Ux

y/0

Part I - Background G. Squillero 12

�Test Generation

� Excitation: y = 1 {abc = - - 0 }

� Propagation: x = 0 {abc = 0 - - , - 0 - }

� Final test = excitation · propagation

�Test = {- - 0} · {0 - - , - 0 - } = {0 - 0 , - 00 }

= {000, 100, 010}ab

cy

Ux

y/0

GECCO 2008 Tutorial / EA-based Test and Verification of Microprocessors

2667

An electronic design automation method/technology used to find an input sequence that, when applied to a digital circuit, enables testers to distinguish between the correct circuit behavior and the faulty circuit behavior caused by defects

(Wikipedia)

Part I - Background G. Squillero 13 Part I - Background G. Squillero 14

ab

y

Ux

y/0

�Defect coverage (FC%)

�Fault coverage (FC%)

�Testable fault coverage (TC%)

�Fault efficiency

�…

Part I - Background G. Squillero 15

�Gate

�Register Transfer

�Behavioral

Part I - Background G. Squillero 16

GECCO 2008 Tutorial / EA-based Test and Verification of Microprocessors

2668

�EDIF

�BLIF

�VHDL

�Verilog

�SystemVerilog

�SystemC

�…

Part I - Background G. Squillero 17

�Can be simulated?

�Can be synthesized?

�How?

Part I - Background G. Squillero 18

architecture RTL of MY_AND is

begin process(x, y)

begin

if ((x='1') and (y='1')) then

F <= '1';

else

F <= '0';

end if;

end process;

end foo;

Part I - Background G. Squillero 19

architecture BEHAV of FOOBAR is

signal A, B: BIT_VECTOR(3 downto 0);

beginA(0) <= X after 20ns;

A(1) <= Y after 40ns;

process(A)

variable P, Q: BIT_VECTOR(3 downto 0);

begin

P := fft(A);

B <= P after 10ns;

end process;

Z <= B;

end foo;

Part I - Background G. Squillero 20

GECCO 2008 Tutorial / EA-based Test and Verification of Microprocessors

2669

architecture BEHAV of FOOBAR is

signal A, B: BIT_VECTOR(3 downto 0);

beginA(0) <= X after 20ns;

A(1) <= Y after 40ns;

process(A)

variable P, Q: BIT_VECTOR(3 downto 0);

begin

P := fft(A);

B <= P after 10ns;

end process;

Z <= B;

end foo;

Part I - Background G. Squillero 21

�Can be simulate

�Not executed

�Description of a physical hardware

�Not imperative language

Part I - Background G. Squillero 22

Part I - Background

if (rst='0') then

REG1(j) <= (REG1(j)'range => '0');

REG2(j) <= (REG2(j)'range => '0');

COEF(j) <= (COEF(j)'range => '0');

MULT16(j) <= (MULT16(j)'range => '0');

SUM(j) <= (SUM(j)'range => '0');

elsif (clk'event and clk ='1') then

REG1(j) <= REG2(j+1);

REG2(j) <= REG1(j);

if (coef_ld = '1') then

COEF(j) <= COEF(j+1);

end if;

MULT8(j) <= signed(REG1(j))*signed(COEF(j));G. Squillero 23

�Very active line of research

� Industrially relevant

�Missing an suitable fault model

�Missing correlation (high-level to lo low-level

metrics)

�A+Bvs. A*B

Part I - Background G. Squillero 24

GECCO 2008 Tutorial / EA-based Test and Verification of Microprocessors

2670

�Validation

� Evaluate whether a system accomplishes its

intended requirements

�Are we building the right system?

�Verification

� Evaluate whether a system complies with the

conditions imposed at the start of a development

phase

�Are we building the system right?

Part I - Background G. Squillero 25

�Verification

� Formal verification (e.g., mathematical models

and theorem proving)

� Simulation and assertion (i.e., properties) checks

� Comparison with a golden model

�Validation

� Sometimes confused with verification

Part I - Background G. Squillero 26

Giovanni [email protected]

�Micros challenges

� Size

� Complexity

� Competitive pressure

Part II - Modern Micros G. Squillero 28

GECCO 2008 Tutorial / EA-based Test and Verification of Microprocessors

2671

Part II - Modern Micros G. Squillero 29 Part II - Modern Micros G. Squillero 30

Itanium

P4

XEON

Pentium IIIPentium80486

4004

Pentium Pro

Itanium 2

Part II - Modern Micros G. Squillero 31

Itanium

P4

XEON

Pentium IIIPentium80486

4004

Pentium Pro

Itanium 2

� Intel 4004 (world's first commercial

microprocessor)

� Released in late 1971

�Discontinued in 1981

� 4-bit CPU

� 2,300 transistors

� 740 kHz

� Execute approx 92,000 instructions/sec

Part II - Modern Micros G. Squillero 32

GECCO 2008 Tutorial / EA-based Test and Verification of Microprocessors

2672

�Pentium 4

� Released in late 2000

� 32-bit CPU

� 42,000,000 to 55,000,000

transistors

� 1.40 GHz (initial) to

3.40 GHz (Northwood C, 2004)

� Execute up to 10,000,000,000

instructions/sec

Part II - Modern Micros G. Squillero 33

�20,000 times bigger

�100,000 times faster

Part II - Modern Micros G. Squillero 34

�Scalar architecture

�Superscalar architecture

Part II - Modern Micros G. Squillero 35

�Strategies

� Cache

� Branch prediction

� Parallelism

� Pipeline

�Out-of-order execution

� Speculative execution

� Simultaneous multithreading

�Multi-core design

Part II - Modern Micros G. Squillero 36

GECCO 2008 Tutorial / EA-based Test and Verification of Microprocessors

2673

�Relatively small volumes

�Complex structure, innovative design

�Unstable technology

�PC, Laptop

�High cost (hundreds of Euros)

Part II - Modern Micros G. Squillero 37

�High volumes

�Relatively simple

�Stable technology

�Embedded in other systems (e.g., USB

controllers)

�Low cost (usually less than €1)

Part II - Modern Micros G. Squillero 38

�A wide range of solutions

� 8- to 32- bit microcontrollers

�Variable clocks and performances

�Variable memory

�Variable costs

�Today high-end micros will be the core of

tomorrow microcontrollers…

� E.g., Freescale Power Architecture for

microcontrollers

Part II - Modern Micros G. Squillero 39

�Semantic does matter!

� Input stimuli must be regarded as programs

and not simply as binary data

Part II - Modern Micros G. Squillero 40

GECCO 2008 Tutorial / EA-based Test and Verification of Microprocessors

2674

�Design are too complex to run logic simulation

�One logic simulation is required to evaluate the

effect of each fault

� The number of faults is roughly two times the

number of gates

�Which fault model?

Part II - Modern Micros G. Squillero 41

�Design are too complex for exact verification

� Simplified models?

� Simulation-based approaches?

� Instructions randomizers

�Designs are too complex for running extensive

simulations

� Pre-synthesis vs. post-synthesis verification

Part II - Modern Micros G. Squillero 42

Part II - Modern Micros G. Squillero 43

YELD ANALYSIS

VERIFICATION

VERIFICATION

VERIFICATION

VERIFICATION

VERIFICATION

TEST

GENERATION

VERIFICATION

VERIFICATION

POWER

VERIFICATION

SILICON DEBUG

Giovanni [email protected]

GECCO 2008 Tutorial / EA-based Test and Verification of Microprocessors

2675

�Design choices

�Proposed methodology

� Stimuli

� System

� Stimuli generator

� Feedback

Part III - Methodology G. Squillero 45

�Being able to tackle real problems

�Uniform approach

� Exploit underlying common aspects

�Minimize effort to change goal/target

Part III - Methodology G. Squillero 46

�Pros:

�Uncover design errors by detecting incorrect

behaviors when tests are applied

�May be usable on under-specified models

�May require limited computational resources

�Cons:

�Only consider a limited range of behaviors

�Never achieve 100% confidence of correctness

Part III - Methodology G. Squillero 47

�Exploits feedback from simulation

� Incremental improvement/refinement of the

solutions (trial-and-error)

�Trade-off between computational resources

and confidence

�May exploit heuristics (e.g., evolutionary core)

or problem-specific knowledge

Part III - Methodology G. Squillero 48

GECCO 2008 Tutorial / EA-based Test and Verification of Microprocessors

2676

Part III - Methodology G. Squillero 49

Stimuli

Generator

System

Stimuli

Feedback

�Stimuli Generator

� EA-based system

�Feedback

� Fitness

Part III - Methodology G. Squillero 50

�Exploit an Evolutionary Algorithm to generate

stimuli to maximize a given fitness function

�Does not require in-depth knowledge

� Trial and error

�Adaptative

�Able to find unexpected solutions

�Human competitive

� Better than random

Part III - Methodology G. Squillero 51 Part III - Methodology G. Squillero 52

Evolutionary

Algorithm

System

Stimuli

Fitness

GECCO 2008 Tutorial / EA-based Test and Verification of Microprocessors

2677

�Maximization

� Test (maximize FC%)

�Verification (maximize tested functionalities)

�…

�Needle in a haystack

� Find a counter-example

� Find a bug

�…

Part III - Methodology G. Squillero 53

�Transform needle-in-a-haystack problems into

maximization problems

�Smooth fitness landscape

� Intermediate goal

�Heuristic

�Problem-specific knowledge

�Favor exploration

Part III - Methodology G. Squillero 54

Part III - Methodology G. Squillero 55

Evolutionary

Algorithm

System

Stimuli

Fitness

�Valid assembly language programs

� Exploit all syntax

� Instruction asymmetries

� Subroutines/Interrupt handlers

�Microprocessor peculiarities

� Register windows on SPARC

� Global Descriptor Table and protected mode in IA86

Part III - Methodology G. Squillero 56

GECCO 2008 Tutorial / EA-based Test and Verification of Microprocessors

2678

�Lower than assembly?

� Even assembly is a high-level language (e.g., in

x86 the same opcode corresponds to different

machine code instructions)

Part III - Methodology G. Squillero 57

�External world?

� In order to check a device (e.g., a I/O block)

external stimuli must be considered

�Highly correlated

Part III - Methodology G. Squillero 58

�Our tool: MicroGP

Part III - Methodology G. Squillero 59

�MicroGP++ (µGP3)

� CAD Group general-purpose evolver

� Project started in 2002

� 3 versions (only 2 released through sourceforge)

� 8 developers, plus several contributors

�Actual version: 3.1

� ≈15,000 lines in C++

� Plus some utilities in different languages

�MOEA in version 3.1 (stable in late 2008?)

Part III - Methodology G. Squillero 60

GECCO 2008 Tutorial / EA-based Test and Verification of Microprocessors

2679

Part III - Methodology G. Squillero 61

µGP3µGP3

Part III - Methodology G. Squillero 62

µGP3µGP3

Part III - Methodology G. Squillero 63

µGP3µGP3

#-asm-stsha %r4, [%l3] 18bneg n23ldsha [%i2] 2, %r7

n23:cb23 n29rd %asr16, %sp…

Part III - Methodology G. Squillero 64

GECCO 2008 Tutorial / EA-based Test and Verification of Microprocessors

2680

Part III - Methodology G. Squillero 65 Part III - Methodology G. Squillero 66

�Multiple populations

�Variable & self adapted� Offspring and Population size

� Selective pressure

� Operation probabilities

�Behavior range smoothly from pure steady state to pure generational

� Entropy-based technique to favor diversity

�Clone detection

�…

Part III - Methodology G. Squillero 67 Part III - Methodology G. Squillero 68

http://ugp3.sourceforge.net /

MicroGP++ (aka. ugp3, µGP 3)• Information• Download• Credits

GECCO 2008 Tutorial / EA-based Test and Verification of Microprocessors

2681

�System

� The microprocessor

�Helper module

Part III - Methodology G. Squillero 69

� (Obviously) problem dependant

�Model via simulation/emulation

�HDL (netlist to high-level)

�HW accelerated (e.g., exploiting FPGA)

�Architectural simulator

� ISA simulator

�Real device

Part III - Methodology G. Squillero 70

�Usually a collection of scripts

�Apply stimuli

�Analyze behavior

�Translate output to fitness

e.g., a file containing a list of real numbers

Part III - Methodology G. Squillero 71

�From simulation

� Code coverage metrics (instruction, branch, …)

�HW specific metrics (toggle coverage)

�High-level information (FSM coverage)

�From running the real microprocessor

� Performance counters

� Physical measures (temperature, time)

Part III - Methodology G. Squillero 72

GECCO 2008 Tutorial / EA-based Test and Verification of Microprocessors

2682

Giovanni [email protected]

�Design verification

�Post-silicon verification

�Test

Part IV - Case Studies G. Squillero 74

�Generate test-program for pre-silicon verification

�Verify that a microprocessor conforms to its specification

�Devise a set of programs able to excite all functionalities and corner cases

�Simulate the design against the reference model

Part IV - Case Studies G. Squillero 75

�DLX/pII

� Cleaned and simplified MIPS intended primarily

for teaching purposes

� 32-bit load/store architecture

� 5-stage pipeline

� RTL description (about 1,000 statements)

Part IV - Case Studies G. Squillero 76

GECCO 2008 Tutorial / EA-based Test and Verification of Microprocessors

2683

�Code coverage metrics

� Parts of the description that the have been

evaluated by the HDL simulator

� Caveat: it is not a program

�HW specific metric

Part IV - Case Studies G. Squillero 77

�Code coverage metrics

� Statement coverage

� Branch coverage

� Condition coverage

� Expression coverage

�HW specific metric

� Toggle coverage

Part IV - Case Studies G. Squillero 78

Part IV - Case Studies G. Squillero 79

0.0%

10.0%20.0%

30.0%40.0%

50.0%

60.0%70.0%

80.0%90.0%

100.0%

Statementcoverage

Branchcoverage

Conditioncoverage

Expressioncoverage

Togglecoverage

Functional (531)

Random (230K)

Enhanced (2978)

�Generate functional test-program for post-silicon verification

�The generated test programs

� could be added as new content to improve

existing validation suites

� can be used to perform regression testing on

future processor models

�Activity performed in collaboration with the Embedded Test Methodology Group, Intel

Part IV - Case Studies G. Squillero 80

GECCO 2008 Tutorial / EA-based Test and Verification of Microprocessors

2684

� Intel Pentium 4

� 55 millions transistor

� 5 millions gate (my unreliable estimate)

� 2GHz clock

�NetBurst architecture

Part IV - Case Studies G. Squillero 81

�Performance counters

� Introduced in 1993 in IA-32 architecture

� P4 Counters architecture:

� 48 event detectors

� 18 event counters

� 18 counter configuration control registers

� Instruction-tagging (for discriminating non-

speculative performance events)

Part IV - Case Studies G. Squillero 82

�Use monitors as a proxy for the creation of

certain µarchitectural events to

� stress specific features

� excite subtle corner cases

Part IV - Case Studies G. Squillero 83 Part IV - Case Studies G. Squillero 84

Generator

candidatetest

program

feedback

Assemblysyntax

Evaluator

Target µPdescription

Host µP Host µP

GECCO 2008 Tutorial / EA-based Test and Verification of Microprocessors

2685

Part IV - Case Studies G. Squillero 85

Generator

candidatetest

program

feedback

Assemblysyntax

Evaluator

Target µP counters

G. Squillero

�Maximize/minimize the ratio of mispredicted

branches over the total branches

� only non-speculative (retired) instructions are

considered.

� controlling the branch prediction rate is challenging

(the approach is, by definition, random)

� could generate interesting code for exciting corner-

case events

� may cover flaws that would be hardly detected by

manually-written targeted tests

Part IV - Case Studies 86

G. Squillero

Time EventRandom [max] 278 6.01 5.93Random [min] 426 0.1 0Random [avg] 353.87 1.63 1.33Random [std] 91.91 2.11 2.19µGP (maximizing) 442 49.34 49.55µGP (minimizing) 266 0.02 0.01

Program #INSTSampling Type

Part IV - Case Studies 87 G. Squillero

�Max/Min ratio of clock cycles in which the

trace cache is delivering µops to the execution

unit instead of decoding or building traces

� intrinsic feature of the µarchitectural design

� tests programs not biased to any specific solutions

� likely cover multiple cases, while an architect

would target specific features

� hard metric

Part IV - Case Studies 88

GECCO 2008 Tutorial / EA-based Test and Verification of Microprocessors

2686

G. Squillero

Time EventRandom [max] 6 99.32 98.13

Random [minT] 5 85.39

Random [minE] 53 81.46

Random [avg] 32.13 91.68 88.58Random [std] 21.52 4.38 4.75

µGP (maximizingT) 36 99.49

µGP (maximizingE) 40 93.94

µGP (minimizingT) 5 48.13

µGP (minimizingE) 55 23.33

Program #INSTSampling Type

Part IV - Case Studies 89

�Devise a test-set suitable for post-production test (i.e., a program that enables testers to distinguish between the correct circuit behavior and the faulty circuit behavior caused by defects)

Part IV - Case Studies G. Squillero 90

�PLASMA (MIPS I)

� 3-stage pipelined processor

� Processor design models

� Architectural level

� RTL

� Gate - level

Part IV - Case Studies G. Squillero 91 Part IV - Case Studies G. Squillero 92

Specs

ISS

Simulatable

Model

High level RTL

Hybrid

Netlist

Architectural

Models

RTL

Models

Gate-Level

Models

Detailed RTL

Gate-Level

µP Specifications

Production Physical Circuit

Verification

Verification

Verification

.

.

.

Test

GECCO 2008 Tutorial / EA-based Test and Verification of Microprocessors

2687

� In each step a test-set is generated

�Already available test set are the starting

point for current step

� Incremental generation

�MicroGP exploits the Borg

�Designer functional testbenches can be exploited

by the automatic tool

�Manual tuning

Part IV - Case Studies G. Squillero 93 Part IV - Case Studies G. Squillero 94

F. C.

100%

µProcessorSpecifications

Functional Code

Coverage Statement

Coverage

Toggle

Coverage

Branch

Coverage

Toggle

Act ivity

Toggle

Act ivity

tuning

Design Abstraction Level

Archietctural RT Gate

Part IV - Case Studies G. Squillero 95

FC [%]

0,010,020,030,040,050,060,070,080,090,0

100,0

ISA RTL RTL RTL RTL RTL Gate Gate Gate

Manual µGP µGP µGP µGP µGP µGP µGP Manual

7,0 5,0 2,1 2,4 2,7 2,9 8,1 21,0 28,0

FC [%]

GECCO 2008 Tutorial / EA-based Test and Verification of Microprocessors

2688