Interrupt Driven I/O on the Mano CPU Doing things decently and in order.

Slides:



Advertisements
Similar presentations
M. Mateen Yaqoob The University of Lahore Spring 2014.
Advertisements

PART 5: (2/2) Processor Internals CHAPTER 15: CONTROL UNIT OPERATION 1.
ARITHMETIC LOGIC SHIFT UNIT
Chapter 10 Input/Output Organization. Connections between a CPU and an I/O device Types of bus (Figure 10.1) –Address bus –Data bus –Control bus.
Computer Organization and Architecture
A look at interrupts What are interrupts and why are they needed.
CSCI 4717/5717 Computer Architecture
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 3: Input/output and co-processors dr.ir. A.C. Verschueren.
Interrupts What is an interrupt? What does an interrupt do to the “flow of control” Interrupts used to overlap computation & I/O – Examples would be console.
6-1 I/O Methods I/O – Transfer of data between memory of the system and the I/O device Most devices operate asynchronously from the CPU Most methods involve.
Chapter 16 Control Unit Implemntation. A Basic Computer Model.
Chapter 15 IA 64 Architecture Review Predication Predication Registers Speculation Control Data Software Pipelining Prolog, Kernel, & Epilog phases Automatic.
Midterm Wednesday 11/19 Overview: 25% First Midterm material - Number/character representation and conversion, number arithmetic - DeMorgan’s Law, Combinational.
5 Computer Organization
Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2009
Interrupts. 2 Definition: An electrical signal sent to the CPU (at any time) to alert it to the occurrence of some event that needs its attention Purpose:
Bus Architecture Memory unit AR PC DR E ALU AC INPR 16-bit Bus IR TR
Computer System Architecture ESGD2204
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
Chapter No 5 Basic Computer Organization And Design.
1 Basic Computer Organization & Design Computer Organization Computer Architectures Lab BASIC COMPUTER ORGANIZATION AND DESIGN Instruction Codes Computer.
Eng. Mohammed Timraz Electronics & Communication Engineer University of Palestine Faculty of Engineering and Urban planning Software Engineering Department.
Bus Architecture Memory unit AR PC DR E ALU AC INPR 16-bit Bus IR TR
COMPUTER ORGANIZATIONS CSNB123 NSMS2013 Ver.1Systems and Networking1.
Exam2 Review Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2009.
Microprocessors 1 MCS-51 Interrupts.
1 Purpose of This Chapter In this chapter we introduce a basic computer and show how its operation can be specified with register transfer statements.
M. Mateen Yaqoob The University of Lahore Spring 2014.
Lec 5 Basic Computer Organization
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
5-6 Memory Ref. Instruction
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
1 Basic Computer Organization & Design Computer Organization Prof. H. Yoon BASIC COMPUTER ORGANIZATION AND DESIGN Instruction Codes Computer Registers.
Instruction.
Ch5. 기본 컴퓨터의 구조와 설계.
Embedded Systems Design 1 Lecture Set 8 MCS-51 Interrupts.
Basic Elements of Processor ALU Registers Internal data pahs External data paths Control Unit.
Bus Architecture Memory unit AR PC DR E ALU AC INPR 16-bit Bus IR TR
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
Input Output Techniques Programmed Interrupt driven Direct Memory Access (DMA)
Control Unit Operations Chapter10:. What is Control Unit (CU)?(1)  Part of a CPU or other device that directs its operation.  Tells the rest of the.
Structure and Role of a Processor
Basic Computer Organization - Part 2 Designing your first computer
1 BASIC COMPUTER ORGANIZATION AND DESIGN Instruction Codes Computer Registers Computer Instructions Timing and Control Instruction Cycle Memory Reference.
UNIT 2 REGISTER TRANSFER AND MICROOPERATIONS
Basic Computer Organization and Design
68HC11 Interrupts & Resets.
Symbol Hex Code Description I=0 I=1
Computer Architecture
CHAPTER 4 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
BASIC COMPUTER ORGANIZATION AND DESIGN
Overview Instruction Codes Computer Registers Computer Instructions
BASIC COMPUTER ORGANIZATION AND DESIGN
BASIC COMPUTER ORGANIZATION AND DESIGN
CSCE 212 Chapter 5 The Processor: Datapath and Control
By: A. H. Abdul Hafez CAO, by Dr. A.H. Abdul Hafez, CE Dept. HKU
سازمان و طراحي کامپيوتر پايه.
Computer System Overview
Computer Architecture and Organization: L11: Design Control Lines
8085 Microprocessor Architecture
By: A. H. Abdul Hafez Computer Architecture and Organization: L06: Stored program and Instruction code.
Computer System Overview
8085 Microprocessor Architecture
Lecture 7 System architecture Input-output
Computer Architecture
Presentation transcript:

Interrupt Driven I/O on the Mano CPU Doing things decently and in order

Final Phase of Instruction Cycle Simulation FETCH DECODE EXECUTE CHECK FOR INTERRUPTS (CFI)

I/O Device Issues Devices operate asynchronously with respect to the CPU Devices operate slowly with respect to the CPU Devices must request service Devices must hold pending requests

Alternative I/O Approaches Polling – Cycle through I/O devices – Process as needed – Polling consumes CPU cycles Interrupts – Adds hardware complexity (IEN, FGI, FGO, TR, OUTR, INPR) – Complicates CU design (especially for pipelined CPUs)

Semantics for CFI Conditions for CFI: T 0 ’ T 1 ’ T 2 ’ IEN (FGI+FGO) – T 0 ’,T 1 ’, T 2 ’: Not during FETCH or DECODE (or EXECUTE!) – IEN: interrupts must be enabled – FGI or FGO: a device requests service – If T 0 ’ T 1 ’ T 2 ’ IEN (FGI+FGO), then R<-1 Actions required to switch to interrupt handler (What to do if R equals1.) – RT 0 : AR<-0, TR<-PC – RT 1 : M[AR]<-TR, PC<-0 – RT 2 : PC<-PC+1, IEN<-0, R<-0

Testing CFI Use an I/O script Script entries contain (see the assignment) – Request time – Input register values Tests will only assess input operations Conditions the device simulator implements – TimeCC ≥ Time[ nextRequest ] – FGI = 0

Processing Steps For Simulating Input Device Service Requests Conditions – There is a request for service – Time has advanced to the scripted request – Any previous input service request has acquired a value from the INPR and cleared FGI = 0. Actions – Copy the value into the INPR – Set FGI=1 – Advance the script cursor (to the next request)

A Problem What must happen before returning from the Interrupt Service Routine (ISR)? – IEN<-1 via the ION instruction How does control return from a subroutine? – BUN I ZRO Suppose a request for service is pending when ION is executed in the ISR – IEN and FGI are 1 => CFI transfers to ISR with a return to the BUN I !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Final Simulator Demonstration ADD an RTI instruction to the simulator – RTI has hexadecimal representation F020 – Uses 2 clock cycles to execute – Semantics: AR<-0, IEN<-1; PC<-M[AR] Use the script from the assignment Apply to CPUTest13.dat and CPUTest14.dat – CPUTest13.dat produces an infinite loop – CPUTest14.dat executes in exactly 457 clock cycles