flync_4_topology

class FLYNCTopology

Bases: FLYNCBaseModel

Represents the complete FLYNC system topology, including ECU connections and multicast routing configuration.

Parameters

ethernet_topologyEthernetTopology, optional

The system-wide ethernet topology between external ports of ECUs. Optional: a workspace with no ECU-to-ECU Ethernet wiring (or none yet authored) does not need one, but system-wide Ethernet features (e.g. multicast across multiple Ethernet ECUs) require it.

can_bus_topologylist of CANBusTopology

System-wide CAN bus attachment topology. Runtime-derived from CAN bus definitions and ECU CAN interfaces; never authored in YAML.

lin_bus_topologylist of LINBusTopology

System-wide LIN bus attachment topology. Runtime-derived from LIN bus definitions and ECU LIN interfaces; never authored in YAML.

Ethernet Topology

Expand for Schematic
        classDiagram

    class CANBusTopology {
        bus_name: str
        bus_type: Literal['can'] = 'can'
        attachments: list[BusAttachmentPoint] = list
    }

    class EthernetTopology {
        connections: list[ExternalConnection]
    }

    class ExternalConnection {
        type: Literal['ecu_port_to_ecu_port'] = 'ecu_port_to_ecu_port'
        id: str
        ecu1_port_name: str
        ecu2_port_name: str
    }

    class Category {
        <<Enumeration>>
        VALUE_RANGE: int = 1
        REQUIRED: int = 2
        CONSISTENCY: int = 3
        UNIQUENESS: int = 4
        REFERENCE: int = 5
        FORMAT: int = 6
        COMPATIBILITY: int = 7
        STRUCTURAL: int = 8
        LIFECYCLE: int = 9
    }

    class OutputStrategy {
        <<Enumeration>>
        AUTO: int = 1
        FOLDER: int = 1
        SINGLE_FILE: int = 2
        OMMIT_ROOT: int = 4
        FIXED_ROOT: int = 8
    }

    class FLYNCTopology {
        ethernet_topology: EthernetTopology | None = None
        can_bus_topology: list[CANBusTopology] = list
        lin_bus_topology: list[LINBusTopology] = list
    }

    class LINBusTopology {
        bus_name: str
        bus_type: Literal['lin'] = 'lin'
        attachments: list[BusAttachmentPoint] = list
    }

    class FLYNCBaseModel {
    }

    class ECUPort {
        name: str
        mdi_config: BASET1 | BASET1S | BASET = BASET1
        mii_config: MII | RMII | SGMII | RGMII | XFI | None = None
    }

    ECUPort ..> SGMII
    ECUPort ..> MII
    ECUPort ..> XFI
    ECUPort ..> BASET1S
    ECUPort ..> RMII
    ECUPort ..> BASET
    ECUPort ..> RGMII
    ECUPort ..> BASET1
    CANBusTopology ..> BusAttachmentPoint
    LINBusTopology ..> BusAttachmentPoint
    EthernetTopology ..> ExternalConnection
    FLYNCTopology ..> CANBusTopology
    FLYNCTopology ..> LINBusTopology
    FLYNCTopology ..> EthernetTopology


    
Expand for a YAML example - 📄 ethernet_topology.flync.yaml

Note

In ethernet_topology the external connections between ECUs of the system are described (if more than one ECU is specified).

connections:
  - type: ecu_port_to_ecu_port
    id: conn1
    ecu1_port: hpc1_p1
    ecu2_port: z1_p1
  - type: ecu_port_to_ecu_port
    id: conn2
    ecu1_port: hpc1_p2
    ecu2_port: z2_p1
  - type: ecu_port_to_ecu_port
    id: conn3
    ecu1_port: hpc1_p3
    ecu2_port: eth_ecu_p1
  - type: ecu_port_to_ecu_port
    id: conn4
    ecu1_port: hpc1_p5
    ecu2_port: zgw_p1

Hint

All the connections listed in a ethernet topology shall be of the type : ecu_port_to_ecu_port.

class EthernetTopology

Bases: FLYNCBaseModel

Represents the system-wide ethernet topology consisting of external connections between ECUs.

Parameters

connectionslist of ExternalConnection

A list of ExternalConnection instances that define the links between ECU ports.

Private Attributes

_flync_modelFLYNCModel

Internal reference to the FLYNC model that owns this topology. Managed internally and not part of the public API.

class ExternalConnection

Bases: FLYNCBaseModel

Represents a connection between two ECU (Electronic Control Unit) ports.

This model captures a directed or undirected link between two named ports on separate ECUs.

Parameters

typeLiteral[“ecu_port_to_ecu_port”]

The type of the connection. Defaults to “ecu_port_to_ecu_port” for schema identification.

idstr

A unique identifier for the external connection.

ecu1_port_namestr

The name of the first ECU port (alias: “ecu1_port”).

ecu2_port_namestr

The name of the second ECU port (alias: “ecu2_port”).

Private Attributes

_ecu1_portECUPort

Runtime reference to the first ECUPort object.

_ecu2_portECUPort

Runtime reference to the second ECUPort object.

CAN and LIN Bus Topology

Note

Unlike the Ethernet topology, the CAN and LIN bus topology is never authored in YAML. There is no bus-topology file. It is recomputed on every model load from the bus_ref declared on each controller’s CAN and LIN interfaces (see flync_4_ecu), and every CAN/LIN bus declared under communication.channels.

The derived topology gives a system-wide view of which ECU interfaces attach to which bus. It is exposed on the model via get_can_bus_topology() and get_lin_bus_topology(), and stored on the can_bus_topology / lin_bus_topology fields of FLYNCTopology.

Hint

The derivation runs the following consistency checks:

  • Unknown bus (major): a CAN/LIN interface references a bus_ref that is not declared under communication.channels.

  • LIN master cardinality (major): a LIN bus must have exactly one master interface.

  • LIN master missing (warning): a LIN bus has slave interfaces but no master.

  • Unused bus (warning): a bus is declared but no interface attaches to it.

  • Single node (warning): only one interface attaches to a bus.

class BusTopology

Bases: FLYNCBaseModel

Runtime-derived attachment topology of a single CAN or LIN bus.

Parameters

bus_namestr

Name of the CAN or LIN bus, matching bus_ref on the attached interfaces.

bus_typeLiteral[“can”, “lin”]

Kind of bus.

attachmentslist of BusAttachmentPoint

ECU interfaces attached to this bus.

class CANBusTopology

Bases: BusTopology

Runtime-derived attachment topology of a single CAN bus.

class LINBusTopology

Bases: BusTopology

Runtime-derived attachment topology of a single LIN bus.

class BusAttachmentPoint

Bases: FLYNCBaseModel

A single ECU controller interface attached to a CAN or LIN bus.

Parameters

ecu_namestr

Name of the ECU that owns the attached interface.

controller_namestr

Name of the controller that owns the attached interface.

interface_namestr

Name of the CAN or LIN interface attached to the bus.

roleLiteral[“can_node”, “lin_master”, “lin_slave”]

Role the interface plays on the bus.