From RTSC Central
![]() | [offline version] | ![]() |
RTSC Interface Primer
Working with Spec'd Target Modules in the Abstract
This Primer introduces RTSC interfaces, used to abstract the functionality of spec'd target modules. Picking up where the companion RTSC Module Primer leaves off, we'll take the production and consumption of ordinary (concrete) modules to a whole new level of generality through the use (abstract) RTSC interfaces.
Along the way, we'll constantly probe ever-deeper into XDCspec and XDCscripttwo special-purpose languages that work hand-in-hand with standard C in a symbiotic alliance of programmatic capabilities that RTSC names eXpanDed C:
- As for XDCspec, we'll formally introduce interface as a language keyword, taking its place alongside module and package as the one of the programmatic pillars upon which all of RTSC rests.
- As for XDCscript, we'll continually leverage its general-purpose programmability within ever-more sophisticated meta-content used to build, configure, and test ever-more sophisticated target-content.
As an overarching objective, RTSC has always promised a higher-level form of C programmingone suitable for developing, delivering, and deploying real-time software componentsbut without sacrificing overall system performance through additional runtime overhead. With RTSC interfaces just in front of usalong with the all-important proxy-delegate design pattern that composes RTSC modules using RTSC interfaceswe can at last declare: You're finally here!
Who's the audience
Needless to say, we assume you've studiedand hopefully retainedmuch of the material covered in the RTSC Module Primer. Your ability to not only consume but also produce RTSC modules will become axiomatic to working with RTSC interfaceswhich, as you'll come to appreciate, serve as abstractions that characterize entire families of conforming RTSC modules.
In all other respects, our presumptions about your software background and experience remain the same:
- you've worked with the C programming language, preferably in developing embedded applications;
- you don't necessarily have any experience with object-oriented programming or languages; but
- you are at least curious about how RTSC can take C programming to an entirely new level.
As for RTSC itself, we require neither prior knowledge of its concepts nor practical experience with the XDCtools productother than what you've already mastered from reading the RTSC Module Primer.
What we'll cover
We've structured the Primer as a graduated series of lessons, reinforcing concepts and idioms fundamental not only to producing and consuming RTSC modules but also to abstracting the behavior of these modules through RTSC interfaces.
Lesson 11 | Module Abstraction Implementing the IGen interface |
Lesson 12 | Proxy Modules Generalizing the implementation of Bench |
Lesson 13 | Proxy Modules Managing target-specific Fir implementations |
Lesson 14 | Abstract Testing Benchmarking IFir implementations |
Lesson 15 | Abstract Instances Techniques for creating IGen objects |
Lesson 16 | Design Patterns Composing modules through interfaces |
To further emphasize how all of this material ultimately builds upon the foundation laid down by the RTSC Module Primer, you'll notice we've numbered these Lessons 11-16. With the exception of the last lesson, the remaining lessons of the Interface Primer will generally revisit programming examples covered in the earlier lessons of the Module Primerbut now, through the use of RTSC interfaces, we'll render these examples more flexible, more portable, and hence more re-usable.
How to proceed
No different than beforethat is, iteratively.... More than ever we encourage making several passes through these lessons, which actually pack quite of bit of (new) information as they move from one example to the next. As before, don't feel compelled to actually run any of the programming examples in your initial reading(s) of this materialstay in "read-only" mode if you prefer, and focus instead on grasping the underlying concepts rather than the programming mechanics.
Installing the examples. Even if you don't plan to run the programming examples at this time, you still might consider installing the examples for reference. Unlike the earlier Module Primerwhich faithfully reproduced all of the example code within the body of the documentwe'll now omit portions of a source file not pertinent to the discussion at hand; or, we'll simply omit certain (trivial) files from the discussion altogether, inviting you to browse the code instead.
You'll find the examples here, distributed as a single .zip file which you should unpack into the same %examples% directory populated back in Lesson 0. Note that we've created new package names for the (new) examples presented in Lessons 11-16, so you can indeed install these packages in the same %examples% repository used earlier.
NOTE: If you plan to run the examples, also unpack a .zip file of patches found here into your %examples% directory.
NOTE: These patches include new or updated packages slated for general availability with XDCtools 3.10.
NOTE: If you are currently viewing an offline version of this document, these patches are not included.
Updating config.bld. Several of the examples rely upon the ti.targets.C64P RTSC target, which supports the TMS320C64+ processor architecture. To actually build and execute any code, your config.bld file prepared back in Lesson 0 will require some minor adjustments.
%examples%/config.bld | |
1 2 | var Build = xdc.useModule('xdc.bld.BuildEnvironment'); var C64P = xdc.useModule('ti.targets.C64P'); ... C64P.rootDir = "%c6xtools%"; C64P.platform = 'ti.platforms.sim6xxx'; ... Build.targets = [C64P, ...]; |
As you can see here, line 1 now references the ti.targets.C64P target instead of ti.targets.C64; and line 2 now names the ti.platforms.sim6xxx platform instead of ti.platforms.load6x. Your configuration of GCC for Windows or Linux should remain the same, however.
NOTE: The updated ti.platforms.sim6xxx package (contained in the patches) now loads C64P programs from the command-line.
NOTE: Verify that you're using version 6.0.15 of the TI C6000 compiler, and upgrade if necessary.
Once you've made these changes, feel free to clean-and-rebuild the Module Primer examples at your discretion. All of the new packages introduced in Lessons 11-15 faithfully contain requires statements in their package.xdc files, so you can build any of these packages on an as-needed basis by simply invoking some variant of the xdc [goal] -PD . command.
![]() | [offline version] | ![]() |