1 Code Composer Studio & DSP/BIOS Integrated Develop Integrated Develop Environment Environment Real Time Scheduling, Real Time Scheduling, Debug & Analysis Debug & Analysis Time To Market Time To Market Performance Performance Reliability Reliability
41
Embed
1 Code Composer Studio & DSP/BIOS Integrated Develop Environment Environment Real Time Scheduling, Debug & Analysis Time To Market PerformanceReliability.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Fundamental mechanism needed for an application to control and react to multiple, discrete real world events to produce a correct result within a specified time
Traditional Super-loopTraditional Super-loop(Cyclically Scheduled)(Cyclically Scheduled)
Independent ControlIndependent Control
26
Cyclically Scheduled Systems Are Problematic
INTsINTsINTsINTs
fxn 2fxn 2fxn 2fxn 2
fxn 1fxn 1fxn 1fxn 1
main()main()main()main()
fxn 3fxn 3fxn 3fxn 3
fxn 4fxn 4fxn 4fxn 4
INTsINTsINTsINTs
Time-Out?
CPU Load?
Time
... hence the need for preemptive Real Time SchedulingReal Time Scheduling
27
Thread Scheduling - HWI & Idle/ Background
INT 5INT 5INT 5INT 5
INT 1INT 1INT 1INT 1
main()main()main()main()
idleidle
INT 2INT 2INT 2INT 2
INT 3INT 3INT 3INT 3
INT 4INT 4INT 4INT 4
TimeJWL - TISB - 2/4/00
28
HWI - Hardware ISR Manager
Respond to external asynchronous events
HWIs run uninterrupted to completionIf posted multiple times, runs only once
Need to minimize time and code in Interrupt Service Routine
Move large processing needs by posting a SWI
HWI time is ‘Other Threads’ on Execution Graph
Set up with Config Tool
29
Priority Based Scheduling - DSP/BIOS
HWIsHWIsHWIsHWIs
SWI 1SWI 1SWI 1SWI 1
main ()main ()main ()main ()
idleidle
SWI 2SWI 2SWI 2SWI 2
SWI 3SWI 3SWI 3SWI 3
SWI 4SWI 4SWI 4SWI 4
TimeJWL - TISB - 1/24/00
Run
Post
Ready (post)
Run
Preempted
30
DSP/BIOS - Round Robin & Periodic Examples
INT 1INT 1INT 1INT 1
SWI 1SWI 1SWI 1SWI 1
main ()main ()main ()main ()
idleidle
SWI 2SWI 2SWI 2SWI 2
SWI 3SWI 3SWI 3SWI 3
SWI 5SWI 5SWI 5SWI 5
Time
Priority basedScheduling
Round robinScheduling
SWI 4SWI 4SWI 4SWI 4
PeriodicScheduling
31
DSP/BIOS - SW Interrupt Scheduling
DSP/BIOS Software Interrupt threads use an ‘Interrupt Service’DSP/BIOS Software Interrupt threads use an ‘Interrupt Service’scheduling model.scheduling model.
DSP/BIOS SWI threads are preemptable, and run to completion.DSP/BIOS SWI threads are preemptable, and run to completion.DSP/BIOS SWI threads cannot be suspended (blocked) and therefore DSP/BIOS SWI threads cannot be suspended (blocked) and therefore
must have required resources ready before they run.must have required resources ready before they run.DSP/BIOS SWI threads are an excellent scheduling mechanism for DSP/BIOS SWI threads are an excellent scheduling mechanism for
very low overhead, deterministic, ‘Hard Real Time’ systems.very low overhead, deterministic, ‘Hard Real Time’ systems.
INT 1INT 1INT 1INT 1
SWI 1SWI 1SWI 1SWI 1
SWI 2SWI 2SWI 2SWI 2
SWI 3SWI 3SWI 3SWI 3
SWI 5SWI 5SWI 5SWI 5
SWI 4SWI 4SWI 4SWI 4
JWL - TISB - 2/08/00
32
DSP/BIOS II - Beyond SW Interrupts
_IO_isr: ssbx intm stm #0, imr pshm st0
…. popm st0 rsbx intm rete
A need for Dynamic A need for Dynamic PrioritizationPrioritization
No Guarantee of No Guarantee of Resource Resource AvailabilityAvailability
What if our new design requiresconcurrent real time operation?
TASK Scheduling blocking semaphores dynamic prioritization dynamic creation & termination Real Time Analysis low overhead log & statistics
RTOS style ConcurrencyRTOS style Concurrency
Dynamic Resource SharingDynamic Resource Sharing
Dynamic SchedulingDynamic Scheduling
Then we need Synchronized TaskScheduling !!(Multi-Tasking) (SPOX)
JWL - TISB - 2/08/00
34
DSP/BIOS II Task Scheduling
idleidle
INT 1INT 1INT 1INT 1
SWI 1SWI 1SWI 1SWI 1
TSK 2TSK 2TSK 2TSK 2
TSK 1TSK 1TSK 1TSK 1
DSP/BIOS II adds “Multi-Tasking” scheduling to the “InterruptDSP/BIOS II adds “Multi-Tasking” scheduling to the “InterruptService” scheduling model.Service” scheduling model.
DSP/BIOS Tasks are dynamic, preemptable, and can be suspendedDSP/BIOS Tasks are dynamic, preemptable, and can be suspended(blocked) to wait for data or other tasks.(blocked) to wait for data or other tasks.
DSP/BIOS Tasks are an excellent scheduling mechanism for DSP/BIOS Tasks are an excellent scheduling mechanism for dynamic, shared resource, ‘Hard & Soft Real Time’ systems.dynamic, shared resource, ‘Hard & Soft Real Time’ systems.
preempted
blocked
Ready (post)
Run
Preempted
Blocked
Terminated
35
IDL - Idle Function Manager
DSP BIOS API
H/W Interrupts
SWI
Background• Host data pump• Idle CPU load• Your function
Program
• Insert functions to execute within idle• Lowest priority SWI thread• Set up with Config Tool• Continuous loop - round robin• Real-time analysis plug-ins updated
C main ()
36
Real-Time Analysis
Determine whether the system is:Operating within its design specifications
Start a new project Set up objects with Configuration Tool Migrate interrupt vector table to the HWI
module Migrate memory sections from linker.cmd file
to MEM module Save and Add the .cdb file to your project Edit C source for #include headers and
declare variables Change C functions within your program
to DSP/BIOS APIs. Build the new project
Also… try the CC Studio Tutorial examplesAlso… try the CC Studio Tutorial examples……and study the DSP/BIOS by Degrees app note - SPRA591and study the DSP/BIOS by Degrees app note - SPRA591… … also Audio Example - DSP/BIOS app note - SPRA598also Audio Example - DSP/BIOS app note - SPRA598
Easy to visually configure run-time objects Set global run-time parameters Statically configures objects Detect errors early by validating properties before execution Calculate estimated data and minimal stack size Minimize target memory footprint by eliminating run-time code