Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 1.

Slides:



Advertisements
Similar presentations
1/1/ / faculty of Electrical Engineering eindhoven university of technology Memory Management and Protection Part 3:Virtual memory, mode switching,
Advertisements

More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Wat gaan we doen? harhaling data types
ECE 353 Introduction to Microprocessor Systems
Lab III Real-Time Embedded Operating System for a SoC System.
Exceptions. Exception Types Exception Handling Vectoring Interrupts Interrupt Handlers Interrupt Priorities Interrupt applications 6-2.
Interrupts Chapter 8 – pp Chapter 10 – pp Appendix A – pp 537 &
1/1/ / faculty of Electrical Engineering eindhoven university of technology Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir.
Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 1  pak het project tint.zip.
Chapter 12: Software interrupts (SWI) and exceptions
LOGO Chapter 1 Interrupt handling. hardware interrupt Under x86, hardware interrupts are called IRQ's. When the CPU receives an interrupt, it stops whatever.
CSS 372 Lecture 1 Course Overview: CSS 372 Web page Syllabus Lab Ettiquette Lab Report Format Review of CSS 371: Simple Computer Architecture Traps Interrupts.
Introduction To The ARM Microprocessor
Chapter 7 Interupts DMA Channels Context Switching.
Midterm Tuesday October 23 Covers Chapters 3 through 6 - Buses, Clocks, Timing, Edge Triggering, Level Triggering - Cache Memory Systems - Internal Memory.
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 Interrupts INPUT/OUTPUT ORGANIZATION: Interrupts CS 147 JOKO SUTOMO.
1 COMP541 Interrupts, DMA, Serial I/O Montek Singh April 24, 2007.
ARM 7 Datapath. Has “BIGEND” input bit, which defines whether the memory is big or little endian Modes: ARM7 supports six modes of operation: (1) User.
COMP3221 lec28-exception-II.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lectures 28: Exceptions & Interrupts - II
COMP3221 lec27-exception-I.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lectures 27: Exceptions & Interrupts - I
COMP3221 lec40-exception-review.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lecture 40: Review of Exception
Midterm Wednesday 11/19 Overview: 25% First Midterm material - Number/character representation and conversion, number arithmetic - DeMorgan’s Law, Combinational.
Prardiva Mangilipally
The ARM Programmer’s Model
Embedded System Design Center Sai Kumar Devulapalli ARM7TDMI Microprocessor Thumb Instruction Set.
Exception and Interrupt Handling
Introduction to Embedded Systems
Interrupts. What Are Interrupts? Interrupts alter a program’s flow of control  Behavior is similar to a procedure call »Some significant differences.
CORTEX-M0 Structure Discussion 2 – Core Peripherals
DAT2343 Accessing Services Through Interrupts © Alan T. Pinck / Algonquin College; 2003.
Introduction to Embedded Systems Rabie A. Ramadan 6.
ECE 353 Introduction to Microprocessor Systems Discussion 11.
1 CS/COE0447 Computer Organization & Assembly Language Chapter 5 part 4 Exceptions.
AT91 Interrupt Handling. 2 Stops the execution of main software Redirects the program flow, based on an event, to execute a different software subroutine.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Operating Systems 1 K. Salah Module 1.2: Fundamental Concepts Interrupts System Calls.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Antelope Progress MMU and Cache->Datapath interfaces almost complete Datapath moving slowly, control issues keep surfacing Hazard Detection/Prevention.
AT91 C-startup. 2 For reasons of modularity and portability most application code for an embedded application is written in C The application entry point.
بسم الله الرحمن الرحيم MEMORY AND I/O.
Renesas Electronics America Inc. © 2011 Renesas Electronics America Inc. All rights reserved. RX Interrupt Control Unit (ICU) Ver
The 8051 Microcontroller Chapter 6 INTERRUPTS. 2/29 Interrupt is the occurrence of a condition an event that causes a temporary suspension of a program.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
1 TM 1 Embedded Systems Lab./Honam University r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 (sp) r14 (lr) r15 (pc) cpsr r13 (sp) r14 (lr) spsr r13 (sp)
Introduction to ARM processor. Intro.. ARM founded in November 1990 Advanced RISC Machines Company headquarters in Cambridge, UK Processor design centers.
ARM7 TDMI INTRODUCTION.
Instruction Set Architectures Early trend was to add more and more instructions to new CPUs to do elaborate operations –VAX architecture had an instruction.
Introduction to Exceptions 1 Introduction to Exceptions ARM Advanced RISC Machines.
Ch 5. ARM Instruction Set  Data Type: ARM processors supports six data types  8-bit signed and unsigned bytes  16-bit signed and unsigned half-words.
Intel Xscale® Assembly Language and C. The Intel Xscale® Programmer’s Model (1) (We will not be using the Thumb instruction set.) Memory Formats –We will.
Chap. 4 ARM Boot Loader Internals. 2 S3C2500 ARM940T Core module ARM9TDMI CoreIC.
Intel Xscale® Assembly Language and C. The Intel Xscale® Programmer’s Model (1) (We will not be using the Thumb instruction set.) Memory Formats –We will.
Chapter 12: Software interrupts (SWI) and exceptions
Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir. A.C. Verschueren Eindhoven University of Technology Section of Digital.
Chapter 4: Introduction to Assembly Language Programming
Interrupts and signals
CS501 Advanced Computer Architecture
Chapter 9 Exception & Interruption
Timer and Interrupts.
May 2006 Saeid Nooshabadi ELEC2041 Microprocessors and Interfacing Lectures 27: Exceptions & Interrupts - I
Real-Time Embedded Operating System for a SoC System
Chapter 12: Software interrupts (SWI) and exceptions
Accessing Services Through Interrupts
ARM Introduction.
Computer System Laboratory
Agenda Programmers Model Instruction Sets System Design
May, 2004 Modified from notes by Saeid Nooshabadi
Lecture 12 Input/Output (programmer view)
Presentation transcript:

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 1

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 2 Main program code Interrupt code Interrupt Interrupt return

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 3  ARM runs in 1 of 6 modes  each mode has (some) unique registers  mode is available to outside world (fi: for a memory managment unit – not in LPC2106)  current mode is in the CPSR register  2 ‘normal’ interrupts: IRQ, FIQ

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 4 ARM User Programming model r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 (PC) CPSR 31 0 N Z C V r13: stack pointer r14: link register 31 0 Status register mode

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 5 All ARM registers 

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 6  switch to the interrupt mode (IRQ or FIQ) (this switches to the new set of registers!)  copy PC to LR  copy CPSR to SPSR  set PC to start of interrupt code (fixed) notes:  Almost the same as a procedure call (BL)  no use of the stack  No (automatic) saving of registers

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 7  ‘normal’ interrupts  Private LR (of course)  Private SP  no other private registers (must save users registers)

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 8  typically used for ‘simple & fast’ processing  Private LR (of course)  Private SP  Private R6.. R12  Low latency:  no need to save user’s registers  no need to initialise FIQ registers!

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 9  Vectored Interrupt Controller  between interrupt sources and the ARM core  handles: priorities and vectoring

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 10 1.FIQs 2.Vectored IRQs 3.Non-vectored IRQs While the code for an interrupt is running lower interrupts are blocked  The interrupt code must inform the VIC when its done!

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 11 Each  FIQ  vectored IRQ has a unique vector. In most cases this will be the start address of the code that handles the interrupt. All non-vectored IRQs share one vector, the interrupt code must inquire which interrupt has occured.

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 12  32 sources possible  16 hardware sources implemented on an LPC 2106

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 13

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 14 I

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 15 I

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 16 I

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 17

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 18 I

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 19

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 20 I

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 21

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 22  16 vector slots  0 has highest priority, 15 lowest  each slot contains  enable bit  the interrupt source (0..31)  the vector address (32 bits)

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 23 I

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 24

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 25 I

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 26 This is not mentioned in the Philips manuals 

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 27  probably: reserve and set the interrupt stack  make sure the hardware vector points to your code  configure the peripheral to generate interrupts  enable the interrupt source  select FIQ or IRQ  (vectored) set source, enable, vector  (non-vectored IRQ) set default vector  enable interrupts

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 28 ldrr2, = … mrsr0, Original PSR value bicr0, r0, Clear the mode bits orrr0, r0, Set IRQ mode bits msrcpsr_c, Change the mode movsp, r2 bicr0, r0, Clear the mode bits orrr0, r0, Set Supervisor bits msrcpsr_c, Change the mode

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 29 ldrpc, reset vector ldrpc, undefined instruction ldrpc, software interrupt ldrpc, prefetch abort ldrpc, data abort ldrpc, reserved ldrpc, [pc, IRQ. load from VICVectAddr ldrpc, FIQ

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 30  (probably) save registers  do what you have to do  clear the interrupt source  write to VicVectAddr  return: subspc, lr, #4

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 31 Why?  protect data that is used by both main and interrupts  protect code that must execute with a fixed timing

Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 32 __disable_interrupts: mrsr0, CPSR orrr0, r0, disable IRQ interrupts msrCPSR_fsxc, r0 movpc, lr __enable_interrupts: mrsr0, CPSR bicr0, r0, enable IRQ interrupts msrCPSR_fsxc, r0 movpc, lr