XDCspec
serves as RTSC's specification language — used to formally define programmatic contracts (often termed APIs) between producers and consumers of software components in a higher-level manner than otherwise possible using C alone. XDCspec
has its roots in the C-like IDLs (interface definition languages) first introduced with COM and CORBA in conjunction with C++ several decades ago, and embodies one of the fundamental principles of modern software engineering — clean separation of public, client-visible specifications from internal, supplier-proprietary implementations.
Along the implementation axis, we also mitigate some limitations of embedded C programming by introducing XDCscript
as RTSC's meta-language — used by component producers and consumers alike to streamline delivery and assembly of real-time software components through (meta-)functions that execute on a resource-rich, general-purpose host computer. Complementing the more resource-constrained target-domain of embedded hardware executing embedded applications, RTSC's meta-domain opens up a world of possibilities for selectively migrating C-based target content to a higher-level language that operates in an implementation environment with virtually unlimited resources. XDCscript
itself leverages industry-standard JavaScript for its foundation, extending this popular language through tighter coupling back to XDCspec
and indirectly through to C itself.
To best appreciate the strategic role fulfilled by XDCspec
and XDCscript
within RTSC, consider the five-phase flow illustrated in the following figure which overlays new capabilities for specifying, delivering, and assembling real-time software components atop the familiar steps of compiling and linking C libraries and programs:
XDCspec
, a C-like specification language used for defining programmatic contracts in a more expressive and robust manner than possible with C header (.h
) files; in fact, RTSC automatically generates the latter files from XDCspec
sources. The XDCspec
language also elevates three new programming constructs to keyword
status, enabling better support for "programming-in-the-large" in standard C: module
, a cohesive collection of constants, types, and functions with both a public specification (expressed in XDCspec
) and a private implementation (typically expressed in C); interface
, an abstract module (spec only) that other interfaces can inherit and that concrete modules can ultimately implement; and package
, a higher-level programmatic namespace that in turn contains modules/interfaces within its scope.
XDCscript
meta-functions play an active role in the design-time configuration as well as the run-time analysis of target programs. To fulfill the role of the companion XDCscript
meta-language shown in the earlier figure, RTSC leverages the popularity, simplicity, and C-like "look-and-feel" of industry-standard JavaScript and its openly-available implementation through Mozilla's Rhino.
XDCspec
sources, a RTSC package has a concrete manifestation as a directory that adheres to a prescribed set of conventions; even more important, each RTSC package is built, released, and deployed as an indivisible entity throughout its life-cycle. Specialized package build scripts — written in the XDCscript
meta-language — simplify supplier-side management of multiple libraries compiled with multiple tool-chains (RTSC targets) as well as the inclusion of multiple subsets of these libraries in different package releases; manifests generated with each package record information about dependencies on other packages, about tool-chains used to compile constituent libraries, and about compatibility with earlier versions of this package. Client-side command-line and GUI tools streamline the deployment of RTSC packages by managing package repositories (directories containing package directories) as well as the package path (an ordered list of repository directories used to locate packages and their contents); these tools also validate the consistency and completeness of a set of deployed packages by leveraging information recorded in their manifests upon release.
XDCscript
meta-program — a script that prescribes the target-domain elements required by a corresponding target-program — RTSC configuration leverages the full resources of the client's host computer to robustly validate this specific combination of elements as well as to optimally generate downstream C compiler/linker inputs tailored for this program's needs. Besides explicitly identifying all modules required by the target-program, the corresponding XDCscript
meta-program can selectively assign configuration parameters ("configs" for short) — declared in the module's original XDCspec
source file and then used in downstream generation to enable new levels of application-specific optimizations for embedded C programs. Once the client's XDCscript
meta-program completes, RTSC configuration systematically invokes a series of special XDCscript
meta-functions implemented by each module required by the corresponding target-program: 1) to assign configs to other modules; 2) to issue errors/warning if anything seems "wrong"; 3) to guide generation of linker-commands for this program; and 4) to actively synthesize C code based on knowledge gained through the configuration phase. In general, all XDCscript
meta-content executing during RTSC configuration enjoys full access to this program's RTSC target and RTSC platform — more XDCscript
meta-content that codifies information about the underlying ISA and memory-map as well as the process of compiling/linking/loading the program using underlying tools.
XDCscript
meta-functions can also actively participate in the run-time analysis of these programs once execution has commenced (or even terminated). Given the ability to read the program's data memory — via a host-based debugger, an embedded program monitor, or even a snapshot of program state saved to disk — RTSC analysis first decodes target-domain module state-structures into equivalent meta-domain objects and then calls special XDCscript
meta-functions on a per-module basis to optionally transform these objects into a more meaningful view of the underlying state. Complementing this state-oriented perspective, another dimension of RTSC analysis involves merging, filtering, and interpreting streams of time-stamped events sourced during the course of program execution; the events themselves could be retained in target-side memory or else transmitted to another processor at run-time using an appropriate output device on the underlying hardware platform.
XDCspec
) as well as a meta-language (XDCscript
) may seem rather exotic at first glance, you can actually employ RTSC in a more incremental manner that allows content leveraging select aspects of the RTSC flow to ultimately co-exist with legacy libraries/headers in embedded application programs. RTSC is revolutionary and evolutionary.
Creating Managed Content. Without changing a line of legacy source code, you can leverage RTSC packages for their ability to manage software content from production through consumption; with only modest effort, existing libraries and headers could now flow from supplier to client via a standardized container that is built, released, and deployed using widely-available command-line and GUI tools.
XDCscript
meta-functions; content suppliers may also employ RTSC package build scripts to better insulate themselves from underlying compiler details as well as to better manage the compilation of common (legacy) source code for multiple targets.
makefile
that is robust and portable while readily extensible and customizable for the supplier's own production flow.
Creating Spec'd Content. As general-purpose containers, RTSC packages need not further define any RTSC modules within their logical scope; but when they do, these packages can participate more actively in downstream program configuration as well as present a more uniform face to client C programmers via generated headers. By wrapping legacy libraries with spec'd RTSC modules whose bodies trivially defer to existing implementations, this content becomes indistinguishable from newly developed modules in the eyes of the component consumer; at the end of the day, each RTSC module has an XDCspec
source that draws a programmatic boundary between clients and suppliers using a mixture of formal declarations and informal commentary, regardless of the implementation strategy chosen by the module supplier. Wrapper modules become an ideal locale for "adding value" atop existing libraries, through:
XDCspec
sources over .h
header files
XDCscript
meta-functions to support program synthesis and analysis
#define
symbols, static
constants, or readonly extern
data in the existing code base. Straightforward to implement on the supplier's side, benefit accrues when downstream clients can robustly assign these configs in XDCscript
meta-programs in lieu of more ad hoc and error-prone editing of C source files. And thanks to whole-program optimization technology available in many contemporary C compilers, module configs can be as efficient as #define
symbols used in conjunction with #if
; and wrapper modules can be as efficient as #define
macros or inline
functions.
Finally, RTSC enables content suppliers to define so-called metaonly
modules in XDCspec
— a module whose implementation is limited to host-based XDCscript
meta-functions — used to otherwise facade legacy content when even wrapper modules are inappropriate. Though lacking an automatically generated C header from its XDCspec
source, a metaonly facade module becomes indistinguishable from others during design-time configuration (and even during run-time analysis). Leveraging some of the more sophisticated back-end generation capabilities of RTSC configuration (e.g., synthesis of C code via parameterized templates), metaonly facade modules can achieve some of the benefits of target modules containing configs — but without any modification of legacy code, a possible constraint. Erecting software facades itself emerges as a general design pattern employed to encapsulate a myriad of underlying details — whether configuring legacy libraries or even calling other spec'd modules — through a simpler, more focused programmatic contract; what's important here is that RTSC modules defined in XDCspec
can broadly subsume a virtually unlimited continuum of techniques for layering new functionality atop existing content.
XDCTOOLS
product? XDCTOOLS
product lies at RTSC's point-of-origin, providing the necessary foundational elements for others to fill the RTSC space with target-content as well as additional tooling.
XDCTOOLS
— and by extension, RTSC — starts with the XDCspec
language. The XDCTOOLS
product itself includes an XDCspec
translator used to first parse source files and then (among other things) to generate corresponding C headers as well as client programmer documentation.
XDCTOOLS
likewise delivers the XDCscript
meta-language, integrated more closely with XDCspec
through an extended version of Rhino/JavaScript also shipped with the product; besides relying heavily on XDCscript
to support the build/release/deploy cycle of RTSC packages as well as the configure/execute/analyze cycle of RTSC programs, XDCTOOLS
encourages use of the XDCscript
meta-language as a general-purpose scripting engine that leverages the power and familiarity of JavaScript.
As for C itself, the XDCTOOLS
product does not necessarily bundle any particular compiler tool-chain(s); indeed, the XDCTOOLS
can interoperate with any ANSI C compiler. At the same time, the product does include knowledge of literally dozens of different C compilers from multiple vendors — so-called RTSC targets, which are actually spec'd XDCspec
metaonly modules coupled with a XDCscript
implementation which (with only modest effort) anyone could develop and deliver in their own package.
Core Packages. Moving up a level in the figure, the bulk of XDCTOOLS
comprises over a hundred packages containing even more modules/interfaces that broadly fall into three major groups:
XDCTOOLS
.
XDCTOOLS
builds upon itself through special XDCscript
meta-content that in turn drives the synthesis and analysis of target-content elements in executable programs.
XDCTOOLS
product in source-code form, to support migration to new RTSC targets — has its origins in some of the more rudimentary elements of TI's DSP/BIOS kernel. Separating out this functionality from the kernel enables RTSC to serve a much broader class of embedded system environments. By making the XDCTOOLS
product openly and freely available (not unlike Sun's Java Runtime Environment or Microsoft's .NET Framework), we anticipate an ever-growing inventory of interoperable third-party target content populating the world of RTSC.
XDCTOOLS
run-time. Information about its popular predecessor — DSP/BIOS, one of the industry's most widely deployed embedded kernels — can be found here.
Essential Utilities. Finally, the XDCTOOLS
product incorporates a number of basic utilities for:
XDCscript
XDCscript
in concert with the Java-based (and JavaScript-friendly) Eclipse/SWT graphical environment. In other situations, we leave the provision of higher-level GUI tooling to others.
Here again, we see broad availability of the XDCTOOLS
as a catalyst for others contributing compatible yet complimentary tooling — not only for general-purpose use, but also to address the needs of more specialized vertical markets through integrated solutions that synergistically couple tooling and content.
XDCTOOLS
for several years now, beginning with a 1.00 product first released in 2004; for reference, XDCTOOLS
3.00 became available in mid-2007. The XDCTOOLS
product has broadly maintained the same functionality throughout its lifetime, though (referring back to the earlier figure) has generally solidified from left-to-right:
XDCTOOLS
3.00 also establishes a firm baseline for backward compatibility. Through some rather novel code-generation techniques coupled with whole-program optimization, we believe that binary compatibility for deployed packages containing spec'd target modules is now possible going forward.
A premier user of the most recent XDCTOOLS
product, System/BIOS 6.00 represents a complete top-to-bottom "RTSC-ization" of the legacy DSP/BIOS code base:
XDCscript
meta-content accompanying each target module which supports design-time configuration as well as run-time analysis; and
XDCTOOLS
run-time, yielding full entitlement to the latter.
XDCTOOLS
, with the emphasis here more on packaging and facading legacy content rather than re-working existing code. Because CodecEngine amalgamates a rather diverse set of elements — DSP/BIOS and Linux, I/O and communication drivers, DSP algorithms plus framework middleware, etc. — fielding this sort of product demands a common delivery format (RTSC packages) as well as a standard integration process (RTSC configuration) for these various sub-elements.
As a consequence of CodecEngine and its recent proliferation, a growing number of content suppliers have already embraced RTSC packaging as a de-facto standard; others have also begun facading existing xDAIS algorithms with metaonly modules whose configs guide integration of legacy code into CodecEngine program images. As part of its own roadmap, CodecEngine looks to drive use of RTSC's XDCspec
language more aggressively when publishing target-domain C interfaces that codify different classes of algorithms — what might well become a RTSC-ization of the long-standing xDAIS algorithm standard along with its derivatives.
XDCTOOLS
becomes an ever-higher priority moving forward. And while System/BIOS and CodecEngine will themselves continue to draw other producers and consumers of real-time software components into the RTSC circle, we plan a number of independent initiatives — such as amassing an online RTSCpedia, starting with this white-paper — to make the XDCTOOLS
product and its underlying technology available and accessible to the broader community of embedded C programmers.
To that end, we also anticipate launching an open-source initiative — think rtsc-space.org — that would truly render XDCTOOLS
openly and freely available to all. Besides encouraging third-party vendors to field to higher-level forms of tools (e.g., integration with the Eclipse/CDT programming environment, popular among embedded developers), a de-facto standard component model that addresses the specific needs of embedded software can breath some necessary life back into the C programming community as a whole. Recognizing an opportunity to provide much-needed leadership within an otherwise highly fragmented population of almost a half-million embedded C programmers, RTSC is quite simply: a better way to leverage C.
XDCTOOLS
product, available here. If you would, however, prefer to just sample the documentation, we have begun work on a trio of guided primers (available shortly) that introduce different aspects of the XDCTOOLS
through graduated programming examples:
XDCscript
meta-language brings to standard JavaScript, without regard for any particular application of the language in package management, in program configuration and analysis, or even in stand-alone tooling; also a follow-on to the other primers, this material become important to potential suppliers of supplementary tools and utilities (delivered as spec'd metaonly modules).
XDCTOOLS
respectively supporting the RTSC package life-cycle, the RTSC program life-cycle, and the RTSC program run-time; these documents also introduce more advanced features of the XDCspec
language together with corresponding programming idioms used in XDCscript
meta-content as well as C target-content.
Finally, reference documentation exists for each of the packages bundled with the XDCTOOLS
product; this material is automatically synthesized from special documentation comments embedded in XDCspec
sources contained within these packages — no different from any other package. You will also find language reference material covering XDCspec
syntax and semantics, XDCscript
extensions to JavaScript, and conventions for mapping higher-level programming constructs like modules and interfaces onto ANSI C.
— Bob Frankel, 19 Nov 2007