AeroCoder
Open the tools

DO-178C HANDBOOK · CONTENTS

DO-178C HANDBOOK

/

Model-Based Development (DO-331)

Model Standards & Modeling Constraints

Writing a Software Model Standard: allowed blocks, naming, data typing, configuration settings and checks.

Desk summary

  • 01DO-331 adds a life cycle data item, the Software Model Standards (MB.11.23): one standard per type of model, defining the language subset, style and complexity limits, tool constraints, and how requirements, derived requirements and non-requirement elements are identified and traced.
  • 02A good model standard is mostly about removing ambiguity: a restricted, assured block set; strong, explicit data typing; fixed-step discrete timing with specified sample times; deterministic state-machine semantics; and frozen model configuration settings.
  • 03Industry guideline sets — high-integrity modeling guidelines, MAB/JMAAB style rules, MISRA AC SLSF/GMG — are good starting points, but the project must tailor and justify them; the standard, not the vendor catalogue, is what reviewers check against.
  • 04Automated checking (rule checkers run in CI) makes conformance cheap and repeatable; if its output is relied on without review, the checker is a verification tool and may need DO-330 qualification.
  • 05Every deviation needs a recorded justification; unjustified deviations are among the most common SOI #2 findings on model-based programs.

Intuition

A coding standard for pictures

A C coding standard exists because C lets you write things that compile but mean different things to different readers (or compilers). Graphical languages have the same problem in a new shape: an untyped signal, an inherited sample time, an implicit state-machine execution order, a block whose behaviour changes with a hidden setting. The model standard plays the role MISRA plays for C — it carves out the safe, unambiguous, verifiable subset and makes it the only dialect your team writes.

What MB.11.23 asks for

DO-331 expects a Software Model Standard for each kind of model used (a specification-model standard and a design-model standard can differ). The reference project’s standard template is organised exactly along the MB.11.23 contents, which makes it a good checklist:

  • 1.Methods and tools used to develop the models, with justification.
  • 2.Modeling languages, including the syntax, semantics, features and limitations that matter — for example which block categories and which state-machine features are in or out.
  • 3.Style guidelines and complexity restrictions that keep models unambiguous, deterministic and compliant with the DO-331 objectives (nesting depth, elements per diagram, chart size).
  • 4.Constraints on the modeling tools and supporting libraries — configuration settings, diagnostics, prohibited optimisations.
  • 5.Method to identify requirements contained in the model and to trace them to other life cycle data.
  • 6.Method to identify derived requirements in the model and feed them to the system processes, including the safety assessment.
  • 7.Means to identify model elements that are not requirements or design (comments, documentation blocks, annotations) and are not inputs to later processes.
  • 8.Rationale for the suitability of the technique for the kind of information the model expresses (why block diagrams suit control laws, why state machines suit mode logic).

Model-based development

How it differs from a design standard

A DO-178C design standard describes how to write LLR and architecture in prose and diagrams. A model standard must also pin down the execution semantics of the notation — because the model will be simulated and turned into code, a rule like ‘all sample times explicit’ is not style, it is correctness. Keep the model standard separate from the code standard: generated code is checked against a coding standard too (see Requirements, Design, Code & Model Standards).

Language subset and allowed blocks

The first job of the standard is to define the block set. Restrict it to blocks that (a) have well-defined, deterministic semantics, (b) are supported by the code generator and by the code verifier or qualified generator, and (c) have been assured to the software level — DO-331 requires library elements used in models to be developed and verified like any other software at that level. The safest way to enforce the subset is a project block library from which modelers drag everything, with the tool’s full palette locked out.

Typical block-usage rules in a design-model standard (illustrative)

AreaTypical ruleWhy
Math operationsGuard division, square root, logarithm and reciprocal against zero or negative inputs; specify the rounding/saturation behaviour of products and gainsAvoid run-time exceptions and NaN propagation in generated code (algorithm accuracy, robustness)
Loops and iteratorsBounded iteration only; no while-type constructs without a fixed maximum countVerifiability, WCET, no unbounded loops
Conditional executionDefine outputs of conditionally executed subsystems when inactive (held vs reset); avoid merges with ambiguous ownershipDeterminism, traceability of every output
Data stores / globalsAvoid shared data stores across rates or components; if used, define access orderData/control coupling must be analysable
Lookup tablesExplicit breakpoints, explicit behaviour outside the table range (clip vs extrapolate), monotonic breakpointsGain schedules in flight control laws must not extrapolate silently
InterfacesEvery root input/output has a data type, dimension, sample time and design min/maxEnables range analysis and test generation; interface consistency with HLR
Prohibited blocksNo blocks not supported by the generator/verifier; no simulation-only blocks in airborne modelsWhat is simulated must be what is generated

Worked example

AHRS voter interfaces

In the reference helicopter project each AHRS input is a typed bus (attitude, rates, a Boolean valid flag) with design min/max ranges declared on the root ports. Those declared ranges let a model analysis tool derive ranges through the voter, prove that the averaging branch cannot overflow, and generate boundary test inputs — none of which is possible if ports inherit their types.

Naming and data typing

Names matter because they flow into generated identifiers and into traceability. A typical naming rule allows only letters, digits and underscores, forbids leading digits, leading/trailing or doubled underscores and reserved words of the modeling and target languages, and limits length (31 characters is common, for compiler and MISRA reasons). Data typing rules are stronger still: no inherited or default ‘double’ types on interfaces, explicit casts at every type boundary (especially between dataflow and state-machine parts), Boolean signals as true Booleans, fixed-point scaling defined and justified, and units recorded for every physical signal.

Pitfall

Implicit ‘double’ everywhere

Models built for desktop simulation default to double precision. When the same model is configured for a single-precision or fixed-point target, results change — sometimes only in the last bits, sometimes (integrators, washout filters, accumulators) visibly over a long flight. Fix data types in the model from the start and run simulation with the target types; otherwise simulation evidence is about a different algorithm from the one that flies.

Timing: solver and sample-time rules

Airborne design models must be fixed-step and discrete: no continuous states, no variable-step solver, no zero-crossing detection. Every rate in the model is specified explicitly (a constrained, specified sample time at the root; no inherited sample times on interfaces), rate transitions are explicit model blocks rather than automatically inserted, and the tasking mode (single-tasking or multi-rate) matches the target scheduler. High-integrity guidelines make the rationale explicit: automatically inserted rate-transition code has no corresponding model element, which breaks traceability and makes it harder to show no unintended function was added.

Worked example

Pitch law at 80 Hz, air data at 20 Hz

The control law runs at 80 Hz but dynamic pressure for the gain schedule arrives at 20 Hz. The standard requires an explicit rate-transition block (with its hold/latency behaviour documented) at that boundary, and the HLR must state the acceptable latency. A model that relied on the tool to insert the transfer automatically would simulate fine and generate code with a hidden buffer no requirement mentions.

Model configuration settings

Modeling tools expose hundreds of settings that change simulation semantics, diagnostics and generated code. The standard fixes them in a version-controlled configuration file referenced by every airborne model, and an automated check confirms each model uses it. The reference project keeps exactly such a configuration script under its tools folder.

Configuration settings a design-model standard typically fixes (tool-neutral wording)

SettingTypical valueObjective supported
Solver typeFixed-step, discrete (no continuous states)Algorithm accuracy; code generation validity
Sample time constraint / taskingSpecified sample times; explicit rate transitions; no automatic data-transfer handlingSource traceable to LLR; determinism
Diagnostics: algebraic loops, priority violations, type conversion, unconnected signals, sample-time issuesError (not warning)Accuracy and consistency of LLR
Block reduction / dead-block eliminationOffEvery model element has code and vice versa (traceability)
Division-by-zero protection in fixed pointKept (not optimised away)Robustness, algorithm accuracy
Logic signalsImplemented as BooleanData typing, MISRA conformance of generated code
Optimisations incompatible with code verificationDisabled (some tools offer a single switch for this)Generated code remains verifiable against the model
Generated-code comments and traceability tagsOnSource-to-model traceability
Application lifespan / timersDefined consistently with the aircraft useNo counter overflow in long-running software

Practitioner tip

One configuration reference, never per-model edits

Store the configuration as a single referenced configuration set (or script) under CM; models reference it rather than carrying their own copies. A change to a setting is then one controlled change with one impact analysis, not forty silent divergences discovered at SOI #3.

State machines and complexity limits

State-machine rules aim at determinism and analysability: specify the chart semantics (Moore-style or Mealy-style) and use it consistently; make transition and state evaluation order explicit; keep transitions out of parallel-state boundaries and do not let transitions pass through states; avoid recursion and unbounded event broadcasting; ensure junction conditions are mutually exclusive or have a default; use strong typing in chart expressions. Complexity limits keep models reviewable: maximum subsystem nesting depth, maximum blocks per diagram (a common figure is about the number that fits legibly on one printed page), maximum states per chart and maximum cyclomatic-style complexity of embedded textual functions.

Worked example

Autopilot mode logic

A vertical-mode chart has parallel regions for armed and engaged modes. The standard requires explicit execution order for parallel regions, mutually exclusive guards on every transition out of a state (so ALT capture and VS cannot both fire in the same step), and a documented default transition. These rules make it possible to later prove properties such as ‘at most one vertical mode engaged’ with a model checker (see Verifying Models).

Starting points: guideline families

Published guideline sets often tailored into a model standard

FamilyOrigin and focusUse in avionics
High-integrity modeling guidelines (tool vendor)Rules for blocks, charts, configuration and code-generation settings with stated rationale and DO-331 referencesCommonly adopted almost whole for Simulink-style design models; each rule maps to an automated check
MAB / JMAAB control algorithm modeling guidelinesIndustry consortium style rules (naming, layout, signal flow, chart style) — automotive originReadability and consistency layer; tailor rather than adopt wholesale
MISRA AC SLSF and MISRA AC GMGMISRA’s modeling design and style guidelines for Simulink/Stateflow and generic modelingUseful especially when the code standard is MISRA C
Language-specific rules for formal synchronous languagesConstraints shipped with qualified-generator toolsets (e.g. clock, type and operator usage limits)Often required to stay within the qualified generator’s domain
Company-specific rulesLessons learned, target-specific constraints, library usageAlways needed: generic sets do not know your target or architecture

Pitfall

Adopting a guideline catalogue without reading it

Pasting several hundred vendor rules into a standard and turning all checks on produces thousands of findings, a culture of blanket waivers, and a standard nobody can recite. Select rules deliberately, state the rationale for each family, and mark which are enforced automatically, which by review, and which are advisory.

Automated checking and deviations

Most model-standard rules can be checked mechanically by a model rule checker, producing a conformance report per model (the reference project archives one per component — AHRS voter, inner loop, outer loop, actuator loop, FCC). Run checks on every commit and gate configuration-controlled baselines on a clean or fully justified report. Rules that cannot be automated (naming meaning, appropriateness of decomposition, comment quality) go on the model review checklist.

What the auditor looks for

What the reviewer asks about standards

Show me the standard and its traceability to MB.11.23. Which rules are automated, by which tool and version? Is that checker qualified, or is its report reviewed? Show the conformance report for this baseline and each deviation’s justification and approval. Do the configuration settings in the model under review match the controlled configuration file? Who may change the standard, and how are existing models re-checked when it changes?

Note

Does the rule checker need qualification?

If you claim the ‘conforms to standards’ objective based on the checker’s report without a human re-checking those rules, the checker eliminates a verification activity and is a verification tool under DO-330 (criteria 3 → TQL-5 in most cases). Vendors offer qualification kits for model checkers; otherwise, review the rules by hand. See Mapping Tools to Objectives.

Software Model Standard readiness

0/11

Self-check

Why do high-integrity modeling standards typically prohibit letting the tool automatically insert rate-transition handling between tasks?

Sources & further reading

  • RTCA DO-331 (2011) — MB.11.23 Software Model Standards; library and non-contributing model element guidance
  • Rierson, Developing Safety-Critical Software (2013), ch. 14.4 (Differences 2–4)
  • Model-based DO-178C/DO-331 reference project: Software Model Standards (MB.11.23) template, model configuration scripts, SMS conformance reports
  • MathWorks, Modeling Guidelines for High-Integrity Systems (hisl/hisf/himl rules) and DO Qualification Kit
  • MathWorks Advisory Board / JMAAB, Control Algorithm Modeling Guidelines Using MATLAB, Simulink and Stateflow
  • MISRA, MISRA AC SLSF: Modelling design and style guidelines for Simulink and Stateflow (2009); MISRA AC GMG: Generic modelling design and style guidelines (2009)

← Previous

Specification vs Design Models

Model-Based Development (DO-331)

Next →

Verifying Models: Reviews & Analyses

Model-Based Development (DO-331)

On this page

What MB.11.23 asks forLanguage subset and allowed blocksNaming and data typingTiming: solver and sample-time rulesModel configuration settingsState machines and complexity limitsStarting points: guideline familiesAutomated checking and deviations