Article

Behind the datasheet: HW-RTOS

Nishant Nishant
computer motherboard on bench
Making software run faster using hardware acceleration

Transferring data is fundamental to the Industrial IoT. As communications protocols become more complex to handle the large amount of data being moved around, they demand more of the limited resources available in an endpoint, such as a sensor or actuator. Can hardware accelerators help minimize the software burden?

Most embedded systems now use some form of operating system, particularly if they are based on a modern 32-bit core like the Arm Cortex-M family. Support for embedded real-time operating systems is strong, thanks to the benefits they bring. But real-time comes in many shapes, so what can engineers do if they need to maintain hard real-time execution? One approach is to make full use of the hardware features offered by the processing platform.

An operating system is normally software, designed to interact with hardware at a low level. Operating systems often provide an abstraction layer between the application and the hardware, which makes it easier for the higher-level code to access those low-level features.

A real-time operating system, or RTOS, extends this to include ways of guaranteeing things happen just when you want them to. This can create conditions where the software and hardware battle for control. The way around this is to turn off those hardware features that could disrupt the software, but this too has problems. If certain features, like interrupts, are turned off (masked) even for very short periods, there is a chance that an event will be missed.

This basically describes the huge challenges involved and the enormous skills required when developing real-time systems. The RTOS was designed to mitigate these issues, using techniques such as ticks, semaphores and interrupt service routines. All these features are normally software based.

The concept behind the proprietary HW-RTOS, or hardware RTOS, is to implement these features in hardware and access them through APIs. What this brings is low interrupt latency with low jitter and very short interrupt disable periods.

The main features of the Renesas HW-RTOS

By taking a dedicated hardware approach, the HW-RTOS handles the tasks that could make an RTOS less responsive. Because these features are offloaded to hardware, the rest of the system becomes more responsive and less susceptible to disruption from isolated events.

The first of these is tick offloading. By handling the process of measuring elapsed time in hardware, the RTOS doesn’t have to stop executing its current task just to mark time. And because the tick is executed in hardware there is no variation in time measurement, resulting in higher precision.

Diagram

The tick offloading feature of Renesas’ HW-RTOS acceleration technology delivers greater accuracy and higher processor utilization.

 

Interrupt servicing is a big part of real-time system design. A RTOS handles interrupts by switching to the relevant service routine when an interrupt is detected. If another interrupt is asserted during that time, potentially with a higher priority, it could be missed. The normal approach is to switch between tasks when servicing interrupts, but this can result in long periods of time when no tasks are being executed due to the interrupt servicing process.

In the HW-RTOS, the interrupt service routine is handled in hardware. This has the effect of reducing the load on the CPU, but also shortening the time during which interrupts are disabled. A further gain is a reduction in context switching.

Task switching with HW-RTOS

The HW-RTOS works through APIs. To the host the operating system, the HW-RTOS looks like a peripheral sitting on the system bus. Renesas has created a library for using the three registers that control the HW-RTOS. These registers are the API register, the argument register and the result register. If a task switch is needed, the HW-RTOS indicates this to the host operating system and puts the identification of the task to switch to into the results register.

The HW-RTOS is available in the RZ/N1D, RZ/N1S and RZ/N1L processors from Renesas. For more information about HW-RTOS, including a full list of the APIs it supports, take a look at this document on the Renesas website.

Download Article

About Author

Nishant Nishant
Philip Ling, Senior Technology Writer

Philip Ling is a senior technology writer with Avnet. He holds a post-graduate diploma in Advanced M...

Marketing Content Spots
Related Articles
Related Articles
cityscape with radio waves
How to evaluate 5G mmWave Phased Array Antenna Modules
By Steven Fireman   -   May 29, 2024
Faster 5G development requires hardware and software with proven compatibility, plus precision instruments and interconnects to ensure the stability and accuracy of test and simulation results.
Engineers_bench_with_electronic_components
Where is the new low end in FPGAs?
By Avnet Staff   -   April 8, 2024
Programmable logic is a favorite of design engineers. Programmable devices blend flexibility, functional density, and time-to-market advantages. When low-end parts are discontinued, it reflects how electronic system design is evolving.
Related Events
Related Events
satellite in orbit
Space 2.0: AMD Technologies for New Space
Date: February 23, 2022
Location: Webinar