Using model file compiler directives, Acceptable model file compiler directives – Echelon FTXL User Manual
Page 132
![background image](/manuals/735717/132/background.png)
120
Model File Compiler Directives
Using Model File Compiler Directives
ANSI C permits compiler extensions through the #pragma directive. These
directives are implementation-specific. The ANSI standard states that a
compiler can define any sort of language extensions through the use of these
directives. Unknown directives can be ignored or discarded. The Neuron C
compiler issues warning messages for unrecognized directives.
In the Neuron C compiler, pragmas can be used to set certain Neuron firmware
system resources and device parameters such as code generation options,
debugging options, error reporting options, and other miscellaneous features. In
general, these directives can appear anywhere in the model file.
Any compiler directive that is not described in this appendix is not accepted by
the LonTalk Interface Developer utility, and causes an error if included in a
model file. You can use conditional compilation to exclude unsupported
directives.
Acceptable Model File Compiler Directives
You can specify the following compiler directives in a model file. These directives
can appear anywhere in the model file, and control the output produced by the
LonTalk Interface Developer utility.
#pragma codegen
option
This pragma allows control of certain features in the compiler's code
generator. Application timing and code size might be affected by use of these
directives. Valid values for
option
include:
• cp_family_space_optimization
• no_cp_template_compression
The Neuron C compiler can attempt to compact the configuration property
template file by merging adjacent family members that are scalars into
elements of an array. Any CP family members that are adjacent in the
template file and value file, and that have identical properties, except for the
item index to which they apply, are merged. Using optional
configuration
property re-ordering and merging
can achieve additional compaction beyond
what is normally provided by automatic merging of whatever CP family
members happen to be adjacent in the files. To enable this re-ordering
feature, specify #pragma codegen cp_family_space_optimization in your
model file. With this feature enabled, the Neuron C compiler optimizes the
layout of CP family members in the value and template files to make merging
more likely.
You can specify #pragma codegen no_cp_template_compression in your
program to disable the automatic merging and compaction of the
configuration property template file. Use of this directive can cause your
program to consume more of the device’s memory, and is intended only to
provide compatibility with the NodeBuilder 3.0 Neuron C compiler.
You cannot use both the no_cp_template_compression option and the
cp_family_space_optimization option in the same model file.