Hardware/Software Codesign of Schedulers for Real Time Systems

Similar documents
Using Time Division Multiplexing to support Real-time Networking on Ethernet

Implementing Scheduling Algorithms. Real-Time and Embedded Systems (M) Lecture 9

ReconOS: An RTOS Supporting Hardware and Software Threads

Real-Time Networking for Quality of Service on TDM based Ethernet

OPERATING SYSTEMS CS3502 Spring Processor Scheduling. Chapter 5

Hardware Implementation of an RTOS Scheduler on Xilinx MicroBlaze Processor

PROCESS SCHEDULING Operating Systems Design Euiseong Seo

Concurrent Programming. Implementation Alternatives. Content. Real-Time Systems, Lecture 2. Historical Implementation Alternatives.

Network Interface Architecture and Prototyping for Chip and Cluster Multiprocessors

Concurrent Programming

Real-Time Technology in Linux

Introduction to Real-Time Systems and Multitasking. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff

RT extensions/applications of general-purpose OSs


Green Hills Software, Inc.

Lesson 5: Software for embedding in System- Part 2

Multimedia Systems 2011/2012

Embedded Systems. 5. Operating Systems. Lothar Thiele. Computer Engineering and Networks Laboratory

CS2506 Quick Revision

Implementation Alternatives. Lecture 2: Implementation Alternatives & Concurrent Programming. Current Implementation Alternatives

AUTOBEST: A United AUTOSAR-OS And ARINC 653 Kernel. Alexander Züpke, Marc Bommert, Daniel Lohmann

Reference Model and Scheduling Policies for Real-Time Systems

CSE398: Network Systems Design

The control of I/O devices is a major concern for OS designers

A Configurable High-Throughput Linear Sorter System

A Predictable RTOS. Mantis Cheng Department of Computer Science University of Victoria

Embedded Systems. 6. Real-Time Operating Systems

Microkernel Construction

Real-Time Operating Systems Design and Implementation. LS 12, TU Dortmund

ECEN 449 Microprocessor System Design. Hardware-Software Communication. Texas A&M University

Task Based Programming Revisited Real Time Operating Systems

by I.-C. Lin, Dept. CS, NCTU. Textbook: Operating System Concepts 8ed CHAPTER 13: I/O SYSTEMS

Review: Hardware user/kernel boundary

What s An OS? Cyclic Executive. Interrupts. Advantages Simple implementation Low overhead Very predictable

EE458 - Embedded Systems Modularization

Process Scheduling Queues

Computer Science Window-Constrained Process Scheduling for Linux Systems

Real-time Support in Operating Systems

Module 20: Multi-core Computing Multi-processor Scheduling Lecture 39: Multi-processor Scheduling. The Lecture Contains: User Control.

Hardware/Software Partitioning and Scheduling of Embedded Systems

CPU Scheduling. Daniel Mosse. (Most slides are from Sherif Khattab and Silberschatz, Galvin and Gagne 2013)

EMERALDS: a small-memory real-time microkernel

AMSC/CMSC 662 Computer Organization and Programming for Scientific Computing Fall 2011 Operating Systems Dianne P. O Leary c 2011

Real Time Linux patches: history and usage

The Xenomai Project. The Open Group Conference Paris, April Open Source Engineering

I/O Systems. Amir H. Payberah. Amirkabir University of Technology (Tehran Polytechnic)

Chapter 13: I/O Systems

Common Computer-System and OS Structures

FPGA. Agenda 11/05/2016. Scheduling tasks on Reconfigurable FPGA architectures. Definition. Overview. Characteristics of the CLB.

Department of Computer Science Institute for System Architecture, Operating Systems Group REAL-TIME MICHAEL ROITZSCH OVERVIEW

This is a copy of the accepted version of the paper, held on our institutional server, consistent with IEEE policy:

Module 12: I/O Systems

EECS 571 Principles of Real-Time Embedded Systems. Lecture Note #10: More on Scheduling and Introduction of Real-Time OS

Operating System Review

Chapter 13: I/O Systems

Process Description and Control

Real-Time Programming

Chapter 12: I/O Systems

Chapter 13: I/O Systems

Chapter 12: I/O Systems. Operating System Concepts Essentials 8 th Edition

System-on-Chip Architecture for Mobile Applications. Sabyasachi Dey

COT 4600 Operating Systems Fall Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:00-4:00 PM

TDDD07 Real-time Systems Lecture 10: Wrapping up & Real-time operating systems

I/O Systems and Storage Devices

CEC 450 Real-Time Systems

Back to RTOS. CSE466 Autumn 00-1

Xinu on the Transputer

Chapter 13: I/O Systems

System Architecture Directions for Networked Sensors[1]

CS/ECE 6780/5780. Al Davis

Page 1. Lab 5 Logistics. Implicit Threads. Explicit Thread Semantics. Problem not enough interrupt pins CS/ECE 6780/5780. Al Davis

Embedded Systems Dr. Santanu Chaudhury Department of Electrical Engineering Indian Institution of Technology, IIT Delhi

Embedded Systems. 7. System Components

Real-Time Concepts for Embedded Systems Author: Qing Li with Caroline Yao

RiceNIC. Prototyping Network Interfaces. Jeffrey Shafer Scott Rixner

Memory Management Outline. Operating Systems. Motivation. Paging Implementation. Accessing Invalid Pages. Performance of Demand Paging

DSP/BIOS Kernel Scalable, Real-Time Kernel TM. for TMS320 DSPs. Product Bulletin

SMD149 - Operating Systems

Threads SPL/2010 SPL/20 1

Introduction to Real-Time Operating Systems

ECE 477 Digital Systems Senior Design Project. Module 10 Embedded Software Development

Windows Interrupts

CEC 450 Real-Time Systems

Lecture Topics. Announcements. Today: Advanced Scheduling (Stallings, chapter ) Next: Deadlock (Stallings, chapter

Exam TI2720-C/TI2725-C Embedded Software

Handout. The ARM Instruction Set. Real Time Systems. Real Time Operating Systems. Real Time System Organization. Classification of Real Time Systems

Tasks. Task Implementation and management

15: OS Scheduling and Buffering

Generation of Multigrid-based Numerical Solvers for FPGA Accelerators

A Process Model suitable for defining and programming MpSoCs

Course Syllabus. Operating Systems

Chapter 19: Real-Time Systems. Operating System Concepts 8 th Edition,

Commercial Real-time Operating Systems An Introduction. Swaminathan Sivasubramanian Dependable Computing & Networking Laboratory

Outline. Introduction. Survey of Device Driver Management in Real-Time Operating Systems

Embedded Systems: OS. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Lecture notes Lectures 1 through 5 (up through lecture 5 slide 63) Book Chapters 1-4

CPU Scheduling. Operating Systems (Fall/Winter 2018) Yajin Zhou ( Zhejiang University

Computer Science. ! Other approaches:! Special systems designed for extensibility

Mobile Operating Systems Lesson 01 Operating System

Lecture 15: I/O Devices & Drivers

Transcription:

Hardware/Software Codesign of Schedulers for Real Time Systems Jorge Ortiz Committee David Andrews, Chair Douglas Niehaus Perry Alexander

Presentation Outline Background Prior work in hybrid co-design FPGA hardware/software co-design Scheduling RTFPGA Project Overview Design approach & functionality Design implementation plan Scheduler Implementation Hybrid co-design for KURT-Linux event scheduler System properties Testing and Analysis Functionality validation of design Data Stream testing Conclusions and future work

Contributions Design Mitchell Trope, Sweatha Rao Implementation Sweatha Rao, Jorge Ortiz Testing Mitchell Trope, Sweatha Rao, Jorge Ortiz

Background

Prior Work in Hybrid Codesign Average-case enhancements Worst-case scenarios Platform architectures for real time systems Systems that support real-time constraints

System Co-Design Parallel systems Multi-processor, FPGA, System-on-Chip, ASIC, Reconfigurable systems Hybrid systems Exploit recursive patterns Increase quality of service Meet real-time constraints Real time operating systems Hardware support for the operating system OS function migration

FPGA Hardware/Software Co-design Desired system properties Timeliness, concurrency, liveness, interfaces, heterogeneity, reliability, reactivity, predictability and safety Average-case, worst case scenarios System flexibility and performance Reconfigurable No loss in performance

Scheduling How to allocate which resources to whom and for how long Handling real-time events Desire for finer granularity for servicing interrupts Overhead costs due to interrupt handling and event scheduling Design trade-offs

RTFPGA Project Overview

Project Motivation Provide higher resolution and finer granularity for event handling Minimize overhead processing Migrating key functions into hardware Time keeping hardware support Hardware/software co-design of event scheduler for real-time hybrid operating system

Design Approach Migrate shadow timer into FPGA Implement scheduler bookkeeping operations Provide processing for enqueuing and dequeuing events Allow entering, sorting and deletion of events Enable access to all queued events Move scheduling algorithm into the hardware

Design Functionality FPGA stores event information in local queue Run scheduling algorithm Identify the next event to run Sends event time to a match register Free-counting hardware clock provides interrupt generation

Design Implementation Plan Interface ported KURT-Linux to FPGA components Create FPGA-mapped registers Create basic event queue storage, interface and functionality Implement event scheduler Deliver FIQ interrupts to CPU Solve concurrency issues of hardwarebased implementation

Scheduler Implementation

Hybrid Co-design for Kurt- Linux Event Scheduler Forward event requests from OS to hardware through command register Identify request type and event information:execution time and reference pointer Service request on event scheduler Raise interrupt flag upon execution time KURT-Linux runs appropriate ISR with retrieved event information

Data Flow Chart in the RTFPGA Scheduler Request to FPGA Send request to scheduler Identify request Add or delete in Block RAM storage Schedule events in parallel Queue expired events for CPU to read

RTFPGA Scheduler Modules

RTFPGA Scheduler Modules Register Mapper Interface to all registers Interface to internal functionality in the FPGA board Modular and portable Two operational blocks - read and write Timing, event information, scheduler commands, debugging information.

RTFPGA Scheduler Modules Memory Manager Control storage and handling of Block RAM-implemented event queue Block RAM Address generation for event addition Service Scheduler requests Dirty bits indicate usage of Block RAM addresses

RTFPGA Scheduler Modules Block RAM Dual-read/write port synchronous Block RAM FPGA storage memory First port for Memory Manager requests Second port for continuously polling information in BRAM addresses for scheduling and searching purposes

RTFPGA Scheduler Modules Utime Shadow of KURT Utime clock implementation Set for microsecond resolution Provide match register for next scheduled event time Create FIQ interrupts to CPU

RTFPGA Scheduler Modules Queue Minimum Earliest Deadline First algorithm Reads event values output by Block RAM Output information for next event to be scheduled Send appropriate control signals EDF pseudo-code START SET next_event = max value LOOP IF last deleted value = next_event GOTO START IF last expired event = next_event GOTO START IF no elements in queue THEN GOTO START ELSE READ new data from BRam event queue IF data = event (dirty bit is set) READ scheduled time IF scheduled time < next_event next_event = scheduled time END IF END IF END IF GOTO LOOP

RTFPGA Scheduler Modules Queue Delete Continuously receive polled information from Block RAM Perform a deletion using linear search & comparison Found or lost signal sent back to Memory Manager Check for concurrency with interrupt generation and event queue popping

RTFPGA Scheduler Modules FIFO Block RAM FIFO queue for expired events that have not been read yet by CPU Keep track of number of expired events De-queue until empty

Inter-Module Interfaces

System Properties High interdependency of modules Concurrency of deletions and interrupts solved by linear approach Highly cohesive scheduling algorithm Tight coupling due to system requirements

Testing and Analysis

Functionality validation of design Initial setup bootstraps FPGA timer shadow Check for: Event addition Event deletion Event scheduling

Event Addition Timing Diagram

Event Deletion Timing Diagram

Event Scheduling Timing Diagram

Integrated Scheduler Test 1. Initial Set up 2. Add Event1, Add Event2, Add Event3, Add Event4, Add Event5 3. Find Minimum 4. Delete Event2, Delete Event3 5. Find Minimum 6. Read current time from FPGA timer registers (jiffy, jiffy_u) 7. Write event_time = jiffy + offset 8. Write ref_ptr = loop variable 9. Repeat the above three steps for loop variable = 0 to 2 10. Wait on jiffy + large offset 11. WHILE fifo_ref_ptr!= x"00000000" (queue not empty) 12. Read fifo_ref_ptr (confirm all the three timers expired) 13. END WHILE 14. Read jiffy & jiffy_u

Data Stream Kernel Interface Tests With Hardw are Components Without 5000 Number of events 4000 3000 2000 1000 0 0 2 4 6 8 10 12 14 16 18 20 22 Execution time delay (us) Timer Execution Delay for Software RTOS and Hardware/Software RTOS

Data Stream Kernel Interface Tests The Software-based RTOS showed expected better performance Lag between CPU and FPGA timers of 2-4 microseconds FIQ handler schedules an IRQ, downgrading the interrupt priority

Data Stream Kernel Interface Tests [root@george dski]$./dskihists -i 900 -f 4 -h 1 -n 100 Waiting for 900 seconds... Name of the histogram: HIST_TIMER_EXEC_DELAY Number of events logged: 10000 Minimum Value: 0 Maximum Value: 7137329 Lower Bound: 0 Upper Bound: 100 Num of Buckets: 102

Stability and Bounded Execution Time Maximum execution delay for a softwarebased timer was in the range of millions of microseconds In the hardware version, all events in all tests were executed within the time delay range of 23 microseconds Hardware delay attributed to startup delays, worst case scenario checking, interrupt servicing, communication costs across ports

Event handling under different loads % of Events Handled FPGA Event handling 120 100 80 60 40 20 0 1 3 5 7 9 11 13 15 17 19 21 23 25 Time in microseconds 10K events 100 K Events Increase of 6.4% for events handled with a zero microsecond delay 1.7% increase for all events handled within one microsecond 12.6% increase after the serial port polling delay between 10-12 microseconds

Device Utilization (V2P) EDF scheduling function Logic utilization: 11% SLICES, 17% of LUT, 22% Block RAM, Gate Count of 405,637 Device utilization: 24% SLICES Total FPGA SLICE Utilization 83% or 2510 out of 3008

Conclusions and Future Work

System behavior Number of Events 12000 10000 8000 6000 4000 2000 0 1 3 5 7 9 11 13 15 With Hardw are Components Without 17 Execution Delay (us) 19 21 23 Aggregate performance characteristics of both systems are comparable Robust base for hardware based event scheduler correctness, behavior and performance

System characteristics Modular and Portable, IP encapsulated Flexible and reconfigurable COTS Linux environment Tested in different architectures, ADI Engineering's 80200EVB and the Xilinx Virtex-II Pro

Future Work Thread Scheduling Hardware-based Threads Hybrid Threads Smarter scheduler functionality Only necessary interruptions to CPU

Questions