02/10/06EECS150 Lab Lecture #41 Debugging EECS150 Spring 2006 – Lab Lecture #4 Philip Godoy Greg Gibeling.

Slides:



Advertisements
Similar presentations
1 Brief Introduction to Verilog Weiping Shi. 2 What is Verilog? It is a hardware description language Originally designed to model and verify a design.
Advertisements

ECE 551 Digital System Design & Synthesis Lecture 08 The Synthesis Process Constraints and Design Rules High-Level Synthesis Options.
Annoucements  Next labs 9 and 10 are paired for everyone. So don’t miss the lab.  There is a review session for the quiz on Monday, November 4, at 8:00.
Programming Types of Testing.
ECE 551 Digital System Design & Synthesis Lecture 09 Synthesis of Common Verilog Constructs.
2/24/2006EECS150 Lab Lecture #61 N64 Controller (Project Checkpoint#1) EECS150 Spring2006 – Lab Lecture #6 Philip Godoy Guang Yang Greg Gibeling.
1/27/06EECS150 Lab Lecture #21 Designing with Verilog EECS150 Spring 2006 – Lab Lecture #2 Brian Gawalt Greg Gibeling.
1/20/2006EECS150 Lab Lecture #11 EECS150 Intro. & CAD Tools EECS150 Spring 2006 Lab Lecture #1 David Lin.
Design for Testability
ECE Synthesis & Verification1 ECE 667 Spring 2011 Synthesis and Verification of Digital Systems Verification Introduction.
2/16/2007EECS150 Lab Lecture #51 Logic Analyzers EECS150 Spring 2007 – Lab Lecture #5 Shah Bawany.
2/17/2006EECS150 Lab Lecture #51 Logic Analyzers EECS150 Spring 2006 – Lab Lecture #5 David Lin Greg Gibeling.
16/27/2015 3:38 AM6/27/2015 3:38 AM6/27/2015 3:38 AMTesting and Debugging Testing The process of verifying the software performs to the specifications.
9/5/2008EECS150 Lab Lecture #21 Designing with Verilog EECS150 Fall Lab Lecture #2 Chen Sun Adopted from slides designed by Greg Gibeling.
2/9/2007EECS150 Lab Lecture #41 Debugging EECS150 Spring2007 – Lab Lecture #4 Laura Pelton Greg Gibeling.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE VLSI System Design Lecture 4 - Advanced Verilog.
8/31/2007EECS150 Lab Lecture #11 EECS150 Intro. & CAD Tools EECS150 Fall 2007 Lab Lecture #1 Shah Bawany.
1/19/2007EECS150 Lab Lecture #11 EECS150 Intro. & CAD Tools EECS150 Spring 2008 Lab Lecture #1 Ke Xu.
10/31/2008EECS150 Lab Lecture #10 The Waveform Generator EECS150 Fall Lab Lecture #10 Chris Fletcher Adopted from slides designed by Chris Fletcher.
Overview Logistics Last lecture Today HW5 due today
Guest Lecture by Ben Magstadt CprE 281: Digital Logic.
Guest Lecture by Ben Magstadt CprE 281: Digital Logic.
1 COMP541 State Machines Montek Singh Feb 8, 2012.
Introduction to CMOS VLSI Design Test. CMOS VLSI DesignTestSlide 2 Outline  Testing –Logic Verification –Silicon Debug –Manufacturing Test  Fault Models.
ASIC/FPGA design flow. FPGA Design Flow Detailed (RTL) Design Detailed (RTL) Design Ideas (Specifications) Design Ideas (Specifications) Device Programming.
Some Course Info Jean-Michel Chabloz. Main idea This is a course on writing efficient testbenches Very lab-centric course: –You are supposed to learn.
ECE 551 Digital System Design & Synthesis Fall 2011 Midterm Exam Overview.
Testing and Debugging Version 1.0. All kinds of things can go wrong when you are developing a program. The compiler discovers syntax errors in your code.
Debugging Strategies from Software Carpentry. Agan's Rules Many people make debugging harder than it needs to be by: Using inadequate tools Not going.
Slide 1 6. VHDL/Verilog Behavioral Description. Slide 2 Verilog for Synthesis: Behavioral description Instead of instantiating components, describe them.
1 CSE-308 Digital System Design (DSD) N-W.F.P. University of Engineering & Technology, Peshawar.
Module 1.2 Introduction to Verilog
Moving Arrays -- 1 Completion of ideas needed for a general and complete program Final concepts needed for Final Review for Final – Loop efficiency.
1 Ch. 1: Software Development (Read) 5 Phases of Software Life Cycle: Problem Analysis and Specification Design Implementation (Coding) Testing, Execution.
BMTRY 789 Lecture 11: Debugging Readings – Chapter 10 (3 rd Ed) from “The Little SAS Book” Lab Problems – None Homework Due – None Final Project Presentations.
Modern VLSI Design 4e: Chapter 8 Copyright  2008 Wayne Wolf Topics Modeling with hardware description languages (HDLs).
1 Debugging and Syntax Errors in C++. 2 Debugging – a process of finding and fixing bugs (errors or mistakes) in a computer program.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 11 – gdb and Debugging.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL State Machines Anselmo Lastra.
Introduction to ASIC flow and Verilog HDL
Lecture 1 – Overview (rSp06) ©2008 Joanne DeGroat, ECE, OSU -1- Functional Verification of Hardware Designs EE764 – Functional Verification of Hardware.
CSE 311 Foundations of Computing I Lecture 28 Computability: Other Undecidable Problems Autumn 2011 CSE 3111.
1 COMP541 Finite State Machines - 1 Montek Singh Sep 22, 2014.
2/3/2006EECS150 Lab Lecture #31 Implementation of FSMs EECS150 Spring 2006 – Lab Lecture #3 Guang Yang Greg Gibeling.
2/2/07EECS150 Lab Lecture #31 Verilog Synthesis & FSMs EECS150 Spring 2007 – Lab Lecture #3 Brent Mochizuki Greg Gibeling.
CprE 281: Verilog Tutorial Ben Magstadt – Master’s Student Electrical Engineering.
Penn ESE370 Fall DeHon 1 ESE370: Circuit-Level Modeling, Design, and Optimization for Digital Systems Day 24: November 5, 2012 Synchronous Circuits.
EE3A1 Computer Hardware and Digital Design Lecture 1 The Role of Hardware Description Languages.
Lecture 1 – Overview (rSp06) ©2008 Joanne DeGroat, ECE, OSU -1- Functional Verification of Hardware Designs EE764 – Functional Verification of Hardware.
A few m3 tips. Street Segment Length / Travel Time Need to compute in double precision –Otherwise too much round off See piazza.
Lecture 5: Design for Testability. CMOS VLSI DesignCMOS VLSI Design 4th Ed. 12: Design for Testability2 Outline  Testing –Logic Verification –Silicon.
1 COMP541 Sequential Logic – 2: Finite State Machines Montek Singh Feb 29, 2016.
Overview Logistics Last lecture Today HW5 due today
Figure 8.1. The general form of a sequential circuit.
Cracking the Coding Interview
CSCE 315 – Programming Studio, Fall 2017 Tanzir Ahmed
CSE 311 Foundations of Computing I
EECS150 Intro & CAD Tools EECS150 Fall Lab Lecture #1
Logic Analyzers EECS150 Fall Lab Lecture #5 Arjun Singh
EECS150 Fall 2007 – Lab Lecture #4 Shah Bawany
Debugging EECS150 Fall Lab Lecture #4 Sarah Swisher
Designing with Verilog
Lecture 9: Testbench and Division
Debugging EECS150 Fall Lab Lecture #4 Sarah Swisher
The SDRAM Controller EECS150 Fall Lab Lecture #8 Chen Sun
Logic Analyzers EECS150 Fall Lab Lecture #5 Arjun Singh
Design of Digital Circuits Lab 6 Supplement: Testing the ALU
ECE 352 Digital System Fundamentals
Verilog Synthesis & FSMs
Presentation transcript:

02/10/06EECS150 Lab Lecture #41 Debugging EECS150 Spring 2006 – Lab Lecture #4 Philip Godoy Greg Gibeling

02/10/06EECS150 Lab Lecture #42 Today (1) Lab #2 Solution Simulation vs Hardware Debugging Goals Tips Algorithm Administrative Info

02/10/06EECS150 Lab Lecture #43 Today (2) Lab #4 Bottom Up Testing (Peak Detector) Designing Test Hardware (Broken Adder) Exhaustive FSM Testing (Broken FSM)

02/10/06EECS150 Lab Lecture #44 module Accumulator(In, Out, Enable, Clock, Reset); input[7:0]In; output[7:0]Out; inputEnable; inputClock, Reset; reg[7:0]Out; (posedge Clock) begin if (Reset) Out <=8'h00; else if (Enable) Out <=Out + In; end endmodule Lab #2 Solution (1)

02/10/06EECS150 Lab Lecture #45 Lab #2 Solution (2)

02/10/06EECS150 Lab Lecture #46 Lab #2 Solution (3) Accumulator Simple, easy to build What is the actual circuit? Get used to answering this in your head RTL View from Lab #1 (Section 4.3 Synthesis) Peak Detector Hard to build Minute control of hardware Tools couldn’t optimize though!!

02/10/06EECS150 Lab Lecture #47 Simulation vs. Hardware (1) Debugging in Simulation Slow Running Time Fast Debugging Waveforms Text messages Full Visibility Can examine any signal Easy to Fix A few minutes to compile and resimulate

02/10/06EECS150 Lab Lecture #48 Simulation vs. Hardware (2) Debugging in Hardware Fast Running Time Full speed in fact Slow Debugging Synthesis can take hours Little or No Visibility Very hard to probe signals Maybe Impossible to Fix (ASICs)

02/10/06EECS150 Lab Lecture #49 Simulation vs. Hardware (3) Simulation Functional Testing & Verification Test everything at least minimally Fully Verify what you can This will save you many sleepless nights Hardware Debugging Treat this as a last resort It is painful

02/10/06EECS150 Lab Lecture #410 Debugging (1) Debugging Algorithm Hypothesis: What’s broken? Control: Give it controlled test inputs Expected Output: What SHOULD it do? Observe: Did it work right? If it broke: THAT’S GREAT! If we can’t break anything like this then the project must be working…

02/10/06EECS150 Lab Lecture #411 Debugging (2) First, check for Verilog syntax errors Run Synthesis on the module View Synthesis report to see errors Don’t debug randomly Just changing things at random often makes things look fixed It won’t really help Debug systematically Your first design may be the best

02/10/06EECS150 Lab Lecture #412 Debugging (3) High Level Debugging Localize the problem N64? SDRAM? Video? Test Patterns Lets you easily isolate the broken component If you know exactly what’s going in you can check what’s coming out

02/10/06EECS150 Lab Lecture #413 Debugging (4) Simulate the broken component(s) Writing test benches takes less time than sitting around wondering why its broken Everyone hates writing testbenches (Even the TA’s) You will hate hardware debugging more Get used to it

02/10/06EECS150 Lab Lecture #414 Debugging (5) Your best debugging tool is logic If 3 out of 4 components work, what’s broken? Question all your assumptions! Just because you think its true doesn’t mean it is 90% of debugging time is wasted debugging the wrong problem otherwise Given solutions and modules may not work the way you expect!

02/10/06EECS150 Lab Lecture #415 Debugging (6) Before you change anything Understand exactly what the problem is Find an efficient solution Evaluate alternative solutions After the change Fixes may make things worse sometimes May uncover a second bug May be an incorrect fix Repeat the debugging process

02/10/06EECS150 Lab Lecture #416 Debugging (7) Ask around Someone else may have had the same bug They’ll probably at least know about where the problem is Different bugs may produce the same results TAs The TAs know common problems We’re here to help, not solve it for you

02/10/06EECS150 Lab Lecture #417 Administrative Info Midterm I Thursday 02/16, 2-3:30pm, Room 125 Cory Review Session TBA, 125 Cory Partners You MUST have one for this week Try someone other than your best friend Restrictions You can change partners until the project starts You must be in the same lab Project in 2 weeks

02/10/06EECS150 Lab Lecture #418 Part1: Bottom Up Testing (1) What if EqualOut = 1’b0 and GreaterOut = 1’b0?

02/10/06EECS150 Lab Lecture #419 Part1: Bottom Up Testing (2) Exhaustive Testing Ideal Testing Method Circuit is 100% tested! Requires us to test a LOT! Can we do it here? (2 4 possible inputs) Method Make a truth table Have the testbench generate all inputs Make sure outputs match truth table

02/10/06EECS150 Lab Lecture #420 Part1: Bottom Up Testing (3)

02/10/06EECS150 Lab Lecture #421 Part1: Bottom Up Testing (4) Exhaustive Testing? 2 8 = 256 Possible Inputs Method Use a for loop to generate all inputs Loops allowed only in testbenches They will not synthesize Compare against a “ >= “ Print a message if they differ

02/10/06EECS150 Lab Lecture #422 Part1: Bottom Up Testing (5)

02/10/06EECS150 Lab Lecture #423 Part1: Bottom Up Testing (6) Exhaustive Testing? 2 4 = 16 Possible Inputs 2 4 = 16 Possible States 16*16 = 256 combinations We could do it in this case Can’t exhaustively test FSMs Too many state/input combinations Must rely on directed testing

02/10/06EECS150 Lab Lecture #424 initial begin end Part1: Bottom Up Testing (7) integeri; reg[3:0]TestValues[1:16]; $readmemh("TestValues.txt", TestValues); for(i = 1; i <= 16; i = i + 1) begin #(`Cycle); In = TestValues[i]; $display("In = %d, Peak = %d", In, Peak); end

02/10/06EECS150 Lab Lecture #425 Part1: Bottom Up Testing (8) Read Test Vectors from a File Designing Test Vectors Make sure to cover most cases We want 95%+ coverage Designing test vectors is a “black art” $ Processes Not synthesizeable More information in IEEE Verilog Reference

02/10/06EECS150 Lab Lecture #426 Part2: Test Hardware (1)

02/10/06EECS150 Lab Lecture #427 Part2: Test Hardware (2) Test Procedure Hit Reset (SW1) Hit Go (SW2) Record an error DD1-8 show {A, B} SW10[1] selects the sum on DD4-8 Hit Go Repeat until the tester stops

02/10/06EECS150 Lab Lecture #428 Part2: Test Hardware (3) The Broken Adder 16bit Adder 2 32 ≈4 Billion Test Vectors Can’t simulate this much 2:40 to test this at 27MHz Fail Modes 0: No Errors 2: Will claim = 3 1-3: Can have anywhere from 0 to 4 errors

02/10/06EECS150 Lab Lecture #429 Part3: FSM Testing (1) Exhaustive Testing Again! Check every arc Check every output You don’t need to correct this one… We’re not giving you the source code Boring (and Easy) You will have FSM bugs Get used to debugging them

02/10/06EECS150 Lab Lecture #430 Part3: FSM Testing (2)