The use of Linux and DSP implementation of signal processing technology Dual-OS

| 23/04/2009 10:30:27

in system performance and programming ease of a compromise between the trade-off is a general-purpose OS with real-time operating system to distinguish between one of the main.

GPOS (general operating system) tend to provide higher level abstraction of resources, not only to support the software modules can be isolated and resources to improve application portability, simplify the development process, while the stability augmentation system, which has become GPOS such as network, user interface and display management of common system components such as the ideal choice.

However, the abstract system resources necessary to control the cost of fine particle size to meet the high intensity of signal processing code performance requirements of the calculation algorithm. For the realization of such high-level control, developers often require the use of real-time operating system (RTOS).

Embedded signal processing from the point of view, we usually have to consider two types of operating systems, Linux operating system that is universal real-time operating system and DSP (digital signal processor) / BIOS (basic input output system). Linux can support a higher level of abstraction techniques, and DSP / BIOS may provide more precise control.

In order to give full play to the advantages of the two operating systems, developers use a virtual machine system, which makes programming may be in the same DSP processor running Linux and DSP / BIOS system.

However, we would like to make an important question: Why not run Linux, respectively, with the use of DSP / BIOS system CPU + DSP combination device does? After all, CPU is running user interface such as control code has a higher efficiency. In addition, the different cores can be brought to avoid the cost of virtualization. However, in a chip with all the features still very attractive for the following reasons:

First, today's high-performance DSP generation DSP better than much larger, so that control can reduce the number of processing cycles. Second, the majority of high-performance general-purpose DSP performance stronger than the previous generation product, which enables more efficient handling of control code.

If all functions are integrated on the DSP, its advantages will be more outstanding. Fewer number of chips can be achieved at lower cost and smaller space. In addition, no longer need to spend a lot of electricity in the inter-processor data transfer, it can also reduce power consumption.

scheduling

The most common operating system is one of the best features is that we can run multiple tasks at the same time or more threads. Management through the core operating system to deal with the timetable to implement the relevant tasks for.

The past, the use of embedded Linux programmers will be less worried about the problem of real-time performance. However, the latest Linux kernel enhanced significantly improved its ability to respond to system events, so that it can meet a variety of enterprises and individuals, as well as embedded products.

Linux can be time-slicing threads, as well as the timing of priorities. Time slicing technology is the sharing between threads in all processing cycle to ensure that non-blocking threads. This method is usually applied to user interface functions, to ensure that the system overload, slow response is not the case in respect of a total loss of user functionality.

In contrast, the priority of thread scheduling techniques to ensure that the system may be the highest priority in the implementation of thread until the thread so far to give up control, then the next highest priority thread that is started.

Linux kernel every time the kernel to user mode from the conversion will be on the priority of threads available for re-evaluation, which means that core-to-date assessment of any incident (such as driver availability of data) can be immediately trigger a new thread (scheduler in response to the delay time) conversion. Identified as a result of priority-based thread, which usually must be met for real-time signal processing applications required.

The introduction of Linux kernel versions prior to 2.6, real-time performance constraints is a major factor in Linux kernel will disable the interrupt, and disable the time sometimes up to hundreds of milliseconds.

In this context, we can improve the efficiency of the kernel. Disable interrupt because when certain parts of code need to re-enter, and this will increase the interrupt latency response.

2.6 The current version provides the option of building may be in the kernel code in a higher frequency of disruption of re-opening of the insert command. Linux community often referred to as the first account of the characteristics of the kernel (preempt kernel), although this will give a slight decrease in core performance, but it can significantly improve the real-time performance. System for many tasks, the first account of Linux 2.6 kernel with real-time threads, when used in combination, will be able to provide sufficient performance to meet the demand for real-time.

For example, Texas Instruments (TI) of the DSP / BIOS software interrupt and tasks to support the form of priority scheduling only. With the Linux scheduler, the software interrupt and task-based accounts are the first. However, DSP / BIOS Application Programming also provides direct access to hardware interrupt conditions, the resource applies only to kernel mode Linux.

Direct access to hardware interrupt application programmers can achieve in theory, supported by the underlying hardware in response to the shortest delay. Of the control loop, such as the need for the application of the absolute minimum time delay, this fine grain size of the hardware interrupt control mechanism is usually a very important characteristic.

access protected resources

Linux operating system with the most common is a fundamental attribute of the user space program and the underlying system resources used in the separation. Only in the monitoring in the workplace (such as the kernel) mode to allow only direct access to memory and peripheral devices.

If users want to access the system resources to process, then it must be referred to as the kernel module driver requests from the kernel. The application is located in the user memory space, and file access through virtual driver. Then, the virtual file request will be applied to drive the implementation of the kernel memory space.

Linux provides a very rich characteristics of the drive model, including streaming media standard peripherals, modules, storage devices and file systems, network and even Web-based file system.

drive space applications and users can achieve a high degree of separation stability. In addition, the common drive interface to facilitate the abstraction level of data loss down the serial port, flash memory file system or network shared folder, and only a little of the underlying application code changes.

However, a price to pay to achieve this flexibility. Applications and the strict separation of the physical resources will increase costs. If the user space program to access peripheral devices, the kernel-mode environment must be exchanged in order to deal with the request.

Into a block of data is due to visit, rather than by the sample (sample-by-sample) to visit, so this will not usually result in very serious limitations. In this way, the kernel mode for each block only once to visit the exchange to the environment.

However, in some cases, the application code to be strictly matched with the physical hardware. If you use the DSP, such as higher data throughput and high-performance processors can not come to a halt, it is usually in such cases will appear. At this time, the kernel space of the physical resources and user-space application of phase separation approach may seriously affect system performance.
Application and hardware

match

We may wish to use to study the TMS320DM643x processor architectures in the implementation of video processing block will be encountered in a typical situation, the structure of a 600 MHz / 4800 MIPS DSP processing cores as well as feature-rich video subsystem port multimedia peripherals such as . This hardware typically used to input video stream H.264 compression format.

In order to give full play to the DSP core processing power, data processing operations from the internal memory read cycle, rather than from slower external memory read. Although technically can have a fast enough processor-chip memory storage of one or more complete video frame, but the majority of this technology is too costly for the target market. Therefore, provided the use of the single-cycle operation 80kB on-chip data memory to replace the processor.

80kB although small, can not store a complete video frame, but TI testing by simulating the view that sufficient storage capacity such as H.264 and other video processing algorithms to provide the best area / performance than integrated.

DSP through direct memory access (DMA) controller to provide data for the memory, this controller can also be used for internal and external memory efficient transmission of data between the sub-block, and will not take up the cycle of operation of processor core (see Figure 1 ).

graph processor 1DSP external memory DMA hardware to the smaller sub-block of the video frame transfer to internal memory for the DSP core to handle


From the perspective of the overall system, this method can provide almost the same as with the entire video buffer provided by the performance of the chip, but costs are very low. However, in order to achieve such a high-performance, on the need for applications, operating system and underlying hardware memory and DMA, close co-operation between.

First of all, the application must be able to distinguish between fast internal memory and large capacity external memory. Secondly, the application must be able to perform a lot of time for small precision DMA operation. Visit occurred as a result of all the DMA in the DMA access delay of each video frame will be enlarged when hundreds or even thousands of times, so in the Linux driver model to achieve high-performance DMA operation is not impossible, but it is extremely difficult.

The actual implementation of this method through DSP / BIOS to complete and provide the original application API to achieve the request of internal and external memory, but also to enable direct access to the application of DMA register will not result in exchange losses environment.

combination of the two operating systems

Despite the large number of multimedia applications to operate most of the processor cycles are used for signal processing, to meet consumer demand but also the product must perform many more advanced features such as user interface, display, network and document management.

As a result of these characteristics do not ask for much of the time there is no need for precise control of DSP / BIOS. At this time, Linux driver model provided by the resource extraction functions can be better to increase flexibility, reduce development time, not to mention access to a wealth of open source Linux community in support of the application code.

DSP BIOS and enable the Linux operating system running on the same device solutions is the need for the use of virtual procedures (virtualizer) for system development or integration of these two operating systems provide the advantage of (see Figure 2).

Figure 2Linux and DSP / BIOS to run in DM643xDSP device


Virtual process as a rapid, predictable switches in Linux and DSP / BIOS operating system resources between the DSP. When received at the time of interruption of DSP / BIOS operating system environment speculative exchange, to ensure that DSP / BIOS thread performance.

If the new arrival corresponds to the interruption of DSP / BIOS environment events have been identified, it will have been loaded and ready to run the DSP / BIOS environment to deal with them.

Procedures in a virtual support DSP / BIOS at the same time, applications can directly access the system resources required, and will not affect the (pending) Linux environment to maintain the user and kernel space.

Once the completed application DSP / BIOS environment of high-performance signal processing, the virtual machine will be forced to switch back to Linux environment, in order to access the environment of the more advanced features.

Conditioning in a virtual process, the exchange between the operating system for less than 10ms, which programmers can achieve real-time performance requirements, as opposed to only include DSP / BIOS of the original system, is no loss of performance. The solution of a typical multi-media equipment to deal with the resources occupied by only about 1.5%.

more advantage of dual-operating system

DSP / BIOS operating system, Linux-based products to expand one of the most obvious advantages are: no need to transfer hundreds of types of third parties to use the correlation algorithm. XDAIS as a result of compliance with standards to ensure that third-party algorithms can be seamlessly integrated in the DSP / BIOS environment.

DSP / BIOS operating system, Linux-based expansion of the system is another advantage: In the DSP / BIOS application environment from the Linux kernel implementation of GNU General Public License (GPL) restrictions.

in the implementation of solutions based on Linux, we are sometimes not very clearly the uniqueness of the introduction of software developers in the licensing of intellectual property rights in the end what the specific requirements. Through the DSP / BIOS operating environment rather than a Linux implementation of IP, to avoid legal issues in this regard.

Conclusion

This article describes the use of technology, Linux and DSP BIOS can be run in a unified core DSP, which is able to provide Linux solutions for all of the features, but also to ensure that the DSP / BIOS environment of high-precision control and hardware.

Programmers can take full advantage of Linux for the application code and apply to DSP / BIOS of the signal processing code, the need for transplants in different environments.

For embedded applications in real-time characteristics of the use of Linux in terms of designers, through the virtual process upgrades, while DSP BIOS tools, will greatly enhance the signal processing performance, and significant cost savings in system resources.