32-Bit-Digital Signal Controller Texas Instruments Incorporated

Slides:



Advertisements
Similar presentations
Yaron Doweck Yael Einziger Supervisor: Mike Sumszyk Spring 2011 Semester Project.
Advertisements

Real-Time Library: RTX
Computer System Overview
Chapter 4 DSP/BIOS. DSP/BIOS Part 1 - Introduction.
Real-Time Kernels and Operating Systems Basic Issue - Purchase commercial “off-the- shelf” system or custom build one Basic Functions –Task scheduling.
MotoHawk Training Model-Based Design of Embedded Systems.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
Chapter 13 Embedded Systems
OS Spring’03 Introduction Operating Systems Spring 2003.
Chapter 1 and 2 Computer System and Operating System Overview
Midterm Tuesday October 23 Covers Chapters 3 through 6 - Buses, Clocks, Timing, Edge Triggering, Level Triggering - Cache Memory Systems - Internal Memory.
Chapter 11 Operating Systems
Real-Time Kernels and Operating Systems. Operating System: Software that coordinates multiple tasks in processor, including peripheral interfacing Types.
1 When to Switch Processes 3 triggers –System call, Interrupt and Trap System call –when a user program invokes a system call. e.g., a system call that.
1 Operating Systems Ch An Overview. Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, Bare Bones Computer.
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
MicroC/OS-II Embedded Systems Design and Implementation.
1 Threads Chapter 4 Reading: 4.1,4.4, Process Characteristics l Unit of resource ownership - process is allocated: n a virtual address space to.
Detailed Technical Feature Presentation Background Information The Importance of Software Software Roadblocks Development Environment DSP Development Cycle.
Anne Mascarin DSP Marketing The MathWorks
Performance Evaluation of Real-Time Operating Systems
0 Deterministic Replay for Real- time Software Systems Alice Lee Safety, Reliability & Quality Assurance Office JSC, NASA Yann-Hang.
The 6713 DSP Starter Kit (DSK) is a low-cost platform which lets customers evaluate and develop applications for the Texas Instruments C67X DSP family.
DSP/BIOS System Integration Workshop Copyright © 2004 Texas Instruments. All rights reserved. D SP TEXAS INSTRUMENTS TECHNOLOGY 1.
Real-Time DSP System Design Course and DSP/BIOS II David J. Waldo Associate Professor Oklahoma Christian University 2501 E. Memorial Rd. Oklahoma City,
Introduction to Embedded Systems
Chapter 8 Windows Outline Programming Windows 2000 System structure Processes and threads in Windows 2000 Memory management The Windows 2000 file.
Ch. 9 Interrupt Programming and Real-Time Sysstems From Valvano’s Introduction to Embedded Systems.
1 Computer System Overview Chapter 1. 2 n An Operating System makes the computing power available to users by controlling the hardware n Let us review.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3: Operating Systems Computer Science: An Overview Tenth Edition.
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
TMS320 DSP Algorithm Standard: Overview & Rationalization.
DSP/BIOS Scheduling Chapter 9 C6000 Integration Workshop Copyright © 2005 Texas Instruments. All rights reserved. Technical Training Organization T TO.
Lecture 04 DSP/BIOS. Chapter 4 DSP/BIOS Part 1 - Introduction.
Code Composer Studio & DSP/BIOS
Overview Task State Diagram Task Priority Idle Hook AND Co-Routines
RTX - 51 Objectives  Resources needed  Architecture  Components of RTX-51 - Task - Memory pools - Mail box - Signals.
Real Time Operating Systems Michael Thomas Date: Rev. 1.00Date.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
System Components ● There are three main protected modules of the System  The Hardware Abstraction Layer ● A virtual machine to configure all devices.
MicroC/OS-II S O T R.  MicroC/OS-II (commonly termed as µC/OS- II or uC/OS-II), is the acronym for Micro-Controller Operating Systems Version 2.  It.
1 VxWorks 5.4 Group A3: Wafa’ Jaffal Kathryn Bean.
Processes & Threads Introduction to Operating Systems: Module 5.
DSP/BIOS for C6000/C5000. What is DSP/BIOS Real-time Environment –Thread execution model Threads, Mailboxes, Semaphores –Device independent I/O Logging,
Chapter 2 Process Management. 2 Objectives After finish this chapter, you will understand: the concept of a process. the process life cycle. process states.
Embedded Computer - Definition When a microcomputer is part of a larger product, it is said to be an embedded computer. The embedded computer retrieves.
Lecture 04 DSP/BIOS. Chapter 4 DSP/BIOS Part 1 - Introduction.
1.  System Characteristics  Features of Real-Time Systems  Implementing Real-Time Operating Systems  Real-Time CPU Scheduling  An Example: VxWorks5.x.
DSP/BIOS Real Time Operating system using DSP /ARM processor.
Unit - I Real Time Operating System. Content : Operating System Concepts Real-Time Tasks Real-Time Systems Types of Real-Time Tasks Real-Time Operating.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Overview: Using Hardware.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
Big Picture Lab 4 Operating Systems C Andras Moritz
Real-Time Operating Systems RTOS For Embedded systems.
Chapter 4 DSP/BIOS. DSP/BIOS Part 1 - Introduction.
Multiprogramming. Readings r Chapter 2.1 of the textbook.
Process concept.
Topics Covered What is Real Time Operating System (RTOS)
Intro to Processes CSSE 332 Operating Systems
Chapter 4 DSP/BIOS.
Real-time Software Design
Computer System Overview
Threads Chapter 4.
EE 472 – Embedded Systems Dr. Shwetak Patel.
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

32-Bit-Digital Signal Controller Texas Instruments Incorporated Module 12 : Real Time OS: DSP/BIOS 32-Bit-Digital Signal Controller TMS320F2812 Texas Instruments Incorporated

Real Time Operating Systems (RTOS) What is a RTOS? Particular class of operating systems for digital processor systems Capable of serving multiple user tasks at one time ( “multi-task OS”) For all tasks in a running system it is guaranteed, that random external events in the environment of each individual task will be serviced in a given time ( “Worst Case Response Time”). All tasks must be served simultaneously (“multi-task OS”) AND timely (“RTOS”) RTOS are very popular in embedded control

Real Time Operating Systems (RTOS) What is a Task? A running or executable program object, that: is controlled by a portion of machine code ‘owns’ a given set of operating resources to start/resume its course of actions is characterized by a set of state variables ( registers, program counter, local stack variables, semaphores, mailboxes) Tasks are programmed and debugged independently from each other Accesses to peripherals or data transfers between tasks are performed by RTOS -system functions calls.

Real Time Operating Systems (RTOS) What is a Task- State - Model? Each task can reside in one of the following states: existent not existent ready completed blocked running 1 2 3 4 5 6 7 8 For explanation of arrows 1-8 see next slide

Real Time Operating Systems (RTOS) When does the task – state change? A task is created by an initialization function A task is selected by the scheduler to use the CPU The scheduler performs a task change according to the scheduling rules of the RTOS The running task is waiting for an external event , a message from another task or for a signal The event that was blocking a task has occurred The task has completed its program The task is re-activated by another task or by an event The task will never be used again ( as long as the embedded system is not switched off) All other task state transitions are illegal.

Real Time Operating Systems (RTOS) What is a Task - Scheduler? An important part of the RTOS that schedules the sequence of task execution phases and the change of task states Two basic operating modes for schedulers: time slice mode - computing time is assigned to tasks in a predefined amount of processor time priority mode – computing time is assigned to tasks according to the priority of each task in the system. If a task with higher priority gets into status ‘ready’ the running task will be pre-empted. combined versions between pre-emptive and time slice schedulers are also possible

Texas Instruments DSP/BIOS What is DSP/BIOS? BIOS = “Build In Operating System” Texas Instruments firm ware RTOS kernel for the TMS320 family of DSP’s A full-featured, scalable real-time kernel System configuration tools Preemptive multi-threading scheduler Real-time analysis tools

Texas Instruments DSP/BIOS Why use DSP/BIOS? Helps manage complex C28x system resources Allows to develop and test tasks in a multiple task control environment independently Reduces software project development time Eases software maintenance & documentation Integrated with Code Composer Studio IDE Requires no runtime license fees Fully supported by TI and is a key component of TI’s eXpressDSP™ real-time software technology Uses minimal MIPS and memory (2-8K)

DSP/BIOS Configuration Tool (file .cdb) System Setup Tools Handles memory configuration (builds .cmd file), run-time support libraries, interrupt vectors, system setup and reset, etc. Real-Time Analysis Tools Allows application to run uninterrupted while displaying debug data Real-Time Scheduler Preemptive tread manager kernel Real-Time I/O Allows two way communication between threads or between target and PC host

Design Problem: Add a new Function TI DSP Existing Function Function 1 New Function Issues: Do we have enough remaining computing power to add another function? Are there possible resource conflicts between the new function and the existing system? Will the new system meet all time restrictions in a real-time embedded control system? Function 2 What are some possible solutions?

Solution 1: extend the main-loop { while(1) } Call each function from an endless loop within main Potential Problems: What if Algorithms run at different rates: - motor current loop at 20 kHz - respond to keypad input at 2 Hz What if one algorithm consumes enough MIPS to force the other algorithm to miss its real-time deadlines / delays its response? Function 1 Function 2

Solution 2: use interrupts An interrupt driven system places each function in its own ISR TI DSP main { while(1); } Function1_ISR Function2_ISR Period Compute CPU Usage Function 1: 0.05 ms 1 s 2% Function 2: 500 ms 3 s ~ 0% 2% Function 1 running Function 1 idle Function 2 Function 2 Time 1 2 3 5 4 6 7 Only one ISR can run at a time: Function 1 will be delayed, eventually missing its deadline…

Solution 3: nested hardware interrupts (HWI) Nested interrupts allow hardware interrupts to preempt each other main { return; } Function1_ISR Function2_ISR running idle Function 1 Time 1 2 3 4 5 6 7 Use DSP/BIOS HWI dispatcher for context save/restore, and allow preemption Reasonable approach if you have limited number of interrupts/functions one HWI function for each interrupt Function 2

DSP/BIOS - HWI Dispatcher for ISRs For non-BIOS code, we use the interrupt keyword to declare an ISR tells the compiler to perform context save/restore interrupt void MyHwi(void) { } For DSP/BIOS code, the dispatcher will perform the save/restore Remove the interrupt keyword from the MyHwi() Check the “Use Dispatcher” box when you configure the interrupt vector in the DSP/BIOS config tools

DSP/BIOS - Software Interrupts (SWI) Make each algorithm an independent software interrupt SWI scheduling is handled by DSP/BIOS HWI function triggered by hardware SWI function triggered by software e.g. a call to SWI_post() Why use a SWI? No limitation on number of SWIs, and priorities for SWIs are user-defined SWI can be scheduled by hardware or software event(s) Relocate task processing from HWI to SWI main { … // return to O/S; } DSP/BIOS Function 1 Function 2

DSP/BIOS - Periodic Functions CLK tick period LED Periodic functions run at a specific rate in your system: - e.g. LED blink requires 0.5 Hz Use the CLK Manager to specify the DSP/BIOS CLK rate in microseconds per “tick” Use the PRD Manager to specify the period (for the function) in ticks Allows multiple periodic functions with different rates

Creating a Periodic Function DSP/BIOS CLK tick period func1

Enabling BIOS – Return from main() { … // return to BIOS } DSP BIOS Must delete the endless while() loop main() returns to BIOS IDLE thread, allowing BIOS to schedule events, transfer info to host, etc. An endless while() loop in main() will not allow BIOS to activate Function 1 Function 2

Built-in Real-Time Analysis Tools Gather data on target (3-10 CPU cycles) Send data during BIOS IDL (100s of cycles) Format data on host (1000s of cycles) Data gathering does NOT stop target CPU Execution Graph Software logic analyzer Debug event timing and priority CPU Load Graph Shows amount of CPU- power being consumed

DSP/BIOS - API Modules TSK Communication/Synchronization SEM Semaphores manager MBX Mailboxes manager LCK Resource lock manager Device-Independent Input/Output PIP Data pipe manager HST Host input/output manager SIO Stream I/O manager DEV Device driver interface Memory and Low-Level Primitives MEM Memory manager SYS System services manager QUE Queue manager ATM Atomic functions GBL Global setting manager Instrumentation/Real-Time Analysis LOG Message log manager STS Statistics accumulator manager TRC Trace manager RTDX Real-Time Data eXchange manager Thread Types HWI Hardware interrupt manager SWI Software interrupt manager TSK Multi-tasking manager IDL Idle function & process loop manager Clock and Periodic Functions CLK System clock manager PRD Periodic function manager

Lab 12: Modify Lab 2 to use BIOS Use your solution for Lab2 to begin with Modify the project to use DSP/BIOS functionality Let DSP/BIOS create the necessary Linker Command Files Replace the software delay loop from Lab2 by a periodic function (“PRD”) of DSP/BIOS Create a new function “led_runner()” that will activate the next state of the LED-line Call this function every 500ms with a PRD-function out of DSP/BIOS For a detailed procedure see textbook!