%%============================================================================
%%
%%
%%
%%
%%Abstract:
%%ThisfilecallsanumberoffunctionstosetupvariousTLCglobalsand
%%::CompiledModelfields.Thefunctionscalledinthisfilecanbefound
%%insetuplib.tlc.
%%
 
%%Copyright1994-2015TheMathWorks,Inc.
%%
 
 
%selectfile NULL_FILE
 
%include "setuplib.tlc"
 
%include "globalsetup.tlc"
 
%if EXISTS("_COMMONSETUP_") == 0
%assign _COMMONSETUP_ = 1
 
%%Eitherthisorgenmap.tlcwillbecalledfirst.So,assigningthisglobal
%%variableinboththeplacesandcallEnablingfunction
%if EXISTS(CompileStatsEnabled) == 0
   %assign CompileStatsEnabled = TLC_FALSE
%endif
 
%include "compilestats.tlc"
 
%%CalltheSetCompileStatsEnabledfunction
%<SetCompileStatsEnabled()>
 
%%CompilestatsshouldbecollectedafterSLibSetupBasicDefaults,since
%%thechecksforTLCompileStatsisdoneinthisfunction
%<SLibAddTLCCompileStatsCheckPoint(TLC_TRUE,"Common Setup")>
 
%%=============================================================================
%%PopulateTypeLimitIdentifierReplacementMap.
%assign typeLimitIdMap = SLibGetTypeLimitIdReplacementMap()
%assign setTlirMapSuccess = SET_TYPE_LIMIT_ID_REPLACEMENT_MAP(typeLimitIdMap)
 
%%============================================================================
%%Setupbasicglobaldefaults
%%
%<SLibSetupBasicDefaults()>
 
%%=============================================================================
%%Setupdefaultsthathelpperformdiagnosticsofthecodegenerationprocess.
%%Thesedefaultsdonotaffectthegeneratedcode.
%%----------------------------------------------------------------------
%%SettingDefault-Value
%%----------------------------------------------------------------------
%%RTWVerbose1
%%ShowObsoleteWarnings0
%%WarnNonSaturatedBlocks2
%%----------------------------------------------------------------------
%%
%<SLibSetupDiagnosticDefaults()>
 
%%============================================================================
%%Loadallthefunctionlibraries
%%
%<SLibSetupPrintStatusMsgs("libload")>
%include "funclib.tlc"
 
%%============================================================================
%%SetupERTrelatedfeatures
%%
%<SLibERTFeatureSetup()>
 
%%============================================================================
%%Setupoptionsthatdeterminethelayoutofthecode.Theseareoptionsthat
%%aresharedacrossallcodeformats
%%----------------------------------------------------------------------
%%SettingDefault-Value
%%----------------------------------------------------------------------
%%GenerateComments1
%%ForceParamTrailComments0
%%ShowEliminatedStatements1(C),0(Ada)
%%HaveSeparateSourceFiles0
%%ProtectCallInitFcnTwice0
%%GenerateInterfaceAPI0
%%GenerateASAP20
%%InlineParameters0
%%InlineInvariantSignals1
%%ZeroInternalMemoryAtStartup1
%%ZeroExternalMemoryAtStartup1
%%MaxStackSizertInf
%%MaxStackVariableSizertInf
%%roundingConvention(Adaonly)
%%InitFltsAndDblsToZero0
%%ForceBlockIOInitOptimize0
%%DoAsserts0
%%RateGroupingCode0
%%----------------------------------------------------------------------
%%
%<SLibSetupLayoutOptions()>
 
%%CachedataalignmentflagssothatTLCcodecanemitpropercodetoalign
%%dataobjects
%<SLibCacheDataAlignmentFlags()>
 
%%============================================================================
%%Setupsthecodeformatandassociatedfieldsandvariables
%%----------------------------------------------------------------------
%%SettingDefault-Value
%%----------------------------------------------------------------------
%%CodeFormatRealTime
%%PreStructPragma""
%%PostStructPragma""
%%----------------------------------------------------------------------
%%
%<SLibSetupCodeFormat()>
 
%%============================================================================
%%Setupsrootmodelmethods
%%----------------------------------------------------------------------
%<SLibRootSystemMethodProps()>
 
%%============================================================================
%%Setupfieldsthattracktheprogressofcodegeneration.Thesearefields
%%thatareforinternaluseoftheTLCcode
%<SLibSetupCodeGenTrackingFields()>
 
%%============================================================================
%%Setupinformationneededtosupportthe%rollconstruct
%%----------------------------------------------------------------------
%%SettingDefault-Value
%%----------------------------------------------------------------------
%%RollThreshold5
%%----------------------------------------------------------------------
%%
%<SLibSetupRollingInfo()>
 
%%=============================================================================
%%Setupdataandstatelogginginfo
%%----------------------------------------------------------------------
%%SettingDefault-Value
%%----------------------------------------------------------------------
%%MatFileLogging0
%%LogVarNameModifierrt_
%%----------------------------------------------------------------------
%%
%<SLibSetupLoggingInfo()>
 
%%=============================================================================
%%SetsupfieldsforvariousIdentifiersusedinthegeneratedcode.
%%Someofthesefieldsaresetuponthebasisofthespecificcodeformat
%%----------------------------------------------------------------------
%%SettingDefault-Value
%%----------------------------------------------------------------------
%%tRealPartre
%%tImagPartim
%%PrefixModelToStructs1
%%ofvarsbasedoncodeformat>
%%----------------------------------------------------------------------
%%
%<SLibSetupCodeIdentifiers()>
 
%%=============================================================================
%%DefinitionoffilepackagingAPIsandloaddefaultfilepackagingtable
%%
%include "filepackaginglib.tlc"
%<SLibSynchronizeFileRepWithFileRecords()>
 
%%=============================================================================
%%Codertypesfiles
%%
%<SLibSetupCoderTypesInfo()>
 
%%=============================================================================
%%SetupLibSrcfunctionnames
%%
%<SLibSetupLibSrcFcnNames()>
 
%%=============================================================================
%%Performvalidationof::CompiledModel
%%-Checkiftherearealgebraicloopsinmodel
%%
%<SLibCheckCompiledMdl()>
 
%%=============================================================================
%%Setupdatatypeinfo
%%
%<SLibSetupDatatypeInfo()>
 
%%=============================================================================
%%Docheckspertainingtoparticularcodeformats
%%
%<SLibSetupDoCodeFmtChecks()>
 
 
%%============================================================================
%%SetupvarsforsettinguptheCAPIsformonitoringblockIOandtuningprms
%%atrun-time
%%
%<SLibSetupCAPI()>
%<SLibSetupBIOAPI()>
%<SLibSetupPrmAPI()>
 
%include "partitiongroupinglib.tlc"
 
%<SLibSetupCustomCode()>
 
%%=============================================================================
%%Setupandcheckcustomstorageclasses
%%
%assign ::BlockFcn = "GlobalMap"
%<SLibSetupAndCheckCustomSC()>
%assign ::BlockFcn = "Unknown"
 
%%=============================================================================
%%Nowthatmemorysectionshavebeensetup(whensettingupcustomstorage
%%classes,setupthertModelrecordsforcoderdatagroups
%%
%if GenRTModel && !::CompiledModel.SuppressSelf
  %<SLibInitCoderDataGroupRTMdlRecs()>
%endif
 
%%=============================================================================
%%IncludeCodeFormatspecificlibrary
%%
%with ::CompiledModel
  %switch CodeFormat
    %case "RealTime"
      %include "srtlib.tlc"
      %break
    %case "S-Function"
      %if !Accelerator
      %include "sfcnlib.tlc"
      %else
    %include "accellib.tlc"
      %endif
      %break
    %case "Embedded-C"
      %include "ertlib.tlc"
      %break
    %default
      %assign errTxt = "Unknown CodeFormat: %<CodeFormat>"
      %<LibReportFatalError(errTxt)>
  %endswitch
  %%
  %% universal pass through model to setup code generation and allow
  %% users to cache custom code using the BlockInstanceSetup and
  %% BlockTypeSetup functions.
  %%
  %include "commonpass.tlc"
  %%
  %% Defer this check until after commonpass.tlc since it is there
  %% that we establish block's level of compliance (via their
  %% InstanceSetup functions
  %%
  %<VerifyCustomStorageCompliance()>
%endwith
 
%%=============================================================================
%%SetupSimulinkFunctionFPC
%%
%<SLibSetupSimulinkFunctionFPC()>
 
%%DeclareSimulinkFunctionsformodelreferencing.
%<SLibDeclareExternalSimulinkFunctions()>
 
%%Beforewritingoutthetypedefs,shouldpropogatealignmentrequirementsfrom
%%ExternalIO/BlockIOtobusdatatype,ifnecessary.
%<SLibUpdateAlignmentForBusType()>
 
%%Writetypedefs
%<SLibWriteDatatypeTypedefs()>
 
 
 
%%=============================================================================
%%SetupTLCreplacementv-tabledefaultfunctionstrings
%%
%<SLibSetupTLCvtable()>
 
%%=============================================================================
%%SetupTLCcodeprofiling
%%
%<SLibSetupProf()>
%<SLibAddTLCCompileStatsCheckPoint(TLC_FALSE,"Common Setup")>
 
 
%%=============================================================================
%%Setupcodecustomizationhooksforothermodeltypes
%%
%if (::CompiledModel.BlockDiagramType == "deploymentdiagram")
  %include "deploymentdiagram.tlc"
%endif
 
%endif %% _COMMONSETUP_
 
%%[EOF]commonsetup.tlc