Top Banner
Spring 2006 Lillevik 437s06- l9 1 University of Portland School of Engineering EE 437 Advanced Computer Architecture Lecture 9 DMA controller design
33

Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Jan 04, 2016

Download

Documents

Bennett Burke
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 1University of Portland School of Engineering

EE 437

Advanced ComputerArchitecture

Lecture 9

DMA controller design

Page 2: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 2University of Portland School of Engineering

EE 437

Direct memory access

• Objective: avoid the disadvantages of programmed I/O (eliminate the busy loop)

• Technique– CPU writes to special controller (word count

and memory address)– CPU tells controller to start data transfers– CPU continues with other computing– CPU responds to interrupt from controller: ISR

Page 3: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 3University of Portland School of Engineering

EE 437

Role of DMA controller

• Accept initialization data from CPU

• Access I/O device and drive bus (master)– Input: read I/O device and write data to

memory– Output: read memory data and write to I/O

device

• Interrupt CPU when transfer complete

Page 4: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 4University of Portland School of Engineering

EE 437

DMA hardware view

n words n words

adr X

adr X+(n-1)

Memory

I/O device

buffer

System bus adr 0

adr n-1

Page 5: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 5University of Portland School of Engineering

EE 437

DMA controller architecture

Counts up from zero

Counts down to zero Preset counter

Word

Count

Data

Buffer

Memory

Address

Buffer

Address

Control

D

A

C

Xcvr

Xcvr

Xcvr

5 key blocks

Page 6: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 6University of Portland School of Engineering

EE 437

DMA initialization instructions?

1. Write start address

2. Write word count (or end address)

3. Write “go” command

Each write is to a specific DMA controller port address

Page 7: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 7University of Portland School of Engineering

EE 437

DMA controller initialization 1

Start address

Word

Count

Data

Buffer

Memory

Address

Buffer

Address

Control

D

A

C

Xcvr

Xcvr

Xcvr

Page 8: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 8University of Portland School of Engineering

EE 437

DMA controller initialization 2

Word count

Word

Count

Data

Buffer

Memory

Address

Buffer

Address

Control

D

A

C

Xcvr

Xcvr

Xcvr

Page 9: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 9University of Portland School of Engineering

EE 437

DMA controller initialization 3

StartWord

Count

Data

Buffer

Memory

Address

Buffer

Address

Control

D

A

C

Xcvr

Xcvr

Xcvr

Page 10: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 10University of Portland School of Engineering

EE 437

DMA controller driving bus

• Must enable all tri-state drivers: D, A, and C buses

• D bus sources the data, memory agent sinks the data

• A bus contains the memory address decoded by memory agent

• C bus contains the memory write code

Page 11: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 11University of Portland School of Engineering

EE 437

DMA controller driving bus

Memory write

Word

Count

Data

Buffer

Memory

Address

Buffer

Address

Control

D

A

C

Xcvr

Xcvr

Xcvr

Memory adr

Memory data

Page 12: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 12University of Portland School of Engineering

EE 437

Hard drive DMA

• Assumptions– Operation: Input, or read disk, or read file– HD buffer: represent with a ROM

• Initialization commands– Port 1: start address– Port 2: word count– Port 4: start

• Design contains 5 sections

Project 5

Page 13: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 13University of Portland School of Engineering

EE 437

Buffer address section

• Objective: create an address for the HD buffer (ROM)

• Role: zero counter, count up

Page 14: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 14University of Portland School of Engineering

EE 437

Buffer address block?

Page 15: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 15University of Portland School of Engineering

EE 437

Data buffer section

• Objective: provide data for bus transfers

• Role: drive the data bus when enabled and addressed

Page 16: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 16University of Portland School of Engineering

EE 437

Data buffer block?

Page 17: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 17University of Portland School of Engineering

EE 437

Word count section

• Objective: keep track of how many data words have been transferred

• Role: preset to some number, then count down to zero, indicate zero condition

Page 18: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 18University of Portland School of Engineering

EE 437

Word count block?

Page 19: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 19University of Portland School of Engineering

EE 437

Memory address section

• Objective: provide address for bus transfer

• Role: accept start address, then count up, drive the address bus

Page 20: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 20University of Portland School of Engineering

EE 437

Memory address block?

Page 21: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 21University of Portland School of Engineering

EE 437

Updated block diagram

Word

Count

Data

Buffer

Memory

Address

Buffer

Address

Control

D

A

C

Xcvr

Xcvr

Xcvr

Port1Port2

BAclr

BAinc

WCdec

MAincZero

Ben

Ben

Ben

Cou

nt

Page 22: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 22University of Portland School of Engineering

EE 437

Control section

• Objective: decode the Port instructions, request bus, transfer data across the bus, coordinate the sequence of the other blocks, interrupt CPU when done

• Role– Contains three subsections: decoder, counters,

bus I/F– Bus I/F a FSM similar to CPU model

Page 23: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 23University of Portland School of Engineering

EE 437

Control section block 1?Decode

Page 24: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 24University of Portland School of Engineering

EE 437

Control section block 2?Counters

Page 25: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 25University of Portland School of Engineering

EE 437

Control section block 3?Bus interface

Page 26: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 26University of Portland School of Engineering

EE 437

Page 27: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 27University of Portland School of Engineering

EE 437

Buffer address block?

Buffer

Address

BAclr

BAinc

BAdr

Page 28: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 28University of Portland School of Engineering

EE 437

Data buffer block?

Data

Buffer

(ROM)

Data

Ben

BAdr

Assume ROM outputs are tri-state

Page 29: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 29University of Portland School of Engineering

EE 437

Word count block?

Word

Count

Data

WCload

WCdecZero

Page 30: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 30University of Portland School of Engineering

EE 437

Memory address block?

Memory

AddressA

Assume MA outputs are tri-state

D

MAload

MAinc

Ben

Page 31: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 31University of Portland School of Engineering

EE 437

Control section block 1?

Decode

LogicC

A Port1 (MAload)

Port2 (WCload)

Port4 (Start)

Decode

Page 32: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 32University of Portland School of Engineering

EE 437

Control section block 2?

Enables

Start

BAclr

BAinc

WCdec

MAincZero

Counters

One signal?

Page 33: Spring 2006 1 EE 437 Lillevik 437s06-l9 University of Portland School of Engineering Advanced Computer Architecture Lecture 9 DMA controller design.

Spring 2006

Lillevik 437s06-l9 33University of Portland School of Engineering

EE 437

Control section block 3?

Bus

I/F

Bgnt

Breq

Int

BenAck

Inta C

Must drive C bus with memory write instruction

Bus interface