CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Bus Protocols and Interfacing Bus basics I/O transactions MPC555 bus Reference:

Slides:



Advertisements
Similar presentations
Bus arbitration Processor and DMA controllers both need to initiate data transfers on the bus and access main memory. The device that is allowed to initiate.
Advertisements

Homework Reading Machine Projects Labs
IT253: Computer Organization
Computer Architecture
1  1998 Morgan Kaufmann Publishers Interfacing Processors and Peripherals.
9/20/6Lecture 3 - Instruction Set - Al1 The Hardware Interface.
Chapter 2 Microprocessor Bus Transfers. Big- and Little-Endian Ordering Bit-endian processor architecture –High-order-byte-first (H-O-B-F) map the highest-order.
Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 1 A simple bus bus structure ProcessorMemory rd'/wr enable addr[0-11]
EECS 470 Busses in the real world Lecture 22 – Fall 2013.
Interfacing Processors and Peripherals Andreas Klappenecker CPSC321 Computer Architecture.
DIRECT MEMORY ACCESS CS 147 Thursday July 5,2001 SEEMA RAI.
Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ input/output and clock inputs Sequence of control signal combinations.
TECH CH03 System Buses Computer Components Computer Function
68000 Interface Timing Diagrams Outline –68000 Read Cycle –68000 Write Cycle Goal –Understand bus cycles –Learn how to attach memory, peripherals.
680XX Hardware Interface Outline Goal Reading
Input-Output Problems L1 Prof. Sin-Min Lee Department of Mathematics and Computer Science.
1 COMP541 Interrupts, DMA, Serial I/O Montek Singh April 24, 2007.
1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 4: Memory-Mapped I/O, Bus Architectures January 20, 2015.
9/20/6Lecture 3 - Instruction Set - Al Hardware interface (part 2)
COMP3221 lec31-mem-bus-II.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lectures 32: Memory and Bus Organisation - II
CS-334: Computer Architecture
Computer Architecture Lecture 08 Fasih ur Rehman.
Memory interface Memory is a device to store data
Digital System Bus A bus in a digital system is a collection of (usually unbroken) signal lines that carry module-to-module communications. The signals.
CPU BASICS, THE BUS, CLOCKS, I/O SUBSYSTEM Philip Chan.
NS Training Hardware.
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
I/O Example: Disk Drives To access data: — seek: position head over the proper track (8 to 20 ms. avg.) — rotational latency: wait for desired sector (.5.
Top Level View of Computer Function and Interconnection.
DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK
Interrupts, Buses Chapter 6.2.5, Introduction to Interrupts Interrupts are a mechanism by which other modules (e.g. I/O) may interrupt normal.
Direct Memory Access (DMA) Microprocessors I -1. Topics to be discussed  Basic DMA Concept Basic DMA Concept  DMA pins and timing DMA pins and timing.
MBG 1 CIS501, Fall 99 Lecture 18: Input/Output (I/O): Buses and Peripherals Michael B. Greenwald Computer Architecture CIS 501 Fall 1999.
EEE440 Computer Architecture
Modes of transfer in computer
1 EECS 373 Design of Microprocessor-Based Systems Mark Brehob University of Michigan Lecture 4: Bit of ssembly, Memory-mapped I/O, APB January 21, 2014.
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
80386DX functional Block Diagram PIN Description Register set Flags Physical address space Data types.
12/16/  List the elements of 8255A Programmable Peripheral Interface (PPI)  Explain its various operating modes  Develop a simple program to.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 16: Introduction to Buses and Interfaces.
Dr Mohamed Menacer College of Computer Science and Engineering, Taibah University CE-321: Computer.
CE 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst The Pentium Pro® (P6) Bus Reference: “Penium Pro and Pentium II System Architecture”
Introduction to Microprocessors - chapter3 1 Chapter 3 The 8085 Microprocessor Architecture.
Bus Protocols and Interfacing (adopted Steven and Marios’s slides) Bus basics I/O transactions MPC823 bus Reference: Chapter 13 of “White Book”
MACHINE CYCLE AND T-STATE
Chapter 3 System Buses.  Hardwired systems are inflexible  General purpose hardware can do different tasks, given correct control signals  Instead.
8085 INTERNAL ARCHITECTURE.  Upon completing this topic, you should be able to: State all the register available in the 8085 microprocessor and explain.
1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 4: Review, Simulation, ABI, and Memory-Mapped I/O September.
Amdahl’s Law & I/O Control Method 1. Amdahl’s Law The overall performance of a system is a result of the interaction of all of its components. System.
EECS 373 – lecture 4 Buses, serial communication and digital design.
Interconnection Structures
Department of Computer Science and Engineering
Bus Interfacing Processor-Memory Bus Backplane Bus I/O Bus
Chapter 6 Input/Output Organization
Slides developed in part by Mark Brehob & Prabal Dutta
CPU Sequencing 6/30/2018.
EE 107 Fall 2017 Lecture 7 Serial Buses – I2C Direct Memory Access
EECS 373 Design of Microprocessor-Based Systems Mark Brehob
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Suppose that a certain program takes 200 seconds of elapsed time to execute. Out of these 200 seconds, 180 seconds is the CPU time and the rest is I/O.
The Programmable Peripheral Interface (8255A)
CPU Sequencing 7/20/2019.
Advanced Computer Architecture Lecture 3
Presentation transcript:

CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Bus Protocols and Interfacing Bus basics I/O transactions MPC555 bus Reference: Chapter 9 of MPC555 User’s Manual

CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Basic example Discuss a basic bus protocol –Asynchronous (no clock) –Initiator and Target –REQ#, ACK#, Data[7:0], ADS[7:0], CMD CMD=0 is read, CMD=1 is write. REQ# low means initiator is requesting something. ACK# low means target has done its job. REQ# = REQ

CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst A read transaction Say initiator wants to read location 0x24 –Initiator sets ADS=0x24, CMD=0. –Initiator then sets REQ# to low. (why do we need a delay? How much of a delay?) –Target sees read request. –Target drives data onto data bus. –Target then sets ACK# to low. –Initiator grabs the data from the data bus. –Initiator sets REQ# to high, stops driving ADS and CMD –Target stops driving data, sets ACK# to high terminating the transaction

CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Read transaction ADS[7:0] CMD Data[7:0] REQ# ACK# ?? 0x24 ?? 0x55 A B C D E F G HI

CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst A write transaction (write 0xF4 to location 0x31) –Initiator sets ADS=0x31, CMD=1, Data=0xF4 –Initiator then sets REQ# to low. –Target sees write request. –Target reads data from data bus. (Just has to store in a register, need not write all the way to memory!) –Target then sets ACK# to low. –Initiator sets REQ# to high & stops driving other lines. –Target sets ACK# to high terminating the transaction

The push-button (if ADS=0x04 write 0 or 1 depending on button) ADS[0] ADS[1] ADS[2] ADS[3] ADS[4] ADS[5] ADS[6] ADS[7] REQ# Button (0 or 1) 0 Data[0] Data[7].. Delay ACK# What about CMD?

CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst The LED (1 bit reg written by LSB of address 0x05) ADS[2] ADS[0] ADS[1] ADS[3] ADS[4] ADS[5] ADS[6] ADS[7] REQ# Flip-flop which controls LED clock D DATA[2] DATA[0] DATA[1] DATA[3] DATA[4] DATA[5] DATA[6] DATA[7] Delay ACK#

CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst MPC555 Bus The basic function of the MPC555 bus is similar, though slightly more complicated. (Chapter 9 of 555 User’s Manual) Timing is controlled by a global clock; all signals are in reference to the rising edge of this clock. 32-bit data bus D[0:31] 24-bit address bus A[8:31] A[0:7] not sent off chip On-chip peripherals still see 32 address bits Basic control lines: RD/#WR #TS (transfer start)—like #REQ but only asserted on first clock cycle of transaction #TA (transfer acknowledge)—like #ACK

CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst MPC555 Read Master drives address, RD/#WR, and #TS to initiate a read transaction. Address and RD/#WR guaranteed valid at same rising clock edge that #TS is asserted. Master deasserts #TS after one cycle, but keeps driving address and RD/#WR until it sees #TA. Slaves look at address and RD/#WR when #TS asserted. One of them will drive data and assert #TA. Master samples data on same rising clock edge when #TA is asserted. Minimum transactions takes two clock cycles. Transactions can take longer slow slaves add wait states by not asserting #TA.

MPC555 Read(s) CLK A[8:31] D[0:31] RD/#WR #TS #TA ?? A1 D1 A2 D2 A1 A2

CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst

CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst MPC555 Write Same start as for a read, except for polarity of RD/WR#. Master drives data by 2 nd cycle. Slaves look at address and RD/#WR when #TS is asserted. One of them will read data and assert #TA. As with reads, minimum transaction length is two cycles. Slaves can take longer, however, by not asserting #TA. Master keeps driving address, RD/#WR, and data until it sees #TA asserted.

MPC555 Write CLK A[8:31] D[0:31] RD/#WR #TS #TA ?? A1 D1 A2 D2 A1 A2

CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst TSIZ[0:1] – Specifies the size of the data to be transferred. (aka “Port Size”) #Burst – Indicates a burst transaction #BDIP – Burst Data In Progress (more burst stuff) #BI – Burst Inhibit. Indicates that the slave doesn’t support burst transactions Many More… Of course, things aren’t that simple

CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Example of complexity: The Burst Mechanism (9.5.3) Burst transfers are used to move (up to) 16 bytes at a time #BURST must be asserted by master #BI must not be asserted by slave Must be a 16-byte aligned access Supports critical word first.

CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Arbitration (9.5.6) Requesting deviceArbiter Request the bus Assert #BR ACK bus mastership Wait for #BB to be deasserted Assert #BB Negate #BR Perform data transfer Release bus mastership Negate #BB Grant bus arbitration Assert #BG Terminate Arbitration Negate #BG

CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Transfer Alignment 0x MPC555 external bus supports natural address alignment Byte access: Any address alignment Half-word access: Address bit 31 equal to 0 Word access: Address bits 31 and 30 equal to 0

Dealing with Smaller Accesses: Reads 0x Assume that the word value 0x is stored at 0x1000 and that r4 contains 0x1000. What happens on the following transfers? D[0:7] D[8:15] D[16:23] D[24:31] lbz r3, 0 (r4) lbz r3, 1 (r4) lbz r3, 2 (r4) lbz r3, 3 (r4) lhz r3, 0 (r4) lhz r3, 2 (r4)

CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst

CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst

CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst

Dealing with Smaller Accesses: Writes How about the following transfers? D[0:7] D[8:15] D[16:23] D[24:31] stb r2, 0 (r4) stb r2, 1 (r4) stb r2, 2 (r4) stb r2, 3 (r4) sth r2, 0 (r4) sth r2, 1 (r4) 0x

CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst On a write access, which two factors determine which bits in a 32-bit word are updated? On most wide buses, the master drives byte enable lines instead of less significant address bits Moto (16 bits): #LDS, #UDS (no address LSB) 32-bit buses: Replace low 2 address bits with 4 byte enables MPC555 does not: Full byte address provided Size (byte, halfword, word) encoded on two control lines TSIZ[0-1] Dealing with Smaller Accesses

Unaligned Accesses 0x x1004 Consider two adjacent 32-bit memory locations and assume that r4 = 0x1000. What happens when the CPU executes the following instructions? lwz r3, 2 (r4) lwz r3, 1 (r4)

CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Problems with Unaligned Accesses What are some problems with unaligned accesses?

CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Basic bus issues What are the basic wires for specifying the transaction and moving the data? –What are the types of transactions? How are they specified? –How is length of data transfer specified? Who can delay (insert wait states?) How is arbitration done? Out-of-order transfers allowed? –Any restrictions? Error reporting? Weirdness? –Alignment for example.

CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Transaction types Usually read/write with a length –But in a given domain, other info might be important. Data vs. Code access. I/O vs. memory access Hints to target device –Length might be arbitrary.

CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Delaying Who can delay and how –Usually a target (slave) can delay –Sometimes initiator (master) can delay –Sometimes initiator can drop the transaction –Sometimes the target has options on how to delay.

CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Arbitration Fairness –Even sharing, priority sharing, weighted sharing Mechanism –Centralized arbiter –Distributed arbiter –Combination Duration –Until done –Until someone else requests –Until certain time passes. –Combination

CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Out-of-order Does the bus allow transactions to complete out-of-order? –If so, can increase bandwidth (why?) –If so, might have to worry about ordering issues Memory consistency models not a topic for this class (take CE 452!) but basics are pretty easy to grasp

CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Out-of-order: Ordering problem Processor 1 Write I=1 Write J=1 Processor 2 Write J=2 Write I=2 If both programs are executed in order, is there any setting of J and I which is impossible?

CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst CLK A[8:31] D[0:31] RD/#WR #TS #TA ?? D1 ??