Docsity

Computer Achitecture and org - Interrupt - Saritha, Study notes of Computer Architecture and Organization

Toggle sidebar
bg1
Interrupt
What is an interrupt?
An interrupt is a signal from a device attached to a computer or from
a program within the computer that causes the CPU to stop its
normal program execution and perform service related to the event.
Examples of interrupts :I/O completion, divide-by-0, etc.
Maskable Interrupt: It is a hardware interrupt that may be ignored
by setting a bit in an interrupt mask register's (IMR) bit-mask.
Nonmaskable Interrupt:is a hardware interrupt that does not have
a bit-mask associated with it - meaning that it can never be ignored.
NMIs are often used for timers, especially watchdog timers
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Computer Achitecture and org - Interrupt - Saritha and more Study notes Computer Architecture and Organization in PDF only on Docsity!

Interrupt

What is an interrupt?

An interrupt is a signal from a device attached to a computer or from

a program within the computer that causes the CPU to stop its

normal program execution and perform service related to the event.

Examples of interrupts :I/O completion, divide-by-0, etc.

Maskable Interrupt : It is a hardware interrupt that may be ignored

by setting a bit in an interrupt mask register's (IMR) bit-mask.

Nonmaskable Interrupt :is a hardware interrupt that does not have

a bit-mask associated with it - meaning that it can never be ignored.

NMIs are often used for timers, especially watchdog timers

Interrupt Service

A complete interrupt service cycle includes

1. Saving the program counter value in the stack

2. Saving the CPU status (including the CPU status

register and some other registers) in the stack

3. Identifying the cause of interrupt

4. Resolving the starting address of the corresponding

interrupt service routine

5. Executing the interrupt service routine

6. Restoring the CPU status and the program counter

from the stack

7. Restarting the interrupted program (continue)

-In a similar way, the interrupted process suffers from the interrupt:

-the cache it was using is disturbed, and cache updates are

required

Interrupt nesting:

-An interrupt can happen while executing an ISR. This is

called in terrupt nesting.

Reentrant Code

- A computer program or routine is described as reentrant if

the routine can be re-entered while it is already running (i.e it

can be safely executed concurrently ).

To be reentrant, a computer program or routine:

Must hold no static (or global) non-constant data.

Must not return the address to static (or global) non-

constant data.

Must work only on the data provided to it by the caller.

Must not modify its own code. (unless executing in its

own unique thread storage)

Must not call non-reentrant computer programs or

routines.

Example for reentrant code:

int f(int i)

{ return i + 2; }

int g(int i)

{ return f(i) + 2; }

If the processor and/or operating system allows interrupt

nesting, ISR servicing of one interrupt can itself be pre-empted

by another interrupt. Interrupt nesting increases code complexity,

because ISRs must use re-entrant code only, i.e. any number of

concurrent processes (including itself) can call them at the same

time.

What is a Bus?

  • A communication pathway connecting two or more devices and also provide the

mechanisms for controlling the exchange of signals over the bus.

  • System bus comprises of data, address and control bus and handles the

intrasystem communication.

  • Data bus - Carries data - Width is a key determinant of performance - 8, 16, 32, 64 bit
  • Address bus - Identify the source or destination of data - Bus width determines maximum memory capacity of system -

e.g. 16 bit address bus giving 64k address space

  • Control bus - Control and timing information - Memory read/write signal - Interrupt request -

Clock signals

Types of Buses

  • Today there are likely to be a number of different buses in

the typical machine, supporting various devices. They can be

divided into

  • Local buses
    • Such as PCI
    • Used with internal devices such as graphical cards

-External buses

  • Such as ISA
  • Used with external devices such as scanners.

Other types of buses:

  • Processor-Memory Bus
    • Short and high speed
    • Only need to match the memory system
      • Maximize memory-to-processor bandwidth
    • Connects directly to the processor
    • Optimized for cache block transfers

I/O Bus

  • Usually is lengthy and slower
  • Need to match a wide range of I/O devices
  • Connects to the processor-memory bus or backplane bus
  • Backplane Bus
  • Backplane: an interconnection structure within the

Computer’s chassis

  • Allow processors, memory, and I/O devices to coexist
  • Cost advantage: one bus for all components

Principle Bus Design Issues

  • The speed and bandwidth of a bus are influenced by

four main factors:

  • the bus width
  • the bus clocking scheme
  • the bus arbitration method, and
  • the bus operation

D1 D2 D

Bus

Controller

BG

BR

Bus Busy

Daisy chain Arbitration

Advantage: simple

  • Disadvantages:
  • Cannot assure fairness:

A low-priority device may be locked out indefinitely

  • The use of the daisy chain grant signal also limits the

speed of the bus

B u s

a r b i t e r 1

A c k R e q

B u s

a r b i t e r 4

A c k R e q

B u s

a r b i t e r 3

A c k R e q

B u s

a r b i t e r 2

A c k R e q

4 × 2

P r i o r i t y e n c o d e r

2 × 4

D e c o d e r

B u s b u s y l i n e

Parallel Arbitration

D1 D2 D

Bus

Controller

BR

Bus Busy

Polling

Poll

count

polling

  • Unit requests the bus via BUS request line.
  • In response, the Bus controller proceeds to generate a

sequence of numbers on the poll-count lines.

  • Each unit compares to the unique address assigned to it.
  • When requesting unit finds the match, Bus Busy signal is

activated.

  • In response, bus controller terminates the polling process

and U

i

connects to the bus.

  • Advantage: failure of one unit need not affect the other

units.

  • Disadvantage: expensive because of more control lines.

Number of units are limited based on the poll-count lines

capability