Lookup Table Implementation
The MicroC Style Guide implementation of the Rational Statemate Language has been extended to include Lookup Tables.
The language supports non-linear “Y=F(X)” functions that are so common in the world of micros. Typically, these non-linear functions are used to represent characteristic curves of valves in a table structure. Such a table may consist of a list of pairs of digitizing points, Xi, and its corresponding value, Fi. The data might be imported from any ASCII data file. A choice is given whether to perform (linear) interpolation between points, or to use a histogram like mode. In addition, saturation values might be defined, for the upper and lower range bounds, as well as a search order to support performance sensitive scenarios.
For example, consider the following definition and implementation of such a function with return value defined to be “Real” and input defined to be “Integer”:
In “Interpolation,” High to Low mode, Lower Bound=0, Upper Bound =4 The following code will be generated.
Note: Define default mapping between Real and either “double
” or “float
” andInteger
vs
.int8/16/32.