Skip to content

Check Topology Definitions

bocchino edited this page Mar 17, 2021 · 26 revisions

This algorithm traverses the source model and checks topology definitions.

Input

  1. A list tul of translation units.

  2. An analysis data structure a representing the results of analysis so far.

Output

An updated analysis a' with the topology map filled in if the check passes; otherwise an error.

Procedure

Visit each translation unit in tul with input a, yielding either a' or an error.

AST Visitor Methods

Each method accepts an analysis data structure a as input and yields either an updated analysis data structure a' or an error as output.

Translation Units

For each translation unit tu, visit each definition appearing in tu.

Component Definitions

For each topology definition d that has not yet been resolved:

  1. Visit each member m of d with input a, building up a topology data structure t. Check each member for semantic validity as much as possible. For example, ensure that the types of the port connections match.

  2. Resolve t to a partially numbered topology consisting of (a) a list of instances and (b) a mapping between connection graph names and lists of connections. The connection end points have port numbers if and only if those numbers are present in the model source.

    1. Visit all topologies imported into t, ensuring that they are resolved.

    2. Determine the set of all instances in t, consisting of (a) all instances specified in t and (b) public instances specified in topologies imported into t.

    3. Resolve pattern specifiers in t to direct specifiers.

    4. For each connection graph name g appearing in t or in an imported topology, determine the set of all connections in g, with multiplicity (two or more connections between the same pairs of unnumbered ports are allowed).

      1. Include all connections directly specified in t, after resolving patterns. Check that all connections are between instances present in t. If not, throw an error.

      2. Include all connections from imported topologies that go between instances present in t.

      3. Check that no pair of connections connects to the same output port at the same port number.

  3. Apply automatic numbering to t. This step fills in missing port numbers, preserving any numbers specified in the model source.

    1. General numbering

    2. Matched numbering

  4. Check for unused ports in t that are not in the unused port list.

  5. Construct the unique topology symbol s for d.

  6. Map s to t in the component map of a.

  7. Return a as the result.

Clone this wiki locally