Budapest University of Technology and Economics, Faculty of Electrical Engineering and Informatics

    címtáras azonosítással

    vissza a tantárgylistához   nyomtatható verzió    

    Parallel and Event Driven Programming in Embedded Systems

    A tantárgy neve magyarul / Name of the subject in Hungarian: Párhuzamos és eseményvezérelt programozás beágyazott rendszereken

    Last updated: 2016. június 6.

    Budapest University of Technology and Economics
    Faculty of Electrical Engineering and Informatics
    Electrical Engineering, Embedded and Control Systems specialization
    Course ID Semester Assessment Credit Tantárgyfélév
    VIMIAC08 6 2/1/0/v 4  
    3. Course coordinator and department Dr. Kovácsházy Tamás,
    Web page of the course
    4. Instructors

    Tamás Kovácsházy, PhD, Associate Professor, MIT

    Balázs Scherer, Master Lecturer, MIT

    5. Required knowledge

    Fundamentals of microcontrollers, Computer architectures, Operating systems fundamentals, C/C++ programming, Fundamentals of embedded systems

    6. Pre-requisites
    Szakirany("AVINbeagy", _)
    VAGY Training.code=("5NAA7")

    A fenti forma a Neptun sajátja, ezen technikai okokból nem változtattunk.

    A kötelező előtanulmányi rendek grafikus formában itt láthatók.


    Informatics 1 (Operating systems and Computer architectures), Informatics 2 (Computer networks), Fundamentals of programming 1 (C programming), Fundamentals of programming (C++ programming)

    7. Objectives, learning outcomes and obtained knowledge

    The primary aim of the subject is to introduce students to the fundamentals and practice of parallel and event-driven programming because due to the growing complexity of embedded software and the emergence of many processor, distributed, heterogeneous system architectures this programming model is in the center of interest. To reach its aim the subject introduces the fundamental architecture and internal operation of embedded operating systems, the provided services to implement applications, both on the kernel and application programming interface level. The subject uses the FreeRTOS () and UNIX/Linux embedded operating systems to demonstrate the introduced topics, detailing the fulfillment of real-time requirements, memory handling, reliability, and resource virtualization related aspects also.

    8. Synopsis

    1. Architectural background of parallel and event-driven programming, processor and memory virtualization, protection/privilege levels and the MMU, cache coherency, multiprocessor, distributed and heterogeneous systems.

    2. Operating systems architectures, operating system types, internal operation, relationship to the applications. Concurrent and cooperative scheduling, priority, scheduling and the HW. System call and its implementations. Real-time operation and safety-critical operation in operating systems.   

    Practice: Test system installation into a virtual machine, introduction to the development system, make utility, Eclipse IDE, etc.

    3. Implementation of tasks and subtasks, processes and threads, comparison and properties, their implementation. Co-routine and fiber, as implementations of cooperative tasks, details of implementation. Design patterns for using processes and threads in cooperative scheduling.

    4. Processes and threads in embedded environments, practical implementations, analyses and comparison from this aspect using design patterns. Monitoring the running and inter-operation of processes and threads using software solutions.

    Practice: Creating and using processes and threads on Linux, monitoring their operation. FreeRTOS threads in practice and monitoring their operations.

    5. Mutual exclusion, synchronization, and communication in systems having shared memory. Sufficient condition to run task in parallel (Bernstein's condition). Lock-bit, semaphore, mutex, multiple readers single writer mutex, etc. and their operation and usage demonstrated using design patterns. Spinlocks and sleeplocks, their operation, and their effect on the performance of the embedded system including real-time properties and energy use.
    6. Analyses of practical solutions for mutual exclusion, synchronization, and communication as a case study.

    Practice: Mutual exclusion, synchronization, and communication 1.

    7. Continued analyses of mutual exclusion, synchronization, and communication. Comparing the kernel and user space solutions.

    8. Handling time in embedded systems, time as a physical unit and its representation in computers in embedded systems. The architecture of clocks, real-time clocks, system clocks, delaying execution and suspension of tasks based on time.

    Practice: Mutual exclusion, synchronization, and communication 2.

    9. Mutual exclusion, synchronization, and communication in massage passing systems. Properties of message passing, comparison of message passing to shared memory. Mailbox, message queue, pipelines and named pipelines, TCP/IP, remote procedure/method call. Design patterns for message based communications.

    10. Mutual exclusion, synchronization, and communication in Linux. Posix and System V solutions. TCP/IP and Unix domain sockets.

    Practice: Mutual exclusion, synchronization, and communication using message passing in between processes in Linux.

    11. Typical programming errors in the application of mutual exclusion, synchronization, and communication, and common solutions to avoid them. Deadlock, livelocks, priority inversion, other errors. The concept of monitors and its application.

    12. Handling of memory. The memory modell of FreeRTOS, reserving and freeing memory, consequences, the role of the heap and the stack. Memory handling in Linux, using virtual memory and its consequences.

    Practice: Suspending a task for specified time and running tasks at given time. The application of spinlocks, HW timers and OS virtual timers. Using timeouts for reliability and error handling embedded systems.

    13. Tools used during the development of parallel and event-driven system, their operation, and practical application. Tracing with software and hardware tools. Profiling. Tracking memory use and detecting memory leaks with tools. Fault detection, performance analyses and optimization tools for embedded systems.

    14. Alternative software and/or hardware solutions. Hardware semaphores, multiport memory, software or hardware transactional memory, lockless programming. Hypervisors and platform virtualization in embedded systems. Peripheral virtualization including sensor virtualization.    

    Practices are scheduled for even weeks, but due to some scheduling issues they can be organized on even weeks.

    9. Method of instruction Lecture and practice
    10. Assessment

    During the semester:

    1. Participation on the practices. There will be 6 practices organized during the semester (2 hours in every two week taking into account state holidays, etc.). Participation is checked on these occasions. It is mandatory to take part at least on 4 practices, otherwise no signature will be granted. No practices can be repeated.

    2. Satisfactory preparation of a home work assignment is also mandatory for the signature. The homework is a complex system, running on both FreeRTOS based (running on a microcontroller development board) and Linux based (running on a virtualized PC) components.

    Oral exam during the examination period. No advanced exam will be organized.

    11. Recaps The homework can be finished during the repetition period according the Rules of Lectures and Examination (Tanulmányi és Vizsga Szabályzat, TVSZ). The homework and the practices cannot be substituted with an examination.
    12. Consultations Upon request by student taking into account both human and other resources.
    13. References, textbooks and resources Bruce Powel Douglass, „Real-Time Design Patterns: Robust Scalable Architecture for Real-Time Systems”, Addison-Wesley Professional Computing Series, 2002.
    Bruce Powel Douglass, „Design Patterns for Embedded Systems in C: An Embedded Software Engineering Toolkit”, Newnes, 2010.
    Richard Barry, „Using the FreeRTOS Real Time Kernel - Standard Edition”, 2010.
    Richard Barry, „Using the FreeRTOS Real Time Kernel - a Practical Guide - Cortex M3 Edition”, 2010.
    W. Richard Stevens (Author), Stephen A. Rago, „Advanced Programming in the UNIX Environment (3rd Edition) (Addison-Wesley Professional Computing Series, 2013.
    14. Required learning hours and assignment
    Kontakt óra60
    Félévközi készülés órákra20
    Felkészülés zárthelyire 
    Házi feladat elkészítése20
    Kijelölt írásos tananyag elsajátítása 
    15. Syllabus prepared by
    Tamás Kovácsházy, PhD Associate ProfessorBME-MIT
    Balázs Scherer Master LecturerBME-MIT
    Gábor Naszály Assistant Lecturer BME-MIT
    Gábor Wacha PhD studentBME-MIT