%% sdspmax2.tlc %% %% TLC code generation file for DSP Blockset Maximum block (sdspmax2) %% %% Copyright (c) 1995-2000 The MathWorks, Inc. %% $Revision: 1.8 $ $Date: 2000/02/25 22:57:27 $ %% %% Abstract: %% Top level ANSI-C code generation file. %implements sdspmax2 "C" %include "dsplib.tlc" %include "sdspmax2_maxfcn.tlc" %include "sdspmax2_rstfcn.tlc" %include "event_port_handler.tlc" %function BlockInstanceSetup(block, system) void %% Add block parameters: %% %assign nSamps = SFcnParamSettings.nSamps %assign nChans = SFcnParamSettings.nChans %assign MaxIdx = SFcnParamSettings.MaxFcnIndex %assign FcnType = SFcnParamSettings.FcnType %assign IsRunning = (SFcnParamSettings.IsRunning != 0) %assign DTypeId = LibBlockInputSignalDataTypeId(0) %assign InCplx = (LibBlockInputSignalIsComplex(0) != 0) %assign InFrame = (LibBlockInputSignalIsFrameData(0) != 0) %assign RESET_PORT = 1 %% port number of reset port %assign HasResetPort = (NumDataInputPorts > 1) %% Setup (manual) inlining control: %% %assign inline_real_nonrunning = 0 %assign inline_real_running = 1 %assign inline_real_running_frame = 0 %assign inline_cplx_nonrunning = 0 %assign inline_cplx_running = 0 %assign inline_cplx_running_frame = 0 %assign block = block \ + nSamps + nChans \ + MaxIdx \ + FcnType + IsRunning \ + DTypeId + InCplx + InFrame \ + HasResetPort + RESET_PORT \ + inline_real_nonrunning + inline_cplx_nonrunning \ + inline_real_running + inline_cplx_running \ + inline_real_running_frame + inline_cplx_running_frame %% Setup the event port handler: %% % %endfunction %% Function: InitializeConditions ============================================= %% %function InitializeConditions(block, system) Output %% %% xxx When do we need to do this? Not always. %% Only if the block will be rendered as a fcn-call. %% %if CodeFormat == "S-Function" || CodeFormat == "RealTimeMalloc" { % %endif %% %if IsRunning /* DSP Blockset Maximum (%) - % */ %% %if HasResetPort %% Cannot have a reset port if block is not "running" %% %\ %endif %% % %endif %if CodeFormat == "S-Function" || CodeFormat == "RealTimeMalloc" } %endif %endfunction %% InitializeConditions %% Function: Outputs ========================================================== %% %function Outputs(block, system) Output /* % (DSP Blockset - %) */ %if CodeFormat == "S-Function" || CodeFormat == "RealTimeMalloc" { % %else % %endif %% %if HasResetPort %% Block could be multirate if and only if it has more than %% one input port (eg, a reset input). If it is multirate, %% generate "sample hit" conditional so code executes at the %% block's base rate, and not the overall model base rate. %% %assign differentPortRates = !LibIsSFcnSingleRate(block) %% %if differentPortRates if (%) { % %endif if (%) { % } % %if differentPortRates } %endif %else % %endif %if CodeFormat == "S-Function" || CodeFormat == "RealTimeMalloc" } %endif %endfunction %% [EOF] sdspmax2.tlc