Skip to content

Commit da838ec

Browse files
authored
Merge pull request #37 from modelica/DagBruck-patch-modelica
Dag bruck patch modelica
2 parents 666510f + 28a13c0 commit da838ec

File tree

3 files changed

+71
-15
lines changed

3 files changed

+71
-15
lines changed

docs/5___ssd.adoc

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Note that there is no requirement that connectors have to be present for all var
119119
At least those connectors *MUST* be present which are referenced in connections inside the SSD.
120120

121121
|kind a|
122-
This attribute specifies the kind of the given connector, which indicates whether the connector is an input, an output, both (inout), a local variable, a constant, a parameter, a calculated parameter (i.e. a parameter that is calculated by the component during initialization), or a structural parameter (i.e. a parameter that can be set during (re-)configuration mode).
122+
This attribute specifies the kind of the given connector, which indicates whether the connector is an input, an output, both (inout), unspecified, a local variable, a constant, a parameter, a calculated parameter (i.e. a parameter that is calculated by the component during initialization), or a structural parameter (i.e. a parameter that can be set during (re-)configuration mode).
123123

124124
For components this *MUST* match the related kind of the underlying component implementation.
125125
For referenced FMUs it *MUST* match the combination of variability and causality:
@@ -138,6 +138,9 @@ However, if it is connected, the semantics are same as for an `output`.
138138
For SignalDictionaryReferences, the kind of a given connector can additionally be inout, which indicates that the semantics of the connector are derived from the connections going to the connector.
139139
This can be used for example to allow a connector to function as both an input and output within the same SignalDictionaryReference.
140140

141+
Connectors of kind `unspecified` are used to define connectors for which the flow of information is either not yet specified, or is determined at runtime, for example for acausal connections of Modelica models.
142+
Such connectors can be connected to any other connector under the rules of the underlying modeling language.
143+
141144
|===
142145

143146
The following XML child elements are specified for the Connector element:
@@ -160,6 +163,29 @@ The dimensionality of the Connector is given by the presence of one or more Dime
160163

161164
The association of a connector to a clock is given by the presence of one or more Clock elements.
162165

166+
When Modelica models are represented in SSP, built-in input and output connectors shall be mapped as follows:
167+
168+
[width="100%",cols="25%,25%,50%",options="header",]
169+
|===
170+
|Modelica Type |SSP Type |SSP Kind
171+
|RealInput |ssc:Real |input
172+
|RealOutput |ssc:Real |output
173+
|IntegerInput |ssc:Integer |input
174+
|IntegerOutput |ssc:Integer |output
175+
|BooleanInput |ssc:Boolean |input
176+
|BooleanOutput |ssc:Boolean |output
177+
|StringInput |ssc:String |input
178+
|StringOutput |ssc:String |output
179+
|===
180+
181+
Modelica connectors of more advanced types are currently mapped in the following way:
182+
183+
* The connector type is ssc:Binary.
184+
* The media type is `text/x-modelica` and the `path` parameter of the media type designates the path of the Modelica connector.
185+
* Acausal Modelica connector types are mapped to connectors of kind unspecified.
186+
187+
_[ Note that the current opaque mapping of more advanced types to Binary connectors is a temporary solution, and a more detailed mapping may be provided in future versions of the standard supporting more complex data types. ]_
188+
163189
===== ConnectorGeometry
164190

165191
image:images/image28.png[image,width=307,height=149]
@@ -530,6 +556,10 @@ Note that source and destination in the following table indicate the resulting d
530556
Implementations *MUST NOT* specify connections that are not of one of the allowed combinations in the following table.
531557
Implementations *MUST* ensure that data flow is specified unambiguously, including ensuring that not multiple connections with inbound data flow enter into a connector signifying an input, inout, parameter, or structuralParameter connector of an element, or a local, constant, calculatedParameter, or output connector of an enclosing system.
532558

559+
For connectors of kind unspecified it is ultimately implementation-defined whether and how connections are allowed, as the exact semantics depend on the underlying modeling language.
560+
For the purposes of the following table, connectors of kind unspecified are treated as connectors of whatever kind is needed to make the connection allowed, i.e. they serve a wild-card role.
561+
The handling of conflicts that arise in transitive connections from conflicting wild-card assignments is implementation-defined.
562+
533563
It is implementation-defined whether connections between connectors of different types are allowed, and to what extent conversions are performed.
534564
This includes type conversions that can be performed without data loss, e.g. converting from an output of type `Float32` to an input of type `Float64` or `Real`, as well as conversions that can potentially lead to data loss, e.g. converting from an output of type `Float64` to an input of type `Float32` or `Int8`.
535565
It is also implementation-defined how and whether any error-handling at runtime is performed in those cases.
@@ -750,8 +780,10 @@ A component is an atomic element of a system (i.e. its internal structure is not
750780
|===
751781
|Attribute |Description
752782
|type |Optional attribute giving the MIME type of the component, which defaults to `application/x-fmu-sharedlibrary` to indicate the type of the component.
753-
Valid further types are `application/x-ssp-definition` for system structure description files, and `application/x-ssp-package` for system structure package files.
783+
Valid further types are `application/x-ssp-definition` for system structure description files, `application/x-ssp-package` for system structure package files, and `text/x-modelica` for Modelica models.
754784
No further types are currently defined.
785+
For type `text/x-modelica`, a media type parameter `path` specifies the full path of the Modelica class.
786+
{empty}[ _Example: `type="text/x-modelica; path=Modelica.Mechanics.Rotational.Interface.Flange_A"`._ ]
755787
|source a|
756788
Optional attribute indicating the source of the component as a URI (cf. RFC 3986).
757789
For purposes of the resolution of relative URIs the base URI is the URI of the SSD.
@@ -767,7 +799,7 @@ When the URI is a same-document URI with a fragment identifier, for example `#ot
767799
This mechanism can be used to instantiate an embedded system definition multiple times through reference to its definition element.
768800

769801
Note that implementations are only *REQUIRED* to support relative URIs as specified above, and that especially relative URIs that move beyond the baseURI (i.e. go up a level via `..`) are *not required* to be supported by implementations, and are in fact often not supported for security or other reasons.
770-
Implementations are also *not required* to support any absolute URIs and any specific URI schemes (but are of course allowed to support any and all kinds of URIs where this is considered useful).
802+
Implementations are also *not required* to support any absolute URIs and any specific URI schemes, but are of course allowed to support any and all kinds of URIs where this is considered useful.
771803

772804
If the source attribute is missing, this indicates that there is no provided source for the component, indicating a simulation architecture design without complete executable implementation.
773805
Implementations *CAN* take any specified type attribute into account when handling such components.

schema/SystemStructureDescription.xsd

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -707,12 +707,12 @@
707707
<xs:attribute name="kind" use="required">
708708
<xs:annotation>
709709
<xs:documentation xml:lang="en">
710-
This attribute specifies the kind of the given connector,
711-
which indicates whether the connector is an input, an output,
712-
both (inout), a local variable, a constant, a parameter, a
713-
calculated parameter (i.e. a parameter that is calculated by
714-
the component during initialization), or a structural parameter
715-
(i.e. a parameter that can be set during (re-)configuration mode).
710+
This attribute specifies the kind of the given connector, which
711+
indicates whether the connector is an input, an output, both
712+
(inout), unspecified, a local variable, a constant, a parameter,
713+
a calculated parameter (i.e. a parameter that is calculated by the
714+
component during initialization), or a structural parameter (i.e.
715+
a parameter that can be set during (re-)configuration mode).
716716

717717
For components this must match the related kind of the underlying
718718
component implementation. For referenced FMUs it must match the
@@ -732,12 +732,23 @@
732732
variable must be output and the variability must be parameter. For
733733
connectors of kind constant the causality of the FMI 1.0 variable
734734
must be output and the variability must be constant.
735+
736+
Connectors of kind `local` are used to define variables of the
737+
model element. Such a variable is not intended to be used for
738+
connections. However, if it is connected, the semantics are same as
739+
for an `output`.
735740

736741
For SignalDictionaryReferences, the kind of a given connector can
737742
additionally be 'inout', which indicates that the semantics of the
738743
connector are derived from the connections going to the connector.
739744
This can be used for example to allow a connector to function as
740745
both an input and output within the same SignalDictionaryReference.
746+
747+
Connectors of kind `unspecified` are used to define connectors for
748+
which the flow of information is either not yet specified, or is
749+
determined at runtime, for example for acausal connections of
750+
Modelica models. Such connectors can be connected to any other
751+
connector under the rules of the underlying modeling language.
741752
</xs:documentation>
742753
</xs:annotation>
743754
<xs:simpleType>
@@ -750,6 +761,7 @@
750761
<xs:enumeration value="constant"/>
751762
<xs:enumeration value="local"/>
752763
<xs:enumeration value="inout"/>
764+
<xs:enumeration value="unspecified"/>
753765
</xs:restriction>
754766
</xs:simpleType>
755767
</xs:attribute>

schema/SystemStructureDescription11.xsd

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -704,12 +704,12 @@
704704
<xs:attribute name="kind" use="required">
705705
<xs:annotation>
706706
<xs:documentation xml:lang="en">
707-
This attribute specifies the kind of the given connector,
708-
which indicates whether the connector is an input, an output,
709-
both (inout), a local variable, a constant, a parameter, a
710-
calculated parameter (i.e. a parameter that is calculated by
711-
the component during initialization), or a structural parameter
712-
(i.e. a parameter that can be set during (re-)configuration mode).
707+
This attribute specifies the kind of the given connector, which
708+
indicates whether the connector is an input, an output, both
709+
(inout), unspecified, a local variable, a constant, a parameter,
710+
a calculated parameter (i.e. a parameter that is calculated by the
711+
component during initialization), or a structural parameter (i.e.
712+
a parameter that can be set during (re-)configuration mode).
713713

714714
For components this must match the related kind of the underlying
715715
component implementation. For referenced FMUs it must match the
@@ -729,12 +729,23 @@
729729
variable must be output and the variability must be parameter. For
730730
connectors of kind constant the causality of the FMI 1.0 variable
731731
must be output and the variability must be constant.
732+
733+
Connectors of kind `local` are used to define variables of the
734+
model element. Such a variable is not intended to be used for
735+
connections. However, if it is connected, the semantics are same as
736+
for an `output`.
732737

733738
For SignalDictionaryReferences, the kind of a given connector can
734739
additionally be 'inout', which indicates that the semantics of the
735740
connector are derived from the connections going to the connector.
736741
This can be used for example to allow a connector to function as
737742
both an input and output within the same SignalDictionaryReference.
743+
744+
Connectors of kind `unspecified` are used to define connectors for
745+
which the flow of information is either not yet specified, or is
746+
determined at runtime, for example for acausal connections of
747+
Modelica models. Such connectors can be connected to any other
748+
connector under the rules of the underlying modeling language.
738749
</xs:documentation>
739750
</xs:annotation>
740751
<xs:simpleType>
@@ -747,6 +758,7 @@
747758
<xs:enumeration value="constant"/>
748759
<xs:enumeration value="local"/>
749760
<xs:enumeration value="inout"/>
761+
<xs:enumeration value="unspecified"/>
750762
</xs:restriction>
751763
</xs:simpleType>
752764
</xs:attribute>

0 commit comments

Comments
 (0)