CS 152 Computer Architecture and Engineering Lecture 4 Testing and Teamwork 2006 9 7 John Lazzaro www cs berkeley edu lazzaro C Coon grra ss ng att oon n LL aab b 11 TAs Udam Saini and Jue Sun www inst eecs berkeley edu cs152 CS 152 L4 Testing and Teamwork UC Regents Fall 2006 UCB Last Time Single Cycle Processors Instr Mem Addr Combinational Logic Only Gates No Flip Flops Equal Data 32 Just specify logic functions RegDest RegWr 5 5 5 RegFile rs1 rd1 rs2 32 ws 32 wd RegDest 32 ExtOp rd2 WE RegWr CS 152 L4 Testing and Teamwork ALUsrc MemWr PCSrc MemToReg ALUctr Equal Ext ExtOp MemToReg ALUsrc MemWr UC Regents Fall 2006 UCB Today Testing Processors Teamwork Making a processor test plan Unit testing techniques State machine testing Teamwork Lessons learned from previous CS 152 classes CS 152 L4 Testing and Teamwork UC Regents Fall 2006 UCB Lecture Focus Functional Design Test testing goal g n i ur t t o c a N f u The processor n a m s design t s te correctly executes programs written in the supported subset of the MIPS ISA d e pe s k Cloc I P g C n i m 36 11 Intel XScale ARM Pipeline IEEE Journal of Solid State Circuits November 2001 o c p U res CS 152 L4 Testing and Teamwork UC Regents Fall 2006 UCB Four Types of Testing CS 152 L4 Testing and Teamwork UC Regents Fall 2006 UCB Big Bang Complete Processor Testing Top down testing how it works complete processor testing Lab 1 Assemble the complete processor Execute test program suite on the processor Check results Bottom up testing This is how TAs test on checkoff days CS 152 L4 Testing and Teamwork UC Regents Fall 2006 UCB Methodical Approach Unit Testing Top down testing how it works complete processor testing Remove a block from the design Test it in isolation against specification unit testing Bottom up testing What if the specification has a bug What if team members do not use the exact same CS 152 L4 Testing and Teamwork UC Regents Fall 2006 UCB Climbing the Hierarchy Multi unit Testing Top down testing complete processor testing multi unit testing how it works Remove connected blocks from design Test in isolation against specification unit testing Bottom up testing CS 152 L4 Testing and Teamwork How to choose partition How to create specification UC Regents Fall 2006 UCB Processor Testing with Self Checking Units Top down testing how it works complete processor testing processor testing with self checks multi unit testing unit testing Add self checking to units Perform complete processor testing Bottom up testing Good for Xilinx ModelSim Why not use self checks for all CS 152 L4 Testing and Teamwork UC Regents Fall 2006 UCB Testing Verification vs Diagnostics Top down testing complete processor testing processor testing with self checks multi unit testing unit testing Bottom up testing CS 152 L4 Testing and Teamwork Verification A yes no answer to the question Does the processor have one more bug Diagnostics Clues to help find and fix the bug Which testing types are good for verification For diagnostics UC Regents Fall 2006 UCB Xilinx Observability and Controllability Top down testing Observability Can I sense the state I need to diagnose a bug on the board complete processor testing processor testing with self checks Controllability multi unit testing Can I force a flip flop into known state to diagnose bugs on the board unit testing Bottom up testing For early labs use ChipScope for observability For later labs CS 152 L4 Testing and Teamwork UC Regents Fall 2006 UCB use switches and LEDs on the board LED S Switch es CS 152 L4 Testing and Teamwork LED S UC Regents Fall 2006 UCB Writing a Test Plan CS 152 L4 Testing and Teamwork UC Regents Fall 2006 UCB The testing timeline Top down testing Plan in advance what tests to do when complete processor testing Epoch 1 Epoch 2 Epoch 3 Epoch 4 processor testing with self checks multi unit testing Time unit testing Bottom up testing CS 152 L4 Testing and Teamwork processor assembly complete correctly executes single instructions correctly executes short programs UC Regents Fall 2006 UCB An example test plan Top down testing complete processor testing processor testing with self checks Epoch 1 unit testing early multi unit testing unit testing Bottom up testing CS 152 L4 Testing and Teamwork multi unit testing Epoch 2 Epoch 3 Epoch 4 processor testing with self checks processor testing with self checks complete processor testing multi unit testing multi unit testing unit testing unit testing verificati on processor testing with self checks later diagnostidiagnosti diagnosti cs Time cs cs processor assembly complete correctly executes single instructions correctly executes short programs UC Regents Fall 2006 UCB Spr 05 Works in Modelsim not on board In the end Team Ergo failed because they didn t figure out how to handle some write buffer conditions They passed most tests but not that one As far as checkoffs go Ergo passed the following in simulation basic corner hammer 3 8 tests for base extra Nothing worked on board CS 152 L4 Testing and Teamwork UC Regents Fall 2006 UCB Solving Works in ModelSim not on board Top down testing complete processor testing Solution get confidence in going to board earlier Epoch 1 Epoch 2 Epoch 3 Epoch 4 ModelSim ModelSim ModelSim ModelSim processor testing with self checks multi unit testing 80 80 80 20 Xilinx Xilinx Xilinx Xilinx 20 20 20 80 Time unit testing Bottom up testing processor assembly complete correctly executes single instructions correctly executes short programs Catch warnings and errors signal name Errors latch generated combinational loop misspellings CS 152 L4 Testing and Teamwork UC Regents Fall 2006 UCB Unit Testing CS 152 L4 Testing and Teamwork UC Regents Fall 2006 UCB Combinational Unit Testing 3 bit Adder Cin A B 3 3 3 Sum Number of input bits Total number of possible input values 7 2 128 7 Just test them all Cout Apply test vectors 0 1 2 127 to inputs 100 input space coverage Exhaustive testing CS 152 L4 Testing and Teamwork UC Regents Fall 2006 UCB Combinational Unit Testing 32 bit Adder Cin A B 32 32 32 Cout Sum Number of input bits Total number of possible input values 65 2 3 689e 1 9 65 Just test them all Exhaustive testing does not scale Combinatorial explosion CS 152 L4 Testing and Teamwork UC Regents Fall 2006 UCB Test Approach 1 Random Vectors Cin A B 32 how it works 32 Sum Check Sum Cout 32 Cout How Use random to set inputs to the testbench CS 152 L4 Testing and Teamwork Apply random A B Cin to adder When to stop testing
View Full Document
Unlocking...