%function DumpUserCodeAndCustomDataInst() void
%if !Accelerator && !IsModelReferenceSimTarget()
%openfile tmpBuf
%<LibDumpTopOfPrmFileUserCode()>/
%closefile tmpBuf
%<SLibCacheCodeToFile("baseMdl_src_incl", tmpBuf)>
%openfile tmpBuf
%<LibDumpBottomOfPrmFileUserCode()>/
%closefile tmpBuf
%<SLibCacheCodeToFile("baseMdl_src_define", tmpBuf)>
%openfile tmpBuf
%<LibDumpBottomOfSourceFileUserCode()>/
%closefile tmpBuf
%<SLibCacheCodeToFile("custom_code_userBottom", tmpBuf)>
%endif
%if !Accelerator
%openfile tmpBuf
%<LibDumpTopOfSourceFileUserCode()>/
%closefile tmpBuf
%<SLibCacheCodeToFile("custom_code_topOfSrc", tmpBuf)>
%endif
%openfile tmpBuf
%assign reqInsts = LibGetSystemField(System[NumSystems-1], "ReqRootPrmHdrDataInsts")
%if reqInsts.GlobalPrmDataCacheInst
%<LibDumpGlobalPrmDataCache()>/
%endif
%closefile tmpBuf
%<SLibCacheCodeToFile("mdl_data_defn", tmpBuf)>
%endfunction
%function DumpExportFileUserCode() void
%assign isSfcnForm = (CodeFormat == "S-Function")
%if !isSfcnForm && !Accelerator && !IsModelReferenceSimTarget()
%openfile tmpBuf
%<SLibDumpTopOfExportFileUserCode()>/
%closefile tmpBuf
%<SLibCacheCodeToFile("baseMdl_hdr_userTop", tmpBuf)>
%openfile tmpBuf
%<SLibDumpBottomOfExportFileUserCode()>/
%closefile tmpBuf
%<SLibCacheCodeToFile("mdl_hdr_userBottom", tmpBuf)>
%endif
%endfunction
%function LibDumpGlobalCoderGroupInstancesToModelDotC() void
%openfile instances
%<LibDumpCoderDataGroupInstance()> /
%closefile instances
%if !ISEMPTY(instances)
%<SLibCacheCodeToFile("mdl_data_defn", instances)>
%endif
%endfunction
%function DumpExportedDataInstance() void
%assign reqInsts = LibGetSystemField(System[NumSystems-1], "ReqRootPrmHdrDataInsts")
%openfile expInst
%if reqInsts.ExpGlobalSigsInst && !LibExportedGlobalSignalsInstanceIsEmpty()
/* Exported block signals */
%<LibDumpExportedGlobalSignalsInstance()>/
%endif
%if reqInsts.ExpGlobalSigsInst && !LibCustomReusableSignalsInstanceIsEmpty()
%<LibDumpCustomReusableSignalsInstance()>/
%endif
%if !SLibPrmBufferIsEmpty("ExportedGlobal", "Instance")
/* Exported block parameters */
%<SLibGetPrmBuffer("ExportedGlobal", "Instance")>
%endif
%if reqInsts.ExpGlobalDworkInst && !LibExportedGlobalDWorkInstanceIsEmpty()
/* Exported block states */
%<LibDumpExportedGlobalDWorkInstance()>/
%endif
%closefile expInst
%if !WHITE_SPACE(expInst)
%<SLibCacheCodeToFile("mdl_data_defn", expInst)>
%endif
%endfunction
%function DumpExportedDataDefinition() void
%if !Accelerator && !IsModelReferenceSimTarget()
%assign isSfcnForm = (CodeFormat == "S-Function")
%openfile expDef
%if !SLibExportedGlobalSignalsIsEmpty()
/*
* Exported Global Signals
*
* Note: Exported global signals are block signals with an exported global
* storage class designation. Code generation will declare the memory for
* these signals and export their symbols.
*
*/
%if ::GenCPP && !SLibAutosarCompilerAbstractionRequired()
#ifdef __cplusplus
extern "C" {
#endif
%endif
%<SLibDumpExportedGlobalSignalsDefinition()>/
%if ::GenCPP && !SLibAutosarCompilerAbstractionRequired()
#ifdef __cplusplus
}
#endif
%endif
%endif
%if !SLibCustomReusableSignalsIsEmpty()
/*
* Reusable Custom Storage Class
*
* Note: Reusable CSC signals are used for in-place optimization.
* Code generation will declare the memory for these signals and
* export their symbols.
*
*/
%<SLibDumpCustomReusableSignalsDefinition()>/
%endif
%if !SLibPrmBufferIsEmpty("ExportedGlobal", "Decl")
/*
* Exported Global Parameters
*
* Note: Exported global parameters are tunable parameters with an exported
* global storage class designation. Code generation will declare the memory for
* these parameters and exports their symbols.
*
*/
%<SLibGetPrmBuffer("ExportedGlobal", "Decl")>/
%endif
%if !isSfcnForm
%if !SLibExportedGlobalDWorkIsEmpty()
/*
* Exported States
*
* Note: Exported states are block states with an exported global
* storage class designation. Code generation will declare the memory for these
* states and exports their symbols.
*
*/
%<SLibDumpExportedGlobalDWorkDefinition()>/
%endif
%endif
%closefile expDef
%<SLibCacheCodeToFile("data_exportGlobal_decl", expDef)>
%endif
%endfunction
%function DumpHdrFileUserCode() void
%if !Accelerator && !IsModelReferenceSimTarget()
%openfile tmpBuf
%<LibDumpTopOfHdrFileUserCode()>/
%closefile tmpBuf
%<SLibCacheCodeToFile("baseMdl_hdr_userTop", tmpBuf)>
%openfile tmpBuf
%<LibDumpBottomOfHdrFileUserCode()>/
%closefile tmpBuf
%<SLibCacheCodeToFile("mdl_hdr_userBottom", tmpBuf)>
%elseif IsModelReferenceSimTarget()
%openfile tmpBuf
%<LibDumpTopOfHdrFileUserCode()>/
%closefile tmpBuf
%<SLibCacheCodeToFile("mdl_priv_userTop", tmpBuf)>
%endif
%endfunction
%function ()
%openfile nonVirtSubsbys
%foreach sysIdx = NumSystems - 1
%assign system = System[sysIdx]
%<LibDumpSystemHeader(system)>/
%endforeach
%closefile nonVirtSubsbys
%return nonVirtSubsbys
%endfunction