MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Manual de Serviço Página 43

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 282
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 42
Compiler Directives
2-23
LoopTrailer(block, Startidx, Niterations, Nrolled, …). This function is called once for
each section that will roll after the body of the
%roll statement.
RollTrailer(block, …). This function is called once at the end of the %roll
statement if any of the ranges caused loop rolling.
These functions should output any language-specific declarations, loop code,
and so on as required to generate correct code for the loop. An example of a
Roller.tlc file is:
%implements Roller "C"
%function RollHeader(block) Output
{
int i;
%return ("i")
%endfunction
%function LoopHeader(block,StartIdx,Niterations,Nrolled) Output
for (i = %<StartIdx>; i < %<Niterations+StartIdx>; i++)
{
%endfunction
%function LoopTrailer(block,StartIdx,Niterations,Nrolled) Output
}
%endfunction
%function RollTrailer(block) Output
}
%endfunction
Note: The Target Language Compiler function library provided with RTW
has the capability to extract references to the Block I/O and other
RTW-specific vectors that vastly simplify the body of the
%roll statement.
These functions include
LibBlockInputSignal, LibBlockOutputSignal,
LibBlockParameter, LibBlockRWork, LibBlockIWork, LibBlockPWork, and
LibDeclareRollVars. For more details on these functions and other Simulink
functions, see the section on Loop Rolling beginning on page 3-44 along with
the “Target Language Compiler Function Library Reference” chapter. This
library also includes a default implementation of Roller.tlc.
Vista de página 42
1 2 ... 38 39 40 41 42 43 44 45 46 47 48 ... 281 282

Comentários a estes Manuais

Sem comentários