# Spectra CX – Code Generators for C++ and C

The Spectra CX Code Generators are designed to provide Software Defined Radio (SDR) developers with highly productive and error-free Software Communications Architecture (SCA) compliant source code for SDR components. Generation of source code from Spectra CX de-risks development since the code precisely reflects the SCA-validated component, preserving the architectural intent of the component so ensuring the consistent and correct implementation of SCA interfaces. Code generation also ensures consistency of coding across the project, resulting in high quality, easy to maintain code.

# Reduced Development Risk for Improved Quality, Cost Control and Better Time-to-Market with

With Spectra CX code generation, SCA component code is repeatable and predictable – not prone expensive human code errors. The code generator templates have been tested and proven, so that the code correctness and reliability is achieved from the very beginning of the project.

The Spectra CX Code Generators adapt to existing coding tools and processes, contributing the required SCA artifacts and allowing developers to continue to use their existing tools for developing the behavior of the radio e.g. control code and signal processing code. Ready access to quality SCA structural code allows specialists such as digital signal processing experts to rapidly move their component implementation tasks along; the code generator provides value to every member of the project team.

# SCA Application, Device and Service Code Generation

abstracts the physical hardware in accordance with the SCA specification. Automating the generation of this code benefits both developers of SCA-compliant radio platforms and developers needing to modify an SCA- compliant radio platform, allowing them to make changes to their hardware while ensuring continuous adherence to the SCA specification.

# Portable Code

The Spectra CX Code Generators provide a universal code generation template that renders 100% portable code across embedded targets.

Since many SDR architectures take advantage of real-time operating system (RTOS), Object Request Broker (ORB) and SCA Core Framework (CF) optimization, ADLINK also provides code templates optimized for the chosen operating environment (OE).

The Spectra CX Code Generator maps the domain-specific SDR model into a full set of executable language-specific files that contain all the functionality needed for running components under the Spectra OE. This capability includes:

• Extensive, complete, and correct implementation code for the Port, PortSupplier, TestableObject, PropertySet, Lifecycle, and Resource, ResourceFactory, Device, LoadableDevice, and ExecutableDevice interfaces
• Standard entry-points to allow for instantiation and deployment by a core framework
• In addition to code for successful operating scenarios, the generated code includes the error handling code for all required exceptions
• Port code for user-defined interfaces and standardized APIs
• Code has a well-defined separation between the radio platform infrastructure code and the radio logic of your components
Generation of platform, OS and ORB-specific build artifacts

![This flowchart depicts a linear process moving from left to right, indicated by a large light blue arrow at the bottom.\n\n**Labeled Blocks:**\n1.  **Model**\n2.  **Validate**\n3.  **Generate**\n4.  **Implement**\n5.  **Deploy** (This block contains a checklist with two items: 'Host' and 'Target')\n6.  **Test**\n\n**Connections:**\n*   **Model** connects to **Validate** via a bidirectional dashed arrow.\n*   **Validate** connects to **Generate** via a bidirectional dashed arrow.\n*   **Generate** connects to **Implement** via a bidirectional dashed arrow.\n*   **Implement** connects to **Deploy** via a bidirectional dashed arrow.\n*   **Deploy** connects to **Test** via a bidirectional dashed arrow.](.spectra-codegen/8ad4ac7ac8bf40a4315cdd266df0d4a68b3ccf301c5ac3cbe63b42b70fb1486d.jpg)

# Optimized Code Templates

Optimizing SCA structural code is as important as optimizing behavior (e.g. signal processing code). Spectra CX’s code generation engine preintegrates Core Framework and ORB development kits, often referred to as “Component Development Kits”, available from industry leading middleware and RTOS vendors. These kits provide features that take advantage of CF and RTOS services for optimization of control and distribution. These services include extensions for connection, messaging, logging and debugging.

Using these services allows developers to maximize the benefits of their chosen platform. Spectra CX’s Code Generation enables developers to benefit from automation without losing the value of the component development kit and the performance enhancements gained from it.

![SCA Structure + Behavior Code = SCA Component](.spectra-codegen/7520d8bb62c557235e14eddce0565d979b639e5f253a6cdcb507806f849e7bb7.jpg)

# Future-Proof Development: Flexible Build Environment

The Spectra CX Code Generators produce SCA component structure code complete with a “skeleton” for the inclusion of behavior code (signal processing and control code typically made up of additional source code or 3rd party libraries). The build environment generated by Spectra CX’s Code Generators compile and link the SCA structural and behavioral into a single executable — all within the Eclipse CDT environment placing elements of the compiled code into a directory structure and make- file system that allows for:

Maximum flexibility for developers
• Maximum code portability
• Multiple implementations per component

# Clean Separation of SCA Structure Code and Behavior Code

Behavior code contains virtually no OE dependent code. The Spectra CX Code Generator promotes the seamless reusability of this code by cleanly separating it from the SCA structure code in the directory structure. Sending and receiving messages are translated to operation calls in the behavior directories so that virtually no CORBA code is contained within them. It is thus very easy to migrate behavior code from one

# Adaptable to Multiple Targets and Settings

During the course of the software project, developers will create multiple implementations of components to support different target configurations such as the development host and the embedded target. Developers will also create multiple implementations with different compiler settings such as debug configurations. By using a few simple settings and a button click, the Spectra CX Code Generator will generate multiple component implementations using the same model and code base. Developers write code once and run it on multiple platforms, again future-proofing development.

# Support for Iterative Development – Build and Merge Management

Numerous changes will be made to both the SCA model and the behaviour (control code and signal processing code) as the project progresses. Spectra CX is integrated with Eclipse CDT so that behaviour code added to the generated structural code is persisted upon regeneration. The Spectra CX Code Generator requires no merging of changes to the structural code. Delays caused by re-compiling over and over can impact projects. The Spectra CX Code Generator only regenerates files that have been changed in the model, reducing cycle time.

# Integrated Environments

All compile and build actions can be initiated from the Spectra CX environment. Additionally, users can prepare the runtime environment for execution and observe their code running on host and/or target. SCA developers benefit from the simplicity of using only one tool for modeling, validation, code generation and execution.

# Multiple Programming Languages, Patterns and Customizable Templates

Spectra CX provides universal and optimized generators for C++ and C. The Spectra CX Code Generation infrastructure can be extended to generate SCA structure code in alternate languages such as VHDL, Java and ADA in order to assimilate with established processes. The Spectra CX Code Generators use open technology and standards to translate model information to code and gives users full access to the code generation templates. Engineering teams can therefore optimize the templates to accommodate their environment if they need to.

# Support and Professional Services

A range of optional professional services are also available from ADLINK. Product training, technology familiarization, developer mentoring, optimization techniques, and ADLINK’s renowned product support and maintenance services (to 24x7).

# Summary of Spectra CX Code Generation Benefits

• Facilitates true model-based development
• Generates correct-by-construction structural code for SCA resources, devices, and services
• Produces high quality, portable, optimized, and compliant SCA code
• Integrates with existing development tools
• Supports iterative development workflows
• Supports multiple target operating environments and programming languages for a component language for a component

# For More Information

For further information regarding Spectra CX capabilities please e-mail: ist\_info@adlinktech.com or visit: ist.adlinktech.com
[🔗 Link to the original document](.spectra-codegen/spectra-codegen.pdf)
