%% $RCSfile: sdspcontig2.tlc,v $ %% $Revision: 1.1 $ %% %% TLC for DSP Blockset contiguous copy block %% %% Copyright (c) 1995-1999 The MathWorks, Inc. %implements sdspcontig2 "C" %include "dsplib.tlc" %function Outputs(block, system) Output /* DSP Blockset Contiguous Copy block (%): % */ %% %% Only generate code if output buffer does not share the input buffer area. %% %% There are two reasons why we might need to generate code here: %% 1) Input is discontiguous and therefore inputs cannot overwrite outputs. %% This is exactly the situation for which we know we want to generate code, %% i.e., to make a contiguous copy of discontiguous inputs. %% %% 2) Input is contiguous, but some other block is overwriting the input area. %% Unfortunately, this case generates code where none should be required. %% In this case, user should eliminate this instance of the block. %% %if LibBlockInputSignalBufferDstPort(0) == 0 /* Input data is contiguous - no copy needed */ %else %% %% Inputs not overwriting outputs - copy data: %% %if IsInputPortContiguous(block, 0) /* * Input data is already contiguous, but output data could not overwrite * the input data area (i.e., data needs to be copied to output). * This could be due to another block overwriting the input data area. * Consider removing block "%" from model. */ %endif %% %assign rollVars = ["U","Y"] %roll sigIdx = RollRegions, lcv = RollThreshold, block, "Roller", rollVars %assign y = LibBlockOutputSignal(0, "", lcv, sigIdx) %assign u = LibBlockInputSignal(0, "", lcv, sigIdx) % = %; %endroll %endif %endfunction %% [EOF] sdspcontig2.tlc