Sinelabore Homepage

Diagnostics#

When the code generator cannot make sense of a model it reports a message with a stable code. The codes are grouped by what went wrong, so the first digits already tell you where to look:

Range Area
E1001, E2008, M10xx State machine structure — reused from the UML backends
E30xx Type references — a name that should denote a type
E31xx, E32xx Features and usages — attributes, ports, actions, flow nodes, signals, units
W31xx, W32xx Warnings — the model is accepted, but probably not what you meant

E… prevents usable code from being produced. W… and M… let generation continue.

Type references#

Code Message Typical cause
E3001 unresolved type ‘X’ Typo, missing import, or the type lives in another file that is not reachable from the primary one
E3002 ambiguous type ‘X’ Two wildcard imports bring in the same name — qualify it (Pkg::X)
E3003 type ‘X’ has wrong kind e.g. an item definition used where a port definition is required
E3004 type ‘X’ is not visible The type exists but is private in the package that owns it

Features and usages#

Code Message Typical cause
E3101 unresolved feature ‘X’ The attribute, port or part named here does not exist on the part or any of its base parts
E3103 feature ‘X’ has wrong kind e.g. an attribute used where a port is expected
E3105 cannot connect … / incompatible connection types A connect joins two in ports, two out ports, or ports of different types
E3107 action usage ‘X’ has no definition entry X; or do action X; names an action that is not declared on the part or its base parts
E3109 action usage ‘X’ binds n parameters but the definition declares m The call site passes the wrong number of parameters, or an in/out direction does not match
E3111 cannot resolve performer chain ‘X’ A segment of a.b.setOn does not exist — or the chain ends on a collection, which cannot be performed on. Perform on a named member instead
E3113 flow node ‘X’ is used as K1 but was already declared as K2 The same name appears twice in one action flow with different meanings
E3119 cannot resolve port ‘X’ used in a send action The port is not declared on the part or any of its base parts
E3231 port ‘X’ of part ‘P’ is already delegated to ‘a.b’ A bind or connect between a boundary port and a port inside it stands for is refused because the boundary port already stands for another port. A delegation makes its two ends one feature, so it needs exactly one port inside. See Ports
E3245 port ‘X’ of part ‘P’ and ‘a.b’ are delegated to each other but face opposite ways One of the two receives what the other sends. A delegated port carries the direction of the port it stands for — give both the same direction
E3246 port ‘X’ of part ‘P’ is typed by ‘T’ and ‘a.b’ by ‘U’ A delegation makes the two ports one feature, which needs one port type
E3248 ’event_’ / ’eventQueue_’ is reserved for the events the state machine of ‘P’ processes A machine that accepts signals keeps the current event and its queue under these names. Rename the model’s feature
E3249 ‘accept E::lit’ names an enumeration literal, not a type A trigger accepts an occurrence of a type. Declare the event as one (attribute def lit;) and write accept lit, or test the value in a guard (if msg == E::lit). See States

Units and durations#

Code Message Typical cause
E3250 ‘accept after 500 [ms]’: ‘ms’ is not declared SI declares no prefixed second. Declare the unit in the model once — the message shows the declaration to write. See States
E3251 ‘x’ is not a DurationValue, which is what a time trigger waits for An accept after names a number or a feature without a duration unit. Give it one, as in x [s]
E3254 ‘xs[2]’: a bracket after a value is its measurement reference In SysML a bracket after a value names its unit. To index a collection write xs#(2)

Warnings#

Code Message What to do
W3115 ‘x’ adds values with different units Units are normalized but never converted. Either write both operands in the same unit, or ignore the warning if the mix is intended. Only + and - are checked — U*I is ordinary physics and stays quiet. See Attributes
W3210 ‘a := b’ assigns Real to Integer, which discards the fraction The model binds a real value to an integer feature. Declare the attribute Real, or round explicitly. Reported against the model rather than left to a C++ compiler, which mentions it only on some toolchains
W3171 calc ‘X’ ends in an expression but declares no result The result type is not inferred: write return : <type>; beside the expression. See Calculations
W3173 calc ‘X’ states its result twice The calculation gives both a return … = value and a trailing expression. The declared value is the one generated; drop the other
W3117 ‘x’ declares a new empty action You wrote entry action x; where an action x already exists. That declares a second, empty one. To perform the existing action write entry x; or entry references x;. See States
W3214 ‘send … via p’ in ‘P’ goes against the port’s direction The item’s feature is in (or out) in the port definition, possibly turned round by a conjugated port (~), so the port receives what the model sends through it, or sends what it accepts. A send needs the feature out at that port, an accept needs it in
W3212 ‘accept x : T’ cannot bind ‘x’ The machine has an event enum of its own and receives only the event’s value, not the item’s data. The transition still fires; accept through a port (via) to read the item
W3213 port ‘p’ is read by the state machine of ‘P’ and by action ‘a’ Each arriving element reaches only one of the two. Read the port in one place
W3172 the sequence ’(…)’ of ‘xs’ is parsed and not generated A collection is filled from the members it declares; write ( ) for an empty one
W3303 n line(s) could not be routed around the boxes and were drawn straight through them Only from -l svg. The drawing is still written, but those lines cross whatever lies between their ends instead of going around it, which reads as a mistake in the model rather than in the picture. Usually a sign that the boxes leave too little room - drawing with fewer compartments (-pc) or less depth (-pcd) gives the router space

State machine structure#

These come from the shared state machine backend and also appear for UML models.

Code Meaning
E1001 A default state is missing. With an init state leading into a choice, the else path is usually the one that is absent
E2008 A transition starts in a state that is not known in this machine — check for a typo in the source state, or a transition that starts in a history state
M1024 / M1032 A state is not reachable — no transition leads to it
M1054 A state has no outgoing transition, which usually indicates a dead end

Reading the location#

Messages carry the source position where available:

tl.sysml:212:9: W3117: 'setYellow' declares a new empty action.
                To perform an existing one write 'setYellow;' or 'references setYellow'.

Run the generator with -d to get the symbol table dump alongside the diagnostics; it shows how each name was classified (def, usage, use+def, connect) and which references were bound. That is usually the fastest way to see why a name did not resolve.

Cross-checking with a SysML editor#

The generator accepts a few constructs that stricter tools reject, and it cannot detect every modelling error. If a model generates cleanly but a SysML editor complains, the editor is usually right. See Tooling for the editors and graphical environments that validate a model against the language itself.