You are required to read and agree to the below before accessing a full-text version of an article in the IDE article repository.

The full-text document you are about to access is subject to national and international copyright laws. In most cases (but not necessarily all) the consequence is that personal use is allowed given that the copyright owner is duly acknowledged and respected. All other use (typically) require an explicit permission (often in writing) by the copyright owner.

For the reports in this repository we specifically note that

  • the use of articles under IEEE copyright is governed by the IEEE copyright policy (available at
  • the use of articles under ACM copyright is governed by the ACM copyright policy (available at
  • technical reports and other articles issued by Mälardalen University is free for personal use. For other use, the explicit consent of the authors is required
  • in other cases, please contact the copyright owner for detailed information

By accepting I agree to acknowledge and respect the rights of the copyright owner of the document I am about to access.

If you are in doubt, feel free to contact

An Application Programming Interface for Hardware and Software Threads


Peter Nygren , Peter Nygren



Start time:

2004-09-24 15:15

End time:

2004-09-24 17:15


Delta-salen, Mälardalens högskola

Contact person:


In the modern society today, almost every mechanical system contains some kind of computer based system. The mechanical system could be for exampel a toaster, a toy for the kids to a more advanced system like a car, a train or an airplane. The computer based systems will be used to regulate and control external equipment connected to the system. The computer system has the task to react within precise time constraints to events in the environment. As a consequence, the correct behavior of these computer based systems depends not only on the calculated value but also on the time at which the results are produced. To have the possibility to regulate and control the mechanical system the computer system contains many components in software and today also an increasing number of hardware. The most common way to communicate between software and hardware components is to interrupt the software processor kernel and let the operating system manage the events. In almost any operating system, the arrival of an interrupt event causes the execution of a service routine (device driver). The advantage of this method is to encapsulate all hardware details of the I/O device. In many cases these interrupt driven service routines introduce problem for the real-time behavior. In cases where the interrupt routine is not handled properly, they can introduce priority inversion and unbounded delays of process execution. The new technology introduced with the Field Programmable Gate Arrays(FPGA's) represents a leap forward in digital design as large as when the micro-controllers were made public in the 70's. The inherent enormous parallelism in these devices introduces new design challenges and trade-offs. One promising approach is to use standard and custom hardware components to build a complete system on a single chip. All hardware components are executed in truly massive parallel to each other and do not need to interfere with each other, as opposed to software implementations. The problem with software in real time systems and the challenger with FPGA technology motivate research in communication and synchronization between hardware and software. This thesis presents an application interface called VCB (Virtual Communication Bus). It can in an easy way communicate and synchronize between hardware and software without any execution of software. The interface provides six different system-calls {connect, disconnect, send, receive, send&wait, broadcast}. The VCB has also functions to avoid priority inversion problems. The interface is fully implemented in hardware, meaning that no software is used during communication and system-calls can be made simultaneously. This makes the system easier to analyze and design. This thesis is organized with a description of the VCB concept, implementation architecture, and definition of hardware threads. Further more; a case study with device drivers for designing a service routine (device driver) to manage a Universal Asynchronous Receiver Transmit (UART) will be presented.

Peter Nygren,