|
QNX support for Virtex-II Pro devices enables software upgrades
and fault tolerance before, during, and after deployment.
Who would have thought RAM and
ROM memory, digital signaling processing,
customizable IP, embedded hard- and
soft-core microprocessors, multi-gigabit
serial transceivers, controlled impedance
technology, and remote-reconfigurable
FPGA logic fabric could all be integrated
into a single, reprogrammable device?
That's exactly the level of integration
offered by system-on-chip (SOC) platforms
like the Xilinx Virtex-II Pro™
FPGA. This device not only reduces board
size and simplifies the manufacturing
process, but is programmable (fast to
start), reprogrammable (quick to fix or
enhance), and field-upgradable (possible
to upgrade or optimize after deployment).
Moreover, it comes in a variety of densities,
packages, and configurations, allowing
you to deploy an SOC tailored to your
specific requirements.
To exploit these numerous capabilities,
you need appropriate tools and operating
system technology. Consequently, Xilinx
has worked with QNX Software Systems
to provide an integrated development
environment (QNX® Momentics® development
suite) and real-time operating system
(QNX Neutrino® RTOS) for the
IBM PowerPC™ 405 processors embedded
in Virtex-II Pro FPGAs. Together,
these QNX products offer software upgradability,
fault tolerance, and true real-time
performance – along with a rich complement
of tools for building, debugging, and
fine-tuning software applications.
Why Use an RTOS?
Before taking a closer look at the QNX
Neutrino RTOS, let’s examine why your
programmable system would even need an
RTOS in the first place. The answer, as
we’ll see, goes beyond issues of sheer speed
or efficiency.
On any given day, you may use dozens
of embedded applications. In some cases,
you probably don’t mind if the application
takes a second or two to respond. Waiting
for an ATM machine to dispense cash is a
perfect example.
An ATM represents the world of “soft”
real time, where a delay might diminish the
value of a system operation, but it doesn’t
pose a safety hazard, cause a major inconvenience,
or lead to an economic penalty.
An RTOS, with its ability to guarantee fast
response times, can be beneficial for such
applications, but it is not essential.
In many applications, however, even a
slight delay or timing error can constitute
system failure. Consider a router handling
VoIP where delayed packets can result in
unacceptable voice jitter, or an in-car
telematics system where consumers won’t
tolerate a user interface that fails to
respond immediately to input.
Similar delays can cause the effective
failure of medical monitoring devices,
consumer appliances, and a variety of
other software-dependent products. Such
systems – often dubbed “hard” real-time
systems – need an OS like the QNX
Neutrino RTOS to deliver the predictable
response times demanded of them.
How does an RTOS enable this predictability?
To begin with, it ensures that
software processes always execute in order
of their priority. If a high-priority, time-critical
process becomes ready to run, the
RTOS will immediately take over the
CPU from any lower-priority process.
Moreover, the high-priority process can
run uninterrupted until it has finished
what it needs to do – unless, of course, it
is preempted by a process with an even
higher priority.
This approach, known as “preemptive
scheduling,” helps ensure that time-critical
processes meet their deadlines consistently,
regardless of how many other
processes are competing for CPU time.
Besides preemptive scheduling, the
QNX Neutrino RTOS provides a number
of other mechanisms and capabilities to
enable fast, predictable response to critical
events. These include support for:
- Microsecond and even sub-microsecond
interrupt latencies
- Scheduling methods that set a capped
limit on the execution time of threads
- Nested interrupts that ensure the
RTOS always handles high-priority
interrupts first.
The QNX Neutrino RTOS also supports
“distributed priority inheritance,”
which enables any OS (for instance, a
device driver) to execute at the priority of
the application requesting the service. This
ensures that work done for a low-priority
application doesn’t prevent a higher-priority
process from accessing the CPU – a condition
known as “priority inversion.”
Nonetheless, RTOSs aren’t just for hard
real-time systems. By providing precise
control over the timing of every application
and system service, the QNX Neutrino
RTOS can make it much easier for you to
optimize the performance and behavior of
virtually any embedded design.
Engineered for Upgradable,
Reconfigurable Systems
Although Virtex-II Pro FPGAs provide a
platform for creating upgradable hardware
solutions, few RTOSs offer the equivalent
upgradability on the software side. For
instance, in a conventional RTOS, most
software components – the OS kernel,
networking stacks, drivers, and applications
– run together in a single memory
address space. This architecture is efficient,
but has two immediate drawbacks:
- A memory violation in any component
can corrupt the OS kernel or
any other component, causing system-
wide failure.
- It is difficult, if not impossible, to
dynamically add, repair, or replace
individual components.
The QNX Neutrino RTOS takes a very
different approach. Rather than pack software
components into a single, unwieldy
“monolith,” it allows applications, drivers,
file systems, and networking stacks to run
in separate, memory-protected address
spaces (Figure 1).
This approach offers several benefits:
- A fault in any software component
won’t damage the OS kernel or any
other component.
- Any component that commits a memory
or logic error can be automatically
restarted while the rest of the system
continues to run.
- Virtually any component, even a lowlevel
driver, can be started or replaced
on the fly, without rebooting.
Together, these capabilities make the
QNX Neutrino RTOS an ideal OS for
high-availability systems (such as network
elements, in-car telematics units, or TV
broadcast systems) that must run nonstop
– even if individual components fail or
hardware subsystems need to be replaced or
reconfigured. In fact, QNX-based systems
have a reputation for running 10 years or
longer without downtime.
The modularity of the QNX Neutrino
RTOS also makes it ideal for resource-constrained
systems, as it allows a system to
run only the software components it currently
requires. Any component that isn’t
required can be dynamically removed and
then restarted when the need arises.
Distributed Processing for
Multiprocessor Platforms
As Figure 1 illustrates, all software components
in the QNX Neutrino RTOS communicate
via a single, well-defined
communication mechanism: high-speed
message passing. This message passing
forms a virtual “software bus” that lets you
plug in – or plug out – any component
independently of other components, much
like the hardware buses of modern networking
equipment.
QNX message passing has other benefits
as well. Messages can flow transparently
across processor boundaries, allowing
applications to seamlessly access services
running on remote nodes.
This transparency offers interesting possibilities
for Virtex-II Pro FPGA-based systems
incorporating multiple PowerPC 405
embedded processors. For example, an
application running on one processor could
access a device driver or communications
stack running on another processor as if
that service was on the local processor. No
special code or programming is required. In
addition, QNX message passing automatically
synchronizes the execution of the
application and the remote service, even
though they reside on different CPUs.
It’s important to note that QNX message
passing can run “on the bare metal.”
As a result, remote processes can communicate
with each other without the overhead
of a conventional networking
protocol, such as TCP/IP (although
TCP/IP can be used if desired).
In addition, QNX message passing
doesn’t require any special programming
skills or application programming interfaces
(APIs). To exchange messages,
processes can simply use industry-standard
Portable Operating System Interface
(POSIX) calls, such as open(), read(), write(),
and lseek(). The actual job of passing messages
between processes is handled transparently
by the underlying C library.
Standard Interfaces Ease Portability
Speaking of POSIX, the QNX Neutrino
RTOS complies with POSIX 1003.1-2001 API standards, including threads,
real-time extensions, and a number of
other options. Consequently, it is quite
easy to port Linux™, Unix™, and other
open-source applications; in most cases,
you simply recompile and relink the
source. Programmers with Linux or Unix
experience can become productive almost
immediately in the QNX Neutrino operating
environment.
Validated Support for Platform IP
The QNX Neutrino RTOS has been ported
to the IBM PowerPC 405 embedded
processor in the Virtex-II Pro FPGA. In
addition, QNX Software Systems has ported (and validated with Xilinx)
support for customizable
platform IP cores such as
bootloader and startup code,
as well as drivers for the universal
asynchronous receiver
transmitter (UART), interrupt
controller (INTC),
10/100 Ethernet MAC, and
I2C. The Xilinx ML300 reference
platform with Virtex-II
Pro FPGA and PowerPC 405
processor served as the target
board for this process.
Integrated Toolset
Optimizes Workflow
QNX Software Systems has
also extended its QNX
Momentics development suite
to target the PowerPC processor
in the Virtex-II Pro FPGA. The QNX
Momentics suite supports all the tools you
might expect, such as graphical code editors,
debuggers, compilers, and project
builders. As Figure 2 illustrates, it also
includes a complement of non-intrusive
diagnostic tools to fine-tune applications on
your programmable system.
The integrated development environment
(IDE) in the QNX Momentics suite
is extremely flexible. You can:
- Code in multiple languages (C, C++,
Embedded C++, Java).
- Develop on several host environments
(Windows™, Solaris™, Linux, QNX
Neutrino RTOS).
- Use a mix of source-control protocols
- Choose between your own build
commands or the IDE’s multi-CPU
makefile framework.
The QNX Momentics suite also supports
industry-standard tools such as the
GNU GCC compiler and GDB debugger,
as well as a graphical source debugger that
is tightly integrated with the code editors,
memory analysis plug-in, and other tools.
Developers must focus on writing reliable
software in the least amount of time.
As a result, the QNX Momentics suite
includes wizards to automate mundane
tasks, such as creating new projects, configuring
remote debug sessions, and building
custom flash file system images for target
hardware. Plus, all tools – even third-party
plug-ins – share the same user interface,
making the IDE easy to learn.
To simplify diagnosis of system behavior,
the QNX Momentics development
suite offers several visualization tools:
The application profiler supports both
statistical and instrumented profiling
to pinpoint inefficient code and algorithms.
It can drill down to the sourceline
level, showing which lines are
consuming the most processor cycles.
- The memory analysis plug-in graphically
displays memory usage to help
catch overruns, underruns, invalid use
of memory, and freeing the same memory
twice.
- The system profiler performs trace
analysis to revolve timing conflicts,
pinpoint deadlocks, root out logic
flaws, detect hidden faults, and optimize
system-level performance. For an
example of the system profiler in
action, see Figure 3.
These tools are engineered to be noninvasive,
allowing you to accurately troubleshoot
systems both in the lab and in
the field.
To simplify integration
of third-party tools, the
QNX Momentics development
suite is based on
the Eclipse universal tool
platform. The Eclipse
platform is supported by a
large and rapidly growing
community of tool vendors
and developers.
Eclipse provides welldefined
interfaces to
ensure that tools – even
those from multiple vendors
– work together
seamlessly. Eclipse also
allows previously isolated
or unextensible tools to
share data with each
other, without the need
for manual intervention.
This integration can improve workflow
immensely, allowing you to quickly transition
from one task (stepping through the
start-up code for an embedded device) to
another (debugging applications running
on the embedded device).
Conclusion
To achieve the right mix of hardware, software,
and embedded operating system
technology in a programmable platform
like the Virtex-II Pro FPGA, you must
choose system components and development
tools wisely. The QNX Neutrino
RTOS allows your application to gain the
benefits of software reliability and hard
real-time performance, and it lets you
scale OS features to the size and nature of
the design.
Using the QNX Momentics IDE introduces
the flexibility of choosing your preferred
host and language, as well as
command-line or graphic interaction. The
highly integrated architecture of the IDE
can streamline your development process,
while the non-invasive diagnostic tools let
you quickly fine-tune your final product.
To learn more about the QNX
Neutrino RTOS, the QNX Momentics
development suite, and their support for
the Virtex-II Pro FPGA, visit QNX
Software Systems at www.qnx.com.
Printable PDF version of this article with graphics. (12/11/03) 325 KB |