CS 250 VLSI Design Lecture 11 Design Verification

Similar documents
CS 250! VLSI System Design

CS 152 Computer Architecture and Engineering

CS 152 Computer Architecture and Engineering Lecture 1 Single Cycle Design

Digital Design Methodology

Lab. Course Goals. Topics. What is VLSI design? What is an integrated circuit? VLSI Design Cycle. VLSI Design Automation

CS 152 Computer Architecture and Engineering

EECS150 - Digital Design Lecture 6 - Logic Simulation

Digital System Design Lecture 2: Design. Amir Masoud Gharehbaghi

Hardware Design Environments. Dr. Mahdi Abbasi Computer Engineering Department Bu-Ali Sina University

DIGITAL DESIGN TECHNOLOGY & TECHNIQUES

Digital Design Methodology (Revisited) Design Methodology: Big Picture

CS2204 DIGITAL LOGIC & STATE MACHINE DESIGN FALL 2005

FPGA Design Flow 1. All About FPGA

Outline. EECS Components and Design Techniques for Digital Systems. Lec 11 Putting it all together Where are we now?

Hardware Modeling using Verilog Prof. Indranil Sengupta Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

SP3Q.3. What makes it a good idea to put CRC computation and error-correcting code computation into custom hardware?

EECS150 - Digital Design Lecture 4 - Verilog Introduction. Outline

EECS150 - Digital Design Lecture 7 - Computer Aided Design (CAD) - Part II (Logic Simulation) Finite State Machine Review

Logic Synthesis. EECS150 - Digital Design Lecture 6 - Synthesis

CS/ECE 5780/6780: Embedded System Design

One and a half hours. Section A is COMPULSORY UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE

EECS150 - Digital Design Lecture 5 - Verilog Logic Synthesis

Lecture #1: Introduction

Don t expect to be able to write and debug your code during the lab session.

ECE 587 Hardware/Software Co-Design Lecture 11 Verification I

CS250 VLSI Systems Design Lecture 8: Introduction to Hardware Design Patterns

Programmable Logic Devices II

Chapter 1 Overview of Digital Systems Design

Hardware Design Verification: Simulation and Formal Method-Based Approaches William K Lam Prentice Hall Modern Semiconductor Design Series

EECS Components and Design Techniques for Digital Systems. Lec 20 RTL Design Optimization 11/6/2007

An Introduction to Programmable Logic

Administrivia. ECE/CS 5780/6780: Embedded System Design. Acknowledgements. What is verification?

EE 466/586 VLSI Design. Partha Pande School of EECS Washington State University

What is Verilog HDL? Lecture 1: Verilog HDL Introduction. Basic Design Methodology. What is VHDL? Requirements

Two HDLs used today VHDL. Why VHDL? Introduction to Structured VLSI Design

Design Methodologies and Tools. Full-Custom Design

COMP12111 Fundamentals of Computer Engineering Paul Nutter Vasilis Pavlidis Comments

ECE 2300 Digital Logic & Computer Organization. More Sequential Logic Verilog

DESIGN STRATEGIES & TOOLS UTILIZED

TOPIC : Verilog Synthesis examples. Module 4.3 : Verilog synthesis

SoC Verification Methodology. Prof. Chien-Nan Liu TEL: ext:

VHDL. VHDL History. Why VHDL? Introduction to Structured VLSI Design. Very High Speed Integrated Circuit (VHSIC) Hardware Description Language

ADVANCED DIGITAL IC DESIGN. Digital Verification Basic Concepts

Functional Programming in Hardware Design

Advanced VLSI Design Prof. Virendra K. Singh Department of Electrical Engineering Indian Institute of Technology Bombay

Choosing an Intellectual Property Core

Logic Verification 13-1

VLSI Test Technology and Reliability (ET4076)

Lecture (05) Boolean Algebra and Logic Gates

Lab 6 Debugging. Objective. Introduction. Prelab

FPGA for Complex System Implementation. National Chiao Tung University Chun-Jen Tsai 04/14/2011

EECS150 - Digital Design Lecture 10 Logic Synthesis

Chapter 6 Objectives

Multi Cycle Implementation Scheme for 8 bit Microprocessor by VHDL

EECS150 - Digital Design Lecture 10 Logic Synthesis

Overview. CSE372 Digital Systems Organization and Design Lab. Hardware CAD. Two Types of Chips

EECS150: Lab 3, Verilog Synthesis & FSMs

101-1 Under-Graduate Project Digital IC Design Flow

EECS150 - Digital Design Lecture 20 - Finite State Machines Revisited

EEL 4783: HDL in Digital System Design

CS250 VLSI Systems Design Lecture 9: Memory

Leveraging Formal Verification Throughout the Entire Design Cycle

L2: Design Representations

Sequential Logic Design

FABRICATION TECHNOLOGIES

More Course Information

ECE/CS Computer Design Lab

VLSI Testing. Virendra Singh. Bangalore E0 286: Test & Verification of SoC Design Lecture - 7. Jan 27,

EECS150 - Digital Design Lecture 6 - Logic Simulation. Encoder Example

Topics. Midterm Finish Chapter 7

Design Process. Design : specify and enter the design intent. Verify: Implement: verify the correctness of design and implementation

CSE A215 Assembly Language Programming for Engineers

Recommended Design Techniques for ECE241 Project Franjo Plavec Department of Electrical and Computer Engineering University of Toronto

ECE 152A LABORATORY 2

Programmable Logic Devices HDL-Based Design Flows CMPE 415

CSE140L: Components and Design Techniques for Digital Systems Lab

problem maximum score 1 10pts 2 8pts 3 10pts 4 12pts 5 7pts 6 7pts 7 7pts 8 17pts 9 22pts total 100pts

Verilog Simulation Mapping

EITF35: Introduction to Structured VLSI Design

A Brief Introduction to Verilog Hardware Definition Language (HDL)

Lab 1: FPGA Physical Layout

CS 152 Computer Architecture and Engineering

Introduction to CMOS VLSI Design (E158) Lecture 7: Synthesis and Floorplanning

Overview. Design flow. Principles of logic synthesis. Logic Synthesis with the common tools. Conclusions

Fundamentals of Digital System Design ECE 3700, CPSC 3700

EECS150: Lab 3, Verilog Synthesis & FSMs

CSE 141L Computer Architecture Lab Fall Lecture 3

Design of Digital Circuits

VLSI Testing. Fault Simulation. Virendra Singh. Indian Institute of Science Bangalore

CS 152 Computer Architecture and Engineering

Testing & Verification of Digital Circuits ECE/CS 5745/6745. Hardware Verification using Symbolic Computation

Overview of Digital Design with Verilog HDL 1

Henry Lin, Department of Electrical and Computer Engineering, California State University, Bakersfield Lecture 7 (Digital Logic) July 24 th, 2012

Boolean Logic CS.352.F12

Electronic Design Automation Prof. Indranil Sengupta Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

EE282H: Computer Architecture and Organization. EE282H: Computer Architecture and Organization -- Course Overview

Overview of Digital Design Methodologies

Synthesis vs. Compilation Descriptions mapped to hardware Verilog design patterns for best synthesis. Spring 2007 Lec #8 -- HW Synthesis 1

CS429: Computer Organization and Architecture

VERILOG HDL. (and C) 1 ENGN3213: Digital Systems and Microprocessors L#5-6

Transcription:

CS 250 VLSI Design Lecture 11 Design Verification 2012-9-27 John Wawrzynek Jonathan Bachrach Krste Asanović John Lazzaro TA: Rimas Avizienis www-inst.eecs.berkeley.edu/~cs250/

IBM Power 4 174 Million Transistors A complex design... First silicon booted AIX & Linux, on a 16-die system. 96% of all bugs were caught before first tape-out. How???

Three main components... (1) Specify chip behavior at the RTL level, and comprehensively simulate it. (3) Technology layer: do the the electrons implement the RTL, at speed and power? (2) Use formal verification to show equivalence between VHDL RTL and circuit schematic RTL. Today, we focus on (1).

But our project isn t a CPU! Camera input frames dx/dt dy/dt Hardwired Optic Flow Algorithm Large SRAMs for image data, etc. Input movie streams == CPU test programs Both are history-dependent. Both exercise a small fraction of state space.

Today: Processor Design Verification Making a test plan Unit techniques State machine How to write test programs

Lecture Focus: Functional Design Test Not manufacturing tests... goal The design correctly executes programs written in the Instruction Set Architecture Correct == meets the Architect s Contract Intel XScale ARM Pipeline, IEEE Journal of Solid State Circuits, 36:11, November 2001

Architect s Contract with the Programmer To the program, it appears that instructions execute in the correct order defined by the ISA. As each instruction completes, the architected machine state appears to the program to obey the ISA. What the machine actually does is up to the hardware designers, as long as the contract is kept. Also: The data sheet contract with board or SOC designer.

When programmer s contract is broken... Testing our financial trading system, we found a case where our software would get a bad calculation. Once a week or so. Eventually, the problem turned out to be a failure in a CPU cache line refresh. This was a hardware design fault in the PC. The test suite included running for two weeks at maximum update rate without error, so this bug was found. Eric Ulevik

A 475M$ Bug

Three models (at least) to cross-check. The contract specification The answer (correct, we hope). Simulates the ISA model in C. Fast. Better: two models coded independently. The Chisel RTL model Logical semantics of the Chisel model we will use to create gates. Runs on a software simulator or FPGA hardware. Chip-level schematic RTL Catch synthesis bugs. Formally verify netlist against Chisel RTL. Also used for timing and power. Where do bugs come from?

Where bugs come from (a partial list)... The contract is wrong. You understand the contract, create a design that correctly implements it, write correct Chisel for the design... The contract is misread. Your design is a correct implementation of what you think the contract means... but you misunderstand the contract. Conceptual error in design. You understand the contract, but devise an incorrect implementation of it... Chisel coding errors. You express your correct design idea in Chisel.. with incorrect Chisel semantics. Also: CAD-related errors. Example: Chisel-to-Verilog translation errors.

For your project: X dx/dt Do bit-by-bit compare of output movie from contract and Chisel. dy/dt y

Optic Flow Contract

Computing Specify all details of fixed-point arithmetic, so that bit-accurate hardware is efficient. y x t

Computing Be sure to specify what happens in the first frame (i.e. what happens on reset) y x t

(2) How to do optimization... Think carefully about commutativity, associativity, overflow and underflow, pros and cons of saturating arithmetic, etc. Reminder: All of your implementations need to be bit-accurate with your contract model... so define it carefully!

Four Types of Testing

Big Bang: Complete Processor Testing Top-down complete how it works Assemble the complete. Execute test program suite on the. Bottom-up Check results. Checks contract model against Chisel RTL. Test suite runs the gamut from 1-line programs to boot the OS.

Methodical Approach: Unit Testing Top-down complete unit how it works Remove a block from the design. Test it in isolation against specification. Bottom-up Requires writing a bug-free contract model for the unit.

Climbing the Hierarchy: Multi-unit Testing Top-down complete multi-unit unit how it works Remove connected blocks from design. Test in isolation against specification. Bottom-up Choice of partition determines if test is eye-opening or a waste of time

Processor Testing with Self-Checking Units Top-down how it works complete with self-checks multi-unit unit Bottom-up Add self-checking to units Perform complete Self-checks are unit tests built into CPU, that generate the right answer on the fly. Slower to simulate.

Testing: Verification vs. Diagnostics Top-down complete with self-checks multi-unit unit Bottom-up Verification: A yes/no answer to the question Does the have one more bug? Diagnostics: Clues to help find and fix the bug. Diagnosis of bugs found during complete is hard...

CPU program diagnosis is tricky... Observation: On a buggy CPU model, the correctness of every executed instruction is suspect. Consequence: One needs to verify the correctness of instructions that surround the suspected buggy instruction. Depends on: (1) number of instructions in flight in the machine, and (2) lifetime of non-architected state (may be indefinite ).

State observability and controllability Top-down complete with self-checks multi-unit unit Bottom-up Observability: Does my model expose the state I need to diagnose the bug? Controllability: Does my model support changing the state value I need to change to diagnose the bug? Support!= yes, just rewrite the model code!

Writing a Test Plan

The timeline... Top-down complete Plan in advance what tests to do when... Epoch 1 Epoch 2 Epoch 3 Epoch 4 with self-checks multi-unit Time unit Bottom-up assembly complete correctly executes single instructions correctly executes short programs

An example test plan... Top-down complete with self-checks multi-unit Epoch 1 Epoch 2 Epoch 3 Epoch 4 unit early multi unit later with self-checks multi-unit unit diagnostics with self-checks multi-unit unit diagnostics complete verification with self-checks diagnostics unit Bottom-up assembly complete correctly executes single instructions correctly executes short programs Time

Unit Testing

Combinational Unit Testing: 3-bit Adder Cin Number of input bits? 7 A 3 + 3 Sum Total number of possible input values? 2 7 = 128 B 3 Just test them all... Cout Apply test vectors 0,1,2... 127 to inputs. 100% input space coverage Exhaustive

Combinational Unit Testing: 32-bit Adder Cin Number of input bits? 65 A 32 + 32 Sum Total number of possible input values? 2 65 = 3.689e+19 B 32 Cout Just test them all? Exhaustive does not scale. Combinatorial explosion!

Test Approach 1: Random Vectors Cin how it works A B 32 32 + 32 Sum Apply random A, B, Cin to adder. Check Sum, Cout. Cout When to stop? Bug curve. Bug Rate Bugs found per minute of Time

Test Approach 2: Directed Vectors A B 32 32 Cin + Directed random... 32 Sum how it works Hand-craft test vectors to cover corner cases A == B == Cin == 0 Cout Black-box : Corner cases based on functional properties. Clear-box : Corner cases based on unit internal structure.

State Machine Testing CPU design examples DRAM controller state machines Cache control state machines Branch prediction state machines

Testing State Machines: Break Feedback Rst Change Next State Combinational Logic D Q R D Q G D Q Y Isolate Next State logic. Test as a combinational unit. Easier with certain HDL coding styles...

Testing State Machines: Arc Coverage Rst == 1 Change == 1 R Y G 1 0 0 R Y G Change == 1 0 0 1 Change == 1 R Y G 0 1 0 Force machine into each state. Test behavior of each arc. Intractable for state machines with high edge density...

Regression Testing Or, how to find the last bug...

Writing complete CPU test programs Top-down complete with self-checks Single instructions with directed-random field values. Epoch 1 Epoch 2 Epoch 3 Epoch 4 with self-checks White-box Instructions-inflight sized programs that stress design. with self-checks complete multi-unit Time unit Bottom-up assembly complete correctly executes single instructions correctly executes short programs Tests that stress long-lived non-architected state. Regression : re-run subsets of the test library, and then the entire library, after a fix.

Formal Verification: How does it work? Cadence Labs + EECS Adjunct Prof. Verity - a Formal Verification Program for Custom CMOS Circuits Andreas Kuehlmann Arvind Srinivasan David P. LaPotin Boolean Equivalence Checking. How can you show two RTL descriptions are equivalent using static techniques? We begin by formally defining the problem...

The formal problem statement... Verilog RTL State Machine C A : Combinational logic. S A : Flip-flops. Question: If we initialize flip-flops appropriately... x x A FSM A C A y A z A z A S A Clk Reset A brief sketch of how the tool goes about answering the question... c For any sequence of input vectors Xo, X1,... C B : Combinational logic. S B : Flip-flops. Schematic State Machine B x FSM B z B C B S B Clk Reset z B B y Will C ever be 1? If no, the Verilog and schematic RTLs are Booleanequivalent.

FSM Equivalence: A two-step algorithm (1) Flip-flop equivalence. We assume we can find all flip-flops in RTL for each FSM. If the FSMs do not have the same number of flip-flops, FSMs not EQ. x x A FSM A C A y A z A z A S A Clk Reset (2) Prove C A = C B. Like proving DeMorgan s theorem for a homework assignment... an exercise in symbolic manipulation. c Otherwise, run an algorithm to reorder S A (and thus C A ) to match S B. Trivial solution: the user names the flip-flops. But modern tools can do it automatically. B x FSM B z B C B S B Clk Reset z B B y But the symbols are manipulated by a computer program... and the functions are very large! Rocket science would start here...

Conclusion -- Testing Processors" Bottom-up test for diagnosis, top-down test for verification. Unit : avoiding combinatorial explosions. Complete CPU tests: write programs that stress the hard parts of the design. Make your plan early! After the break: Chisel tips.

Next Week: Transition to Project Mode