Chapter 3 Ada Language Reference
© National Instruments Corporation 3-21 AutoCode Reference
frequently overflowing, a different data type should be selected. If you are
concerned about performance and the use of an exception handler for
detecting overflow, the generic functions can be changed. These changes do
not affect the generated code in any way. Thus, you can freely modify the
generic function implementations without having to regenerate the model.
Caution The provided implementations of the generic functions implement a behavior that
is numerically correct and matches the SystemBuild Simulator’s results. Any change to the
generic functions can severely affect the numeric results of a model. Do not attempt to
change the implementation unless you are fully aware of the intricacies of fixed-point
numerics.
Stand-Alone Files
Support for the AutoCode/Ada Fixed-Point architecture is found within
files in the System-Specific Files src directories. Table3 -7 contains all of
the fixed-point specific files. Notice that the .a extension depends on the
Ada compiler you use.
Compilation Example
This section illustrates the steps required to generate and compile a model
that includes fixed-point types. For the purpose of this example, assume a
top-level superblock name of gaintest.
Table 3-7. Fixed-Point Stand-Alone Files
File Name Package Name Description
sa_fxptypes_.a SA_FIXED Contains all fixed-point type
declarations.
sa_fxpgenerics_.a SA_FIXED_GENERICS Specification of the generic
function.
sa_fxpgenerics.a SA_FIXED_GENERICS Package body that implements the
generic functions.
sa_fxpbit_.a SA_FIXED_BITWISE_FUNCTIONS Package specification containing
bitwise operations on radix 0
fixed-point types.
sa_fxpbit.a SA_FIXED_BITWISE_FUNCTIONS Package body of the bitwise
operations on fixed-point types.