%selectfile NULL_FILE
%if EXISTS("_COMMONPRMLIB_") == 0
%assign _COMMONPRMLIB_ = 1
%realformat "CONCISE"
%<LibAddToCompiledModel("BlockIOInstance", 0)>
%<LibAddToCompiledModel("ConstBlockIOInstance", 0)>
%<LibAddToCompiledModel("ExportedGlobalSignalsInstance", 0)>
%<LibAddToCompiledModel("CustomReusableSignalsInstance", 0)>
%<LibAddToCompiledModel("ExportedGlobalDWorkInstance", 0)>
%<LibAddToCompiledModel("ContStatesInstance", 0)>
%<LibAddToCompiledModel("PeriodicContStatesInstance", 0)>
%<LibAddToCompiledModel("PeriodicStateIndInstance", 0)>
%<LibAddToCompiledModel("PeriodicStateRngInstance", 0)>
%<LibAddToCompiledModel("MassMatricesGlobalInstance", 0)>
%<LibAddToCompiledModel("DWorkInstance", 0)>
%<LibAddToCompiledModel("CoderDataGroupInstance", 0)>
%<LibAddToCompiledModel("PrevZCStatesInstance", 0)>
%<LibAddToCompiledModel("ExternalInputsInstance", 0)>
%<LibAddToCompiledModel("ExternalOutputsInstance", 0)>
%<LibAddToCompiledModel("ExternalInputSizesInstance", 0)>
%<LibAddToCompiledModel("ExternalOutputSizesInstance", 0)>
%function SLibPragmaIdentifierRegexp(pragmastring, identifier) void
%if ISEMPTY(pragmastring)
%return pragmastring
%endif
%return FEVAL("strrep", pragmastring, "$N", identifier)
%endfunction
%function SLibApplyMemSecToDataDecl(declaration, mstype, identifier) void
%return FcnApplyMemSecToDataDefnForSystem(...
declaration, mstype, identifier, ::CompiledModel.CoderDictionary.DefaultMemorySections, TLC_TRUE, TLC_TRUE)
%endfunction
%function SLibApplyMemSecToDataDeclForSystem(declaration, mstype, identifier, system, isModelData) void
%return FcnApplyMemSecToDataDefnForSystem(declaration, mstype, identifier, system, isModelData, TLC_TRUE)
%endfunction
%function SLibApplyMemSecToDataDefn(definition, mstype, identifier) void
%return FcnApplyMemSecToDataDefnForSystem(...
definition, mstype, identifier, ::CompiledModel.CoderDictionary.DefaultMemorySections, TLC_TRUE, TLC_FALSE)
%endfunction
%function FcnApplyMemSecToDataDefnForSystem(definition, mstype, identifier, system, isModelData, isDecl) void
%assign msDefn = ""
%assign applyMemSec = FcnApplyMemSec()
%if (applyMemSec)
%switch mstype
%case "MemSecDataConstants"
%assign memsecname = system.MemSecDataConstants
%break
%case "MemSecDataInternal"
%assign memsecname = system.MemSecDataInternal
%break
%case "MemSecDataInputs"
%assign memsecname = system.MemSecDataInputs
%break
%case "MemSecDataOutputs"
%assign memsecname = system.MemSecDataOutputs
%break
%case "MemSecDataParameters"
%assign memsecname = system.MemSecDataParameters
%break
%default
%<LibReportFatalError(...
"Invalid mstype in function: SLibApplyMemSecToDataDefn")>
%endswitch
%if TYPE(memsecname) != "String"
%assign msDefn = memsecname
%elseif !ISEMPTY(memsecname) && (memsecname != "Default")
%assign msDefn = SLibGetInternalMemorySectionDefForName(memsecname)
%endif
%endif
%openfile buffer
%if !isModelData
%<SLibIfSystemVariantCondition(system)>
%endif
%createrecord qualifierInfo { /
IsConst TLC_FALSE /
IsVolatile TLC_FALSE /
Qualifier "" /
}
%assign msInfo = []
%if !ISEMPTY(msDefn)
%assign qualifierInfo.IsConst = msDefn.IsConst
%assign qualifierInfo.IsVolatile = msDefn.IsVolatile
%assign qualifierInfo.Qualifier = msDefn.Qualifier
%assign prePragma = FcnHandleNewLineForMemSec(msDefn.PrePragma)
%assign postPragma = FcnHandleNewLineForMemSec(msDefn.PostPragma)
%assign comment = FcnHandleNewLineForMemSec(msDefn.Comment)
%assign pragmaPerVar = ISFIELD(msDefn, "PragmaPerVar") && msDefn.PragmaPerVar
%createrecord msInfo { /
PragmaPerVar pragmaPerVar /
PrePragma prePragma /
PostPragma postPragma /
Comment comment /
}
%endif
%<SLibCreateDefinitionStatement(definition, msInfo, qualifierInfo, ...
identifier, TLC_FALSE, isDecl, TLC_TRUE, TLC_TRUE)>
%if !isModelData
%<SLibEndIfSystemVariantCondition(system)>
%endif
%closefile buffer
%return buffer
%endfunction
%function FcnGenParameterDefNotHandledInVarGroup(prm) void
%return ""
%endfunction
%function SLibApplyMemSecToDataDefnForSystem(definition, mstype, identifier, system, isModelData) void
%return FcnApplyMemSecToDataDefnForSystem(definition, mstype, identifier, system, isModelData, TLC_FALSE)
%endfunction
%function SLibGetFcnMemSecPragmaOnDecl(identifier, mstype, preorpost) void
%return SLibGetFcnMemSecPragmaForSystemOnDecl(...
identifier, mstype, preorpost, ::CompiledModel.CoderDictionary.DefaultMemorySections)
%endfunction
%function SLibGetFcnMemSecPragmaForAccessMethod(fcn, preorpost) void
%assign msDefn = ""
%assign applyMemSec = FcnApplyMemSec()
%if(!applyMemSec)
%return ""
%endif
%assert ISFIELD(fcn, "AccessFunctionMemorySectionUUID")
%assign memsecuuid = fcn.AccessFunctionMemorySectionUUID
%assign pragmaPerVar = CGMODEL_ACCESS("MemorySection.PragmaPerVar", memsecuuid)
%assign prePragma = FcnHandleNewLineForMemSec(CGMODEL_ACCESS("MemorySection.PrePragma", memsecuuid))
%assign postPragma = FcnHandleNewLineForMemSec(CGMODEL_ACCESS("MemorySection.PostPragma", memsecuuid))
%assign comment = FcnHandleNewLineForMemSec(CGMODEL_ACCESS("MemorySection.Comment", memsecuuid))
%assign pragma = ""
%switch preorpost
%case "Pre"
%openfile pragma
%if !WHITE_SPACE(comment)
%<comment>
%endif
%if !WHITE_SPACE(prePragma)
%<SLibPragmaIdentifierRegexp(prePragma, fcn.Name)>
%endif
%closefile pragma
%break
%case "Post"
%openfile pragma
%if !WHITE_SPACE(postPragma)
%<SLibPragmaIdentifierRegexp(postPragma, fcn.Name)>
%endif
%closefile pragma
%break
%default
%<LibReportFatalError(...
"Invalid preorpost in function: SLibGetFcnMemSecPragmaForSystem")>
%endswitch
%return pragma
%endfunction
%function SLibGetFcnMemSecPragmaForSystemOnDecl(identifier, mstype, preorpost, system) void
%if !SLibIsPragmaOnDecls()
%return ""
%endif
%return SLibGetFcnMemSecPragmaForSystem(identifier, mstype, preorpost, system)
%endfunction
%function SLibGetFcnMemSecPragma(identifier, mstype, preorpost) void
%return SLibGetFcnMemSecPragmaForSystem(...
identifier, mstype, preorpost, ::CompiledModel.CoderDictionary.DefaultMemorySections)
%endfunction
%function SLibGetFcnMemSecUUIDForFunction(fcnType, fcnId) void
%assign memsecUUID = ""
%switch fcnType
%case "Initialize"
%assign memsecUUID = CGMODEL_ACCESS("CGModel.getModelEntryMemorySection", "Initialize", "")
%break
%case "Terminate"
%assign memsecUUID = CGMODEL_ACCESS("CGModel.getModelEntryMemorySection", "Terminate", "")
%break
%case "Reset"
%assign memsecUUID = CGMODEL_ACCESS("CGModel.getModelEntryMemorySection", "Reset", "%<fcnId>")
%break
%case "Step"
%assign memsecUUID = CGMODEL_ACCESS("CGModel.getModelEntryMemorySection", "Step", "%<fcnId>")
%break
%case "Output"
%assign memsecUUID = CGMODEL_ACCESS("CGModel.getModelEntryMemorySection", "Output", "%<fcnId>")
%break
%case "Update"
%assign memsecUUID = CGMODEL_ACCESS("CGModel.getModelEntryMemorySection", "Update", "%<fcnId>")
%break
%case "FcnCallInport"
%assign memsecUUID = CGMODEL_ACCESS("CGModel.getModelEntryMemorySection", "FcnCallInport", "%<fcnId>")
%break
%case "SimulinkFunction"
%assign memsecUUID = CGMODEL_ACCESS("CGModel.getModelEntryMemorySection", "SimulinkFunction", "%<fcnId>")
%break
%default
%<LibReportFatalError(...
"SLibGetFcnMemSecUUIDForFunction: Invalid : fcnType" + fcnType)>
%endswitch
%return memsecUUID
%endfunction
%function SLibGetFcnMemSecPragmaForFunction(identifier, fcnType, fcnId, preorpost) void
%assign pragma = ""
%assign applyMemSec = FcnApplyMemSec()
%if(!applyMemSec)
%return ""
%endif
%if !CGMODEL_ACCESS("CGModel.isIndividualFunctionMappingEnabled") && !SLibAutosarActive()
%return ""
%endif
%assign memsecUUID = SLibGetFcnMemSecUUIDForFunction(fcnType, fcnId)
%if !ISEMPTY(memsecUUID)
%assign msDefn = SLibGetMemorySectionForUUID(memsecUUID)
%if CGMODEL_ACCESS("MemorySection.IsLegacy", memsecUUID)
%assign msPkg = CGMODEL_ACCESS("MemorySection.Package", memsecUUID)
%assign msDefn = SLibGetMemorySectionDefForName(msPkg, msDefn)
%endif
%switch preorpost
%case "Pre"
%openfile pragma
%if !WHITE_SPACE(msDefn.Comment)
%<msDefn.Comment>
%endif
%if !WHITE_SPACE(msDefn.PrePragma)
%<SLibPragmaIdentifierRegexp(msDefn.PrePragma, identifier)>
%endif
%closefile pragma
%break
%case "Post"
%openfile pragma
%if !WHITE_SPACE(msDefn.PostPragma)
%<SLibPragmaIdentifierRegexp(msDefn.PostPragma, identifier)>
%endif
%closefile pragma
%break
%default
%<LibReportFatalError(...
"Invalid preorpost in function: SLibGetFcnMemSecPragmaForFunction")>
%endswitch
%endif
%return pragma
%endfunction
%function SLibGetFcnMemSecPragmaForSystem(identifier, mstype, preorpost, system) void
%assign msDefn = ""
%assign applyMemSec = FcnApplyMemSec()
%if(!applyMemSec)
%return ""
%endif
%switch mstype
%case "MemSecFuncInitTerm"
%assign memsecname = system.MemSecFuncInitTerm
%break
%case "MemSecFuncExecute"
%assign memsecname = system.MemSecFuncExecute
%break
%case "MemSecFuncSharedUtil"
%assign memsecname = system.MemSecFuncSharedUtil
%break
%default
%<LibReportFatalError(...
"SLibGetFcnMemSecPragmaForSystem: Invalid mstype: " + mstype)>
%endswitch
%if TYPE(memsecname) != "String"
%assign msDefn = memsecname
%assign prePragma = FcnHandleNewLineForMemSec(msDefn.PrePragma)
%assign postPragma = FcnHandleNewLineForMemSec(msDefn.PostPragma)
%assign comment = FcnHandleNewLineForMemSec(msDefn.Comment)
%switch preorpost
%case "Pre"
%openfile pragma
%if !WHITE_SPACE(comment)
%<comment>
%endif
%if !WHITE_SPACE(prePragma)
%<SLibPragmaIdentifierRegexp(prePragma, identifier)>
%endif
%closefile pragma
%break
%case "Post"
%openfile pragma
%if !WHITE_SPACE(postPragma)
%<SLibPragmaIdentifierRegexp(postPragma, identifier)>
%endif
%closefile pragma
%break
%default
%<LibReportFatalError(...
"Invalid preorpost in function: SLibGetFcnMemSecPragmaForSystem")>
%endswitch
%return pragma
%else
%if !ISEMPTY(memsecname) && (memsecname != "Default")
%assign msDefn = SLibGetInternalMemorySectionDefForName(memsecname)
%switch preorpost
%case "Pre"
%openfile pragma
%if !WHITE_SPACE(msDefn.Comment)
%<msDefn.Comment>
%endif
%if !WHITE_SPACE(msDefn.PrePragma)
%<SLibPragmaIdentifierRegexp(msDefn.PrePragma, identifier)>
%endif
%closefile pragma
%break
%case "Post"
%openfile pragma
%if !WHITE_SPACE(msDefn.PostPragma)
%<SLibPragmaIdentifierRegexp(msDefn.PostPragma, identifier)>
%endif
%closefile pragma
%break
%default
%<LibReportFatalError(...
"Invalid preorpost in function: SLibGetFcnMemSecPragmaForSystem")>
%endswitch
%return pragma
%endif
%endif
%return ""
%endfunction
%function SLibCreateDefinitionStatement(definition, msInfo, qualifierInfo, ...
identifier, includeQualifier, isDecl, isFirstElement, isLastElement) void
%if isDecl
%assign extern = "extern "
%else
%assign extern = ""
%endif
%assign qualifier = ""
%if includeQualifier
%if qualifierInfo.IsConst
%assign qualifier = qualifier + "const "
%endif
%if qualifierInfo.IsVolatile
%assign qualifier = qualifier + "volatile "
%endif
%if !ISEMPTY(qualifierInfo.Qualifier)
%assign qualifier = qualifier + qualifierInfo.Qualifier + " "
%endif
%endif
%if ISEMPTY(msInfo)
%if ISEMPTY(definition)
%return qualifier + definition
%endif
%return extern + qualifier + definition + "/n"
%else
%assign prepragma = ""
%assign postpragma = ""
%if(ISFIELD(msInfo, "PragmaPerVar") && msInfo.PragmaPerVar)
%if !isDecl || (SLibIsPragmaOnDecls())
%assign prepragma = ...
SLibPragmaIdentifierRegexp(msInfo.PrePragma, identifier)
%assign postpragma = ...
SLibPragmaIdentifierRegexp(msInfo.PostPragma, identifier)
%endif
%else
%if isFirstElement
%assign prepragma = msInfo.PrePragma
%endif
%if isLastElement
%assign postpragma = msInfo.PostPragma
%endif
%endif
%openfile buffer
%if !WHITE_SPACE(msInfo.Comment) && isFirstElement
%<msInfo.Comment>
%endif
%if !WHITE_SPACE(prepragma)
%<prepragma>
%endif
%<extern>%<qualifier>%<definition>
%if !WHITE_SPACE(postpragma)
%<postpragma>
%endif
%closefile buffer
%return buffer
%endif
%endfunction
%function SLibBHMParamIsUsed(block, paramIdx) void
%assign mdlParamIdx = block.Parameter[paramIdx]._idx
%if mdlParamIdx == -1
%return TLC_FALSE
%else
%return TLC_TRUE
%endif
%endfunction
%function SLibGetBlockParamIdentifier(block, paramIdx) void
%return SLibBHMParamGetIdentifier(block, paramIdx)
%endfunction
%function SLibBHMParamGetIdentifier(block, paramIdx) void
%assert SLibBHMParamIsUsed(block, paramIdx)
%assign mdlParamIdx = block.Parameter[paramIdx]._idx
%assign mdlParam = ::CompiledModel.ModelParameters.Parameter[mdlParamIdx]
%assign paramIdentifier = LibGetRecordIdentifier(mdlParam)
%return paramIdentifier
%endfunction
%function SLibBHMParamIsGlobal (block, paramIdx) void
%assert SLibBHMParamIsUsed(block, paramIdx)
%assign bhmParam = block.Parameter[paramIdx]
%assign mdlParam = ::CompiledModel.ModelParameters.Parameter[bhmParam._idx]
%if mdlParam.IsGlobal
%return TLC_TRUE
%else
%return TLC_FALSE
%endif
%endfunction
%function SLibBHMParamIsInGMMModelParameters(block, paramIdx) void
%assert SLibBHMParamIsUsed(block, paramIdx)
%assign bhmParam = block.Parameter[paramIdx]
%if bhmParam.IsReference
%assign mdlParam = ::CompiledModel.ModelParameters.Parameter[bhmParam._idx]
%if ISEQUAL(mdlParam.IsPseudoWorkspaceVar,"yes")
%return TLC_FALSE
%elseif mdlParam.GraphicalSource[0] == 0 && mdlParam.GraphicalSource[1] == -1
%return TLC_FALSE
%else
%return TLC_TRUE
%endif
%else
%return TLC_FALSE
%endif
%endfunction
%function SLibBHMParamGetSource(block, paramIdx) void
%assert SLibBHMParamIsUsed(block, paramIdx)
%assign bhmParam = block.Parameter[paramIdx]
%assign mdlParam = ::CompiledModel.ModelParameters.Parameter[bhmParam._idx]
%return mdlParam.GraphicalSource
%endfunction
%function SLibBHMParamIsUsedInTrivialExpression(block, paramIdx) void
%assert SLibBHMParamIsUsed(block, paramIdx)
%assign bhmParam = block.Parameter[paramIdx]
%if bhmParam.IsUsedInTrivialExpr
%return TLC_TRUE
%else
%return TLC_FALSE
%endif
%endfunction
%function SLibBHMParamGetUsedElement(block, paramIdx) void
%assert SLibBHMParamIsUsed(block, paramIdx)
%assign bhmParam = block.Parameter[paramIdx]
%return bhmParam.UsedElement
%endfunction
%function SLibBHMParamGetInitialValue(block, paramIdx) void
%assert SLibBHMParamIsUsed(block, paramIdx)
%assign mdlParamIdx = block.Parameter[paramIdx]._idx
%assign mdlParam = ::CompiledModel.ModelParameters.Parameter[mdlParamIdx]
%return LibParameterInstanceInitStr(mdlParam)
%endfunction
%function FcnGetMemorySectionAttribute(system, memSecGroup, attribute) void
%if TYPE(system) != "Scope"
%assert(system == -1)
%assign system = ::CompiledModel.CoderDictionary.DefaultMemorySections
%endif
%if SLibAreInternalMemorySectionsDefined()
%assign memsecname = system.%<memSecGroup>
%if TYPE(memsecname) != "String"
%return memsecname.%<attribute>
%elseif !ISEMPTY(memsecname) && (memsecname != "Default")
%assign msDefn = SLibGetInternalMemorySectionDefForName(memsecname)
%return msDefn.%<attribute>
%endif
%endif
%return TLC_FALSE
%endfunction
%function SLibGetGlobalConstantMemorySectionHasVolatile() void
%return FcnGetMemorySectionAttribute(-1, "MemSecDataConstants", "IsVolatile")
%endfunction
%function FcnGetQualifiersForData(system, name, mstype, canBeConst) void
%assign qualifiers = ""
%if (canBeConst == 2)
%assign qualifiers = "const "
%elseif FcnGetMemorySectionAttribute(system, mstype, "IsConst")
%if (canBeConst == 1)
%assign qualifiers = "const "
%else
%<SLibReportWarningWithIdAndArgs("RTW:tlc:CannotAddConstToData", name)>
%endif
%endif
%if FcnGetMemorySectionAttribute(system, mstype, "IsVolatile")
%assign qualifiers = qualifiers + "volatile "
%endif
%return qualifiers
%endfunction
%function FcnGetQualifiersForConstantData(system, name) void
%return FcnGetQualifiersForData(system, name, "MemSecDataConstants", 2)
%endfunction
%function SLibGetGroundQualifiers() void
%return FcnGetQualifiersForConstantData(-1, "data type ground values")
%endfunction
%function SLibGetConstParamQualifiers() void
%return FcnGetQualifiersForConstantData(-1, ::tConstParamStruct)
%endfunction
%function SLibGetConstParamWithInitQualifiers() void
%return FcnGetQualifiersForData(-1, ::tConstParamWithInitStruct, "MemSecDataConstants", 0)
%endfunction
%function SLibGetConstBlockIOQualifiers() void
%if SLibCanConstBlockIOBeConst()
%return FcnGetQualifiersForConstantData(-1, ::tConstBlockIOStruct)
%else
%return FcnGetQualifiersForData(-1, ::tConstBlockIOStruct, "MemSecDataConstants", 0)
%endif
%endfunction
%function SLibGetConstBlockIOForSystemQualifiers(system) void
%if SLibCanConstBlockIOForSystemBeConst(system)
%return FcnGetQualifiersForConstantData(system, ::tConstBlockIOStruct)
%else
%return FcnGetQualifiersForData(system, ::tConstBlockIOStruct, "MemSecDataConstants", 0)
%endif
%endfunction
%function SLibCanConstBlockIOBeConst() void
%return ISEMPTY(::CompiledModel.NonFiniteBlockIOAssignmentsCache)
%endfunction
%function SLibCanConstBlockIOForSystemBeConst(system) void
%return ISEMPTY(LibGetSystemField(system, "CachedNonFiniteBlockIOAssignments"))
%endfunction
%function LibCacheModelStructureInstance() void
%<LibCacheBlockIOInstance()>
%<LibCacheConstBlockIOInstance()>
%<LibCacheExportedGlobalSignalsInstance()>
%<LibCacheCustomReusableSignalsInstance()>
%<LibCacheExportedGlobalDWorkInstance()>
%<LibCacheContStatesInstance()>
%<LibCachePeriodicContStatesInstance()>
%<LibCacheMassMatricesInstance()>
%<LibCacheCoderDataGroupInstance()>
%if CodeFormat != "S-Function" || Accelerator
%<LibCacheDWorkInstance()>
%endif
%<LibCachePrevZCStatesInstance()>
%if !SLibAutosarActive()
%<LibCacheExternalInputsInstance()>
%<LibCacheExternalOutputsInstance()>
%<LibCacheExternalInputSizesInstance()>
%<LibCacheExternalOutputSizesInstance()>
%endif
%endfunction
%function FcnGenerateNonFiniteParamValue(mdlParam, lvalue, ridx, cidx) void
%assign dTypeId = LibGetRecordContainerDataTypeId(mdlParam)
%assign complex = LibGetRecordIsComplex(mdlParam)
%assign rval = ...
SLibParameterValue(lvalue, dTypeId, complex, ridx,"%<tRealPart>%<cidx>")
%assign nRows = SIZE(lvalue, 0)
%assign nCols = SIZE(lvalue, 1)
%assign indexStr = SLibGet2dArrayIndexer(0, nRows, "", "", ridx, ...
nCols, "", "", cidx, !SLibIsContainerCGTypeND(mdlParam))
%if (complex)
%assign accessor = ".%<tRealPart>"
%else
%assign accessor = ""
%endif
%if mdlParam.StorageClass == "Custom"
%openfile tmpStr
%if mdlParam.CustomStorageClassVersion > 1
%<LibAccessCustomData(mdlParam, "set", indexStr, accessor, rval)>
%else
%assign lhs = LibCustomData(mdlParam, "contents", indexStr, accessor)
%<lhs> = %<rval>;
%endif
%closefile tmpStr
%else
%assign lhs = FcnAccessModelParameter(mdlParam, indexStr)
%assign tmpStr = "%<lhs>%<accessor> = %<rval>;/n"
%endif
%assign vcRecord = SLibGetDataInlineVariantNetConditions(mdlParam)
%assign ifCond = vcRecord.ifCond
%assign ifEndCond = vcRecord.endIfCond
%assign tmpStr = ifCond + "/n" + tmpStr + "/n" + ifEndCond + "/n"
%assign tmpStr = SLibWrapVariantCondition(mdlParam, tmpStr)
%<SLibCacheNonFiniteParamAssignment(mdlParam, tmpStr)>
%if complex
%if mdlParam.StorageClass == "Custom"
%openfile tmpStr
%if mdlParam.CustomStorageClassVersion > 1
%<LibAccessCustomData(mdlParam, "set", indexStr, tImagPart, ival)>
%else
%assign lhs = LibCustomData(mdlParam, "contents", indexStr, tImagPart)
%<lhs> = %<ival>;
%endif
%closefile tmpStr
%else
%assign ival = ...
SLibParameterValue(lvalue, dTypeId, complex, ridx,"%<tImagPart>%<cidx>")
%assign tmpStr = "%<lhs>.%<tImagPart> = %<ival>;/n"
%endif
%<SLibCacheNonFiniteParamAssignment(mdlParam, tmpStr)>
%endif
%return 1
%endfunction
%function SLibGenMacroStrForModelPrm(mdlParam, indices, complex, reim, ...
accessType) void
%assign macroStr = ""
%if complex
%if reim == tRealPart
%assign macroStr = "_RE"
%elseif reim == tImagPart
%assign macroStr = "_IM"
%else
%assign errTxt = "Unhandled case in SLibGenMacroStrForModelPrm"
%<LibBlockReportFatalError([], errTxt)>
%endif
%else
%assign macroStr = ""
%endif
%if SLibGetWidthOfValueFromParamRec(mdlParam) > 1
%if accessType == "Vector"
%assign pIdx = indices[0]
%assign macroStr = "_EL_%<pIdx>%<macroStr>"
%else
%assign rIdx = indices[0]
%assign cIdx = indices[1]
%assign macroStr = "_R_%<rIdx>_C_%<cIdx>%<macroStr>"
%endif
%endif
%if ISFIELD(mdlParam,"TruncatedId")
%assign macroStr = "%<mdlParam.TruncatedId>%<macroStr>"
%else
%assign remLength = ::CompiledModel.ConfigSet.MaxIdLength - SIZE(macroStr)[1]
%assign identifier = tConstPrms + "_" + LibGetRecordIdentifier(mdlParam)
%assign truncatedMdlPrm = LibRequestIDWithLength(identifier, TLC_TRUE, TLC_FALSE, remLength)
%addtorecord mdlParam TruncatedId truncatedMdlPrm
%assign macroStr = "%<truncatedMdlPrm>%<macroStr>"
%endif
%return macroStr
%endfunction
%function FcnGetModelVectPrmVal(mdlParam, sigIndexer, pIdx, complex, reim) void
%return FcnGetVectPrmValueCore(mdlParam, sigIndexer, pIdx, complex, reim, 0)
%endfunction
%function FcnGetModelMatrixPrmVal(mdlParam, ridx, cidx, complex, reim) void
%assign value = SLibGetValueFromParamRec(mdlParam, TLC_TRUE)
%assign dtype = LibGetRecordContainerDataTypeId(mdlParam)
%return FcnGetMatrixPrmValueCore(value, dtype, ridx, cidx, complex, reim, 0)
%endfunction
%function SLibGenModelConstPrmMacroAccess(mdlParam, sigIndexer, indices, ...
complex, reim, accessType) void
%if (SLibGenMacroForPrm(mdlParam) && !SLibCurrentlyGeneratingSharedFcn())
%if accessType == "Matrix" && !ISFIELD(mdlParam, "MacroAccessAsMatrix")
%addtorecord mdlParam MacroAccessAsMatrix 1
%endif
%if accessType == "Vector" && !ISFIELD(mdlParam, "MacroAccessAsVector")
%addtorecord mdlParam MacroAccessAsVector 1
%endif
%return SLibGenMacroStrForModelPrm(mdlParam, indices, complex, ...
reim, accessType)
%else
%if accessType == "Matrix"
%return FcnGetModelMatrixPrmVal(mdlParam, indices[0], ...
indices[1], complex, reim)
%else
%return FcnGetModelVectPrmVal(mdlParam, sigIndexer, indices[0], ...
complex, reim)
%endif
%endif
%endfunction
%function SLibGenConstRTPForPrm(mdlParam) void
%if mdlParam.InConstSection
%assert (mdlParam.Tunable == "no")
%assert (!mdlParam.InConstWithInitSection)
%return TLC_TRUE
%else
%return TLC_FALSE
%endif
%endfunction
%function SLibGenConstPrmWithInit(mdlParam) void
%if mdlParam.InConstWithInitSection
%assert (mdlParam.Tunable == "no")
%assert (!mdlParam.InConstSection)
%return TLC_TRUE
%else
%return TLC_FALSE
%endif
%endfunction
%function FcnConstParamAccessedOutsideSharedFcn(mdlParam) void
%assign firstInstanceParam = ::CompiledModel.ModelParameters.Parameter[mdlParam.FirstInstanceConstIdx]
%if (!SLibConstParamReferencedOnlyBySharedFcn(firstInstanceParam) && ...
SLibConstParamAccessedOutsideSharedFcn(mdlParam))
%return TLC_TRUE
%else
%return TLC_FALSE
%endif
%endfunction
%function FcnConstParamAccessedBySharedFcn(mdlParam) void
%if !(ISFIELD(mdlParam, "FirstInstanceConstIdx"))
%return TLC_FALSE
%endif
%assign firstInstanceParam = ::CompiledModel.ModelParameters.Parameter[mdlParam.FirstInstanceConstIdx]
%if (ISFIELD(firstInstanceParam, "RLSReferences") && ...
SIZE(firstInstanceParam.RLSReferences, 1) > 0)
%if FcnConstParamAccessedOutsideSharedFcn(mdlParam)
%return TLC_FALSE
%else
%return TLC_TRUE
%endif
%else
%return TLC_FALSE
%endif
%endfunction
%function SLibGenMacroForPrm(mdlParam) void
%assign isStruct = LibIsStructDataType(LibGetDataTypeStorageIdFromId(LibGetRecordDataTypeId(mdlParam)))
%assign refBySharedFcn = FcnConstParamAccessedBySharedFcn(mdlParam)
%assign retVal = (SLibGenConstRTPForPrm(mdlParam) && ...
InlinedPrmAccess == "Macros") && !isStruct && !refBySharedFcn
%return retVal
%endfunction
%function SLibGnerateFormattedSymbolicValue(prmVal, vectorComment) Output
%if !WHITE_SPACE(vectorComment)
%assign vectorComment = " /* %<vectorComment> *//n"
%endif
%assign nRows = SIZE(prmVal, 0)
%assert (nRows == 1)
%if !ISEQUAL(TYPE(prmVal), "Vector")
%<prmVal>%<vectorComment>/
%return
%endif
%assign nCols = SIZE(prmVal, 1)
%assert (nCols >= 1)
%assign symVal = "{"
%foreach colIdx = nCols
%assign symVal = symVal + prmVal[colIdx]
%if colIdx < nCols - 1
%assign symVal = symVal + ", "
%endif
%endforeach
%assign symVal = symVal + "}"
%<vectorComment>
%<symVal>/
%endfunction
%function SLibEmitMatrixValue(mdlPrmValue, dTypeId, row, col, isComplex, storageTypeId) void
%openfile valueString
%if LibIsEnumDataType(dTypeId)
%<SLibGetEnumTypeCodeGenStringFromIndex(dTypeId, mdlPrmValue[col])>/
%elseif LibIsNonBuiltInTypeNeededForFixpt(dTypeId)
%if isComplex
{/
%if TYPE(mdlPrmValue) == "Matrix"
%<FcnGetNonBuiltInRe(mdlPrmValue[row][col])>/
%else
%<FcnGetNonBuiltInRe(mdlPrmValue[col])>/
%endif
, /
%if TYPE(mdlPrmValue) == "Matrix"
%<FcnGetNonBuiltInIm(mdlPrmValue[row][col])>/
%else
%<FcnGetNonBuiltInIm(mdlPrmValue[col])>/
%endif
}/
%else
%if TYPE(mdlPrmValue) == "Matrix"
%/
%else
%/
%endif
%endif
%else
%<LibGetGroundInitFromId(storageTypeId)>/
%endif
%closefile valueString
%return valueString
%endfunction
%function SLibGetFormattedPrmValue(mdlParam, vectorComment) void
%if ISFIELD(mdlParam, "LUTObjectFieldValues")
%<SLibCacheLUTPointerDataInitBuf(mdlParam)>
%return SLibLUTObjectInit(mdlParam)
%endif
%openfile valueString
%assign prmVal = SLibPrepParameterCore(mdlParam, TLC_TRUE)
%assign dTypeId = LibGetRecordDataTypeId(mdlParam)
%assign mdlPrmValue = SLibGetValueFromParamRec(mdlParam, TLC_TRUE)
%if ISFIELD(mdlParam, "IsSymbolicValue")
%assign mdlPrmExpression = GetValueExpressionFromParamRec(mdlParam)
%if WHITE_SPACE(mdlPrmExpression)
%<SLibGnerateFormattedSymbolicValue(prmVal, vectorComment)> /
%else
%if !WHITE_SPACE(vectorComment)
%<vectorComment>
%endif
%<mdlPrmExpression>/
%endif
%elseif (ISSLDATAREF(mdlPrmValue) || ...
LibIsHalfDataType(dTypeId) || ...
LibIsBuiltInDataType(LibGetDataTypeStorageIdFromId(dTypeId)) && !LibIsEnumDataType(dTypeId))
%if SLibIsNdIndexingFeatureOn() || SLibIsContainerCGTypeND(mdlParam)
%assign prmNonFiniteIndices = GENERATE_FORMATTED_VALUE(prmVal, vectorComment, 0, 1)
%else
%assign prmNonFiniteIndices = GENERATE_FORMATTED_VALUE(prmVal, vectorComment)
%endif
%if !LibIsBuiltInDataType(LibGetDataTypeStorageIdFromId(dTypeId)) && ...
!LibIsHalfDataType(dTypeId) && ...
ISSLDATAREF(mdlPrmValue) && ...
prmNonFiniteIndices[0][0] >= 0
%assign longmsg ="/nNonfinite value in structure parameter %<mdlParam.Identifier> is not supported for code generation."/
+ " To proceed, you could either:/n" + " (1) Reassign a finite value to any field whose value is Inf or NaN./n"/
+ " or /n"/
+ " (2) Add a dummy field of a cell array of a string to the structure parameter, for example, %<mdlParam.Identifier>.dummy = {'ForceInline'}."/
+ " However, this workaround disables tunability of this variable."
%<LibReportError(longmsg)>
%endif
%if prmNonFiniteIndices[0][0] >= 0
%foreach idx = SIZE(prmNonFiniteIndices,0)
%assign ret = FcnGenerateNonFiniteParamValue(mdlParam, prmVal, ...
prmNonFiniteIndices[idx][0], prmNonFiniteIndices[idx][1])
%endforeach
%endif
%else
%assign storageTypeId = LibGetRecordContainerDataTypeId(mdlParam)
%if !WHITE_SPACE(vectorComment)
%assign vectorComment = " /* %<vectorComment> */"
%endif
%assign width = LibGetRecordWidth(mdlParam)
%if LibIsStringDataType(dTypeId)
%if !WHITE_SPACE(vectorComment)
%<vectorComment>
%endif
%<prmVal>/
%elseif width == 1
%if LibIsNonBuiltInTypeNeededForFixpt(dTypeId)
%if LibGetRecordIsComplex(mdlParam)
{%<FcnGetNonBuiltInRe(prmVal)>, %<FcnGetNonBuiltInIm(prmVal)>}
%else
%if !WHITE_SPACE(vectorComment)
%<vectorComment>
%endif
%<SLibGetFormattedValueFromId(storageTypeId, prmVal)>/
%endif
%elseif LibIsEnumDataType(dTypeId)
%if !WHITE_SPACE(vectorComment)
%<vectorComment>
%endif
%if %<SLibParamIsVariantControlParamInVariantCondition(mdlParam)> == 1
%<SLibEnumeralPreprocessorSymbol(dTypeId, prmVal)>/
%else
%<SLibGetEnumTypeCodeGenStringFromIndex(dTypeId, prmVal)>/
%endif
%else
%if !WHITE_SPACE(vectorComment)
%<vectorComment>
%endif
%<LibGetGroundInitFromId(storageTypeId)>/
%endif
%else
%assign nRows = SIZE(mdlPrmValue, 0)
%assign nCols = SIZE(mdlPrmValue, 1)
%assign isRM = %
%assign isNd = SLibIsContainerCGTypeND(mdlParam) && ...
nRows > 1 && nCols > 1
%if !WHITE_SPACE(vectorComment)
%<vectorComment>
%endif
{/
%if isRM
%foreach row = nRows
%if row > 0
, /
%endif
%if isNd
{/
%endif
%foreach col = nCols
%if col > 0
, /
%endif
%<SLibEmitMatrixValue(mdlPrmValue, dTypeId, row, col, LibGetRecordIsComplex(mdlParam), storageTypeId)>/
%endforeach
%if isNd
}/
%endif
%endforeach
%else
%foreach col = nCols
%foreach row = nRows
%if col > 0 || row > 0
, /
%endif
%<SLibEmitMatrixValue(mdlPrmValue, dTypeId, row, col, LibGetRecordIsComplex(mdlParam), storageTypeId)>/
%endforeach
%endforeach
%endif
}/
%endif
%endif
%closefile valueString
%if SLibIsContainerCGTypeStdContainer(mdlParam) && ...
ISEQUAL(TYPE(prmVal), "Vector") && ...
(ISFIELD(mdlParam, "IsSymbolicValue") || SIZE(prmVal, 0) != 1 || SIZE(prmVal, 1) != 1)
%openfile returnString
%if WHITE_SPACE(vectorComment)
{/
%<valueString>/
}/
%else
{
%<valueString>
}
%endif
%closefile returnString
%return returnString
%else
%return valueString
%endif
%endfunction
%function LibParameterInstanceInitStr(mdlParam) void
%assign comment = ""
%assign initStr = SLibGetFormattedPrmValue(mdlParam, comment)
%return initStr
%endfunction
%function () void
%assign comments = 0
%if ::CompiledModel.ForceParamTrailComments || ...
::CompiledModel.NumBlockParams < 1000
%assign comments = 1
%endif
%return comments
%endfunction
%function LibCacheBlockIOInstance() void
%if !IsModelReferenceTarget() && !LibBlockIOStructIsEmpty()
%if SLibAutosarCompilerAbstractionRequired()
%assign definition = "%<SLibAutosarCompilerAbstractionForDataDecl(TLC_FALSE, ::tBlockIOType, TLC_FALSE, TLC_FALSE, LibGetBlockIOStruct(), "DataGlobal")>;"
%else
%assign definition = "%<::tBlockIOType> %<LibGetBlockIOStruct()>;"
%endif
%openfile buffer
%<SLibAddPreStructDeclarePragma(LibGetBlockIOStruct())>/
%<SLibApplyMemSecToDataDefn(definition, "MemSecDataInternal", "%<LibGetBlockIOStruct()>")>/
%<SLibAddPostStructDeclarePragma(LibGetBlockIOStruct())>/
%closefile buffer
%assign ::CompiledModel.BlockIOInstance = buffer
%else
%assign ::CompiledModel.BlockIOInstance = ""
%endif
%endfunction
%function SLibWriteOutInstForSignalRec(record) void
%assign retVal = TLC_FALSE
%assign rootSystem = ::CompiledModel.System[NumSystems-1]
%assign reqInsts = LibGetSystemField(rootSystem,"ReqRootPrmHdrDataInsts")
%assign isSignal = ((record.RecordType == "BlockOutput") ...
|| (record.RecordType == "ExternalInput") ...
|| (record.RecordType == "ExternalOutput")...
|| (record.RecordType == "ZcSignalInfo"))
%assign isDWork = (record.RecordType == "DWork")
%assert((reqInsts.ExpGlobalSigsInst && isSignal) || ...
(reqInsts.ExpGlobalDworkInst && isDWork))
%if ((SLibIsERTTarget()) && ...
(::CompiledModel.ConfigSet.EnableDataOwnership == TLC_TRUE) && ...
(record.StorageClass == "Custom"))
%assign cscDefn = SLibGetCSCDefForData(record)
%assign props = LibGetCustomStorageAttributes(record)
%assign dataOwner = LibGetInstanceSpecificProp(cscDefn, props, "Owner")
%if !ISEMPTY(dataOwner)
%return dataOwner == LibGetModelName()
%endif
%endif
%if (IsModelReferenceTarget())
%switch (record.RecordType)
%case "ZcSignalInfo"
%assign retVal = TLC_TRUE
%break
%case "ExternalInput"
%if SLibIsAuxBufferForReusableCSC(record)
%assign retVal = TLC_TRUE
%else
%assign retVal = TLC_FALSE
%endif
%break
%case "BlockOutput"
%if SLibIsAuxBufferForReusableCSC(record)
%assign retVal = TLC_TRUE
%else
%assign retVal = (record.DrivesModelRefRootOutport == "no")
%endif
%break
%case "DWork"
%if SLibIsAuxBufferForReusableCSC(record)
%assign retVal = TLC_TRUE
%else
%assign retVal = (!record.GlobalDSM && ...
!record.DrivesModelRefRootOutportSize && ...
!record.ModelRefRootInportSize)
%endif
%break
%default
%assert TLC_FALSE
%break
%endswitch
%else
%assign retVal = TLC_TRUE
%endif
%return retVal
%endfunction
%function LibGlobalDefinitionWithAlignment(plainDef, comment, align) void
%openfile buf
%switch(globalDAFlag.position)
%case "DATA_ALIGNMENT_PRECEDING_STATEMENT"
%<align>
%<plainDef> %<comment>
%break
%case "DATA_ALIGNMENT_FOLLOWING_STATEMENT"
%<plainDef> %<comment>
%<align>
%break
%case "DATA_ALIGNMENT_PREDIRECTIVE"
%<align> %<plainDef> %<comment>
%break
%case "DATA_ALIGNMENT_POSTDIRECTIVE"
%<plainDef> %<align> %<comment>
%break
%default
%assert TLC_FALSE
%break
%endswitch
%closefile buf
%return buf
%endfunction
%function LibCacheExportedGlobalSignalsInstance() void
%if ::CompiledModel.NumExportedGlobalSignals > 0
%openfile buffer
%if (ExternalInputs.NumExportedGlobalSignals > 0)
%foreach idx = ExternalInputs.NumExternalInputs
%assign ei = ExternalInputs.ExternalInput[idx]
%if ((ei.StorageClass == "ExportedGlobal") && ...
(SLibWriteOutInstForSignalRec(ei)) && !ISFIELD(ei,"Inactive"))
%assign descStr = SLibGetDescriptionForData(ei)
%assign descStr = WHITE_SPACE(descStr) ? "" : "/n* " + descStr + "/n"
%assign comment = "/* '%<ei.BlockName>'%<descStr> */"
%assign dataType = SLibGetRecordContainerOptStdTypeName(ei, TLC_TRUE)
%assign optDims = LibGetRecordVectorDims(ei)
%assign id = LibGetRecordIdentifier(ei)
%assign vcRecord = SLibGetDataInlineVariantNetConditions(ei)
%assign ifCond = vcRecord.ifCond
%assign ifEndCond = vcRecord.endIfCond
%assign traceMarker = SLibAddBlockTrace(ei.BlockName)
%<SLibTraceBegin(traceMarker)>
%if SLibAutosarCompilerAbstractionRequired()
%assign definition = ...
"%<ei.StorageTypeQualifier> %<SLibAutosarCompilerAbstractionForDataDecl(TLC_FALSE, dataType, TLC_FALSE, "%<id>%<optDims>", "DataGlobal")>;"
%else
%assign definition = ...
"%<ei.StorageTypeQualifier> %<dataType> %<id>%<optDims>;"
%endif
%if(ei.Alignment > 0 && !LibCGTypeIsComplex(ei.CGTypeIdx))
%assign align = SLibGetAlignmentSyntax(::CompiledModel.Name, id, dataType, ...
ei.Alignment, "DATA_ALIGNMENT_GLOBAL_VAR")
%<ifCond>
%<LibGlobalDefinitionWithAlignment(definition, comment, align)>
%<ifEndCond>
%else
%<ifCond>
%<definition> %<comment>
%<ifEndCond>
%endif
%<SLibTraceEnd(traceMarker)>
%endif
%endforeach
%endif
%if (ExternalOutputs.NumExportedGlobalSignals > 0)
%foreach idx = ExternalOutputs.NumExternalOutputs
%assign eo = ExternalOutputs.ExternalOutput[idx]
%if ((eo.StorageClass == "ExportedGlobal") && (SLibWriteOutInstForSignalRec(eo)) && !ISFIELD(eo,"Inactive"))
%assign descStr = SLibGetDescriptionForData(eo)
%assign descStr = WHITE_SPACE(descStr) ? "" : "/n* " + descStr + "/n"
%assign comment = "/* '%<eo.BlockName>'%<descStr> */"
%assign dataType = SLibGetRecordContainerOptStdTypeName(eo, TLC_TRUE)
%assign optDims = LibGetRecordVectorDims(eo)
%assign id = LibGetRecordIdentifier(eo)
%assign TypeQualifier = eo.Object.ObjectProperties.CoderInfo.Object.ObjectProperties.TypeQualifier
%assign traceMarker = SLibAddBlockTrace(eo.BlockName)
%<SLibTraceBegin(traceMarker)>
%assign vcRecord = SLibGetDataInlineVariantNetConditions(eo)
%assign ifCond = vcRecord.ifCond
%assign ifEndCond = vcRecord.endIfCond
%if SLibAutosarCompilerAbstractionRequired()
%assign definition = ...
"%<TypeQualifier> %<SLibAutosarCompilerAbstractionForDataDecl(TLC_FALSE, dataType, TLC_FALSE, "%<id>%<optDims>", "DataGlobal")>;"
%else
%assign definition = ...
"%<TypeQualifier> %<dataType> %<id>%<optDims>;"
%endif
%if(eo.Alignment > 0 && !LibCGTypeIsComplex(eo.CGTypeIdx))
%assign align = SLibGetAlignmentSyntax(::CompiledModel.Name, id, dataType, ...
eo.Alignment, "DATA_ALIGNMENT_GLOBAL_VAR")
%<ifCond>
%<LibGlobalDefinitionWithAlignment(definition, comment, align)>
%<ifEndCond>
%else
%<ifCond>
%<definition> %<comment>
%<ifEndCond>
%endif
%<SLibTraceEnd(traceMarker)>
%endif
%endforeach
%endif
%if BlockOutputs.NumExportedGlobalSignals > 0
%foreach boIdx = BlockOutputs.NumExternalBlockOutputs
%assign bo = BlockOutputs.ExternalBlockOutput[boIdx]
%if ((bo.StorageClass == "ExportedGlobal") && ...
(SLibWriteOutInstForSignalRec(bo)))
%assign id = LibGetRecordIdentifier(bo)
%with bo
%assert !ISEMPTY(SigSrc)
%assign blkName = SLibReferencedBy(bo)
%assign descStr = SLibGetDescriptionForData(bo)
%assign descStr = WHITE_SPACE(descStr) ? "" : "/n* " + descStr + "/n"
%assign comment = "/* %<blkName>%<descStr> */"
%assign dataType = SLibGetRecordContainerOptStdTypeName(bo, TLC_TRUE)
%assign optDims = LibGetRecordVectorDims(bo)
%assign traceMarker = SLibAddBlockTrace(blkName)
%<SLibTraceBegin(traceMarker)>
%if SLibAutosarCompilerAbstractionRequired()
%assign definition = ...
" %<bo.StorageTypeQualifier> %<SLibAutosarCompilerAbstractionForDataDecl(TLC_FALSE, dataType, TLC_FALSE, TLC_FALSE, "%<id>%<optDims>", "DataGlobal")>;"
%else
%assign definition = ...
"%<bo.StorageTypeQualifier> %<dataType> %<id>%<optDims>;"
%endif
%assign vcRecord = SLibGetDataInlineVariantNetConditions(bo)
%assign ifCond = vcRecord.ifCond
%assign ifEndCond = vcRecord.endIfCond
%<ifCond>
%if(bo.Alignment > 0 && !LibCGTypeIsComplex(bo.CGTypeIdx))
%assign align = SLibGetAlignmentSyntax(::CompiledModel.Name, bo.Identifier, dataType, ...
bo.Alignment, "DATA_ALIGNMENT_GLOBAL_VAR")
%<LibGlobalDefinitionWithAlignment(definition, comment, align)>
%else
%<definition> %<comment>
%endif
%<SLibTraceEnd(traceMarker)>
%<ifEndCond>
%endwith
%endif
%endforeach
%endif
%closefile buffer
%assign ::CompiledModel.ExportedGlobalSignalsInstance = buffer
%else
%assign ::CompiledModel.ExportedGlobalSignalsInstance = ""
%endif
%endfunction
%function LibCacheCustomReusableSignalsInstance() void
%if ::CompiledModel.NumInPlaceOPTSignals > 0 || ...
::CompiledModel.NumCustomDWork > 0
%openfile buffer
%if (ExternalInputs.NumInPlaceOPTSignals > 0)
%foreach idx = ExternalInputs.NumExternalInputs
%assign ei = ExternalInputs.ExternalInput[idx]
%if (SLibIsAuxBufferForReusableCSCOrAutoSar(ei) && ...
SLibWriteOutInstForSignalRec(ei))
%assign descStr = SLibGetDescriptionForData(ei)
%assign descStr = WHITE_SPACE(descStr) ? "" : "/n* " + descStr + "/n"
%assign comment = "/* '%<ei.BlockName>'%<descStr> */"
%assign optWidth = LibOptionalVectorWidth(LibGetRecordWidth(ei))
%assign id = ei.ReuseBufferName
%assign identifier = ei.Identifier
%assign useStdContainerName = TLC_FALSE
%if !ISEMPTY(optWidth) && SLibIsContainerCGTypeStdContainer(ei)
%assign optWidth = ""
%assign useStdContainerName = TLC_TRUE
%endif
%assign dataType = SLibGetRecordContainerOptStdTypeName(ei, useStdContainerName)
%if SLibAutosarCompilerAbstractionRequired()
%assign definition = ...
"%<ei.StorageTypeQualifier> %<SLibAutosarCompilerAbstractionForDataDecl(TLC_FALSE, dataType, TLC_FALSE, TLC_FALSE, "%<id>%<optWidth>", "DataGlobal")>;"
%else
%assign definition = ...
"%<ei.StorageTypeQualifier> %<dataType> %<id>%<optWidth>;"
%endif
%if ISFIELD(ei, "AutosarPRPortVarIdx")
%assign commentForExtraGlobal = "/* Global variable introduced due to SenderReceiver mapping */"
%else
%assign commentForExtraGlobal = "/* Reusable CSC signals /n * Global signal due to the usage of Reusable CSC signal: %<identifier> */"
%endif
%<commentForExtraGlobal>
%if(ei.Alignment > 0 && !LibCGTypeIsComplex(ei.CGTypeIdx))
%assign align = SLibGetAlignmentSyntax(::CompiledModel.Name, id, dataType, ...
ei.Alignment, "DATA_ALIGNMENT_GLOBAL_VAR")
%<LibGlobalDefinitionWithAlignment(definition, comment, align)>
%else
%<definition> %<comment>
%endif
%endif
%endforeach
%endif
%foreach idx = ExternalOutputs.NumExternalOutputs
%assign ei = ExternalOutputs.ExternalOutput[idx]
%if (ISFIELD(ei, "AutosarPRPortVarIdx") && ...
ISFIELD(ei, "ReuseBufferName") && ...
ei.ReuseBufferName != ei.Identifier && ...
SLibWriteOutInstForSignalRec(ei))
%assign descStr = SLibGetDescriptionForData(ei)
%assign descStr = WHITE_SPACE(descStr) ? "" : "/n* " + descStr + "/n"
%assign comment = "/* '%<ei.BlockName>'%<descStr> */"
%assign optWidth = LibOptionalVectorWidth(LibGetRecordWidth(ei))
%assign id = ei.ReuseBufferName
%assign identifier = ei.Identifier
%assign useStdContainerName = TLC_FALSE
%if !ISEMPTY(optWidth) && SLibIsContainerCGTypeStdContainer(ei)
%assign optWidth = ""
%assign useStdContainerName = TLC_TRUE
%endif
%assign dataType = SLibGetRecordContainerOptStdTypeName(ei, useStdContainerName)
%if SLibAutosarCompilerAbstractionRequired()
%assign definition = ...
"%<ei.StorageTypeQualifier> %<SLibAutosarCompilerAbstractionForDataDecl(TLC_FALSE, dataType, TLC_FALSE, TLC_FALSE, "%<id>%<optWidth>", "DataGlobal")>;"
%else
%assign definition = ...
"%<ei.StorageTypeQualifier> %<dataType> %<id>%<optWidth>;"
%endif
%assign commentForExtraGlobal = "/* Global variable introduced due to SenderReceiver mapping */"
%<commentForExtraGlobal>
%if(ei.Alignment > 0 && !LibCGTypeIsComplex(ei.CGTypeIdx))
%assign align = SLibGetAlignmentSyntax(::CompiledModel.Name, id, dataType, ...
ei.Alignment, "DATA_ALIGNMENT_GLOBAL_VAR")
%<LibGlobalDefinitionWithAlignment(definition, comment, align)>
%else
%<definition> %<comment>
%endif
%endif
%endforeach
%if BlockOutputs.NumInPlaceOPTSignals > 0
%foreach boIdx = BlockOutputs.NumExternalBlockOutputs
%assign bo = BlockOutputs.ExternalBlockOutput[boIdx]
%if (SLibIsAuxBufferForReusableCSCOrAutoSar(bo) && ...
(SLibWriteOutInstForSignalRec(bo)))
%assign id = bo.ReuseBufferName
%assign identifier = bo.Identifier
%with bo
%assert !ISEMPTY(SigSrc)
%assign blkName = SLibReferencedBy(bo)
%assign descStr = SLibGetDescriptionForData(bo)
%assign descStr = WHITE_SPACE(descStr) ? "" : "/n* " + descStr + "/n"
%assign comment = "/* %<blkName>%<descStr> */"
%assign optWidth = LibOptionalVectorWidth(LibGetRecordWidth(bo))
%assign useStdContainerName = TLC_FALSE
%if !ISEMPTY(optWidth) && SLibIsContainerCGTypeStdContainer(bo)
%assign optWidth = ""
%assign useStdContainerName = TLC_TRUE
%endif
%assign dataType = SLibGetRecordContainerOptStdTypeName(bo, useStdContainerName)
%if SLibAutosarCompilerAbstractionRequired()
%assign definition = ...
" %<bo.StorageTypeQualifier> %<SLibAutosarCompilerAbstractionForDataDecl(TLC_FALSE, dataType, TLC_FALSE, TLC_FALSE, "%<id>%<optWidth>", "DataGlobal")>;"
%else
%assign definition = ...
"%<bo.StorageTypeQualifier> %<dataType> %<id>%<optWidth>;"
%endif
%if ISFIELD(bo, "AutosarPRPortVarIdx")
%assign commentForExtraGlobal = "/* Global variable introduced due to SenderReceiver mapping */"
%else
%assign commentForExtraGlobal = "/* Reusable CSC signals /n * Global signal due to the usage of Reusable CSC signal: %<identifier> */"
%endif
%assign vcRecord = SLibGetDataInlineVariantNetConditions(bo)
%assign ifCond = vcRecord.ifCond
%assign ifEndCond = vcRecord.endIfCond
%<ifCond>
%<commentForExtraGlobal>
%if(bo.Alignment > 0 && !LibCGTypeIsComplex(bo.CGTypeIdx))
%assign align = SLibGetAlignmentSyntax(::CompiledModel.Name, bo.Identifier, dataType, ...
bo.Alignment, "DATA_ALIGNMENT_GLOBAL_VAR")
%<LibGlobalDefinitionWithAlignment(definition, comment, align)>
%else
%<definition> %<comment>
%endif
%<ifEndCond>
%endwith
%endif
%endforeach
%endif
%if ::CompiledModel.NumCustomDWork > 0
%foreach idx = ::CompiledModel.DWorks.NumDWorks
%assign dw = ::CompiledModel.DWorks.DWork[idx]
%if (SLibIsAuxBufferForReusableCSCOrAutoSar(dw) && ...
SLibWriteOutInstForSignalRec(dw))
%assign commentForExtraGlobal = "/* Reusable CSC signals /n * Global signal due to the usage of Reusable CSC signal: %<dw.Identifier> */"
%<commentForExtraGlobal>
%assign tempid = dw.Identifier
%assign dw.Identifier = dw.ReuseBufferName
%<FcnGenerateBlockDWorkExternalDeclaration(dw)>/
%assign dw.Identifier = tempid
%endif
%endforeach
%endif
%closefile buffer
%assign ::CompiledModel.CustomReusableSignalsInstance = buffer
%else
%assign ::CompiledModel.CustomReusableSignalsInstance = ""
%endif
%endfunction
%function FcnGenerateBlockDWorkExternalDeclaration(dwRec) Output
%with dwRec
%assign descStr = SLibGetDescriptionForData(dwRec)
%assign descStr = WHITE_SPACE(descStr) ? "" : "/n* " + descStr + "/n"
%assign comment = "/* " + SLibReferencedBy(dwRec) + descStr + " */"
%if LibHasCustomStorage(dwRec) && ...
(!SLibGetIsReusable(dwRec) || ...
!ISFIELD(dwRec, "ReuseBufferName"))
%<LibReportError("Custom dwork should be defined elsewhere")>
%else
%assign dataType = SLibGetRecordContainerOptStdTypeName(dwRec, TLC_TRUE)
%assign star = (dwRec.StorageClass == "ImportedExternPointer") ? ...
"*" : ""
%assign optDims = (dwRec.StorageClass == "ImportedExternPointer") ? ...
"" : LibGetRecordVectorDims(dwRec)
%assign typeQualifier = dwRec.StorageTypeQualifier
%assign id = LibGetRecordIdentifier(dwRec)
%assign initStr = ""
%if dwRec.SharedLocalDSMForHasBeenInit
%assign initStr = " = " + GET_TYPE_ID_REPLACEMENT("false")
%endif
%if SLibAutosarCompilerAbstractionRequired()
%assign definition = ...
"%<typeQualifier> %<SLibAutosarCompilerAbstractionForDataDecl(TLC_FALSE, dataType, (dwRec.StorageClass == "ImportedExternPointer"), TLC_FALSE, "%<id>%<optDims>", "DataGlobal")>; "
%else
%assign definition = ...
"%<typeQualifier> %<dataType> %<star>%<id>%<optDims>%<initStr>; "
%endif
%assign vcRecord = SLibGetDataInlineVariantNetConditions(dwRec)
%assign ifCond = vcRecord.ifCond
%assign ifEndCond = vcRecord.endIfCond
%<ifCond>
%if dwRec.Alignment > 0 && !LibCGTypeIsComplex(dwRec.CGTypeIdx)
%assign align = SLibGetAlignmentSyntax(::CompiledModel.Name, id, dataType, ...
dwRec.Alignment, "DATA_ALIGNMENT_GLOBAL_VAR")
%<LibGlobalDefinitionWithAlignment(definition, comment, align)>
%else
%<definition> %<comment>
%endif
%<ifEndCond>
%endif
%endwith
%endfunction
%function LibCacheExportedGlobalDWorkInstance() void
%if ::CompiledModel.NumExportedGlobalDWork > 0
%assign numDWorks = ::CompiledModel.DWorks.NumDWorks
%openfile buffer
%foreach dwIdx = numDWorks
%selectfile buffer
%assign dwRec = ::CompiledModel.DWorks.DWork[dwIdx]
%if ((dwRec.StorageClass == "ExportedGlobal") && ...
SLibWriteOutInstForSignalRec(dwRec))
%<FcnGenerateBlockDWorkExternalDeclaration(dwRec)>/
%endif
%endforeach
%closefile buffer
%assign ::CompiledModel.ExportedGlobalDWorkInstance = buffer
%else
%assign ::CompiledModel.ExportedGlobalDWorkInstance = ""
%endif
%endfunction
%function LocalFcnGetNonFiniteFcnCall(nonFiniteVal,bo) void
%assert !ISFINITE(nonFiniteVal)
%assign dTypeId = SLibGetRecordDataTypeId(bo)
%assign dtId = LibGetDataTypeIdAliasedThruToFromId(dTypeId)
%assign isSingle = (DataTypes.DataType[dtId].DTName == "single")
%if ISNAN(nonFiniteVal)
%if !isSingle
%assign callInfo = SLibGenOneInputOneOutputFcnCallInfo("getNaN",tSS_VOID,tSS_DOUBLE,"")
%else
%assign callInfo = SLibGenOneInputOneOutputFcnCallInfo("getNaN",tSS_VOID,tSS_SINGLE,"")
%endif
%elseif ISINF(nonFiniteVal) && nonFiniteVal > 0
%if !isSingle
%assign callInfo = SLibGenOneInputOneOutputFcnCallInfo("getInf",tSS_VOID,tSS_DOUBLE,"")
%else
%assign callInfo = SLibGenOneInputOneOutputFcnCallInfo("getInf",tSS_VOID,tSS_SINGLE,"")
%endif
%elseif ISINF(nonFiniteVal) && nonFiniteVal < 0
%if !isSingle
%assign callInfo = SLibGenOneInputOneOutputFcnCallInfo("getMinusInf",tSS_VOID,tSS_DOUBLE,"")
%else
%assign callInfo = SLibGenOneInputOneOutputFcnCallInfo("getMinusInf",tSS_VOID,tSS_SINGLE,"")
%endif
%else
%assert TLC_FALSE
%endif
%return callInfo.Expr
%endfunction
%function FcnGetCPPConstBlockIOInitValues(bo,initValues) void
%assert ::GenCPP
%assign sigWidth = LibGetRecordWidth(bo)
%assign complex = LibGetRecordIsComplex(bo)
%assign numEles = SIZE(initValues,1)
%assign comma = ","
%openfile initBuf
%if sigWidth > 1
{
%endif
%foreach ind = numEles
%assign ele = initValues[ind]
%if TYPE(ele) == "String" || ISFINITE(ele)
%if TYPE(ele) != "String"
%if SLibIsNdIndexingFeatureOn()
%assign dummyVal = GENERATE_FORMATTED_VALUE(ele,"", 0, 1)
%else
%assign dummyVal = GENERATE_FORMATTED_VALUE(ele,"")
%endif
%else
%<ele>
%endif
%if sigWidth > 1 && ind < (numEles-1)
%<comma>
%endif
%else
%if complex
{
%assign rval = REAL(ele)
%assign ival = IMAG(ele)
%if TYPE(rval) != "String" && !ISFINITE(rval)
%assign rinitval = LocalFcnGetNonFiniteFcnCall(rval,bo)
%<rinitval>,
%else
%if TYPE(rval) != "String"
%if SLibIsNdIndexingFeatureOn()
%assign dummyVal = GENERATE_FORMATTED_VALUE(rval,"", 0, 1)
%else
%assign dummyVal = GENERATE_FORMATTED_VALUE(rval,"")
%endif
%else
%<ele>
%endif
%<comma>
%endif
%if TYPE(ival) != "String" && !ISFINITE(ival)
%assign iinitval = LocalFcnGetNonFiniteFcnCall(ival,bo)
%<iinitval>
%else
%if TYPE(ival) != "String"
%if SLibIsNdIndexingFeatureOn()
%assign dummyVal = GENERATE_FORMATTED_VALUE(ival,"", 0, 1)
%else
%assign dummyVal = GENERATE_FORMATTED_VALUE(ival,"")
%endif
%else
%<ival>
%endif
%endif
}
%else
%assign initval = LocalFcnGetNonFiniteFcnCall(ele,bo)
%<initval>
%endif
%if sigWidth > 1 && ind < (numEles-1)
%<comma>
%endif
%endif
%endforeach
%if sigWidth > 1
}
%endif
%closefile initBuf
%return initBuf
%endfunction
%function FcnGenerateNonFiniteConstBlockIOValue(bo, rowidx, colidx) void
%assign value = bo.InitialValue
%assign nCols = SIZE(value, 1)
%assign complex = LibGetRecordIsComplex(bo)
%if bo.DoNotConstify == 0
%assign bo.DoNotConstify = 1
%endif
%if (TYPE(value) == "Vector" && nCols > 1)
%assign value = value[colidx]
%elseif (TYPE(value) == "Vector")
%assign value = value[0]
%else
%assert TLC_FALSE
%endif
%assign dTypeId = SLibGetRecordDataTypeId(bo)
%assign baseSysIdx = GetBaseSystemIdx()
%assign varGroupIdx = bo.VarGroupIdx[0]
%assign varGroup = ::CompiledModel.VarGroups.VarGroup[varGroupIdx]
%assign sysIdx = varGroup.SysIdx
%assign instanceIdx = varGroup.InstanceIdx
%assign identiPath = SLibCGIRVarGroupPath(varGroupIdx,baseSysIdx,TLC_FALSE)
%if LibGetRecordWidth(bo) > 1
%assign sigIndexer = ...
SLibGet1DArrayIndexer(LibGetRecordWidth(bo), "", "", colidx)
%else
%assign sigIndexer = ""
%endif
%if complex
%assign rval = REAL(value)
%assign ival = IMAG(value)
%if !ISFINITE(rval)
%assign str = identiPath + LibGetRecordIdentifier(bo) + sigIndexer + "." + tRealPart
%assign str = str + " = %<rval>;/n"
%if !::GenCPP
%<SLibCacheNonFiniteConstBIOAssignment(sysIdx, instanceIdx, str)>/
%endif
%<LibNeedRealNonFinite(rval)>/
%endif
%if !ISFINITE(ival)
%assign str = identiPath + LibGetRecordIdentifier(bo) + sigIndexer + "." + tImagPart
%assign str = str + " = %<ival>;/n"
%if !::GenCPP
%<SLibCacheNonFiniteConstBIOAssignment(sysIdx, instanceIdx, str)>/
%endif
%<LibNeedRealNonFinite(ival)>/
%endif
%else
%assign str = identiPath + LibGetRecordIdentifier(bo) + sigIndexer
%assign str = str + " = %<value>;/n"
%if !::GenCPP
%<SLibCacheNonFiniteConstBIOAssignment(sysIdx, instanceIdx, str)>/
%endif
%<LibNeedRealNonFinite(value)>/
%endif
%endfunction
%function SLibGetConstBlockOutputValue(aConstBlockOutput) void
%assign isComplex = LibGetRecordIsComplex(aConstBlockOutput)
%assign sigWidth = LibGetRecordWidth(aConstBlockOutput)
%assign boBuff = ""
%openfile boBuff
%with aConstBlockOutput
%assign initValues = ISEMPTY(InitialValue) ...
? CustomInitialValue : InitialValue
%assign initWidth = SIZE(initValues,1)
%assign dtypeIdx = LibCGTypeToSLType(CGTypeIdx)
%if LibIsStringDataType(dtypeIdx)
%<initValues> /
%elseif sigWidth > 1
%if !ISSLDATAREF(initValues) ...
&& ISEQUAL(TYPE(initValues[0]),"String")
{ /
%foreach idx = sigWidth
%assign suffix = (idx == sigWidth-1) ? "" : ","
%assign initIdx = (initWidth == 1) ? 0 : idx
%assign initRe = FcnGetNonBuiltInRe(initValues[initIdx])
%assign initIm = FcnGetNonBuiltInIm(initValues[initIdx])
%if isComplex && !ISEMPTY(FEVAL("regexp",initValues[initIdx],"i"))
%assign initValue = "{%<initRe>, %<initIm>}"
%else
%assign initValue = initRe
%endif
%<initValue>%<suffix> /
%endforeach
} /
%elseif LibIsEnumDataType(dtypeIdx)
{ /
%foreach idx = sigWidth
%assign suffix = (idx == sigWidth-1) ? "" : ","
%<SLibGetEnumTypeCodeGenStringFromValue(dtypeIdx, initValues[idx])>%<suffix> /
%endforeach
} /
%elseif LibDataTypeIsBus(dtypeIdx)
{ /
%foreach idx = sigWidth
%assign suffix = (idx == sigWidth-1) ? "" : ","
%assign initStr = "{%}"
%<initStr>%<suffix> /
%endforeach
} /
%else
%assert initWidth > 1
%openfile tempBuf
%if SLibIsNdIndexingFeatureOn()
%assign cBIONonFiniteIndices = ...
GENERATE_FORMATTED_VALUE(initValues,"", 0, 1)
%else
%assign cBIONonFiniteIndices = ...
GENERATE_FORMATTED_VALUE(initValues,"")
%endif
%closefile tempBuf
%if !::GenCPP || (isComplex && ISEQUAL(TYPE(initValues[0]),"String"))
%<tempBuf> /
%undef tempBuf
%else
%assign initCPP = ...
FcnGetCPPConstBlockIOInitValues(aConstBlockOutput, initValues)
%<initCPP> /
%endif
%if cBIONonFiniteIndices[0][0] >= 0
%foreach idx = SIZE(cBIONonFiniteIndices,0)
%<FcnGenerateNonFiniteConstBlockIOValue(aConstBlockOutput,...
cBIONonFiniteIndices[idx][0],cBIONonFiniteIndices[idx][1])> /
%endforeach
%endif
%endif
%else
%if !ISSLDATAREF(initValues) && ...
ISEQUAL(TYPE(initValues[0]),"String")
%assign initValue = initValues[0]
%assign initRe = FcnGetNonBuiltInRe(initValue)
%assign initIm = FcnGetNonBuiltInIm(initValue)
%if isComplex && !ISEMPTY(FEVAL("regexp",initValue,"i"))
%assign initStr = "{%<initRe>, %<initIm>}"
%else
%assign initStr = initRe
%endif
%<initStr> /
%elseif LibIsEnumDataType(dtypeIdx)
%<SLibGetEnumTypeCodeGenStringFromValue(dtypeIdx, initValues[0])> /
%elseif LibDataTypeIsBus(dtypeIdx)
%assign initStr = "{%}"
%<initStr> /
%else
%openfile tempBuf
%if SLibIsNdIndexingFeatureOn()
%assign cBIONonFiniteIndices = ...
GENERATE_FORMATTED_VALUE(initValues[0],"", 0, 1)
%else
%assign cBIONonFiniteIndices = ...
GENERATE_FORMATTED_VALUE(initValues[0],"")
%endif
%closefile tempBuf
%if !::GenCPP
%<tempBuf> /
%undef tempBuf
%else
%assign initCPP = ...
FcnGetCPPConstBlockIOInitValues(aConstBlockOutput, initValues)
%<initCPP> /
%endif
%if cBIONonFiniteIndices[0][0] >= 0
%<FcnGenerateNonFiniteConstBlockIOValue(aConstBlockOutput,...
cBIONonFiniteIndices[0][0],cBIONonFiniteIndices[0][1])> /
%endif
%endif
%endif
%endwith
%closefile boBuff
%if SLibIsContainerCGTypeStdContainer(aConstBlockOutput)
%openfile retBuff
{/
%<boBuff>
}/
%closefile retBuff
%return retBuff
%else
%return boBuff
%endif
%endfunction
%function SLibGetStandAloneInitName(aVargroupIdx) void
%assign aVarGroupCategory = LibGetVarGroupCategory(aVargroupIdx)
%switch aVarGroupCategory
%case "Parameter"
%case "ConstParameter"
%case "ConstParameterWithInit"
%return "StandaloneParameterInit"
%case "ConstBlockIO"
%return "StandaloneConstBlockIOInit"
%default
%break
%endswitch
%return "StandaloneDataInit"
%endfunction
%function SLibGetVarGroupInitComma(varGroupName, hasAnyElement) void
%assign res = ""
%if !hasAnyElement
%assign res = SLibWrapDefinedHasElement(varGroupName, ",")
%else
%assign res = ",/n"
%endif
%return res
%endfunction
%function FcnGetDynamicDataInitFromCGType(cgTypeIdx) void
%assign value = ""
%if SLibEmitRecordInCoderDataGroupStruct(cgTypeIdx)
%if LibCGTypeIsChar(cgTypeIdx)
%assign groundValue = "'a'"
%assign cmplx = TLC_FALSE
%else
%assign dtypeId = LibCGTypeToSLType(cgTypeIdx)
%assign groundValue = SLibGetGroundValueFromId(dtypeId)
%assign cmplx = LibCGTypeIsComplex(cgTypeIdx)
%endif
%assert !ISFIELD(::CompiledModel.CGTypes.CGType[cgTypeIdx], "SymbolicWidth")
%assign value = SLibExpandGroundForStaticInit(STRING(LibCGTypeWidth(cgTypeIdx)), ...
TLC_FALSE, cmplx, groundValue)
%endif
%return value
%endfunction
%function SLibGetDynamicDataInit(recType, recIdx, loopData, structExplode, initVect) void
%assign res = ""
%assign dataRec = SLibGetDataRecForVarGroupMember(recType, recIdx)
%assign cgTypeIdx = LibGetRecordCGTypeIdx(dataRec)
%if SLibEmitRecordInCoderDataGroupStruct(cgTypeIdx) && ...
(recType != "ZE" || dataRec.NeedsEvent || Accelerator)
%assign value = FcnGetDynamicDataInitFromCGType(cgTypeIdx)
%if structExplode
%assign initVect.data = initVect.data + value
%endif
%openfile body
%<value>
%if loopData.insertComma
,
%endif
%assign loopData.hasUnconditionalElement = loopData.hasUnconditionalElement || !SLibHasVariantCondition(dataRec)
%if !loopData.hasUnconditionalElement
%<loopData.defineHasElement>
%endif
%closefile body
%assign dataBody = SLibWrapVariantCondition(dataRec, body)
%openfile res
%closefile res
%assign loopData.numElements = loopData.numElements + 1
%endif
%return res
%endfunction
%function SLibGetRTMInit(aVarGroupIdx, recIdx, loopData, structExplode, initVect) void
%assign res = ""
%assign rtmVarGroup = ::CompiledModel.VarGroups.VarGroup[aVarGroupIdx]
%assign elemCGTypeIdx = SLibVarGroupElementType(aVarGroupIdx, recIdx)
%assign value = FcnGetDynamicDataInitFromCGType(elemCGTypeIdx)
%if structExplode
%assign initVect.data = initVect.data + value
%endif
%openfile res
%<value>
%if loopData.insertComma
,
%endif
%closefile res
%assign loopData.hasUnconditionalElement = TLC_TRUE
%assign loopData.numElements = loopData.numElements + 1
%return res
%endfunction
%function SLibGetConstBlockOutputInit(cboIdx, loopData, structExplode, initVect) void
%assign res = ""
%assign bo = ::CompiledModel.BlockOutputs.ConstBlockOutput[cboIdx]
%if bo.RequiredInConstBlockIO == 1 || ::CompiledModel.PadderActive
%assign value = SLibGetConstBlockOutputValue(bo)
%if structExplode
%assign initVect.data = initVect.data + value
%endif
%openfile body
%assign bodyContent = value
%if loopData.insertComma
%assign bodyContent = bodyContent + ","
%endif
%if GenerateComments
%assign bodyContent = bodyContent + "/* %<SLibGrBlockCommentName(bo.GrSrc)> */"
%endif
%<bodyContent>
%assign loopData.hasUnconditionalElement = loopData.hasUnconditionalElement || !SLibHasVariantCondition(bo)
%if !loopData.hasUnconditionalElement
%<loopData.defineHasElement>
%endif
%closefile body
%assign dataBody = SLibWrapVariantCondition(bo, body)
%openfile res
%<dataBody>
%closefile res
%assign loopData.numElements = loopData.numElements + 1
%endif
%return res
%endfunction
%function SLibGetParameterInit(parameterIdx, loopData, structExplode, initVect) void
%assign res = ""
%assign prm = ::CompiledModel.ModelParameters.Parameter[parameterIdx]
%assert !SLibIsParamUnstructured(prm)
%if (SLibGetWidthOfValueFromParamRec(prm) > 0) && !SLibOmitRecord(prm)
%assign prmWidth = LibGetRecordWidth(prm)
%if SLibCommentParameterInstances() && !structExplode
%assign comment = SLibGenModelPrmDefnComment(prm)
%else
%assign comment = ""
%endif
%assign value = SLibGetFormattedPrmValue(prm, (prmWidth == 1) ? "" : comment)
%if structExplode
%assign initVect.data = initVect.data + value
%endif
%assign body = value
%if loopData.insertComma
%assign body = body + ", "
%endif
%if prmWidth == 1 && !WHITE_SPACE(comment)
%assign body = "/* " + comment + " *//n" + body
%endif
%assign body = body + "/n"
%assign loopData.hasUnconditionalElement = loopData.hasUnconditionalElement || !SLibHasVariantCondition(prm)
%if !loopData.hasUnconditionalElement
%assign body = body + loopData.defineHasElement
%endif
%assign parameterBody = SLibWrapVariantCondition(prm, body)
%openfile res
%<parameterBody>
%closefile res
%assign loopData.numElements = loopData.numElements + prmWidth
%endif
%if ISFIELD(prm, "NumPrmValues")
%assign prm.ValueAccessIdx = prm.ValueAccessIdx + 1
%if prm.ValueAccessIdx == prm.NumPrmValues
%assign prm.ValueAccessIdx = 0
%endif
%endif
%return res
%endfunction
%function SLibGetPaddingInit(paddingIdx, loopData, structExplode, initVect) void
%assign padInit = "{"
%foreach loopIdx = paddingIdx
%assign padInit = padInit + "'a'"
%if loopIdx != paddingIdx - 1
%assign padInit = padInit + ","
%endif
%endforeach
%assign padInit = padInit +"}"
%if structExplode
%assign initVect.data = initVect.data + padInit
%endif
%openfile res
%<padInit>/
%if loopData.insertComma
%<",">/
%endif
%closefile res
%return res
%endfunction
%function SLibGetSubsystemVarGroupInitValue(subsystemVargroupIdx, loopData, structExplode, initVect) void
%assign res = ""
%assign subVarGroup = ::CompiledModel.VarGroups.VarGroup[subsystemVargroupIdx]
%assign childSystem = ::CompiledModel.System[subVarGroup.SysIdx]
%assign rootSystem = ::CompiledModel.System[NumSystems-1]
%if childSystem != rootSystem
%assign cs = childSystem.CallSites[subVarGroup.InstanceIdx]
%assign blk = ::CompiledModel.System[cs[2]].Block[cs[3]]
%assert blk.Type == "SubSystem"
%else
%createrecord blk {}
%endif
%assert 0 == childSystem.StandaloneSubsystem
%assign inlineRes = SLibGetVarGroupInitValue(subsystemVargroupIdx)
%if inlineRes[1] > 0
%if ISEMPTY(blk)
%assign ppIf = ""
%assign ppFi = ""
%assign startComment = ""
%assign endComment = ""
%else
%assign blkName = LibGetBlockName(blk)
%assign startComment = "/* Start of '%<blkName>' */"
%assign endComment = "/* End of '%<blkName>' */"
%assign vcRecord = SLibGetInlineSystemRelativeConditionFromVarGroup(subVarGroup)
%assign ppIf = ""
%assign ppFi = ""
%if vcRecord.hasConds
%assign ppIf = vcRecord.ifCond
%assign ppFi = vcRecord.endIfCond
%endif
%endif
%openfile elementInit
%<startComment> {
%if LibCGTypeIsMatrix(subVarGroup.CGTypeIdx)
%assign numValueSets = LibCGTypeWidth(subVarGroup.CGTypeIdx)
{
%
}
%foreach valueIdx = numValueSets-1
,
{
%assign value = SLibGetVarGroupInitValue(subsystemVargroupIdx)
%
}
%endforeach
%else
%
%endif
}
%closefile elementInit
%if structExplode
%assign initVect.data = initVect.data + elementInit
%endif
%if loopData.insertComma
%assign endComment = ",/n" + endComment
%endif
%openfile body
%<elementInit>/
%<endComment>
%assign vcRecord = SLibVariantConditionRecord()
%if subVarGroup.Category != "ConstBlockIO" && subVarGroup.Category != "ZCEvent"
%assign vcRecord = SLibGetInlineSystemNetConditionFromVarGroup(subVarGroup)
%endif
%assign loopData.hasUnconditionalElement = loopData.hasUnconditionalElement || (!vcRecord.hasConds && ISEMPTY(ppIf))
%if !loopData.hasUnconditionalElement
%<loopData.defineHasElement>
%endif
%closefile body
%assign subsystemBody = SLibWrapBody(ppIf, body, ppFi)
%if !ISEMPTY(vcRecord)
%if vcRecord.hasConds
%assign subsystemBody = SLibWrapBody(vcRecord.ifCond, subsystemBody, vcRecord.endIfCond)
%endif
%endif
%assign res = subsystemBody
%assign loopData.numElements = loopData.numElements + inlineRes[1]
%endif
%return res
%endfunction
%function SLibGetReferencedCoderGroupInit(recIdx, loopData, structExplode, initVect) void
%assign group = ::CompiledModel.CoderDataGroup[recIdx]
%assign value = "&(" + SLibCoderDataGroupInstance(group) + ")"
%if structExplode
%assign initVect.data = initVect.data + value
%endif
%assign res = value
%if loopData.insertComma
%assign res = res + ", "
%endif
%return res
%endfunction
%function SLibGetCoderDataGroupInitValue(coderDataGroupIdx, loopData, structExplode, initVect, aVarGroupIdx) void
%assign res = ""
%assign varGroup = ::CompiledModel.VarGroups.VarGroup[aVarGroupIdx]
%assign group = FcnGetCoderGroupForVarGroup(varGroup)
%assign childDataGroup = FcnGetChildDataGroup(group, coderDataGroupIdx)
%assert childDataGroup.AsStructure == "InParent"
%assign mdlrefBlock = ::CompiledModel.ModelReferenceBlocks[childDataGroup.CompiledModelBlockIndex]
%assign grBlkIndex = [ %, % ]
%if GenerateComments
%assign comment = "/* %<group.Identification> for %<SLibGrBlockCommentName(grBlkIndex)> *//n"
%else
%assign comment = ""
%endif
%assign value = childDataGroup.Initializer
%if structExplode
%assign initVect.data = initVect.data + value
%endif
%assign res = value
%if loopData.insertComma
%assign res = res + ", "
%endif
%assign res = res + comment
%assign loopData.hasUnconditionalElement = TLC_TRUE
%assign loopData.numElements = loopData.numElements + 1
%return res
%endfunction
%function SLibGetVarGroupInitValue(aVarGroupIdx) void
%assign retValue = ["", 0]
%assign varGroup = ::CompiledModel.VarGroups.VarGroup[aVarGroupIdx]
%assign comma = ""
%assign varGroupName = varGroup.Name
%assign structExplode = !varGroup.PackageAsStruct
%createrecord initVect { data [] }
%assign hasAnyElement = TLC_FALSE
%createrecord loopData { insertComma TLC_TRUE; hasUnconditionalElement TLC_FALSE; ...
defineHasElement SLibVarGroupHasElementDefine(varGroup); numElements 0}
%assign initBuff = ""
%openfile initBuff
%foreach elemIdx = varGroup.NumVarGroupElements
%assign idnum = IDNUM(varGroup.VarGroupElements[elemIdx])
%assign recType = idnum[0]
%assign recIdx = idnum[1]
%assign loopData.insertComma = elemIdx < varGroup.IndexOfLastNonEmptyMember || !SLibVarGroupIsStruct(aVarGroupIdx)
%switch recType
%case "LDW"
%case "W"
%case "U"
%case "Y"
%case "B"
%case "ZE"
%<SLibGetDynamicDataInit(recType, recIdx, loopData, structExplode, initVect)>
%break
%case "RCDG"
%<SLibGetReferencedCoderGroupInit(recIdx, loopData, structExplode, initVect)>
%break
%case "C"
%<SLibGetConstBlockOutputInit(recIdx, loopData, structExplode, initVect)>
%break
%case "P"
%<SLibGetParameterInit(recIdx, loopData, structExplode, initVect)>
%break
%case "PD"
%<SLibGetPaddingInit(recIdx, loopData, structExplode, initVect)>
%assign hasAnyElement = TLC_TRUE
%break
%case "VG"
%<SLibGetSubsystemVarGroupInitValue(recIdx, loopData, structExplode, initVect)>
%break
%case "PCDG"
%<SLibGetCoderDataGroupInitValue(recIdx, loopData, structExplode, initVect, aVarGroupIdx)>
%break
%default
%assert "RTM" == recType
%if "RTM" == recType
%<SLibGetRTMInit(aVarGroupIdx, recIdx, loopData, structExplode, initVect)>
%endif
%endswitch
%endforeach
%if !loopData.hasUnconditionalElement && (loopData.numElements > 0)
%<SLibWrapUndefinedHasElement(varGroup, "0")>
%endif
%closefile initBuff
%if structExplode
%assign retValue[0] = initVect.data
%else
%assign retValue[0] = initBuff
%endif
%assign retValue[1] = loopData.numElements
%return retValue
%endfunction
%function SLibCacheConstVarGroupInstances(aCategory) void
%assign baseSystemIdx = GetBaseSystemIdx()
%assign indexFieldName = aCategory + "VarGroupIndex"
%foreach sysIdx = baseSystemIdx
%assign system = ::CompiledModel.System[sysIdx]
%if system.StandaloneSubsystem
%if ISFIELD(system, indexFieldName)
%assign varGroupIdx = GETFIELD(system, indexFieldName)
%assign varGroup = ::CompiledModel.VarGroups.VarGroup[varGroupIdx[0]]
%assign res = SLibGetVarGroupInitValue(varGroupIdx[0])
%assign fieldName = SLibGetStandAloneInitName(varGroupIdx[0])
%<LibSetSystemField(system, fieldName, res[0])>
%endif
%endif
%endforeach
%assign system = ::CompiledModel.System[baseSystemIdx]
%if ISFIELD(system, indexFieldName)
%assign varGroupIdx = GETFIELD(system, indexFieldName)
%return SLibGetVarGroupInitValue(varGroupIdx[0])
%endif
%assign res = ["", 0]
%return res
%endfunction
%function LibCacheConstBlockIOInstance() void
%if ::CompiledModel.BlockOutputs.NumConstBlockOutputs > 0
%assign val = SLibCacheConstVarGroupInstances("ConstBlockIO")
%assign ::CompiledModel.ConstBlockIOInstance = val[0]
%else
%assign ::CompiledModel.ConstBlockIOInstance = ""
%endif
%endfunction
%function LibCacheContStatesInstance() void
%if NumContStates > 0 && !LibIsDeploymentDiagram()
%if SLibAutosarCompilerAbstractionRequired()
%assign definition = "%<SLibAutosarCompilerAbstractionForDataDecl(TLC_FALSE, ::tContStateType, TLC_FALSE, TLC_FALSE, LibGetContinuousStateStruct(), "DataGlobal")>;"
%else
%assign definition = "%<::tContStateType> %<LibGetContinuousStateStruct()>;"
%endif
%assign ::CompiledModel.ContStatesInstance = ...
SLibApplyMemSecToDataDefn(definition, "MemSecDataInternal", "%<LibGetContinuousStateStruct()>")
%else
%assign ::CompiledModel.ContStatesInstance = ""
%endif
%endfunction
%function LibCachePeriodicContStatesInstance() void
%if ((NumPeriodicContStates > 0) && !LibIsDeploymentDiagram())
%assign pstatesInd = LibGetPeriodicContStateIndices()
%assign pstatesRng = LibGetPeriodicContStateRanges()
%if SLibAutosarCompilerAbstractionRequired()
%assign defind = "%<SLibAutosarCompilerAbstractionForDataDecl(TLC_FALSE, ::tPeriodicStateIndType, TLC_FALSE, TLC_FALSE, pstatesInd, "DataGlobal")>;"
%assign defrng = "%<SLibAutosarCompilerAbstractionForDataDecl(TLC_FALSE, ::tPeriodicStateRngType, TLC_FALSE, TLC_FALSE, pstatesRng, "DataGlobal")>;"
%else
%assign defind = "%<::tPeriodicStateIndType> %<pstatesInd>;"
%assign defrng = "%<::tPeriodicStateRngType> %<pstatesRng>;"
%endif
%assign ::CompiledModel.PeriodicStateIndInstance = SLibApplyMemSecToDataDefn(defind, "MemSecDataInternal", "%<pstatesInd>")
%assign ::CompiledModel.PeriodicStateRngInstance = SLibApplyMemSecToDataDefn(defrng, "MemSecDataInternal", "%<pstatesRng>")
%else
%assign ::CompiledModel.PeriodicStateIndInstance = ""
%assign ::CompiledModel.PeriodicStateRngInstance = ""
%endif
%endfunction
%function LibCacheMassMatricesInstance() void
%if ((SLibGetModelIsLinearlyImplicit() == "yes") && !SLibIsDeploymentDiagramWithNoTopSolver())
%if (SLibAutosarCompilerAbstractionRequired())
%assign definitionGlobal = "%<SLibAutosarCompilerAbstractionForDataDecl(TLC_FALSE, ::tMassMatrixGlobalType, TLC_FALSE, TLC_FALSE, LibGetMassMatrixGlobal(), "DataGlobal")>;"
%else
%assign definitionGlobal = "%<::tMassMatrixGlobalType> %<LibGetMassMatrixGlobal()>;"
%endif
%assign ::CompiledModel.MassMatricesGlobalInstance = ...
SLibApplyMemSecToDataDefn(definitionGlobal, "MemSecDataInternal", "%<LibGetMassMatrixGlobal()>")
%else
%assign ::CompiledModel.MassMatricesGlobalInstance = ""
%endif
%endfunction
%function LibCacheCoderDataGroupInstance() void
%assign ::CompiledModel.CoderDataGroupInstance = ""
%if !IsModelReferenceTarget()
%createrecord groupFilter { /
Static TLC_FALSE /
Dynamic TLC_TRUE /
AccessStandalone TLC_TRUE /
AccessThroughSelf !MultiInstanceERTCode || ::GenerateClassInterface /
Exported TLC_TRUE /
Imported %<::CompiledModel.GenerateImportedDataGroupsTypes> /
ModelData TLC_FALSE /
EmitToTestBuffer %<::CompiledModel.GenerateImportedDataGroupsTypes> /
}
%assign buffer = SLibDeclareCoderDataGroupInstances(::CompiledModel.System[GetBaseSystemIdx()],"",groupFilter)
%assign ::CompiledModel.CoderDataGroupInstance = ::CompiledModel.CoderDataGroupInstance + buffer
%endif
%endfunction
%function LibCacheDWorkInstance() void
%if !LibDWorkStructIsEmpty()
%if SLibAutosarCompilerAbstractionRequired()
%assign definition = "%<SLibAutosarCompilerAbstractionForDataDecl(TLC_FALSE, ::tDWorkType, TLC_FALSE, TLC_FALSE, LibGetDWorkStruct(), "DataGlobal")>;"
%else
%assign definition = "%<::tDWorkType> %<LibGetDWorkStruct()>;"
%endif
%openfile buffer
%<SLibAddPreStructDeclarePragma(LibGetDWorkStruct())>/
%<SLibApplyMemSecToDataDefn(definition, "MemSecDataInternal", "%<LibGetDWorkStruct()>")>/
%<SLibAddPostStructDeclarePragma(LibGetDWorkStruct())>/
%closefile buffer
%assign ::CompiledModel.DWorkInstance = buffer
%else
%assign ::CompiledModel.DWorkInstance = ""
%endif
%endfunction
%function LibCachePrevZCStatesInstance() void
%if NumZCEvents > 0 && !LibPrevZCStatesStructIsEmpty()
%if SLibAutosarCompilerAbstractionRequired()
%assign definition = "%<SLibAutosarCompilerAbstractionForDataDecl(TLC_FALSE, ::tPrevZCStateType, TLC_FALSE, TLC_FALSE, LibGetPreviousZCStruct(), "DataGlobal")>;"
%else
%assign definition = "%<::tPrevZCStateType> %<LibGetPreviousZCStruct()>;"
%endif
%assign ::CompiledModel.PrevZCStatesInstance = ...
SLibApplyMemSecToDataDefn(definition, "MemSecDataInternal", "%<LibGetPreviousZCStruct()>")
%else
%assign ::CompiledModel.PrevZCStatesInstance = ""
%endif
%endfunction
%function LibCacheExternalInputsInstance() void
%if ExternalInputs.NumAutoSignals > 0
%assign modelInputsInRootInportVector = 0
%foreach idx = ExternalInputs.NumExternalInputs
%assign extIn = ExternalInputs.ExternalInput[idx]
%if (ISFIELD(extIn, "Inactive"))
%continue
%endif
%if (ISFIELD(extIn, "UseAccessFunctions") && extIn.UseAccessFunctions == 1)
%continue
%endif
%if (ISFIELD(extIn, "IsMessage") && extIn.IsMessage == 1 && ...
!Accelerator && !isRSim && !isRAccel && ...
!SLibAutosarCompilerAbstractionRequired() && !SLibAdaptiveAutosarActive())
%continue
%endif
%if(SLibDataRecordIsInCoderGroup(extIn))
%continue
%endif
%if extIn.StorageClass == "Auto" && ...
(!SLibFcnProtoCtrlActive() || extIn.RequiresGlobalAccess == "yes")
%assign slBaseTypeIdx = LibCGTypeSLBaseType(extIn.CGTypeIdx)
%assign slBaseTypeSize = LibGetDataTypeSLSizeFromId(slBaseTypeIdx)
%if slBaseTypeSize == 0
%continue
%endif
%assign modelInputsInRootInportVector = ...
modelInputsInRootInportVector + 1
%endif
%endforeach
%if modelInputsInRootInportVector > 0
%if SLibAutosarCompilerAbstractionRequired()
%assign definition = "%<SLibAutosarCompilerAbstractionForDataDecl(TLC_FALSE, ::tInputType, TLC_FALSE, TLC_FALSE, LibGetExternalInputStruct(), "DataGlobal")>;"
%else
%assign definition = "%<::tInputType> %<LibGetExternalInputStruct()>;"
%endif
%openfile buffer
%<SLibAddPreStructDeclarePragma(LibGetExternalInputStruct())>/
%<SLibApplyMemSecToDataDefn(definition, "MemSecDataInputs", "%<LibGetExternalInputStruct()>")>/
%<SLibAddPostStructDeclarePragma(LibGetExternalInputStruct())>/
%closefile buffer
%assign ::CompiledModel.ExternalInputsInstance = buffer
%else
%assign ::CompiledModel.ExternalInputsInstance = ""
%endif
%else
%assign ::CompiledModel.ExternalInputsInstance = ""
%endif
%endfunction
%function LibCacheExternalOutputsInstance() void
%if ExternalOutputs.NumAutoSignals > 0
%assign modelOutputsInRootOutportVector = 0
%foreach idx = ExternalOutputs.NumExternalOutputs
%assign extOut = ExternalOutputs.ExternalOutput[idx]
%assign sysIdx = extOut.Block[0]
%assign blkIdx = extOut.Block[1]
%assign outportBlock = System[sysIdx].Block[blkIdx]
%if (ISFIELD(outportBlock, "Inactive"))
%continue
%endif
%if (ISFIELD(extOut, "UseAccessFunctions") && extOut.UseAccessFunctions == 1)
%continue
%endif
%if(SLibDataRecordIsInCoderGroup(extOut))
%continue
%endif
%if (ISFIELD(extOut, "IsMessage") && extOut.IsMessage == 1 && ...
!Accelerator && !isRSim && !isRAccel && ...
!SLibAutosarCompilerAbstractionRequired() && !SLibAdaptiveAutosarActive())
%continue
%endif
%if !SLibExternalOutputIsVirtual(outportBlock) && extOut.StorageClass == "Auto" && ...
(!SLibFcnProtoCtrlActive() || extOut.RequiresGlobalAccess == "yes")
%assign modelOutputsInRootOutportVector = ...
modelOutputsInRootOutportVector + 1
%endif
%endforeach
%if modelOutputsInRootOutportVector > 0
%if SLibAutosarCompilerAbstractionRequired()
%assign definition = "%<SLibAutosarCompilerAbstractionForDataDecl(TLC_FALSE, tOutputType, TLC_FALSE, TLC_FALSE, LibGetExternalOutputStruct(), "DataGlobal")>;"
%else
%assign definition = "%<tOutputType> %<LibGetExternalOutputStruct()>;"
%endif
%openfile buffer
%<SLibAddPreStructDeclarePragma(LibGetExternalOutputStruct())>/
%<SLibApplyMemSecToDataDefn(definition, "MemSecDataOutputs", "%<LibGetExternalOutputStruct()>")>/
%<SLibAddPostStructDeclarePragma(LibGetExternalOutputStruct())>/
%closefile buffer
%assign ::CompiledModel.ExternalOutputsInstance = buffer
%else
%assign ::CompiledModel.ExternalOutputsInstance = ""
%endif
%else
%assign ::CompiledModel.ExternalOutputsInstance = ""
%endif
%endfunction
%function LibCacheExternalInputSizesInstance() void
%assign modelInputsInRootInportSizeVector = 0
%if ExternalInputs.NumAutoSignals > 0
%foreach idx = ExternalInputs.NumExternalInputs
%assign extIn = ExternalInputs.ExternalInput[idx]
%if ISFIELD(extIn, "SizeVarGroupIdx")
%assign slBaseTypeIdx = LibCGTypeSLBaseType(extIn.CGTypeIdx)
%assign slBaseTypeSize = LibGetDataTypeSLSizeFromId(slBaseTypeIdx)
%if slBaseTypeSize == 0
%continue
%endif
%assign modelInputsInRootInportSizeVector = ...
modelInputsInRootInportSizeVector + 1
%endif
%endforeach
%endif
%if modelInputsInRootInportSizeVector > 0
%assign definition = "%<::tInputSizeType> %<::tInputSize>;"
%openfile buffer
%<SLibAddPreStructDeclarePragma(::tInputSize)> /
%<SLibApplyMemSecToDataDefn(definition, "MemSecDataInputs", ::tInputSize)> /
%<SLibAddPostStructDeclarePragma(::tInputSize)> /
%closefile buffer
%assign ::CompiledModel.ExternalInputSizesInstance = buffer
%else
%assign ::CompiledModel.ExternalInputSizesInstance = ""
%endif
%endfunction
%function LibCacheExternalOutputSizesInstance() void
%assign modelOutputsInRootOutportSizeVector = 0
%if NumModelOutputs > 0
%foreach idx = ExternalOutputs.NumExternalOutputs
%assign extOut = ExternalOutputs.ExternalOutput[idx]
%assign sysIdx = extOut.Block[0]
%assign blkIdx = extOut.Block[1]
%assign outportBlock = System[sysIdx].Block[blkIdx]
%if !SLibExternalOutputIsVirtual(outportBlock) && ...
ISFIELD(extOut, "HasVarDims")
%assign modelOutputsInRootOutportSizeVector = ...
modelOutputsInRootOutportSizeVector + 1
%endif
%endforeach
%endif
%if modelOutputsInRootOutportSizeVector > 0
%assign definition = "%<tOutputSizeType> %<tOutputSize>;"
%openfile buffer
%<SLibAddPreStructDeclarePragma(LibGetExternalOutputStruct())>/
%<SLibApplyMemSecToDataDefn(definition, "MemSecDataOutputs", "%<LibGetExternalOutputStruct()>")>/
%<SLibAddPostStructDeclarePragma(LibGetExternalOutputStruct())>/
%closefile buffer
%assign ::CompiledModel.ExternalOutputSizesInstance = buffer
%else
%assign ::CompiledModel.ExternalOutputSizesInstance = ""
%endif
%endfunction
%function (mdlParam, refByIdx) void
%if ISFIELD(mdlParam, "BHMPrmIdx")
%assign graphSysIdx = mdlParam.GraphicalRef[refByIdx][0]
%assign graphBlkIdx = mdlParam.GraphicalRef[refByIdx][1]
%assign graphPrmIdx = mdlParam.BHMPrmIdx
%if graphSysIdx != -1 && graphBlkIdx != -1 && graphPrmIdx != -1
%assign block = ::CompiledModel.BlockHierarchyMap.Subsystem[graphSysIdx].Block[graphBlkIdx]
%return block.Parameter[graphPrmIdx]
%endif
%endif
%assign sysIdx = mdlParam.ReferencedBy[refByIdx][0]
%assign blkIdx = mdlParam.ReferencedBy[refByIdx][2]
%assign prmIdx = mdlParam.ReferencedBy[refByIdx][3]
%assign block = System[sysIdx].Block[blkIdx]
%return block.Parameter[prmIdx]
%endfunction
%function (mdlParam) void
%assign pName = LibGetRecordIdentifier(mdlParam)
%assign customStr = ""
%assign typeStr = ""
%if ISEMPTY(mdlParam.WorkspaceVarName)
%assign nRefBlkPrms = SIZE(mdlParam.ReferencedBy, 0)
%if nRefBlkPrms > 1 && mdlParam.Tunable == "no"
%foreach refByIdx = nRefBlkPrms
%assign sysIdx = mdlParam.ReferencedBy[refByIdx][0]
%assign blkIdx = mdlParam.ReferencedBy[refByIdx][2]
%assign prmIdx = mdlParam.ReferencedBy[refByIdx][3]
%assign block = System[sysIdx].Block[blkIdx]
%if (block.Type == "SubSystem")
%assign typeStr = "Pooled Parameter (Mixed Expressions)/n"
%break
%endif
%assign blkPrm = FcnGetBlockParameterForCommentGeneration(mdlParam, refByIdx)
%switch blkPrm.StringType
%case "Expression"
%assign instanceStr = blkPrm.String
%break
%case "Computed"
%assign instanceStr = blkPrm.StringTransformed
%break
%default
%assert TLC_FALSE
%endswitch
%if (refByIdx == 0)
%assign exprStr = instanceStr
%assign typeStr = "Pooled Parameter (Expression: %<exprStr>)/n"
%elseif (instanceStr != exprStr)
%assign typeStr = "Pooled Parameter (Mixed Expressions)/n"
%break
%endif
%endforeach
%else
%if mdlParam.IsPseudoWorkspaceVar == "yes" && mdlParam.Tunable == "yes"
%assign typeStr = "Mask Parameter: %<pName>/n"
%else
%assign sysIdx = mdlParam.ReferencedBy[0][0]
%assign blkIdx = mdlParam.ReferencedBy[0][2]
%assign prmIdx = mdlParam.ReferencedBy[0][3]
%assign block = System[sysIdx].Block[blkIdx]
%if block.Type != "SubSystem"
%assign blkPrm = FcnGetBlockParameterForCommentGeneration(mdlParam, 0)
%switch blkPrm.StringType
%case "Expression"
%assign typeStr = "Expression: %<blkPrm.String>/n"
%break
%case "Computed"
%assign typeStr = "Computed Parameter: %<pName>/n"
%break
%default
%assert TLC_FALSE
%endswitch
%if ISFIELD(blkPrm,"DefSideComment")
%assign customStr = "* Comment: %<blkPrm.DefSideComment>/n"
%endif
%else
%assign typeStr = "Mask Parameter: %<pName>/n"
%endif
%endif
%endif
%else
%assign typeStr = "Variable: %<mdlParam.WorkspaceVarName>/n"
%endif
%assign numBlocks = SIZE(mdlParam.GraphicalRef, 0)
%assert (numBlocks > 0)
%if numBlocks == 1
%assign enhanceComment = ""
%assign sysIdx = mdlParam.ReferencedBy[0][0]
%assign blkIdx = mdlParam.ReferencedBy[0][2]
%assign prmIdx = mdlParam.ReferencedBy[0][3]
%if ::CompiledModel.SLCI == "on" && (mdlParam.StorageClass == "Auto")...
&& sysIdx >= 0 && blkIdx >= 0 && prmIdx >= 0
%if System[sysIdx].Block[blkIdx].Type == "SubSystem"
%if ISFIELD(System[sysIdx].Block[blkIdx].CallSiteInfo, "CanonicalPrmArg")
%assign prmName = "System parameter #" + ...
"%"
%else
%assign prmName = "System mask parameter #%<prmIdx>"
%endif
%else
%assign blkPrm = FcnGetBlockParameterForCommentGeneration(mdlParam, 0)
%assign prmName = blkPrm.Name
%endif
%assign enhanceComment = " (Parameter: " + prmName + ")"
%endif
%assign blkName = SLibGrBlockCommentName(mdlParam.GraphicalRef[0])
%assign referencedByStr = "* Referenced by: %<blkName>%<enhanceComment>/n"
%else
%assign referencedByStr = "* Referenced by:/n"
%foreach idx = numBlocks
%assign enhanceComment = ""
%assign sysIdx = mdlParam.ReferencedBy[idx][0]
%assign blkIdx = mdlParam.ReferencedBy[idx][2]
%assign prmIdx = mdlParam.ReferencedBy[idx][3]
%if ::CompiledModel.SLCI == "on" && (mdlParam.StorageClass == "Auto")...
&& sysIdx >= 0 && blkIdx >= 0 && prmIdx >= 0
%if System[sysIdx].Block[blkIdx].Type == "SubSystem"
%if ISFIELD(System[sysIdx].Block[blkIdx].CallSiteInfo, "CanonicalPrmArg")
%assign prmName = "System parameter #" + ...
"%"
%else
%assign prmName = "System mask parameter #%<prmIdx>"
%endif
%else
%assign blkPrm = FcnGetBlockParameterForCommentGeneration(mdlParam, idx)
%assign prmName = blkPrm.Name
%endif
%assign enhanceComment = " (Parameter: " + prmName + ")"
%endif
%assign blkName = SLibGrBlockCommentName(mdlParam.GraphicalRef[idx])
%assign referencedByStr = referencedByStr + "* %<blkName>%<enhanceComment>/n"
%endforeach
%endif
%assign descStr = SLibGetDescriptionForData(mdlParam)
%assign descStr = ISEMPTY(descStr) ? "" : "* " + descStr + "/n"
%assign comment = ...
"%<typeStr> " ...
"%<customStr> " ...
"%<referencedByStr> " ...
"%<descStr> "
%return comment
%endfunction
%function SLibGenModelParamDecl(mdlParam, applyPragma) void
%assign pName = LibGetRecordIdentifier(mdlParam)
%assign vcRecord = SLibGetDataInlineVariantNetConditions(mdlParam)
%assign ppIf = vcRecord.ifCond
%assign ppEndIf = vcRecord.endIfCond
%assign width = SLibGetWidthOfValueFromParamRec(mdlParam)
%if width == 0
%return ""
%endif
%assign useStdContainerName = TLC_FALSE
%assign hasSymbolicWidth = LibRecordHasSymbolicWidth(mdlParam)
%if (hasSymbolicWidth || width > 1) && SLibIsContainerCGTypeStdContainer(mdlParam)
%assign useStdContainerName = TLC_TRUE
%assign optDims = ""
%elseif hasSymbolicWidth || ...
SLibIsNdIndexingFeatureOn() || SLibIsContainerCGTypeND(mdlParam)
%assign optDims = LibGetRecordVectorDims(mdlParam)
%elseif width > 1
%assign optDims = "[%<width>]"
%else
%assign optDims = ""
%endif
%if LibHasCustomStorage(mdlParam)
%openfile buffer
%<ppIf>
%<LibCustomData(mdlParam,"declare",optDims,"")>
%<ppEndIf>
%closefile buffer
%return buffer
%endif
%assign dataType = SLibGetRecordContainerOptStdTypeName(mdlParam, useStdContainerName)
%assign comment = SLibGenModelPrmDefnComment(mdlParam)
%switch mdlParam.StorageClass
%case "Auto"
%case "Auto_SFCN"
%if SLibIsParamUnstructured(mdlParam)
%assign pName = FcnGetAutoParamIdentifier(mdlParam)
%assign externStr = "extern "
%else
%assign externStr = ""
%endif
%assign star = ""
%break
%case "ExportedGlobal"
%case "ImportedExtern"
%assign externStr = "extern "
%assign star = ""
%break
%case "ImportedExternPointer"
%assign externStr = "extern "
%assign star = "*"
%assign optDims = ""
%break
%case "Custom"
%assign errTxt = "Should not get here; should have exited local fcn above"
%<LibReportFatalError(errTxt)>
%default
%assign errTxt = "Unknown storage class: %<mdlParam.StorageClass>"
%<LibReportFatalError(errTxt)>
%endswitch
%assign tq = mdlParam.TypeQualifier
%if (mdlParam.DefinedInLegacyCode == 0)
%if SLibAutosarCompilerAbstractionRequired() && !MultiInstanceERTCode
%assign declaration = ...
"%<tq> %<SLibAutosarCompilerAbstractionForDataDecl(TLC_FALSE, dataType, (mdlParam.StorageClass == "ImportedExternPointer"), TLC_FALSE, "%<pName>%<optDims>", "DataGlobal")>; /* %<comment> */"
%else
%assign declaration = ...
"%<tq> %<dataType> %<star>%<pName>%<optDims>; /* %<comment> *//n"
%endif
%assign elemNameTraceMarker = ""
%if !ISFIELD(mdlParam, "VarGroupIdx")
%assign elemNameTraceMarker = SLibAddTrace2("StorageClassSource", "Individual", "ModelDataSource", "%<mdlParam.Identifier>")
%endif
%assign traceMarker = SLibAddTrace2("ModelElemCategory", "%<SLibGetModelElemCategoryForParam(mdlParam)>", "StorageClass", "%<mdlParam.StorageClass>")
%assign blockTraceMarker = SLibAddBlockTrace(comment)
%assign declaration = " %<SLibTraceBegin">SLibTraceBegin">SLibTraceBegin">SLibTraceBegin(elemNameTraceMarker)> %<SLibTraceBegin">SLibTraceBegin">SLibTraceBegin">SLibTraceBegin(traceMarker)> %<SLibTraceBegin">SLibTraceBegin">SLibTraceBegin">SLibTraceBegin(blockTraceMarker)> %<declaration> %<SLibTraceEnd">SLibTraceEnd">SLibTraceEnd">SLibTraceEnd(blockTraceMarker)> %<SLibTraceEnd">SLibTraceEnd">SLibTraceEnd">SLibTraceEnd(traceMarker)> %<SLibTraceEnd">SLibTraceEnd">SLibTraceEnd">SLibTraceEnd(elemNameTraceMarker)> "
%else
%assign declaration = ""
%endif
%if (applyPragma == TLC_TRUE)
%assign declaration = SLibApplyMemSecToDataDecl(declaration, "MemSecDataParameters", "%<pName>")
%else
%assign declaration = externStr + declaration
%endif
%assign declaration = ppIf + "/n" + declaration + "/n" + ppEndIf + "/n"
%return declaration
%endfunction
%function SLibLUTObjectPtrDataDefinition(mdlParam) void
%assert(ISFIELD(mdlParam, "IsLUTObject") && mdl.Param == 1)
%assert(ISFIELD(mdlParam, "LUTObjectFieldValues"))
%assign dataDef = ""
%assign lutObjTypeIdx = mdlParam.OriginalDataTypeIdx
%assert(LibIsStructDataType(lutObjTypeIdx))
%assign numElems = LibDataTypeNumElements(mdlParam.OriginalDataTypeIdx)
%foreach elIdx = numElems
%if(ISFIELD(mdlParam.LUTObjectFieldValues.FieldValue[elIdx], "DataVar"))
%assign dtype = LibDataTypeElementContainerName(lutObjTypeIdx, elIdx)
%assign dims = LibDataTypeElementVectorDims(lutObjTypeIdx, elIdx)
%openfile dataVal
%assign fv = mdlParam.LUTObjectFieldValues.FieldValue[elIdx].Value
%assign tmp = GENERATE_FORMATTED_VALUE(fv, "")
%closefile dataVal
%assign var = mdlParam.LUTObjectFieldValues.FieldValue[elIdx].DataVar
%assign dataDef = dataDef + dtype + " " + var + dims + " = " + dataVal + ";"
%assign comment = LibDataTypeElementComment(lutObjTypeIdx, elIdx)
%if !WHITE_SPACE(comment)
%assign dataDef = dataDef + comment
%endif
%assign dataDef = dataDef + "/n"
%endif
%endforeach
%return dataDef
%endfunction
%function SLibCacheLUTPointerDataInitBuf(mdlParam) void
%assign ptrDataInit = SLibLUTObjectPtrDataDefinition(mdlParam)
%if ISFIELD(::CompiledModel, "BusPointerDataInitBuf")
%assign ::CompiledModel.BusPointerDataInitBuf = ::CompiledModel.BusPointerDataInitBuf + ptrDataInit
%else
%addtorecord ::CompiledModel BusPointerDataInitBuf ptrDataInit
%endif
%endfunction
%function SLibLUTObjectInit(mdlParam) void
%assert(ISFIELD(mdlParam, "IsLUTObject") && mdlParam.IsLUTObject == 1)
%assert(ISFIELD(mdlParam, "LUTObjectFieldValues"))
%assign lutObjTypeIdx = mdlParam.OriginalDataTypeIdx
%assert(LibIsStructDataType(lutObjTypeIdx))
%assign numElems = LibDataTypeNumElements(mdlParam.OriginalDataTypeIdx)
%assign val = "{ "
%foreach elIdx = numElems
%if(ISFIELD(mdlParam.LUTObjectFieldValues.FieldValue[elIdx], "DataVar"))
%assign val = val + "%"
%else
%assign val = val + "%"
%endif
%if numElems > 1 && elIdx < numElems -1
%assign val = val + ", "
%endif
%endforeach
%assign val = val + " }"
%return val
%endfunction
%function SLibGetBusPointerDataInitBuf() void
%if ISFIELD(::CompiledModel, "BusPointerDataInitBuf")
%return ::CompiledModel.BusPointerDataInitBuf
%else
%return ""
%endif
%endfunction
%function SLibGenUnstrModelParamInstance(mdlParam, applyPragma) void
%assign vcRecord = SLibGetDataInlineVariantNetConditions(mdlParam)
%assign ifCond = vcRecord.ifCond
%assign ifEndCond = vcRecord.endIfCond
%if (mdlParam.StorageClass == "ExportedGlobal")
%assign pName = LibGetRecordIdentifier(mdlParam)
%elseif ((mdlParam.StorageClass == "Auto") && ...
SLibIsParamUnstructured(mdlParam))
%assign pName = FcnGetAutoParamIdentifier(mdlParam)
%if ISFIELD(mdlParam,"RegisteredIdentifier")
%assign pName = mdlParam.RegisteredIdentifier
%else
%assign pName = LibRequestID(pName, TLC_TRUE, TLC_TRUE)
%addtorecord mdlParam RegisteredIdentifier pName
%endif
%else
%assign errTxt = "SLibGenUnstrModelParamInstance only supports " + ...
"exported unstructured parameters."
%<LibReportFatalError(errTxt)>
%endif
%if SLibGetWidthOfValueFromParamRec(mdlParam) == 0
%return ""
%endif
%assign ptrDataDef = ""
%if ISFIELD(mdlParam, "LUTObjectFieldValues")
%assign ptrDataDef = SLibLUTObjectPtrDataDefinition(mdlParam)
%assign initStr = SLibLUTObjectInit(mdlParam)
%else
%assign initStr = LibParameterInstanceInitStr(mdlParam)
%endif
%if !WHITE_SPACE(initStr)
%assign useStdContainerName = TLC_FALSE
%if SLibIsNdIndexingFeatureOn() || SLibIsContainerCGTypeND(mdlParam)
%assign optDims = LibCGTypeSymbolicVectorDims(mdlParam.CGTypeIdx)
%else
%assign prmSize = SLibGetSizeOfValueFromParamRec(mdlParam)
%assign nRows = prmSize[0]
%assign nCols = prmSize[1]
%assign optDims = LibOptionalMatrixDims(nRows, nCols)
%if !ISEMPTY(optDims) && SLibIsContainerCGTypeStdContainer(mdlParam)
%assign optDims = ""
%assign useStdContainerName = TLC_TRUE
%endif
%endif
%assign dataType = SLibGetRecordContainerOptStdTypeName(mdlParam, useStdContainerName)
%assign tq = mdlParam.TypeQualifier
%assign slDT = ::CompiledModel.DataTypes.DataType[mdlParam.OriginalDataTypeIdx]
%assign align = ""
%if mdlParam.Alignment > 0 && !slDT.IsBus && !LibGetRecordIsComplex(mdlParam)
%assign align = SLibGetAlignmentSyntax(::CompiledModel.Name, pName, dataType, ...
mdlParam.Alignment, "DATA_ALIGNMENT_GLOBAL_VAR")
%endif
%assign comment = SLibGenModelPrmDefnComment(mdlParam)
%if SLibAutosarCompilerAbstractionRequired() && !MultiInstanceERTCode
%assign definition = ...
"%<align> %<tq> %<SLibAutosarCompilerAbstractionForDataDecl(TLC_FALSE, dataType, TLC_FALSE, TLC_FALSE, "%<pName>%<optDims>", "DataGlobal")> = %<initStr>; /* %<comment> */"
%else
%assign definition = ...
"%<align> %<tq> %<dataType> %<pName>%<optDims> = %<initStr>; /* %<comment> *//n"
%endif
%assign definition = ifCond + "/n" + definition + "/n" + ifEndCond + "/n"
%if !WHITE_SPACE(ptrDataDef)
%assign definition = ptrDataDef + definition
%endif
%if (applyPragma == TLC_TRUE)
%return SLibApplyMemSecToDataDefn(definition, "MemSecDataParameters", "%<pName>")
%else
%return definition
%endif
%else
%return ""
%endif
%endfunction
%function SLibIsModelParamConst(mdlPrm) void
%if mdlPrm.StorageClass == "Custom"
%assign msDefn = SLibGetMemorySectionDefForData(mdlPrm)
%assert !ISEMPTY(msDefn)
%assign qualifier = SLibGetQualifier(msDefn)
%else
%assign qualifier = mdlPrm.TypeQualifier
%endif
%if !WHITE_SPACE(qualifier)
%if !ISEMPTY(FEVAL("strfind", qualifier, "const"))
%return TLC_TRUE
%endif
%endif
%return TLC_FALSE
%endfunction
%function SLibIsModelParamMacro(mdlPrm) void
%if mdlPrm.StorageClass == "Custom"
%assign cscDefn = mdlPrm.CSCDefn
%assign dataInit = SLibGetDataInitForData(cscDefn, mdlPrm)
%return dataInit == "Macro"
%else
%return TLC_FALSE
%endif
%endfunction
%function SLibIsModelParamFileOrAutoScope(mdlPrm) void
%if mdlPrm.StorageClass == "Custom"
%assign cscDefn = mdlPrm.CSCDefn
%assign dataScope = SLibGetDataScope(cscDefn, mdlPrm)
%return (dataScope == "File" || dataScope == "Auto")
%else
%return TLC_FALSE
%endif
%endfunction
%function LibCoderDataGroupInstanceIsEmpty() void
%<LibTrapCacheAssert(CoderDataGroupInstance)>
%return WHITE_SPACE(CoderDataGroupInstance)
%endfunction
%function LibDumpCoderDataGroupInstance() Output
%<LibTrapCacheAssert(CoderDataGroupInstance)>/
%<CoderDataGroupInstance>/
%<SLibResetTLCGlobal("CoderDataGroupInstance")>/
%endfunction
%function LibDWorkInstanceIsEmpty() void
%<LibTrapCacheAssert(DWorkInstance)>
%return WHITE_SPACE(DWorkInstance)
%endfunction
%function LibDumpDWorkInstance() Output
%<LibTrapCacheAssert(DWorkInstance)>/
%<DWorkInstance>/
%<SLibResetTLCGlobal("DWorkInstance")>/
%endfunction
%function LibPrevZCStatesInstanceIsEmpty() void
%<LibTrapCacheAssert(PrevZCStatesInstance)>
%return WHITE_SPACE(PrevZCStatesInstance)
%endfunction
%function LibDumpPrevZCStatesInstance() Output
%<LibTrapCacheAssert(PrevZCStatesInstance)>/
%<PrevZCStatesInstance>/
%<SLibResetTLCGlobal("PrevZCStatesInstance")>/
%endfunction
%function LibExternalInputsInstanceIsEmpty() void
%if SLibAutosarActive()
%return TLC_TRUE
%else
%<LibTrapCacheAssert(ExternalInputsInstance)>
%return WHITE_SPACE(ExternalInputsInstance)
%endif
%endfunction
%function LibDumpExternalInputsInstance() Output
%<LibTrapCacheAssert(ExternalInputsInstance)>/
%<ExternalInputsInstance>/
%<SLibResetTLCGlobal("ExternalInputsInstance")>/
%endfunction
%function LibExternalInputSizesInstanceIsEmpty() void
%if SLibAutosarActive()
%return TLC_TRUE
%else
%<LibTrapCacheAssert(ExternalInputSizesInstance)>
%return WHITE_SPACE(ExternalInputSizesInstance)
%endif
%endfunction
%function LibDumpExternalInputSizesInstance() Output
%<LibTrapCacheAssert(ExternalInputSizesInstance)>/
%<ExternalInputSizesInstance>/
%<SLibResetTLCGlobal("ExternalInputSizesInstance")>/
%endfunction
%function LibExternalOutputsInstanceIsEmpty() void
%if SLibAutosarActive()
%return TLC_TRUE
%else
%<LibTrapCacheAssert(ExternalOutputsInstance)>
%return WHITE_SPACE(ExternalOutputsInstance)
%endif
%endfunction
%function LibDumpExternalOutputsInstance() Output
%<LibTrapCacheAssert(ExternalOutputsInstance)>/
%<ExternalOutputsInstance>/
%<SLibResetTLCGlobal("ExternalOutputsInstance")>/
%endfunction
%function LibExternalOutputSizesInstanceIsEmpty() void
%if SLibAutosarActive()
%return TLC_TRUE
%else
%<LibTrapCacheAssert(ExternalOutputSizesInstance)>
%return WHITE_SPACE(ExternalOutputSizesInstance)
%endif
%endfunction
%function LibDumpExternalOutputSizesInstance() Output
%<LibTrapCacheAssert(ExternalOutputSizesInstance)>/
%<ExternalOutputSizesInstance>/
%<SLibResetTLCGlobal("ExternalOutputSizesInstance")>/
%endfunction
%function LibContStatesInstanceIsEmpty() void
%<LibTrapCacheAssert(ContStatesInstance)>
%return WHITE_SPACE(ContStatesInstance)
%endfunction
%function LibDumpContStatesInstance() Output
%<LibTrapCacheAssert(ContStatesInstance)>/
%<ContStatesInstance>/
%<SLibResetTLCGlobal("ContStatesInstance")>/
%endfunction
%function LibPeriodicContStatesInstanceIsEmpty() void
%<LibTrapCacheAssert(PeriodicStateIndInstance)>
%<LibTrapCacheAssert(PeriodicStateRngInstance)>
%return WHITE_SPACE(PeriodicStateIndInstance) && WHITE_SPACE(PeriodicStateRngInstance)
%endfunction
%function LibDumpPeriodicContStatesInstance() Output
%<LibTrapCacheAssert(PeriodicStateIndInstance)>/
%<LibTrapCacheAssert(PeriodicStateRngInstance)>/
%<PeriodicStateIndInstance>/
%<PeriodicStateRngInstance>/
%<SLibResetTLCGlobal("PeriodicStateIndInstance")>/
%<SLibResetTLCGlobal("PeriodicStateRngInstance")>/
%endfunction
%function LibMassMatricesInstanceIsEmpty() void
%<LibTrapCacheAssert(MassMatricesGlobalInstance)>
%return ( WHITE_SPACE(MassMatricesGlobalInstance) )
%endfunction
%function LibDumpMassMatricesInstance() Output
%<LibTrapCacheAssert(MassMatricesGlobalInstance)>/
%<MassMatricesGlobalInstance>/
%<SLibResetTLCGlobal("MassMatricesGlobalInstance")>/
%endfunction
%function LibBlockIOInstanceIsEmpty() void
%<LibTrapCacheAssert(BlockIOInstance)>
%return LibBlockIOStructIsEmpty()
%endfunction
%function LibDumpBlockIOInstance() Output
%<LibTrapCacheAssert(BlockIOInstance)>/
%<BlockIOInstance>/
%<SLibResetTLCGlobal("BlockIOInstance")>/
%endfunction
%function LibConstBlockIOInstanceIsEmpty() void
%<LibTrapCacheAssert(ConstBlockIOInstance)>
%return WHITE_SPACE(ConstBlockIOInstance)
%endfunction
%function LibDumpConstBlockIOInstance() Output
%<LibTrapCacheAssert(ConstBlockIOInstance)>/
%<ConstBlockIOInstance>/
%<SLibResetTLCGlobal("ConstBlockIOInstance")>/
%endfunction
%function LibExportedGlobalSignalsInstanceIsEmpty() void
%<LibTrapCacheAssert(ExportedGlobalSignalsInstance)>
%return WHITE_SPACE(ExportedGlobalSignalsInstance)
%endfunction
%function LibDumpExportedGlobalSignalsInstance() Output
%<LibTrapCacheAssert(ExportedGlobalSignalsInstance)>/
%<ExportedGlobalSignalsInstance>/
%<SLibResetTLCGlobal("ExportedGlobalSignalsInstance")>/
%endfunction
%function LibCustomReusableSignalsInstanceIsEmpty() void
%<LibTrapCacheAssert(CustomReusableSignalsInstance)>
%return WHITE_SPACE(CustomReusableSignalsInstance)
%endfunction
%function LibDumpCustomReusableSignalsInstance() Output
%<LibTrapCacheAssert(CustomReusableSignalsInstance)>/
%<CustomReusableSignalsInstance>/
%<SLibResetTLCGlobal("ExportedGlobalSignalsInstance")>/
%endfunction
%function LibExportedGlobalDWorkInstanceIsEmpty() void
%<LibTrapCacheAssert(ExportedGlobalDWorkInstance)>
%return WHITE_SPACE(ExportedGlobalDWorkInstance)
%endfunction
%function LibDumpExportedGlobalDWorkInstance() Output
%<LibTrapCacheAssert(ExportedGlobalDWorkInstance)>/
%<ExportedGlobalDWorkInstance>/
%<SLibResetTLCGlobal("ExportedGlobalDWorkInstance")>/
%endfunction
%endif