Echelon Neuron C User Manual

Page 50

Advertising
background image

30

Compiler Directives

Development Tool, valid values for

num

are 0 to 127. In Neuron C Version

2.2 (and later), there is no compiler default for this value. A Neuron C
program must specify a value using this pragma. You can use this pragma to

trade EEPROM space for alias table entries (see Chapter 8,

Memory

Management,

of the

Neuron C Programmer’s Guide

).

This directive is not supported in model files.

#pragma num_domain_entries

num

Sets the number of domain table entries to

num

. Valid values for

num

are 1

or 2. The default number of domain table entries is 2. You can use this

pragma to trade EEPROM space for a domain table entry (see Chapter 8,

Memory Management,

of the

Neuron C Programmer’s Guide

).

This directive is not supported in model files.

#pragma one_domain

Sets the number of domain table entries to 1. This pragma is provided for

legacy application support and should no longer be used. New applications

should use the num_domain_entries pragma instead. The default number of
domain table entries is 2.
This directive is not supported in model files.

#pragma optimization

level

This pragma allows you to specify a code optimization level for optimal use of

device memory. Supported levels are 0 (no optimization) to 5 (maximum
optimization).
When you specify no optimization, the Neuron C compiler attempts to create

fairly economical code. However, some improvements are generally possible,
and sometimes necessary. In addition to specifying additional code

optimization using this directive, consider manual optimization, as described

in the

What to Try When a Program Does Not Fit on a Neuron Chip

section of

Chapter 8 in the

Neuron C Programmer’s Guide

.

With optimization enabled, the Neuron C compiler performs several types of

code optimization. For example, it identifies common sub-expressions and
moves them into sub-routines when economical, thus reducing the memory

footprint of the generated code.
Table 5 lists the levels of optimization. Levels 2, 3, 4, and 5 are ignored if you
disable optimation within the NodeBuilder FX Development Tool (select the

Disable optimizer checkbox from the Compiler tab of the NodeBuilder Device
Template Target Properties dialog). Levels 0 and 1 are ignored if you enable

optimation within the NodeBuilder FX Development Tool (clear the Disable

optimizer checkbox).

Table 5. Optimization Levels for the #pragma optimization Directive

Level Optimization Performed

Notes

0 No

optimization

CP templates are not compressed

Advertising