Skip to content
Stable.ssp@modelscript/ssp 14 diagnostic rules
Parser WASM GLR
Diagnostics 14 rules
DAE Arena Lowering
Simulation Co-sim / Export
Projections FMU, Modelica
Live ExampleSystemStructure.ssd

Multi-FMU Co-Simulation System Structure (SSP 1.0)

Connects a Controller FMU, Actuator Hydraulics FMU, and Vehicle Dynamics Plant FMU across typed causal Real connectors.

Playground
Source (30 lines)
1<?xml version="1.0" encoding="UTF-8"?>
2<ssd:SystemStructureDescription xmlns:ssd="http://ssp-standard.org/SSP1/SystemStructureDescription" name="ActiveSuspensionCoSim" version="1.0">
3  <ssd:System name="ActiveSuspensionRoot">
4    <ssd:Elements>
5      <ssd:Component name="SkyhookController" source="resources/SkyhookController.fmu">
6        <ssd:Connectors>
7          <ssd:Connector name="z_err" kind="input" />
8          <ssd:Connector name="u_valve" kind="output" />
9        </ssd:Connectors>
10      </ssd:Component>
11      <ssd:Component name="HydraulicActuator" source="resources/HydraulicActuator.fmu">
12        <ssd:Connectors>
13          <ssd:Connector name="u_valve" kind="input" />
14          <ssd:Connector name="f_strut" kind="output" />
15        </ssd:Connectors>
16      </ssd:Component>
17      <ssd:Component name="ChassisPlant" source="resources/ChassisPlant.fmu">
18        <ssd:Connectors>
19          <ssd:Connector name="f_strut" kind="input" />
20          <ssd:Connector name="z_body" kind="output" />
21        </ssd:Connectors>
22      </ssd:Component>
23    </ssd:Elements>
24    <ssd:Connections>
25      <ssd:Connection startElement="SkyhookController" startConnector="u_valve" endElement="HydraulicActuator" endConnector="u_valve" />
26      <ssd:Connection startElement="HydraulicActuator" startConnector="f_strut" endElement="ChassisPlant" endConnector="f_strut" />
27      <ssd:Connection startElement="ChassisPlant" startConnector="z_body" endElement="SkyhookController" endConnector="z_err" />
28    </ssd:Connections>
29  </ssd:System>
30</ssd:SystemStructureDescription>
SSP System Structure & FMU Connection Diagram
«fmu component» SkyhookController «fmu component» HydraulicActuator «fmu component» ChassisPlant
Drag to pan · Click % to reset

SSP (System Structure and Parameterization) ​

@modelscript/ssp (languages/ssp) implements the Modelica Association SSP 1.0 / 2.0 standard for packaging and coupling Functional Mock-up Units (FMUs) into multi-domain Co-Simulation architectures.


Supported Extensions & Container Architecture ​

ExtensionStandard ArtifactRole
.sspSystem Structure Package (ZIP archive)Container bundling SystemStructure.ssd, resources/*.fmu, and *.ssv parameter sets
.ssdSystem Structure Description (XML)Hierarchical System, Components, Connectors, Connections, and DefaultExperiment topology
.ssvSystem Structure Parameter Values (XML)Typed parameter bindings (Real, Integer, Boolean, String, Enumeration)

Virtual File System (VFS) Archive Extraction ​

When a .ssp ZIP archive is loaded into the workspace, sspLanguage.container (languages/ssp/src/language.ts) automatically unpacks and indexes its internal artifacts:

  • *.ssd and *.ssv entries are dispatched via parse_as_language into the @modelscript/ssp CST & Salsa index.
  • resources/*.fmu archives are recursively extracted (extract_nested) so their internal modelDescription.xml ports and parameters are cross-checked against .ssd connectors.
  • Auxiliary tables and binaries under resources/* are mounted into the in-memory VFS (mount_vfs).

Interactive 2D Diagram Builder & Bidirectional XML Writeback ​

languages/ssp/src/diagram.ts provides a two-way schematic editor for .ssd topologies:

  • 2D Schematic Extraction (buildSspDiagramData): Parses <ssd:System>, <ssd:Component>, <ssd:Connector>, <ssd:Connection>, and <ssd:ElementGeometry> / <ssd:ConnectionGeometry> annotations into positioned block nodes, typed causal ports, and orthogonal routing waypoints.
  • Surgical XML Writeback (applySspDiagramEdits / sspLanguage.writeback): Moving components, adding/removing FMU blocks, drawing <ssd:Connection> wires, or editing <ssv:Parameter> values updates the underlying .ssd or .ssv XML document in place while preserving namespace prefixes and custom vendor annotations.

Modelica Architecture Projection (sspToModelicaBlock) ​

sspToModelicaBlock(ssdDoc) (languages/ssp/src/index.ts) projects any .ssd system topology into an equivalent composite Modelica model, translating <ssd:Connector> definitions into Modelica.Blocks.Interfaces.RealInput / RealOutput (or Integer/Boolean causal interfaces), <ssd:Component> blocks into typed sub-models with <ssv:Parameter> modifications, and <ssd:Connection> edges into connect(...) equations.


Semantic Linter & Diagnostic Codes ​

lintSsd and lintSsv (languages/ssp/src/linter.ts) validate structural, causal, and type soundness across .ssd and .ssv files with 20 diagnostic codes (13 SSP_* + 7 SSV_*):

.ssd System Structure Diagnostics (lintSsd) ​

14 rules13 error1 warning Run with msx lint

CodeRuleSeverityMessage
S7001SSP_EMPTY_CONNECTOR_NAMEerrorConnector in <owner> has an empty name.
S7002SSP_DUPLICATE_CONNECTORerrorDuplicate connector '<name>' declared in <owner>.
S7003SSP_INVALID_CONNECTOR_KINDerrorInvalid connector kind '<kind>'. Must be input, output, inout, parameter, or calculatedParameter.
S7004SSP_EMPTY_COMPONENT_NAMEerrorComponent declared with an empty name attribute.
S7005SSP_DUPLICATE_COMPONENTerrorDuplicate component '<name>' in system.
S7006SSP_EMPTY_SOURCEerrorComponent '<comp>' has an empty or missing source FMU URI.
S7007SSP_UNDEFINED_COMPONENTerrorReferenced component '<comp>' is not defined in system elements.
S7008SSP_UNDEFINED_CONNECTORerrorReferenced connector '<conn>' not found on component '<comp>'.
S7009SSP_CONNECTOR_TYPE_MISMATCHerrorConnection type mismatch: '<startType>' cannot connect to '<endType>'.
S7010SSP_CONNECTOR_CAUSALITY_CONFLICTerrorConnection violates causal flow rules.
S7011SSP_CYCLIC_CONNECTIONerrorConnection creates an algebraic loop or cyclic dependency without delay.
S7012SSP_INVALID_EXPERIMENT_BOUNDSerrorDefaultExperiment stopTime must be strictly greater than startTime.
S7013SSP_CONNECTOR_UNIT_MISMATCHwarningConnector unit mismatch: '<startUnit>' connected to '<endUnit>'.
S7014SSP_ALGEBRAIC_FEEDTHROUGH_LOOPerrorAlgebraic feedthrough loop detected across connected components: <cyclePath>.

Generated from languages/ssp/src/errors.ts. All languages →


Command Line Interface (msx fmu & msx cosim) ​

ModelScript CLI provides turnkey subcommands for packaging, validating, and co-simulating SSP archives:

bash
# Validate an FMU or SSP container
msx fmu validate VehicleChassis.fmu

# Simulate an FMU archive directly via SU2, CVODE, or BDF solvers
msx fmu simulate Powertrain.fmu --stop-time=10.0 --step-size=0.001 --format=csv -o output.csv

# Optimize SSP parameter values using differential evolution (CMA-ES, DE, PSO)
msx cosim optimize PlantModel.ssp --params="kp:0.1:10.0,kd:0.01:1.0" --objective="tracking_error"

Polyglot TGG Rules ​

@modelscript/ssp registers 8 bidirectional Triple Graph Grammar (TGG) rules in languages/ssp/src/language.ts:

Rule NameSource (ssp)Target LanguageTarget Construct
SspSystemToModelicaModelSsdSystemmodelicaClassDefinition (model)
SspComponentToModelicaComponentSsdComponentmodelicaComponentClause
SspConnectorToModelicaConnectorSsdConnectormodelicaComponentClause (RealInput / RealOutput)
SspConnectionToModelicaConnectSsdConnectionmodelicaConnectClause
SspSystemToSysmlPackageSsdSystemsysml2PartDef
SspComponentToSysmlPartSsdComponentsysml2PartUsage
SspConnectorToSysmlPortSsdConnectorsysml2PortUsage
SspConnectionToSysmlConnectionSsdConnectionsysml2ConnectionUsage

Open-Core under the GNU AGPL v3 License; Enterprise Edition (ee/) under the ModelScript Enterprise License. • Trademark Policy