Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 13: Regression Testing, MemAccess Block.

Slides:



Advertisements
Similar presentations
Machine cycle.
Advertisements

Computer Architecture and the Fetch-Execute Cycle
Chapter 5 The LC-3 Instruction Set Architecture l ISA Overview l Operate instructions l Data Movement instructions l Control Instructions l LC-3 data path.
1 ITCS 3181 Logic and Computer Systems B. Wilkinson Slides9.ppt Modification date: March 30, 2015 Processor Design.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 8: Sequential Design Spring 2009 W. Rhett.
Chapter 5 The LC-3.
Spring 20067W. Rhett Davis with minor modifications by Dean Brock ECE 406 at UNASlide 1 ECE 406 Design of Complex Digital Systems Lecture 10: 9: State.
CHAPTER 4 COMPUTER SYSTEM – Von Neumann Model
Chapter 5 The LC-3 LC-3 Computer Architecture Memory Map
Stored Program Concept: The Hardware View
Lec 8: Pipelining Kavita Bala CS 3410, Fall 2008 Computer Science Cornell University.
Choice for the rest of the semester New Plan –assembler and machine language –Operating systems Process scheduling Memory management File system Optimization.
Overview The von Neumann Machine - the programmable digital computer Introducing the LC-3 Computer - A “toy” computer for us to learn from Computer machine.
Chapters 5 - The LC-3 LC-3 Computer Architecture Memory Map
L15 – Control & Execution 1 Comp 411 – Spring /25/08 Control & Execution Finite State Machines for Control MIPS Execution.
Class 9.1 Computer Architecture - HUJI Computer Architecture Class 9 Microprogramming.
Chapters 4 & 5: LC-3 Computer Architecture Machine Instructions Assembly language Programming in Machine and Assembly Language.
Overview von Neumann Model Components of a Computer Some Computer Organization Models The Computer Bus An Example Organization: The LC-3.
Group 5 Alain J. Percial Paula A. Ortiz Francis X. Ruiz.
Lecture 13 - Introduction to the Central Processing Unit (CPU)
Computer Science 210 Computer Organization The Instruction Execution Cycle.
Chapter 5 The LC-3. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 5-2 Instruction Set Architecture ISA.
Spring 2007W. Rhett Davis with minor modification by Dean Brock UNCA ECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 7: Design Example,
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 19: Cache Operation & Design Spring 2009.
Spring 2007W. Rhett Davis with slight modification by Dean Brock UNCA ECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 11: Memories,
Bus Architecture Memory unit AR PC DR E ALU AC INPR 16-bit Bus IR TR
Levels of Architecture & Language CHAPTER 1 © copyright Bobby Hoggard / material may not be redistributed without permission.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 2: Introduction to Verilog Syntax Spring.
COSC 3430 L08 Basic MIPS Architecture.1 COSC 3430 Computer Architecture Lecture 08 Processors Single cycle Datapath PH 3: Sections
Chapter 4 MARIE: An Introduction to a Simple Computer.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 3: Structural Modeling Spring 2009 W. Rhett.
Chapter 5 The LC-3. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 5-2 Data Movement Instructions Load --
Chapter 5 The LC Instruction Set Architecture ISA = All of the programmer-visible components and operations of the computer memory organization.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 7: Design Example, Modeling Flip-Flops Spring.
COMPILERS CLASS 22/7,23/7. Introduction Compiler: A Compiler is a program that can read a program in one language (Source) and translate it into an equivalent.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 16: Introduction to Buses and Interfaces.
Spring 2007W. Rhett Davis with minor modification by Dean Brock UNCA ECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 12: Intro to the.
© BYU LC3-DC Page 1 ECEn 224 LC3-DC Designing The LC-3 Control IR PC enaMARMenaPC enaALU enaMDR ALU AB.
Our programmer needs to do this !
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 4: Testing, Dataflow Modeling Spring 2009.
HOW COMPUTERS WORK THE CPU & MEMORY. THE PARTS OF A COMPUTER.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 6: Procedural Modeling Spring 2009 W. Rhett.
CS61C L20 Datapath © UC Regents 1 Microprocessor James Tan Adapted from D. Patterson’s CS61C Copyright 2000.
Spring 20067W. Rhett Davis with minor modification by Dean Brock UNCA ECE 406Slide 1 ECE 406 Design of Complex Digital Systems Lecture 11: Data Converter,
Simple ALU How to perform this C language integer operation in the computer C=A+B; ? The arithmetic/logic unit (ALU) of a processor performs integer arithmetic.
March R. Smith - University of St Thomas - Minnesota ENGR 330: Today’s Class Connecting Hardware to InstructionsConnecting Hardware to Instructions.
Spring 2007W. Rhett DavisNC State UniversityECE 747Slide 1 ECE 747 Digital Signal Processing Architecture SoC Lecture – Working with Buses & Interconnects.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 12: Intro to the LC-3 Micro-architecture.
COM181 Computer Hardware Lecture 6: The MIPs CPU.
Introduction to Computing Systems and Programming The LC-2.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 9: State Machines & Reset Behavior Spring.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 20: Cache Design Spring 2009 W. Rhett Davis.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 10: Data-Converter Example Spring 2009 W.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 18: More Complex Interfaces Spring 2009.
1 CS/COE0447 Computer Organization & Assembly Language Chapter 5 Part 3.
1 CS/COE0447 Computer Organization & Assembly Language Chapter 5 Part 3 In-Class Exercises.
LC-3 Datapath ECE/CS 252, Fall 2010 Prof. Mikko Lipasti Department of Electrical and Computer Engineering University of Wisconsin – Madison.
Lecture 13 - Introduction to the Central Processing Unit (CPU)
Control & Execution Finite State Machines for Control MIPS Execution.
Computer Science 210 Computer Organization
Decode and Operand Read
ECS 154B Computer Architecture II Spring 2009
Processor (I).
Computer Science 210 Computer Organization
Control & Execution Finite State Machines for Control MIPS Execution.
Computer Science 210 Computer Organization
COMS 161 Introduction to Computing
Topic 6 LC-3.
The Processor Lecture 3.2: Building a Datapath with Control
Computer Science 210 Computer Organization
Presentation transcript:

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 13: Regression Testing, MemAccess Block Spring 2009 W. Rhett Davis NC State University with significant material from Paul Franzon, Bill Allen, & Xun Liu

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 2 Announcements l HW#5 Due Today l HW#6 Due in 2 Weeks l Project #1 Due in 3 Weeks

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 3 Today’s Lecture l Regression Testing l MemAccess Block Specification

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 4 A Complicated Testing Problem l … and now you must design the Fetch block. l You designed the Controller in HW5… l … and a model for the Memory is given to you in HW6…

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 5 How to Test the Fetch Block? l What kinds of test-cases would you choose?

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 6 How to Test the Fetch Block? l Now suppose that the previous test-bench works properly, how do you know that the Controller, Fetch, and Memory blocks will work together? » Need to design another test-bench that includes all three (this is the only one you need to turn in) l What kinds of test-cases will this test-bench have?

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 7 Combined Test-Bench Setup

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 8 Test-Bench Tips l Include instances of all three blocks in the test-bench l Give the blocks recognizable instance names, rather than I0, I1, etc. Controller ctrl(…); Memory mem(…); Fetch fetch(…);

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 9 Debugging Quandary #1 l Option A: Debug with the current test-bench l Option B: Go back to the earlier test-benches to find the problem l Suppose you put together the test bench described here, and the design doesn’t work. What do you do?

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 10 Debugging Quandary #2 l Option A: Combine everything in one test-case l Option B: Create several test- cases for small groups of blocks l Once we’re done, we’ll still have 4 more blocks to design. How do we test them?

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 11 Debugging Quandary #3 l How do we keep from being overwhelmed by the complexity of these test-cases? l Regression Testing » Testing that code has not “regressed”, that is, that the functionality that was working yesterday is still working today. » Maintain a list of test-cases for each block, and re-run those test-cases whenever a block changes.

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 12 Test-Bench Tips l Keep the code for the LC-3 hardware in a separate file, such as lc3.v, then include this file in your test-bench with `include “filename” l Don’t rely completely on the waveform viewer. In order to make it easy to tell if a test-case has passed or failed, use a carefully selected set of $display statements.

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 13 Example Test-Case l Recall that the Controller test-bench showed that it was possible to carry your state machines through the proper states by setting the input signals: 0 Fetch Instruction 10 Decode 20 Execute Operate Instructions 30 Update Register File 40 Update PC 50 Fetch Instruction 60 Decode 70 Compute Target PC 80 Update PC 90 Fetch Instruction …

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 14 Example Test-Case l For the new test-case, we can use the same state display code l Add $display statements for the contents of the PC (which which will be the address lines) and dout from Memory: $display($time," dout=%h",dout); $display($time," addr=%h",addr);

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 15 Example Test-Case l Resulting output is easy to verify by a quick visual inspection: 0 Fetch Instruction 0 addr= dout=54a0 10 Decode 20 Compute Target PC 30 Update PC 35 addr= Fetch Instruction 45 dout=14aa 50 Decode …

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 16 Today’s Lecture l Regression Testing l MemAccess Block Specification

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 17 MemAccess l Receives Address to be read/written from Execute block l Receives Data to be written from Decode block l Master of the shared Memory bus during the “Read Memory”, “Write Memory”, and “Indirect Address Read” states. l Provides Data read from Memory to Writeback block Memory Controller Fetch MemAccess Writeback Decode Execute ALU RegFile IR PSR PC State

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 18 Detail of Memory Bus

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 19 MemAccess Signals l What is meant by the M_Data signal? Why does it come from the Decode block? l What is meant by the M_Addr signal? Why does it come from the Execute block? l What is meant by the memout signal?

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 20 MemAccess States

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 21 Read Memory State: LD, LDR l Determine the Memory Bus Signals: » rd » addr » din

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 22 Write Memory State: ST, STR l Determine the Memory Bus Signals: » rd » addr » din

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 23 Read Indirect Address State: LDI, STI l Determine the Memory Bus Signals: » rd » addr » din Same as the previous Read state!

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 24 Example: LDI l Location of Indirect Address:16’h300A l Indirect Address:16’h3010 l Value Stored at Indirect Address:16’h1234 Note that dout is the same as addr

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 25 Example: STI l Location of Indirect Address:16’h300A l Indirect Address:16’h3010 l Value to be Stored at Indirect Address:16’h1234 Note that dout is the same as addr

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 26 Read Indirect Address State l During this state, what will dout be set to? l What needs to happen to this value on the next cycle? l How can we ensure that this happens?

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 27 Read/Write Memory States Revisited l Read State Memory Bus Signals: » rd » addr » din l Write State Memory Bus Signals: » rd » addr » din

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 28 Verilog Code for MemAccess l Read Memory State: » if(M_Control==0) addr<=M_Addr; else addr<=dout; » din<=16'h0; // don’t care » rd<=1'b1; l Read Indirect Address State: » addr<=M_Addr; » din<=16'h0; // don’t care » rd<=1'b1; l Write Memory State: » if(M_Control==0) addr<=M_Addr; else addr<=dout; » din<=M_Data; » rd<=1'b0; l All Other States: » addr<=16'hz; » din<=16'h0; // don’t care » rd<=1'bz; Remember that this is combinational logic!

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 29 Complete the Table OperationmodeM_Control ADD0 1 AND0 1 NOT BR JMP/RET JSR JSRR LD LDR LDI LEA ST STR STI

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 30 What about memout ? l memout needs to present the value read from memory to the Writeback block. l There’s really no reason why it can’t just be connected to dout permanently (with an assign statement). l assign memout = dout;