background image

Chapter 5

Generated Code Architecture

AutoCode Reference

5-30

ni.com

In Example 5-9, a hard-subscript, 

i

, is used to access both inputs and 

outputs. The reason 

i

 is a hard-subscript is that the range of 

i

—that is, 

the values of 1 through to the number of inputs (

u.size

)—is known when 

the code is generated. AutoCode then can unroll the loop so as to translate 

y(i)

 into a single scalar variable for each value of 

i

. The same is true 

for

u(i)

.

Example 5-9

Hard-Subscript Used to Access an Array

Inputs:  u;

Outputs: y;

float u(:), y(u.size);

integer i;

for i = 1:u.size do

  y(i) = u(i) * 2*i;

endfor;

In Example 5-10, a soft-subscript, 

j

, is being used to access both inputs and 

outputs. That script will not generate code. The reason 

j

 is a soft-subscript 

is that the range of 

j

, that is, the values of 1 through to the value of the first 

input 

u(1)

, is not known when code is generated because the upper-bound 

of 

j

’s range is the value of the first input. Because the range of 

j

 is not 

known, AutoCode cannot unroll the loop so as to translate the input/output 
arrays into their scalar representation.

Example 5-10

Soft-Subscript Example

Inputs:  u;

Outputs: y;

integer u(:), y(u.size);

integer j;

for j = 1:u(1)do

  y(j) = u(j) + j;

endfor;

Rolling Loops with Scalar Code Generation

Although inputs, outputs, and states are translated into scalars, parameters 
and local variables of the BlockScript can be either scalar or array variables 
in the generated code. Thus, a common trick has been to copy the inputs 
and outputs into local variables that are arrays and use those variables for 
the algorithm. Refer to Example 5-11.

Содержание AutoCode NI MATRIX

Страница 1: ...NI MATRIXx TM AutoCode TM Reference AutoCode Reference April 2007 370768C 01...

Страница 2: ...400 Lebanon 961 0 1 33 28 28 Malaysia 1800 887710 Mexico 01 800 010 0793 Netherlands 31 0 348 433 466 New Zealand 0800 553 322 Norway 47 0 66 90 76 60 Poland 48 22 3390150 Portugal 351 210 311 210 Rus...

Страница 3: ...nstruments respects the intellectual property of others and we ask our users to do the same NI software is protected by copyright and other intellectual property laws Where NI software may be used to...

Страница 4: ...s and dialog box options Bold text also denotes parameter names italic Italic text denotes variables emphasis a cross reference or an introduction to a key concept Italic text also denotes text that i...

Страница 5: ...d Functions 2 6 error and fatalerr Functions 2 6 fatalerr Stand Alone Utilities Detected Errors 2 7 ERROR Conditions Detected in the Generated Code 2 8 Implementation_Initialize Function 2 9 Implement...

Страница 6: ...entation of the Addition and Subtraction Macros 2 40 Selecting Wordsize Extension in the Preprocessor Macro 2 42 32 Bit Multiplication and Division Macros 2 42 32 Bit Multiplication 2 42 32 Bit Divisi...

Страница 7: ...ters to Generate User Types 3 20 Overflow Protection 3 20 Stand Alone Files 3 21 Compilation Example 3 21 Fixed Point Type Declarations 3 23 Generic Functions 3 23 Bit Wise Functions 3 26 Instantiated...

Страница 8: ...Processor IP Name Table 4 7 Version Table 4 8 Using the Configuration File 4 8 Chapter 5 Generated Code Architecture Symbolic Name Creation 5 1 Default Names 5 1 Signal Naming 5 2 Duplicate Names 5 2...

Страница 9: ...ture Based Interface 5 11 Unrolled Interface 5 12 Phases and Error Handling 5 12 Referenced Percent Variables 5 12 Procedure Arguments 5 15 U Y S and I 5 15 Extended Procedure Information Structure 5...

Страница 10: ...Type Conversion 5 36 Special Directives 5 36 UserCode Block 5 37 Phases of the UCB 5 37 Indirect Terms 5 37 Parameterized UCB Callout 5 38 Software Constructs 5 39 IfThenElse Block 5 39 WHILE Block 5...

Страница 11: ...ed 6 1 Scalar Gain Block Example 6 2 Vectorized Gain Block Example 6 3 Array Subscripts 6 4 Signal Connectivity 6 5 Block Outputs 6 5 Block Inputs 6 5 Vectorization Modes 6 7 Maximal Vectorization 6 7...

Страница 12: ...oduction 8 1 Task Posting Policies 8 2 Standard AutoCode Scheduler 8 3 Scheduler Pipeline 8 5 Managing DataStores in the Scheduler 8 7 Sim Cdelay Scheduler 8 9 State Transition Diagrams of Tasks under...

Страница 13: ...put Connection 9 6 Global Output Connection 9 6 Condition Block Code Generation 9 7 Reusing a Parameterless Procedure 9 7 Generating Code for Parameterless Procedures 9 7 Issues and Limitations 9 8 Co...

Страница 14: ...ed for simulation and testing Chapter 3 Ada Language Reference discusses files used to interface AutoCode and the generated Ada code to your specific platform and target processor and target specific...

Страница 15: ...what to expect from AutoCode if you attempt to modify the generation of code Configuration File The configuration file is a text file containing tables of information related to the generated source...

Страница 16: ...e operating systems Code architecture Vectorized code generation Using MATRIXx Help MATRIXx 7 x provides a hypertext markup language HTML help system The MATRIXx Help is a self contained system with m...

Страница 17: ...on to this guide publications that you may find particularly useful when using AutoCode include the following AutoCode User Guide Template Programming Language User Guide Xmath User Guide SystemBuild...

Страница 18: ...ode of the AutoCode User Guide describes how to compile the code and stand alone library generate sample input data and load the data into Xmath for analysis Compiling on Various Supported Platforms T...

Страница 19: ...ribution directory The names of the distribution directories and files are shown in Table 2 2 Table 2 1 Recognized C Preprocessor Defines for Supported Platforms Platform Preprocessor Define Compiler...

Страница 20: ...sa_fuzzy h files must be available locally Use this file only when linking an AutoCode UCB back into SystemBuild Also sa_user c is just a template for a UCB and only needs to be compiled into the sta...

Страница 21: ...fy sa_types h if you need Table 2 3 Header Files File Purpose sa_sys h Defines the development platform Contains a C preprocessor define statement for each supported platform sa_types h Defines the su...

Страница 22: ...ls c file or keep separate versions of the files in separate directories There is no requirement that the file be named sa_utils c however the name you use must be specified at link time Inside the fi...

Страница 23: ...during critical sections enable and disable are not needed in some implementations These functions are furnished as stubs and defined as NULL in the sa_utils h file The background function as provide...

Страница 24: ...be used for an error indication except that the value of 1 is reserved for use in the scheduler The following are generated messages displayed in the default version of the sa_utils c file Most of th...

Страница 25: ...llowing messages might be generated during the execution of the generated code Stop Block encountered in task n This is not necessarily an error This refers to a SystemBuild Stop Simulation Block enco...

Страница 26: ...ther hardware dependent processes Initialize I O hardware Initialize the clock timer of the target system to request interrupts at the minor cycle of the control system that is the time period require...

Страница 27: ..._Output is for use in the simulation comparison mode it posts external output data to your specified output file The data is presented in XOUTPUT an array of type RT_FLOAT dimensioned equal to the out...

Страница 28: ...e name Make one or more copies of this file and insert the code that implements the algorithm s of the UCB s One or more uniquely named UCB code functions can be placed inside each copy of the sa_user...

Страница 29: ...for simulation purposes using SystemBuild only and UCBs written for linking with AutoCode applications The exact name of the UCB function must be specified in the ucb directive if this UCB function i...

Страница 30: ...he fixed calling method Table 2 5 UCB Calling Arguments and Data Types for the Fixed Interface Argument Data Type Description INFO struct STATUS_RECORD A pointer to STATUS_RECORD structure representin...

Страница 31: ...INFO OUTPUTS do output calculations having the general form Y H T X XD U RP IP if INFO STATES do state update calculation with the general form XD F T X XD U RP IP When an error occurs within the UCB...

Страница 32: ...2 Linking Handwritten UCBs with AutoCode Applications Generate AutoCode Application dsp c usr_dsp c Handwritten UCB using sa_user c example compile and link File Name usr_dsp c y k 1 2 y k 2 3 u k u k...

Страница 33: ...user c example file for writing UCBs These files are different and should not be used interchangeably for linking UCBs with SystemBuild and AutoCode applications usr01 c is strictly meant to link user...

Страница 34: ...with an AutoCode application might not take advantage of some features supported in the SystemBuild simulator such as linearization Linearization is not supported in AutoCode generated code Also highl...

Страница 35: ...ng The variable interface consists of arguments required to meet the specification of the UCB These arguments are passed relative to a fixed total ordering of all possible arguments The following is t...

Страница 36: ...relative to all of the AutoCode optimization As a result AutoCode performs any needed copying for example staging of inputs and outputs to make sure the proper arguments are passed to the UCB For exam...

Страница 37: ...cedures for more information about generating procedures Linking Procedures with the SystemBuild Simulator Replace the procedure SuperBlock with a UserCode Block UCB refer to callout 4 of Figure 2 4 a...

Страница 38: ...Figure 2 4 Linking Generated Reusable Procedures Procedure Generate Reusable Procedure Filename myproc c Function Name simexe lnx myproc c simulation automatic compiling and linking of myproc c int n...

Страница 39: ...ast efficient in some cases The third option also provides ease of use in terms of argument list but although the procedure itself is re entrant the subsystem invoking the procedure is not re entrant...

Страница 40: ...one during initialization only A pointer to this object will be passed as argument S to the procedure Figure 2 5 Arguments to Generated Procedure proc 4 Create an object of type _procedure name_info w...

Страница 41: ...variables is no longer necessary Invoking Procedures Using Generated UCB Wrapper Function As described in Chapter 1 Introduction of the AutoCode User Guide when generating a reusable procedure from a...

Страница 42: ...and XD derivatives Also create a variable of type int and initialize to the number of states in the procedure A pointer to this variable will be passed as argument NX 6 Create two arrays sized by the...

Страница 43: ...objects created in steps 1 and 2 C Fixed Point Arithmetic Fixed point calculations provide significant advantages over floating point arithmetic These include Faster execution on most processors 8 bi...

Страница 44: ...pear as acc o gen_ap DSOLARIS DFX_FUNC_INTERFACE gen_ap c sa_ o lm where gen_ap c represents any AutoCode generated source file Because fixed point operations get inlined while using the macro interfa...

Страница 45: ...caled integer counterpart Macros or procedures for converting between various fixed point types will be invoked when necessary Fixed Point Data Types Fixed point type definitions are provided in the s...

Страница 46: ...gn in that data type Example 2 2 shows some of the I O type declarations Only the significant parts of the code are shown Example 2 2 Fixed Point C I O Type Declarations struct _Subsys_1_out RT_SSHORT...

Страница 47: ...1 Procedures declarations Procedure proc Inputs type declaration struct _proc_u RT_USHORT13 US13 Outputs type declaration struct _proc_y RT_SSHORT13 SS13 RT_SSHORT15 SS15 RT_SSHORT15 SS15_1 RT_USHORT...

Страница 48: ...the results for consistency Most macros and functions with overflow protection have been combined into sets of signed and unsigned macros and functions and combinations of both This was done because...

Страница 49: ...acros sa_fxscale h Contains scale factor constants for different radix values sa_fxlimit h Contains maximum and minimum values that can be represented in different fixed point types sa_fxadd_byte c Co...

Страница 50: ...ables used in fixed point computations sa_fxprv h Contains macros used only by the other macros sa_fxscale h Contains scale factor constants for different radix values sa_fxlimit h Contains maximum an...

Страница 51: ...point conversion functions with overflow protection sa_fxp_f c Contains fixed point conversion functions without overflow protection sa_fxm_f c Contains fixed point algebraic functions without overflo...

Страница 52: ...rom integer to fixed point or from fixed point to integer These macros in turn make use of the left shift or right shift macros defined in sa_fxprv h The right shift macro shifts the bits of a value t...

Страница 53: ...n rp n Fixed point operand to align sr wr ALIGN so wo p q n rp rp Number of bits to shift q optional answer quantization r c or f p Overflow protection optional wo Operand wordsize b byte s short l lo...

Страница 54: ...a shift of rp bits and with overflow protection is sbALIGNip n rp n Fixed point operand to align i ALIGN so wo p n rp rp Number of bits to shift p Overflow protection optional wo Operand wordsize b by...

Страница 55: ...ned in sa_fxmp c Figure 2 9 shows how the arithmetic macros are named Notice that macro names have no embedded spaces Figure 2 9 AutoCode C Arithmetic Macros sr wr op _ s1 w1 _ s2 w2 p n1 n2 rp1 rp2 r...

Страница 56: ...usSUB_ss_usp n1 n2 rp1 rp2 rp3 The macro to multiply two 16 bit signed numbers with overflow protection and produce a 16 bit signed result is ssMUL_ss_ssp n1 n2 rp1 rp2 rp3 The macro to divide two 32...

Страница 57: ...m 8 bits to 16 bits Not using the wordsize extension on 8 bit and 16 bit processors provides faster operations However you can lose precision if the result radix position is not smaller than the radix...

Страница 58: ...2 Not Using Wordsize Extension In binary representation 0001 0001 n1 17 r4 decimal value 1 0625 001 00000 n2 32 r5 decimal value 1 0 Align the radix positions of n1 and n2 to the radix position of the...

Страница 59: ...on by a preprocessor macro in the sa_fxp h file The preprocessor statement define WORDSIZE_EXTEND 1 causes the code to be compiled with wordsize extension This is the default The preprocessor statemen...

Страница 60: ...he routine at the cost of accuracy 16 Bit by 8 Bit Division Depending on the radix value of the operands and the result this operation might result in either an iterative division or a fast shift base...

Страница 61: ...terms of low level relational macros present in sa_fxprv h Figure 2 10 shows how the relational macros are named Notice that macro names have no embedded spaces Figure 2 10 AutoCode C Relational Macro...

Страница 62: ...operation that is the operation can become nonassociative For example the expression y a b c can result in different values if evaluated as a b c instead of a b c Sorting the expression in a separate...

Страница 63: ...bes a process to compile the code and stand alone library generate sample input data and load the data into Xmath for analysis Supported Ada Compilers for the Stand Alone Library Ada 83 is extremely p...

Страница 64: ...y faster than one based on the ada_rt tpl ada_fxpt_sys tpl Template The ada_fxpt_sys tpl template is included in the ada_sim tpl and ada_rt tpl templates This template contains segments that generate...

Страница 65: ...distribution directories and files are shown in Table 3 2 Table 3 2 Distribution Directories and Files Category UNIX Windows Top Level Directory MTXHOME Environment variable MTXHOME Environment varia...

Страница 66: ...you have defined any hand written UserCode Blocks these header files must be available locally sa_user_ a adasa_user a ada When you compile your generated code program all of the previous files must b...

Страница 67: ...along with corresponding array types This file is in the source distribution directory on your system and you can edit a copy of the file as required Certain global record array and exception types ar...

Страница 68: ...ever the name you use must be specified for compilation and linking Inside the file the names of all the external variables functions and other references must be preserved As furnished for this relea...

Страница 69: ...r deactivating all necessary functions and then passing an alarm to the external environment or for initiating recovery action You can choose either to return from an error function or to halt the mac...

Страница 70: ...RT_INTEGER NUMOUT in RT_INTEGER SCHEDULER_FREQ in RT_FLOAT In the default simulation comparison version of the sa_utils a ada file this function initializes the inputs and outputs for the system by l...

Страница 71: ...into Xmath save in matrixx ascii format then try again Incorrect file version Must be at least V7 0 The input data file was generated using an obsolete version of MATRIXx Load the file into Xmath sav...

Страница 72: ...its discussed previously Refer to the comments at the beginning of the file and adjust the limits accordingly and then recompile and relink Implementation_Terminate Procedure procedure Implementation_...

Страница 73: ...sed to it by the scheduler UserCode Blocks This section describes how to link UserCode Blocks UCBs with AutoCode or SystemBuild applications Linking Handwritten UCBs with AutoCode Applications To writ...

Страница 74: ...ts used in the fixed calling method Table 3 5 UCB Calling Arguments and Data Types Argument Data Type Description INFO in out RT_STATUS_RECORD A structure representing operation requests and status T...

Страница 75: ...TPUTS then do output calculations having the general form Y h T X XD U R_P I_P end if if INFO STATES then do state update calculations with the general form XD f T X XD U R_P I_P end if When an error...

Страница 76: ...is more efficient for performance reasons but the latter provides for backward compatibility in terms of argument list Refer to Chapter 5 Generated Code Architecture for more information Linking Proc...

Страница 77: ...3 Number of States 0 Number of Integer parameters 0 Number of Real parameters 0 with myproc_pkg use myproc_pkg procedure myproc_hook iinfo in out RT_STATUS_RECORD TIME in RT_DURATION U in RT_FLOAT_AY...

Страница 78: ...ode from a model using a Graphical User Interface This is the recommended method of generating code to run on your local host Xmath which lets you automatically generate an rtf file and then source co...

Страница 79: ...ication and body for the SA_FIXED_GENERICS package These files are also provided in the System Specific Files src directory These generic functions are the basis for the creation of the overloaded ope...

Страница 80: ...order within an Ada Library Figure 3 1 illustrates the imposed dependency In the figure a package that is beneath a package and connected to a package above it by an arrow is said to be dependent on...

Страница 81: ...negative value Tests for equality with a fixed point type are coded using equivalent logical expressions The expression a b will be generated as a b and a b and the expression a b will be generated a...

Страница 82: ...kage The implementation provided for each of the generic functions uses exception handlers to detect when an overflow occurs Correction is performed by examining the values of the function and replaci...

Страница 83: ...t numerics Stand Alone Files Support for the AutoCode Ada Fixed Point architecture is found within files in the System Specific Files src directories Table 3 7 contains all of the fixed point specific...

Страница 84: ...Corporation Unpublished work Restricted rights apply All rights reserved Portions U S Patent Loading gaintest rtf Initializing Building symbols Executing ada_rt dac Generating procedures package decla...

Страница 85: ...marizes the fixed point type specifications Generic Functions The generic functions that are used to instantiate overloaded operators and other functions are found in the SA_FIXED_GENERICS package whi...

Страница 86: ...IGNEDABS Absolute value for a value of a signed fixed point type UNSIGNEDABS Absolute value for a value of a unsigned fixed point type LESSTHAN Tests less than relation between values of two different...

Страница 87: ...GER to a fixed point type conversion BOOLEANFIXEDCAST RT_BOOLEAN to a fixed point type conversion FLOATFIXEDCAST RT_FLOAT to a fixed point type conversion FLOATFIXEDCAST_TRUNC RT_FLOAT to a fixed poin...

Страница 88: ...r information about the templates Instantiated Functions Package AutoCode Ada will generate one additional file for a model if it contains any fixed point type This file contains the package for the R...

Страница 89: ...Naming Conventions Conversion Type Name1 Fixed to RT_INTEGER RT_YYxx_I Fixed to RT_INTEGER truncation RT_YYxx_It Fixed to RT_INTEGER round RT_YYxx_Ir Fixed to RT_LONG_INTEGER RT_YYxx_LI Fixed to RT_LO...

Страница 90: ...u Jun 1 16 19 31 1999 Fixed Point Operator Instantiation Package with SA_TYPES with SA_FIXED with SA_FIXED_GENERICS package RT_FIXED_OPERATORS is Operator Instantiations function is new SA_FIXED_GENER...

Страница 91: ...ators these generics support mixed type operators that is the types of the operands do not have to be the same To achieve results as accurate as possible without introducing overflow requires the use...

Страница 92: ...raction Example Given n1 is an RT_SBYTE04 n2 is an RT_SBYTE05 and n3 is an RT_SBYTE07 n1 1 0625 n2 1 0 perform n3 n1 n2 Select intermediate type of RT_SSHORT07 and convert n1 and n2 to that type resul...

Страница 93: ...precision might occur Note Computation of 32 bit values is compiler vendor dependent Results compared against the equivalent floating point computation can vary significantly The only solution is to u...

Страница 94: ...on implements truncation for values that are at the midpoint between two model numbers For example if a value of 1 5 in the RT_SBYTE01 type is converted to RT_SBYTE the resulting value is 1 0 Instanti...

Страница 95: ...nother list depending on the purpose of the lists For the fxp_operatorid_li and fxp_conversionid_li parameters these contain the type of operator or conversion to be instantiated However the lists mig...

Страница 96: ...tors and Conversions A so called system scope exists for operators and conversions that are used somewhere other than a subsystem or procedure When using the subsystem level parameters to generate ins...

Страница 97: ...es function call overhead However because those functions are instantiated from generics older Ada compilers might not work properly Comparing Results to SystemBuild s Simulator The SystemBuild Simula...

Страница 98: ...or uses a 64 bit extended integer calculation for 32 bit multiplication and division Therefore differences could be a result of 32 bit algorithm differences It might be necessary to implement your own...

Страница 99: ..._SLO left SL0 return SL0 V1 SB0 V2 SB1 VL SL0 begin VL V1 V2 VL ambiguous VL TO_SL0 V1 V2 VL unambiguous expression end The first assignment is ambiguous because there is more than one choice of the o...

Страница 100: ...OS configuration file The RTOS configuration file is a text file containing tables of information related to the generated source code components of a model like subsystems and non scheduled procedure...

Страница 101: ...f processors Scheduler priority Subsystem Tasks Priority Stack Size Processor Mode Flags Interrupt Procedure SuperBlocks Priority Stack Size Processor Vector Mode Flags Background Procedure SuperBlock...

Страница 102: ...in any order in the file except the Version Table which must be the first table Also a table can appear only once in the file If the table appears more than once the data in the first table is used F...

Страница 103: ...n for all subsystem tasks of the model Each row is identified with the subsystem task number The table is named subsys Example 4 3 shows a subsystem table Table 4 2 Scheduler Priority Table Contents C...

Страница 104: ...new subsystem 1 will use subsystem 1 s configuration The new subsystem 2 which was the old subsystem 3 will use subsystem 2 s configuration Then AutoCode will report that subsystem 3 s data is unused...

Страница 105: ...he table is named bkgdsupblk Example 4 5 shows a background table Example 4 5 Background Table Example rtos bkgdsupblk Background Priority Stack Size Processor Ordering Mode Flags back_1 200 4096 1 2...

Страница 106: ...nit 2 1 ipc_init 2 2 Processor IP Name Table Table 4 7 consists of configuration information assigning each processor an IP name Each row is identified by the processor number The table is named IPprs...

Страница 107: ...time Each time AutoCode is executed with the rtos option the default configuration file is updated This update contains all of the configuration data that was used to generate code for the model and a...

Страница 108: ...file Use a different file and the rtosf option if you plan to preserve the comments Note You must use the template parameters as specified in the previous tables before code affected by RTOS file sett...

Страница 109: ...nerated code The requirements of generated code are somewhat different than that of the model diagram and AutoCode must resolve these differences and preserve the semantics of the model diagram The sy...

Страница 110: ...ht be many levels of hierarchy represented as nested SuperBlocks SuperBlocks of the same rate are combined into subsystems and thus are effectively optimized away Refer to the Subsystems section for m...

Страница 111: ...a to change but at the same time not affect the read only uses Notice that a var value can be changed as part of a startup procedure SuperBlock Refer to the Startup section for details Global Variable...

Страница 112: ...is optimization is optional and the optimization of global and local variable blocks can be separately controlled Global variable block optimization works only if variable blocks are not shared betwee...

Страница 113: ...ks There are various flavors of SuperBlocks such as Procedure SuperBlocks which have different code generation impacts For the moment the current discussion is limited to Discrete and Continuous Super...

Страница 114: ...of the signal connectivity of the model Parallel threads of execution can be sorted in any order as long as data flow integrity is maintained There are special blocks that have special sequencing requ...

Страница 115: ...ernal inputs and outputs Normally the Sys_ExtOut structure is optimized out because the scheduler external outputs are taken from a subset of the subsystem s external outputs A special quality of the...

Страница 116: ...uts Multi Rate System A multi rate system represents the general case for external input and output data In a multi rate system a particular subsystem output might be used by other subsystems or might...

Страница 117: ...ed to store floating point real and integer parameter data hence their names Many blocks require static data in the form of look up tables hard coded parameter data and initial conditions This type of...

Страница 118: ...Is executed only once at the first time the subsystem is called This might be at time 0 0 but might be later if the subsystem is skewed triggered or enabled Each block can have code for its initializ...

Страница 119: ...r reusability and reentrancy Structure Based Interface This form of the interface to the Standard Procedure is conceptually the same as that of the subsystem The inputs outputs and other data are pack...

Страница 120: ...stomized by using a different Xmath partition containing different values of the parameter data Partitioning is used exclusively with SuperBlocks so normally AutoCode is unaffected However partitionin...

Страница 121: ...oned vars Within a Procedure Xmath variable definitions VAR_FLOAT A_GAIN VAR_FLOAT B_GAIN Procedures declarations Procedure foo Inputs type declaration struct _foo_u RT_FLOAT foo_1 Outputs type declar...

Страница 122: ...info foo_2_i static struct _foo_u foo_12_u static struct _foo_y foo_12_y static struct _foo_info foo_12_i struct _foo_info foo_i Initialization if SUBSYS_PREINIT 1 iinfo 0 0 iinfo 1 1 iinfo 2 1 iinfo...

Страница 123: ...or some of the following arguments need to be passed for each call to the procedure in the following order U Y S and I These arguments are pointers to structures reflecting the procedure s inputs out...

Страница 124: ...ed _procedure name_x whose value is toggled between 0 and 1 by the subsystem invoking the procedure The informational data of the procedure is provided by the argument I a pointer to a structure named...

Страница 125: ...fter the Xmath variables used You need to initialize these pointers Table 5 1 Description of Element iinfo in Structure _procedure name_info Array Element Description iinfo 0 Error flag iinfo 1 1 INIT...

Страница 126: ...t is to provide the unique identifier of the caller that is the number of the subsystem task background startup or interrupt procedure SuperBlock As implied in Example 5 2 and Example 5 3 all subsyste...

Страница 127: ...of epi affects all generated procedures It is not possible to specify some procedures with and some other procedures without the caller_id element Also subsystem code generated assumes the existence o...

Страница 128: ...me generated for the Macro Procedure can be the name of the function rather than a macro as would always be the case for Ada Interface The interface generated to a Macro Procedure is very similar to t...

Страница 129: ...are the only way to communicate between these procedures and subsystems Interrupt Some external interrupt event causes an Interrupt Service Routine ISR to call the Interrupt Procedure You must write a...

Страница 130: ...t at least one procedure will execute Rather if all of the conditions fail the results from the last time cycle are used AutoCode stores all of the outputs of the last executed procedure within R_P to...

Страница 131: ...he vector might be a fixed size or a size related to the number of inputs or outputs of the block Note The size of the I O variables and the number of I O signals of the BlockScript block are recursiv...

Страница 132: ...e same number of input signals as output signals Environment Variables BlockScript provides a set of environment variables that represent read only values Some of these values represent the phases of...

Страница 133: ...crete subsystem the phases of a block are set in the following way The first time the block is executed the Init Output and State phases are all active at the same time For subsequent executions only...

Страница 134: ...xt_States xnext float u 10 y 10 wobble 10 x 10 xnext x size integer i if OUTPUT then if INIT then for i 1 10 do wobble i 0 1 i x i wobble i 3 14 endfor endif for i 1 10 do y i u i x i wobble i endfor...

Страница 135: ...fferent data types for the state variables as with inputs and outputs The State variable s are intended to represent state data from the previous time point The State variable s should only be used fo...

Страница 136: ...static struct _Subsys_1_states ss_1_states 2 0 0 0 0 Current and Next States Pointers static struct _Subsys_1_states X ss_1_states 0 static struct _Subsys_1_states XD ss_1_states 1 static struct _Subs...

Страница 137: ...programming sense An unrolled loop is not a loop at all An unrolled loop is the body of the loop generated for each iteration of the loop In other words an unrolled loop is the expansion of that loop...

Страница 138: ...ate code The reason j is a soft subscript is that the range of j that is the values of 1 through to the value of the first input u 1 is not known when code is generated because the upper bound of j s...

Страница 139: ...rized code refer to Chapter 6 Vectorized Code Generation and at the most basic level it means that arrays will be used instead of scalar variables Given that AutoCode does not have to translate the Bl...

Страница 140: ...4 indata_4 8 bsb_5 indata_5 10 Example 5 13 Rolled Loop from Example 5 10 Using Vectorized Code Output Update BlockScript Block bsb 4 for j 1 j indata 0 j bsb 1 j indata 1 j j Table 5 4 Scalar Code Se...

Страница 141: ...rs Instead of States in a Discrete Model Although parameters are intended to be read only data it is possible within a discrete model to update a parameter because the execution of a block is known th...

Страница 142: ...use of the nested IF statement Also the nested IF statement is used to ensure that the SystemBuild Simulator updates the parameter only during the Output phase and not the Init phase Caution Failure...

Страница 143: ...the generated code consider using a parameter instead and p option for code generation Dead Code Elimination Code that is guaranteed to never execute is called dead code When dead code is detected as...

Страница 144: ...be excessive data type conversions that severely penalize performance NI recommends that if you want to maximize the performance of the generated code you eliminate any implicit conversions in your Bl...

Страница 145: ...d for a call to the UCB Specifically a UCB in a discrete system will have both Output and State phases enabled during the same call to the UCB In a continuous system the Output and State phases are no...

Страница 146: ...meters without affecting the var Example 5 18 clarifies this Assume a UCB is parameterized with the var named floatdata for the UCB s real parameters and the var named integerdata for the UCB s intege...

Страница 147: ...E Block can be associated with an IfThenElse Block An ELSE IF Block has a condition section while an ELSE Block does not have one An IfThenElse Block in the block diagram along with the associated ELS...

Страница 148: ...a goto statement is used in Ada and the target of the goto is the first statement in the loop Like the IfThenElse Block the requirements for an iteration mechanism are varied and our design allows fo...

Страница 149: ...iable Blocks Local and Global variable blocks are identical except for their lifetime and scope Scope Global variable blocks are implemented as global variables and are visible throughout the system h...

Страница 150: ...point and independently from each other Integrator A continuous subsystem does not have a period rate to be executed Rather we use a continuous sampling rate CSI to indicate the frequency of the compu...

Страница 151: ...e A multiprocessor template is not provided in the AutoCode distribution Shared Memory Architecture In a multiprocessor system subsystems are distributed across difference processors These subsystems...

Страница 152: ...ubsys_1_in PDown mbuf sys_extin PDown Shared Memory Callouts The following are the four sets of the callouts that is macros that must be implemented if you generate code with the smco option The varia...

Страница 153: ...specify the maps Fixed Point Support for Multiprocessor AutoCode AutoCode s capability to generate code for multiprocessor hardware has been strengthened with fixed point data type support If a multi...

Страница 154: ...is generated from within the template You can update shared memory as follows From Local Memory UPDATE_MBUFSBYTE_WITH_LOCSBYTE x y UPDATE_MBUFUBYTE_WITH_LOCUBYTE x y UPDATE_MBUFSSHORT_WITH_LOCSSHORT x...

Страница 155: ...t data types are not supported in this release However shared memory fixed point is supported for Ada code generation as long as the smco option is not used Shared Variable Block Support AutoCode supp...

Страница 156: ...block structure static struct _shared_varblk LOOPP k 0 k lt nvars_i k k plus 1 IFF vars_prsr_scope_li k eq 2 or vars_prsr_scope_li k eq 3 shared_count shared_count 1 declare shared variable block vars...

Страница 157: ...source file s for each processor must have a declaration of the structure Declare an instance of the structure containing the shared variable blocks into shared memory This will vary depending on your...

Страница 158: ...OAT 32 bit RT_INTEGER RT_ULONG and RT_SLONG 16 bit RT_USHORT and RT_SSHORT and 8 bit RT_UBYTE and RT_SBYTE data types Example 5 23 uses the Read_Shared_Varblk syntax Write Shared Variable Block Callou...

Страница 159: ...nt code generation specifications The callouts are grouped together into pairs A pair of callouts is used to surround the variable block access One function of the pair represents the entry into the c...

Страница 160: ...al_Varblk_Section 4 proc2_4_1 block5 0 proc2_4_2 block5 1 Leave_Local_Varblk_Section 4 Entering with Extended Procedure Info Option Specified The prototype of the callout for entering a non shared glo...

Страница 161: ...There are sets of callouts for shared variable block accesses For a discussion of code generation for shared variable blocks refer to the Shared Variable Block Support section Entering Shared Critica...

Страница 162: ...EGER index RT_INTEGER caller_id procedure Enter_Shared_Varblk_Section index RT_INTEGER caller_id RT_INTEGER The formal argument index represents the global reference number for which the variable bloc...

Страница 163: ...allouts using the vbco and epi options Enter_Shared_Varblk_Section 4 1 proc2_4_1 isi_varblk 0 block5 0 proc2_4_2 isi_varblk 0 block5 1 Leave_Shared_Varblk_Section 4 1 Caution It is not possible to mix...

Страница 164: ...ler object code size Efficient implementation of large systems Loops with general BlockScript blocks Mixed scalar and vectorized code within the same model You do not have to change your pre release 7...

Страница 165: ...o 3 1 SUBSYS_PREINIT 1 FALSE return Output Update Gain Block gain 2 Y gain_2_1 1 2 U gain_1 Y gain_2_2 2 3 U gain_2 Y gain_2_3 3 4 U gain_3 Y gain_2_4 4 5 U gain_4 Y gain_2_5 5 6 U gain_5 Y gain_2_6 6...

Страница 166: ...lly With scalar code generation constants are always hard coded Vectorized Gain Block Example Before showing the code for the vectorized gain block you need to know what to look for and compare agains...

Страница 167: ...a into the R_P or other parameter array as needed However the inputs and outputs of the block are controlled by the signal connectivity of the model AutoCode will never reconnect your model to provide...

Страница 168: ...is to improve the generated code Although it is not necessary to redesign your model you should be aware that the flexibility of the SystemBuild Editor lets you design models that vectorize poorly whi...

Страница 169: ...oid subsys_1 U Y struct _Subsys_1_in U struct _Subsys_1_out Y static RT_INTEGER iinfo 4 Parameters static RT_FLOAT R_P 5 RT_INTEGER cnt static const RT_FLOAT _R_P 5 1 2 2 3 3 4 4 5 5 6 Algorithmic Loc...

Страница 170: ...ation modes supported by AutoCode Maximal vectorization is defined by placing all of the outputs of a block into one or more arrays For most blocks only one array is needed because the block can only...

Страница 171: ...ector must be a range of contiguous pins A vector can only be defined from one block either a basic block s outputs top level SuperBlock inputs or subsystem procedure boundary A signal with an empty l...

Страница 172: ...ctorized Code Generation for Figure 6 2 System Ext I O type declarations struct _Subsys_1_out RT_FLOAT delayed_pulse 5 struct _Sys_ExtIn RT_FLOAT sensor_5 5 States type declaration struct _Subsys_1_st...

Страница 173: ...T_INTEGER cnt static const RT_FLOAT _R_P 11 0 1 0 0 0 0 0 0 0 0 0 0 8 7 7 6 6 5 5 4 4 3 Local Block Outputs RT_FLOAT Throttle 5 Algorithmic Local Variables RT_INTEGER i RT_INTEGER j RT_INTEGER k Initi...

Страница 174: ...me Delay VecEx 12 if INIT k 0 for i 1 i 5 i X sensor_delay k R_P i k k 1 k 1 for i 1 i 5 i Y delayed_pulse 1 i X sensor_delay 1 k k k 1 Gain Block VecEx 2 for i 1 i 5 i Throttle 1 i R_P 5 i U sensor_5...

Страница 175: ...ration struct _Subsys_1_states RT_FLOAT sensor_delay 5 void subsys_1 U Y struct _Sys_ExtIn U struct _Subsys_1_out Y States Array static struct _Subsys_1_states ss_1_states 2 Current and Next States Po...

Страница 176: ...R j RT_INTEGER k Initialization if SUBSYS_PREINIT 1 iinfo 0 0 iinfo 1 1 iinfo 2 1 iinfo 3 1 INIT 1 X ss_1_states 0 XD ss_1_states 1 RT_INTEGER ii for ii 0 ii 5 ii X sensor_delay ii 0 0 RT_INTEGER ii f...

Страница 177: ...0 XD sensor_delay k Throttle k k 1 XD sensor_delay k Pedal k k 1 XD sensor_delay k Brake k k 1 XD sensor_delay k Gear k k 1 XD sensor_delay k Clutch k k 1 Swap state pointers XTMP X X XD XD XTMP INIT...

Страница 178: ...and the algorithm loops might not be generated as expected Generally speaking as long as multiple arrays are connected contiguously to the inputs of the block loops are possible For example examine th...

Страница 179: ...EGER i Initialization if SUBSYS_PREINIT 1 iinfo 0 0 iinfo 1 1 iinfo 2 1 iinfo 3 1 for cnt 0 cnt 20 cnt R_P cnt _R_P cnt SUBSYS_PREINIT 1 FALSE return Output Update Gain Block gain 2 for i 1 i 5 i top...

Страница 180: ...The term split merge is a description of a problem that occurs when generating vectorized code for a diagram and pieces of one or more arrays are used as input This is called a split input vector pro...

Страница 181: ...r Split Vector for Figure 6 4 Output Update Gain Block gain top 2 for i 1 i 5 i top 1 i R_P 1 i U gain_1 1 i Gain Block gain bottom 1 for i 1 i 5 i bottom 1 i R_P 4 i U gain_1 4 i Gain Block gain 99 f...

Страница 182: ...o design level solutions can be applied to eliminate the split vector problem Change the design so that the inputs naturally form the array that is merging multiple blocks into one block Change to int...

Страница 183: ...2 top 0 merged_data 3 bottom 2 merged_data 4 top 1 merged_data 5 bottom 0 Nth Order Integrator gain 3 if INIT XREMAP for i 1 i 6 i X gain_3_S1 0 X gain_3_S1 0 TSAMP X gain_3_S1 1 X gain_3_S1 1 X gain...

Страница 184: ...d Also AutoCode is not able to evaluate the design decision to make one block rolled at the expense of another Therefore for optimal vectorization you might need to change your model External Outputs...

Страница 185: ...date Gain Block gain top 2 for i 1 i 5 i top 1 i R_P 1 i U gain_1 1 i Copy back s and or duplicate s RT_INTEGER k 0 for k 0 k 2 k Y top k top k 3 1 Copy backs are coupled with handling duplicate exter...

Страница 186: ...ystem or Standard Procedure it is important to notice that just having all of the block outputs connected to external output will not eliminate the copy back unless the outputs are connected to contig...

Страница 187: ...rocedure vecproc void vecproc vecproc_1 vecproc_2_1 I RT_FLOAT vecproc_1 5 RT_FLOAT vecproc_2_1 5 struct _vecproc_info I some code deleted Output Update Gain Block vecproc 2 for i 1 i 5 i vecproc_2_1...

Страница 188: ...n other words if the inputs and or outputs are not connected to naturally conform to a vector interface the copies required might add significant overhead to the procedure call eliminating the benefit...

Страница 189: ...if Output Update Time Delay VecEx 12 if INIT then k_1 0 for i_1 in RT_INTEGER range 1 5 loop X sensor_delay k_1 R_P i_1 k_1 k_1 1 end loop end if k_1 1 for i_1 in RT_INTEGER range 1 5 loop Y delayed_...

Страница 190: ...he connectivity of the inputs matches the input groups specified in the BlockScript code Note Even with arrays it is still possible to have the soft subscript limitation for the inputs The last determ...

Страница 191: ...n into the matrix That is row and column positions must be flattened to a single dimensional index number The performance impact should be minimal and this approach has the benefit that all optimizati...

Страница 192: ...application in order to store values from computations AutoCode sequences variable blocks and uses them in a deterministic fashion When a Read from Variable block is used it is first copied into a te...

Страница 193: ...IT 1 iinfo 0 0 iinfo 1 1 iinfo 2 1 iinfo 3 1 SUBSYS_PREINIT 1 FALSE return Output Update Read from Variable new 11 new_11_1 var Read from Variable new 1 new_1_1 var1 Sum of Vectors new 12 new_12_1 U n...

Страница 194: ...truct _Subsys_1_out Y static RT_INTEGER iinfo 4 Local Block Outputs RT_FLOAT new_11_1 RT_FLOAT new_12_1 Initialization if SUBSYS_PREINIT 1 iinfo 0 0 iinfo 1 1 iinfo 2 1 iinfo 3 1 SUBSYS_PREINIT 1 FALS...

Страница 195: ...riable block and its use in a summation block Optimization of local and global variables can be controlled independently The command line arguments Olvarblk and Ogvarblk bring about the optimization o...

Страница 196: ...development phase of an application As the application development nears completion and is ready for deployment the need for restarting an application might not arise AutoCode provides an option to op...

Страница 197: ..._1_states 0 XD ss_1_states 1 X proc_12_S1 0 X proc_4_S1 0 0 XD proc_12_S1 0 0 XD proc_4_S1 0 0 for cnt 0 cnt 8 cnt R_P cnt _R_P cnt SUBSYS_PREINIT 1 FALSE return Example 7 3 shows excerpts of generate...

Страница 198: ...bility Optimized Away void subsys_1 U Y struct _Sys_ExtIn U struct _Subsys_1_out Y States Array static struct _Subsys_1_states ss_1_states 2 0 0 0 0 0 0 0 0 Current and Next States Pointers static str...

Страница 199: ...eeds up applications particularly for processors with pipeline architecture such as Siemens 166 167 In this case there would be considerable improvement in the execution speed If AutoCode cannot merge...

Страница 200: ...proc_14_1 U proc_1 proc_22_1 Gain Block proc 12 proc_12_1 2 0 proc_14_1 Sum of Vectors proc 5 proc_5_1 proc_12_1 proc_24_1 Gain Block proc 4 Y proc_4_1 2 0 proc_5_1 State Update Time Delay proc 22 XD...

Страница 201: ...PREINIT 1 FALSE return Output Update Time Delay proc 22 proc_22_1 X proc_22_S1 Time Delay proc 24 proc_24_1 X proc_24_S1 Sum of Vectors proc 14 proc_14_1 U proc_1 proc_22_1 Gain Block proc 12 proc_12_...

Страница 202: ...ze and bringing down the risk of stack overflow AutoCode provides two ways of reusing temporary block output Reuse whenever specified by the user Maximal reuse reuse whenever possible Reuse Temporarie...

Страница 203: ...FLOAT model_3_1 RT_FLOAT model_4_1 Output Update Time Delay model 5 if INIT X model_5_S1 0 0 Y model_5_1 X model_5_S1 Gain Block model 2 model_2_1 2 0 U model_1 Sum of Vectors model 3 model_3_1 model_...

Страница 204: ...the variable model_2_1 as the output variable of the block model 4 Constant Propagation AutoCode supports an option to propagate constants in the generated code Source of constants in a model are typ...

Страница 205: ...bol name and hence force the source blocks to generate code for computing the value of output variables Example 7 9 shows code generated without constant propagation and Example 7 10 shows code genera...

Страница 206: ...iinfo 2 1 iinfo 3 1 SUBSYS_PREINIT 1 FALSE return Output Update Algebraic Expression const 1 Algebraic Expression const 11 Sum of Vectors const 2 Gain Block const 4 Y const_4_1 4 0 In Example 7 10 dur...

Страница 207: ...ed by design When you create a constant block and label the output as a single matrix you will not see any code generated for the block the constant values defined in the block will be part of the dec...

Страница 208: ...are correctly stored in the desired output variables Following this rule can have a significant impact on code generation for these three blocks However regarding input rules the callout interface in...

Страница 209: ...st be subjected to a copy in Good input connectivity will let you generate looped rather than unrolled code but the copy in cannot be avoided Furthermore the disadvantage to using the MatrixLeftDivide...

Страница 210: ...t use of the Constant Block can reduce code size and its use is preferred over the Algebraic Expression Block for defining constants By using these optimizations you can generate optimal C or Ada sour...

Страница 211: ...n firing off chains of such tasks The MATRIXx product line lets you reproduce the behavior of the generated code with Sim To match the default AutoCode scheduler Sim can be invoked with the actiming o...

Страница 212: ...imum scheduler cycles after its invocation where t is the timing requirement Now that the posting policies are understood the map from task types to posting policies can be studied For free running pe...

Страница 213: ...nce Standard AutoCode Scheduler To illustrate the behavior of the standard AutoCode scheduler with triggered and enabled SuperBlocks it is helpful to consider the diagnostic model shown in Figure 8 1...

Страница 214: ...toCode scheduler the output of this system is as shown in Figure 8 2 The top signal corresponding to the triggered task shows a latency of two cycles relative to its trigger input immediately below wh...

Страница 215: ...cies you need to know what operations are performed during each scheduler invocation under the default scheduler These are best presented in the form of a pipeline diagram as shown in Figure 8 3 Stage...

Страница 216: ...Scheduler Pipeline Stages in the Standard AutoCode Scheduler Given this flow you now can explain why the delays are present for the triggered and enabled subsystems Take the case of the triggered sub...

Страница 217: ...scheduler invocation the enable input goes low which means that the enabled task is not enabled for the 0 8 sec scheduler invocation Thus the task is not invoked again and it posts no output however i...

Страница 218: ...ware for free running periodic tasks Your goal will be to reduce both of these latencies to single cycle delays The scheduler pipeline stages in the Sim Cdelay AutoCode scheduler are shown in Figure 8...

Страница 219: ...In fact the output posting policy of all periodic blocks both free running and enabled goes from ANC Sim with actiming to ATR Sim with Cdelay For free running tasks ANC versus ATR does not really make...

Страница 220: ...fall back to the original AutoCode behavior for these options because the Sim choices have the previously mentioned drawbacks State Transition Diagrams of Tasks under Sim Cdelay New transition diagram...

Страница 221: ...t timer and post outputs Timer greater than zero decrement it Timer has reached zero signal overflow Timer greater than zero decrement it Timer is zero and enable reset timer Timer is zero and enable...

Страница 222: ...scheduler cycle In the default AutoCode scheduler this is enforced by ordering the posting of outputs to post from least priority task first and the highest priority task last thereby obviating the n...

Страница 223: ...th just enough space to hold priorities of registers in DataStores written to by both types of tasks Furthermore observe that the problem is caused by the need to preserve information across the gap b...

Страница 224: ...uler With the new template in place the choice of scheduler can be made easily at AutoCode run time by use of a new command line option Given a current version of AutoCode and the new template using i...

Страница 225: ...creased latency Thus a transition diagram is provided in Figure 8 9 can be substituted for that of Figure 8 6 to obtain the main features of Sim with Cdelay while retaining the original AutoCode enabl...

Страница 226: ...led Task Shortcomings of the Sim Cdelay Scheduler What the pipeline re configuration did in the new scheduler was to purchase low latency at the price of scheduler overhead However the solution is not...

Страница 227: ...r under such a design scheduler execution time would be variable and data dependent undesirable attributes in any hard real time scheduler Contrast this with the new scheduler which catches the first...

Страница 228: ...iable s to be used as the inputs and outputs of a procedure You must explicitly select which signals within the model will be generated as global variables In addition you also will have to specify wh...

Страница 229: ...on require that the automatic variables that are normally used for local blocks outputs instead be global variables When the block outputs are global variables the values persist after the subsystem e...

Страница 230: ...he following set of TPL tokens to allow you to customize the declaration of these variables Since monitored signals are not intended to be shared between subsystems the global variables used to repres...

Страница 231: ...re for that system subsystem That copy occurs at the end of the subsystem execution order Variable Block Aliasing You cannot name a Global Scope label or name that matches the name of the variable blo...

Страница 232: ...s that is the blocks whose output s connect to the procedure s inputs must know the exact name s of the global variables so as to pass the data correctly The goal is to eliminate any extra copies of t...

Страница 233: ...ded Using a Parameterless Procedure After the procedure has been defined with parameterless signals you now have to connect signals to and from the procedure reference The following sections describe...

Страница 234: ...ariable Note If you intend to reuse a parameterless procedure make sure that the sequencing of the blocks that write into the global variables is correct Also keep in mind the same problem with using...

Страница 235: ...ant to pass data between subsystems using global variables use a variable block Variable Blocks Versus Global Scope A Variable Block cannot be used as a Global Scope signal into a parameterless proced...

Страница 236: ...ends applying the following steps to your design if you intend to use parameterless procedures Notice that many of these items have direct parallels to what you would expect if you were hand coding us...

Страница 237: ...lve the naming This is accomplished by using a unit gain block that is a gain block with a gain factor of 1 Using the gain block in this way will let you match any connectivity that you require You mi...

Страница 238: ...ery question receives an answer For information about other technical support options in your area visit ni com services or contact your local office at ni com contact Training and Certification Visit...

Страница 239: ...k 5 51 non shared global variable blocks critical section with epi option 5 52 critical section without epi option 5 51 non shared variable blocks 5 51 pairs 5 51 parameterized UCB 5 38 shared global...

Страница 240: ...C 2 4 RT_BOOLEAN 2 4 RT_FLOAT 2 4 RT_INTEGER 2 4 DHP 2 2 DHP700 2 2 diagnostic tools NI resources A 1 DIBM 2 2 directory demos 2 3 3 4 executables 2 2 3 3 src distribution C 2 2 templates 2 3 3 4 top...

Страница 241: ...p_f c 2 34 sa_fxp_f h 2 33 sa_fxpbit a 3 21 sa_fxpbit_ a 3 21 sa_fxpgenerics a 3 21 sa_fxpgenerics_ a 3 21 sa_fxprv h 2 32 2 33 sa_fxptypes_ a 3 21 sa_fxr h 2 32 2 33 sa_fxscale h 2 32 2 33 sa_fxsub_b...

Страница 242: ...ncation conversion 3 32 user types 3 19 UTs 3 19 wordsize extension 3 30 C 2 26 2 40 32 bit division 2 43 32 bit multiplication 2 42 32 bit operands 2 42 arithmetic macros 2 38 conversion macros 2 35...

Страница 243: ...cks 5 3 BlockScript block environment variables 5 24 example with parameter 5 34 example with states 5 27 5 30 5 31 generated code optimizations 5 35 constant propagation 5 35 dead code elimination 5...

Страница 244: ...ion 9 3 limitations 9 4 specifying monitored signals 9 2 graphical user interface 3 16 H handling vars in a standard procedure 5 12 hard subscript 5 29 header files 2 4 sa_defn h 2 4 sa_fuzzy h 2 4 sa...

Страница 245: ...izing code See generated code optimizing options vbco 5 49 organization manual 1 1 output posting 8 2 overflow error message 2 8 P parameterized UCB callouts 5 38 parameterless procedures See procedur...

Страница 246: ...nfiguration file 1 2 4 1 attributes 4 2 background procedure SuperBlock table 4 6 command options 4 8 contents 4 3 interrupt procedure SuperBlock table 4 5 processor IP name table 4 7 processors table...

Страница 247: ...a file 3 4 3 5 sa_sys h file 2 3 2 4 sa_time a file 3 4 sa_time h file 2 3 2 4 sa_time_ a file 3 4 3 5 sa_types h file 2 4 2 32 2 33 sa_types_ a file 3 4 3 5 sa_types_ ada file 3 5 sa_user a file 3 5...

Страница 248: ...5 10 creation by SystemBuild analyzer 5 5 data monitoring 9 2 code generation 9 3 limitations 9 4 specifying monitored signals 9 2 discrete BlockScript block 5 26 error condition 5 9 error handling 5...

Страница 249: ...loop 5 29 UserCode Block see UCB 3 4 utility routines Ada background 3 6 disable 3 6 enable 3 6 error 3 6 external_input 3 6 3 10 external_output 3 7 3 11 fatalerr 3 6 implementation_initialize 3 6 3...

Страница 250: ...Reference I 12 ni com X X UCB fixed call argument Ada 3 12 C 2 13 XD UCB fixed call argument Ada 3 12 C 2 13 XINPUT array 2 10 Xmath matrixx ascii 2 7 XOUTPUT array 2 10 Y Y UCB fixed call argument A...

Отзывы: