1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 6: AHB-Lite, Interrupts (1) September 18, 2014 Slides developed.

Slides:



Advertisements
Similar presentations
Computer Architecture
Advertisements

9/20/6Lecture 3 - Instruction Set - Al1 The Hardware Interface.
1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 5: Memory and Peripheral Busses September 21, 2010.
CSCI 4717/5717 Computer Architecture
FIU Chapter 7: Input/Output Jerome Crooks Panyawat Chiamprasert
COMP3221: Microprocessors and Embedded Systems Lecture 15: Interrupts I Lecturer: Hui Wu Session 1, 2005.
Architectural Support for OS March 29, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
Architectural Support for Operating Systems. Announcements Most office hours are finalized Assignments up every Wednesday, due next week CS 415 section.
Introduction An interrupt is an event which informs the CPU that its service (action) is needed. Sources of interrupts: internal fault (e.g.. divide by.
1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 7: Exceptions and Interrupts September 27, 2011.
Hardware Support for Operating Systems Sunny Gleason Vivek Uppal COM S 414
Computer System Structures memory memory controller disk controller disk controller printer controller printer controller tape-drive controller tape-drive.
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.
Introduction to Embedded Systems
COMP201 Computer Systems Exceptions and Interrupts.
1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 5: Memory and Peripheral Busses September 20, 2011.
CORTEX-M0 Structure Discussion 2 – Core Peripherals
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
Khaled A. Al-Utaibi  Interrupt-Driven I/O  Hardware Interrupts  Responding to Hardware Interrupts  INTR and NMI  Computing the.
Interrupts Stopping program flow to execute a special piece of code that handles an event Definition and classification PowerPC interrupt structure Precise.
On Chip Bus National Taiwan University
2009 Sep 10SYSC Dept. Systems and Computer Engineering, Carleton University F09. SYSC2001-Ch7.ppt 1 Chapter 7 Input/Output 7.1 External Devices 7.2.
Computer Architecture System Interface Units Iolanthe II approaches Coromandel Harbour.
Interrupts, Buses Chapter 6.2.5, Introduction to Interrupts Interrupts are a mechanism by which other modules (e.g. I/O) may interrupt normal.
1 EECS 373 Design of Microprocessor-Based Systems Mark Brehob University of Michigan Lecture 6: Interrupts Sept. 19 th 2013 Slides developed in part by.
1 EECS 373 Design of Microprocessor-Based Systems Mark Brehob University of Michigan Lecture 6: Interrupts January 30 th Slides developed in part by Prof.
Unit-III Pipelined Architecture. Basic instruction cycle 6/4/2016MDS_SCOE_UNIT32.
COMPUTER ORGANIZATIONS CSNB123. COMPUTER ORGANIZATIONS CSNB123 Expected Course Outcome #Course OutcomeCoverage 1Explain the concepts that underlie modern.
Computer Architecture Lecture 2 System Buses. Program Concept Hardwired systems are inflexible General purpose hardware can do different tasks, given.
EEE440 Computer Architecture
13-Nov-15 (1) CSC Computer Organization Lecture 7: Input/Output Organization.
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.
SOC Consortium Course Material On Chip Bus National Taiwan University Adopted from National Taiwan University SOC Course Material.
1 CSE451 Architectural Supports for Operating Systems Autumn 2002 Gary Kimura Lecture #2 October 2, 2002.
1 EECS 373 Design of Microprocessor-Based Systems Mark Brehob University of Michigan Lecture 12: Memory and Peripheral Busses October 22nd, 2013 Slides.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Dr Mohamed Menacer College of Computer Science and Engineering, Taibah University CE-321: Computer.
EECS 373 Design of Microprocessor-Based Systems Prabal Dutta
EECS 373 Design of Microprocessor-Based Systems Mark Brehob
EECS 373 Design of Microprocessor-Based Systems Prabal Dutta
Spring 2007W. Rhett DavisNC State UniversityECE 747Slide 1 ECE 747 Digital Signal Processing Architecture SoC Lecture – Working with Buses & Interconnects.
Chapter 3 System Buses.  Hardwired systems are inflexible  General purpose hardware can do different tasks, given correct control signals  Instead.
Aditya Dayal M. Tech, VLSI Design ITM University, Gwalior.
Introduction to Exceptions 1 Introduction to Exceptions ARM Advanced RISC Machines.
AMBA® 3 AHB-Lite Protocol
1 EECS 373 Design of Microprocessor-Based Systems Mark Brehob University of Michigan Lecture 12: Memory accesses in C Memory and Peripheral Busses PCB.
Slides developed in part by Mark Brehob & Prabal Dutta
Interrupts and exceptions
Microprocessor Systems Design I
EECS 373 Design of Microprocessor-Based Systems Prabal Dutta
Computer Architecture
EECS 373 Design of Microprocessor-Based Systems Prabal Dutta
ME2100 EMBEDDED SYSTEM DESIGN (ARM9™) [Slide 8] ARM AMBA Bus BY DREAMCATCHER
EECS 373 Design of Microprocessor-Based Systems Mark Brehob
Slides developed in part by Prof. Dutta & Dreslinski
EECS 373 Design of Microprocessor-Based Systems Mark Brehob
Architectural Support for OS
CSE 451: Operating Systems Autumn 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 596 Allen Center 1.
CSE 451: Operating Systems Autumn 2001 Lecture 2 Architectural Support for Operating Systems Brian Bershad 310 Sieg Hall 1.
CSE 451: Operating Systems Winter 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 412 Sieg Hall 1.
Architectural Support for OS
COMP3221: Microprocessors and Embedded Systems
EECS 373 Design of Microprocessor-Based Systems Prabal Dutta
Presentation transcript:

1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 6: AHB-Lite, Interrupts (1) September 18, 2014 Slides developed in part by Mark Brehob

Today Announcements ARM AHB-Lite Start on interrupts

Announcements HW2 assigned; Due on 9/23 Questions – Synchronizers – Why separate read/write busses on APB?

Today Announcements ARM AHB-Lite Start on interrupts

Advanced Microcontroller Bus Architecture (AMBA) - Advanced High-performance Bus (AHB) - Advanced Peripheral Bus (APB) AHB High performance Pipelined operation Burst transfers Multiple bus masters Split transactions APB Low power Latched address/control Simple interface Suitable of many peripherals 5

6 Actel SmartFusion system/bus architecture

7 AHB-Lite supports single bus master and provides high-bandwidth operation Burst transfers Single clock-edge operation Non-tri-state implementation Configurable bus width

8 AHB-Lite bus master/slave interface Global signals –HCLK –HRESETn Master out/slave in –HADDR (address) –HWDATA (write data) –Control HWRITE HSIZE HBURST HPROT HTRANS HMASTLOCK Slave out/master in –HRDATA (read data) –HREADY –HRESP

9 AHB-Lite signal definitions Global signals –HCLK: the bus clock source (rising-edge triggered) –HRESETn: the bus (and system) reset signal (active low) Master out/slave in –HADDR[31:0]: the 32-bit system address bus –HWDATA[31:0]: the system write data bus –Control HWRITE: indicates transfer direction (Write=1, Read=0) HSIZE[2:0]: indicates size of transfer (byte, halfword, or word) HBURST[2:0]: indicates single or burst transfer (1, 4, 8, 16 beats) HPROT[3:0]: provides protection information (e.g. I or D; user or handler) HTRANS: indicates current transfer type (e.g. idle, busy, nonseq, seq) HMASTLOCK: indicates a locked (atomic) transfer sequence Slave out/master in –HRDATA[31:0]: the slave read data bus –HREADY: indicates previous transfer is complete –HRESP: the transfer response (OKAY=0, ERROR=1)

10 Key to timing diagram conventions Timing diagrams –Clock –Stable values –Transitions –High-impedance Signal conventions –Lower case ‘n’ denote active low (e.g. RESETn) –Prefix ‘H’ denotes AHB –Prefix ‘P’ denotes APB

11 Basic read and write transfers with no wait states Pipelined Address & Data Transfer

12 Read transfer with two wait states Two wait states added by slave by asserting HREADY low Valid data produced

13 Write transfer with one wait state One wait state added by slave by asserting HREADY low Valid data held stable

14 Wait states extend the address phase of next transfer One wait state added by slave by asserting HREADY low Address stage of the next transfer is also extended

15 Transfers can be of four types (HTRANS[1:0]) IDLE (b00) –No data transfer is required –Slave must OKAY w/o waiting –Slave must ignore IDLE BUSY (b01) –Insert idle cycles in a burst –Burst will continue afterward –Address/control reflects next transfer in burst –Slave must OKAY w/o waiting –Slave must ignore BUSY NONSEQ (b10) –Indicates single transfer or first transfer of a burst –Address/control unrelated to prior transfers SEQ (b11) –Remaining transfers in a burst –Addr = prior addr + transfer size

16 A four beat burst with master busy and slave wait One wait state added by slave by asserting HREADY low Master busy indicated by HTRANS[1:0]

17 Controlling the size (width) of a transfer HSIZE[2:0] encodes the size The cannot exceed the data bus width (e.g. 32-bits) HSIZE + HBURST is determines wrapping boundary for wrapping bursts HSIZE must remain constant throughout a burst transfer

18 Controlling the burst beats (length) of a transfer Burst of 1, 4, 8, 16, and undef HBURST[2:0] encodes the type Incremental burst Wrapping bursts –4 beats x 4-byte words wrapping –Wraps at 16 byte boundary –E.g. 0x34, 0x38, 0x3c, 0x30,… Bursts must not cross 1KB address boundaries

19 A four beat wrapping burst (WRAP4)

20 A four beat incrementing burst (INCR4)

21 An eight beat wrapping burst (WRAP8)

22 An eight beat incrementing burst (INCR8) using half-word transfers

23 An undefined length incrementing burst (INCR)

24 Multi-master AHB-Lite requires a multi-layer interconnect AHB-Lite is single-master Multi-master operation –Must isolate masters –Each master assigned to layer –Interconnect arbitrates slave accesses Full crossbar switch often unneeded –Slaves 1, 2, 3 are shared –Slaves 4, 5 are local to Master 1

Today Announcements ARM AHB-Lite Start on interrupts

Interrupts Merriam-Webster: –“to break the uniformity or continuity of” Informs a program of some external events Breaks execution flow Key questions: Where do interrupts come from? How do we save state for later continuation? How can we ignore interrupts? How can we prioritize interrupts? How can we share interrupts? 26

I/O Data Transfer Two key questions to determine how data is transferred to/from a non-trivial I/O device: 1.How does the CPU know when data is available? a.Polling b.Interrupts 2.How is data transferred into and out of the device? a.Programmed I/O b.Direct Memory Access (DMA)

Interrupts Interrupt (a.k.a. exception or trap): An event that causes the CPU to stop executing the current program and begin executing a special piece of code called an interrupt handler or interrupt service routine (ISR). Typically, the ISR does some work and then resumes the interrupted program. Interrupts are really glorified procedure calls, except that they: can occur between any two instructions are transparent to the running program (usually) are not explicitly requested by the program (typically) call a procedure at an address determined by the type of interrupt, not the program

Two basic types of interrupts (1/2) Those caused by an instruction –Examples: TLB miss Illegal/unimplemented instruction div by 0 –Names: Trap, exception

Two basic types of interrupts (2/2) Those caused by the external world –External device –Reset button –Timer expires –Power failure –System error Names: –interrupt, external interrupt

How it works Something tells the processor core there is an interrupt Core transfers control to code that needs to be executed Said code “returns” to old program Much harder then it looks. –Why?

… is in the details How do you figure out where to branch to? How to you ensure that you can get back to where you started? Don’t we have a pipeline? What about partially executed instructions? What if we get an interrupt while we are processing our interrupt? What if we are in a “critical section?”

Where If you know what caused the interrupt then you want to jump to the code that handles that interrupt. –If you number the possible interrupt cases, and an interrupt comes in, you can just branch to a location, using that number as an offset (this is a branch table) –If you don’t have the number, you need to poll all possible sources of the interrupt to see who caused it. Then you branch to the right code

Get back to where you once belonged Need to store the return address somewhere. –Stack might be a scary place. That would involve a load/store and might cause an interrupt (page fault)! –So a dedicated register seems like a good choice But that might cause problems later…

Snazzy architectures A modern processor has many (often 50+) instructions in-flight at once. –What do we do with them? Drain the pipeline? –What if one of them causes an exception? Punt all that work –Slows us down What if the instruction that caused the exception was executed before some other instruction? –What if that other instruction caused an interrupt?

Nested interrupts If we get one interrupt while handling another what to do? –Just handle it But what about that dedicated register? What if I’m doing something that can’t be stopped? –Ignore it But what if it is important? –Prioritize Take those interrupts you care about. Ignore the rest Still have dedicated register problems.

Critical section We probably need to ignore some interrupts but take others. –Probably should be sure our code can’t cause an exception. –Use same prioritization as before. What about instructions that shouldn’t be interrupted?

Our processor Over 100 interrupt sources –Power on reset, bus errors, I/O pins changing state, data in on a serial bus etc. Need a great deal of control –Ability to enable and disable interrupt sources –Ability to control where to branch to for each interrupt –Ability to set interrupt priorities Who wins in case of a tie Can interrupt A interrupt the ISR for interrupt B? –If so, A can “preempt” B. All that control will involve memory mapped I/O. –And given the number of interrupts that’s going to be a pain in the rear. 38

39 Enabling and disabling interrupt sources

How to know where to go on an interrupt. 40