Docsity

Device Identification - Computer Architecture - Lecture Slides, Slides of Computer Architecture and Organization

Partial preview of the text

Download Device Identification - Computer Architecture - Lecture Slides and more Slides Computer Architecture and Organization in PDF only on Docsity!

1

Device Identification

 Multiple Interrupt Line

 Software poll

 Daisy Chain

 Bus Arbitration

2

Multiple Interrupt Lines

• Most straightforward approach

• Impractical to implement

• Each line might have multiple I/O

modules attached to it

4

ireq

iack

D Q

Q

D Q

Q

o.c.

Interrupt enable

Interrupt request Vect(7…0)

Info (15…0)

Data (23…16)

Data (0…15)

Simplified Interrupt Circuit for

an I/O Interface

5

Priority Chain

• The wired OR interrupt signal allows

several devices to request interrupt

simultaneously.

• For proper operation, only one device

receives an acknowledge signal.

• This situation is called priority chain.

7

  • The only requesting and enabled

device to receive an acknowledge

signal is the lowest-numbered

one.

8

Daisy Chain

I/O device 0

I/O device 1

I/O device j

data ireq

iack

I/O bus

10

  • The program has two parts:

1): Initialization subroutine,

i.e., GetIn

2): Interrupt handler for SRC

character input

11

GetIn is called to initialize:

  • the device
  • the line done flag
  • Pointer to the buffer

13

Conditions for the

program:

• Only two registers are saved and

restored, i.e., r0 and r1.

• PC is stored by interrupt response

sequence.

• PC is restored by the rfi

instruction.

14

Getline Subroutine for Interrupt-

Driven Character I/O

;Getline is called with return address in R31 and a pointer to a ;character buffer in R1. It will input characters up to a carriage ;return under interrupt control, setting Done to -1 when complete. CR .equ 13 ;ASCII code for carriage return. CIvec .equ 01F0H ;Character input interrupt vector address. Bufp: .dw 1 ;Pointer to next character location. Save: .dw 2 ;Save area for registers on interrupt. Done: .dw 1 ;Flag location is -1 if input complete. Getln: st r1, Bufp ;Record pointer to next character. edi ;Disable interrupts while changing mask. la r2, 1F1H ;Get vector address and device enable bit st r2, CICTL ;and put into control register of device. la r3, 0 ;Clear the st r3, Done ;line input done flag. een ;Enable Interrupts br r31 ;and return to caller.

16

CR .equ 13 ;ASCII code for carriage return.

CIvec .equ 01F0H ;Character input interrupt vector

;address.

Bufp: .dw 1 ;Pointer to next character location.

17

Save: .dw 2 ;Save area for registers on interrupt.

Done: .dw 1 ;Flag location is -1 if input complete.

Getln: str1, Bufp ;Record pointer to next character.

19

la r3, 0 ;Clear the

st r3, Done ;line input done flag.

een ;Enable Interrupts

br r31 ;and return to caller.

20

.org CIvec ;Start handler at vector address. str r0, Save ;Save the registers that str r1, Save+4 ; will be used by the interrupt ;handler.

Interrupt Handler for SRC Character Input