DeSPerado – Realtime Operating System for Analog Devices ADSP-21K

Requirements

Main requirements to our Multi-Tasking Realtime Operating System (RTOS) for DSP – DeSPerado – are stated as follows.

  • Maintain concurrent performance of user programs in realtime mode.
  • Distribute resources of DSP with high effectiveness.
  • Simplify development of DSP firmware by providing to developer a set of service kernel functions.
  • Increase software reliability of control systems with DSP.

Component Parts

During detail analysis of functional and technical requirements to RTOS for DSP, the following components were considered to be implemented.

  • OS Loader - module intended to load OS kernel into internal processor memory from external storage (ROM, host PC, external flash-memory, etc) during initialization of the device.
  • Interrupt Handler - module that includes interrupt-handling routines for all interrupts supported by the processor. This module is necessary whereas the operating system should carry out complete control above functioning of the device.
  • Input/Output Server - module provides to user programs and processes proper facilities to perform I/O operations. It’s a library of system functions intended for work with built-in processor of input/output, and built-in DMA controller. Thus, it is supposed that user programs cannot directly access I/O ports, but should use service functions of I/O Server.
  • Inter-Process Communication Manager - module responsible to maintain and monitor data exchange between processes (programs).
  • Process Manager - a core of RTOS structure. It maintains concurrent processing of programs and processes in DSP. Process Manager implements the following main functions - Process Status Control, Process Workspace Management, Process Dispatcher, and Process Queues.

Approach

Taking into account the specific of software for embedded systems with DSP, we don’t separate OS kernel and user processes, but consider those as just different integral parts of entire DSP software linked together.

Such approach allows us to get rid of task loader as a part of RTOS, as after system is initialized all user processes are already loaded in DSP RAM.

Besides, such structure allows revealing many mistakes and critical factors in the software at compilation and configuration stages, that considerably facilitates debugging of developed software and raises its reliability.

With such approach, the operating system can be configured for definite application by its user, who is a software developer indeed, what’s certainly raising flexibility of the whole system.

Virtual Transputer Technology (VTT)

Designing RTOS for DSP, we developed our own Virtual Transputer Technology (VTT), representing a program model of concurrent processing system in the same way as it was designed in Inmos Transputer hardware. This technology provides conceptual integrity of the system, representing it as simple set of processes connected by I/O channels. Thus, all processes in the system, both service and user ones, have uniform structure, and I/O channels have the same programming interface that doesn’t depend on hardware properties of the I/O resources it uses.

VTT Concept

Some general points of this technology are listed below.

  • Any routine that can be executed concurrently is represented by Process.
  • All Processes in the system have common interface and structure.
  • There are two priority levels in the OS to separate urgent and regular Processes.
  • There are two different planning procedures to dispatch processes depending on their priority level.
  • High-priority realtime Processes are dispatched within the shortest time interval and can't be interrupted by another process.
  • Low-priority non-realtime Processes are dispatched slower and can be interrupted by high-priority process.
  • Process can perform data exchange only via pre-defined Channels.
  • Channel is a one-way point-to-point link for data exchange.
  • All Channels in the system have the same programming interface.
  • Physical Channels perform external data exchange and include hardware input/output resources and monitoring process.
  • Virtual Channels perform internal data exchange (Inter Process Communication) and don't include any hardware input / output resources.
  • When the Process requests the data exchange via Channel it will be de-scheduled to spare CPU time until the linked process is ready.
  • Process can suspend its execution for some time using Timer Channel.

Performance

During testing of developed RTOS for DSP, it has shown a very good realtime performance. Being tested on Analog Devices ADSP-21065 SHARC processor it has committed:

  • Interrupt latency time within 0.7 mcs.
  • High level process switching time within 6.5 mcs.
  • Low level process switching time within 19.75 mcs.

All above-mentioned values almost do not depend on actual OS load, what makes our RTOS outstanding from available competitive products.

Demo

DeSPerado 1.0 demo is a simple presentation version of the multi-tasking operating system core for the ADSP-2106x SHARC processors family. This demo illustrates the concurrent processing on the EZ-KIT LITE board, and includes three sample processes presenting DeSPerado kernel features.

The first process makes system "live check". It’s periodically blinking with LED2 on the EZ-KIT LITE board. User can change the blinking frequency by pressing S2 button.

The second and the third processes are connected with a channel and perform data exchange.

The second process performs four cycles of counting up to 5.000.000.000 and transmits the number of completed cycle to the third process though the channel.

The third process receives the number of cycle from the counting process and turns on LED5 after the first cycle, LED4 after the second cycle, LED3 after the third cycle, and turns off all those LEDs after ending of the second process.