Lecture 5: Lab 3 – Active HW Accelerator Design

Slides:



Advertisements
Similar presentations
Chapter 3 Basic Input/Output
Advertisements

Computer System Organization Computer-system operation – One or more CPUs, device controllers connect through common bus providing access to shared memory.
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, Low Power Modes and Timer A (Chapters 6 & 8)
1/1/ / faculty of Electrical Engineering eindhoven university of technology Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir.
A look at interrupts What are interrupts and why are they needed.
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
HW/SW Interface Operating Systems Design and Implementation.
Interrupts What is an interrupt? What does an interrupt do to the “flow of control” Interrupts used to overlap computation & I/O – Examples would be console.
COMP3221: Microprocessors and Embedded Systems Lecture 15: Interrupts I Lecturer: Hui Wu Session 1, 2005.
A look at interrupts What are interrupts and why are they needed in an embedded system? Equally as important – how are these ideas handled on the Blackfin.
Communication Lab - Interrupts 1/13 Sequential Programming  Our C++ programs are sequential ( סדרתיים), they start at the first instruction and end at.
A look at interrupts What are interrupts and why are they needed.
Homework / Exam Return and Review Exam #1 Reading Machine Projects
INPUT/OUTPUT ORGANIZATION INTERRUPTS CS147 Summer 2001 Professor: Sin-Min Lee Presented by: Jing Chen.
INTERRUPTS PROGRAMMING
Introduction to Embedded Systems
COMP201 Computer Systems Exceptions and Interrupts.
Interrupts. What Are Interrupts? Interrupts alter a program’s flow of control  Behavior is similar to a procedure call »Some significant differences.
DAT2343 Accessing Services Through Interrupts © Alan T. Pinck / Algonquin College; 2003.
Interrupts and DMA CSCI The Role of the Operating System in Performing I/O Two main jobs of a computer are: –Processing –Performing I/O manage and.
Khaled A. Al-Utaibi  Interrupt-Driven I/O  Hardware Interrupts  Responding to Hardware Interrupts  INTR and NMI  Computing the.
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.
HW/SW Co-design Lecture 4: Lab 2 – Passive HW Accelerator Design Course material designed by Professor Yarsun Hsu, EE Dept, NTHU RA: Yi-Chiun Fang, EE.
Microprocessors 1 MCS-51 Interrupts.
13-Nov-15 (1) CSC Computer Organization Lecture 7: Input/Output Organization.
1 © Unitec New Zealand Interrupt Lecture 6 Date: - 20 Sept, 2011 Embedded Hardware ETEC 6416.
6-1 Infineon 167 Interrupts The C167CS provides 56 separate interrupt sources that may be assigned to 16 priority levels. The C167CS uses a vectored interrupt.
Embedded Systems Design 1 Lecture Set 8 MCS-51 Interrupts.
Interrupts.
CS-280 Dr. Mark L. Hornick 1 Sequential Execution Normally, CPU sequentially executes instructions in a program Subroutine calls are synchronous to the.
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.
HW/SW Co-design Lecture 3: Lab 1 – Getting Started with the Tools Course material designed by Professor Yarsun Hsu, EE Dept, NTHU RA: Yi-Chiun Fang, EE.
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
Introduction to Exceptions 1 Introduction to Exceptions ARM Advanced RISC Machines.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Computer System Structures Interrupts
A walk through interrupts on the PPC 823
I/O Systems Shmuel Wimer prepared and instructed by
Homework / Exam Return and Review Exam #1 Reading Machine Projects
Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir. A.C. Verschueren Eindhoven University of Technology Section of Digital.
Interrupts and exceptions
16.317: Microprocessor System Design I
Interrupts and signals
CS501 Advanced Computer Architecture
Operating Systems CMPSC 473
Microprocessor Systems Design I
Mon. Oct 2 Announcements Quiz Postponed to Wednesday – still only on 2.a + 2.b Video lecture for 2.a posted Lab 6 experiment extension You must come to.
Timer and Interrupts.
Computer Architecture
Interrupts In 8085 and 8086.
Homework Reading Labs S&S Extracts ,
BVM Engineering College Electrical Engineering Department : Microprocessor and Microcontroller Interfacing Interrupts of 8051 Prepared by:
8259-programmable interrupt controller
Dr. Michael Nasief Lecture 2
Chapter 8 Input/Output I/O basics Keyboard input Monitor output
8259 Chip The Intel 8259 is a family of Programmable Interrupt Controllers (PIC) designed and developed for use with the Intel 8085 and Intel 8086 microprocessors.
Advisor: Prof. Gandhi Puvvada
Subject Name: Microprocessors Subject Code:10EC46 Department: Electronics and Communication Date: /20/2018.
Interrupts Interrupt is a process where an external device can get the attention of the microprocessor. The process starts from the I/O device The process.
Lecture 18 Interrupt 동국대학교 홍유표.
Speaker: Tian-Sheuan Chang July, 2004
Accessing Services Through Interrupts
Interrupts and Exception Handling
CNET 315 Microprocessor & Assembly Language
Embedded System Development Lecture 7 2/21/2007
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
COMP3221: Microprocessors and Embedded Systems
Interrupts and Exception Handling
Presentation transcript:

Lecture 5: Lab 3 – Active HW Accelerator Design HW/SW Co-design Lecture 5: Lab 3 – Active HW Accelerator Design Course material designed by Professor Yarsun Hsu, EE Dept, NTHU RA: Yi-Chiun Fang, EE Dept, NTHU

Outline Active Hardware Design Co-designed System on FPGA

ACTIVE HARDWARE DESIGN

Active Hardware Most devices in the real world have the ability to actively generate interrupts When the CPU detects that an interrupt is asserted, it saves a small amount of state and jumps to the kernel interrupt handler at a fixed address in memory The handler performs the corresponding processing (ISR), and executes a “return from interrupt” instruction to return the CPU to the execution state prior to the interrupt

GRLIB IRQMP (1/2) Multiprocessor Interrupt Controller Attached to AMBA bus as an APB slave The interrupts generated on the interrupt bus are all forwarded to the interrupt controller The interrupt controller prioritizes, masks and propagates the interrupt with the highest priority to the processor

GRLIB IRQMP (2/2) IRQMP implements a two-level interrupt controller for 15 interrupts When any of the IRQ lines are asserted high, the corresponding bit in the interrupt pending register is set The pending bits will stay set even if the IRQ line is de-asserted, until cleared by software or by an interrupt acknowledge from the processor

Active 1-D IDCT HW Acc. (1/3) The data path is identical to its passive version The registered IRQ number is 15 HIRQ line raises up for exactly one clock cycle right after the second stage completes Raise HIRQ signal for one clock cycle addr phase data phase stage 1 stage 2

Active 1-D IDCT HW Acc. (2/3) Every time the system is interrupted by the IDCT accelerator, its ISR will set a global variable idct_flag to 1 cyg_uint32 idct_isr(cyg_vector_t vector, cyg_addrword_t data) { unsigned long *idct_flag = (unsigned long *) data; (*idct_flag) = 1; cyg_interrupt_acknowledge(vector); return CYG_ISR_HANDLED; }

Active 1-D IDCT HW Acc. (3/3) Instead of polling the device registers, we now wait for idct_flag to become 1 We reset the flag back to 0 afterwards static void hw_idct_1d(short *dst, short *src, unsigned int mode) { ... *c_reg = (long)((mode << 1) | 0x1); while (idct_flag == 0){ /*busy waiting loop*/ } idct_flag = 0; }

CO-DESIGNED SYSTEM ON FPGA

Build SW Application In addition to the flags mentioned in the previous labs, we use -D_HW_ACTIVE_ flag to enable the use of IDCT ISR This flag will only work if -D_HW_ACC_ flag is set Use make to build the new version

Install IDCT Accelerator We replace grlib-gpl-1.0.19-b3188/lib/esw/idct_acc/idct_1x8.vhd with lab_pkg/lab3/hw/idct_1x8.vhd Use make ise | tee ise_log to build the bitstream

Profiling Results (1/2) Build the program with -D_PROFILING_ flag on Compare the computation results of sw_idct_2d() and hw_idct_2d() Compare the computation results with and without -D_HW_ACTIVE_ flag

Profiling Results (2/2) The active version is still faster than the pure SW implementation but much slower than its passive version Interrupt latency The calculation is too fast Only lasts for two clock cycles The action bit is already reset to 0 when the CPU polls the device registers for the first time Interrupt is useful when the CPU gets to do other meaningful operations before the hardware completes