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 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 EthernetMultidropConnection {
        type: Literal['ethernet_multidrop'] = 'ethernet_multidrop'
        id: str
        plca: PLCACycle | None = None
        nodes: list[EthernetMultidropNode]
    }

    class FLYNCBaseModel {
    }

    class EthernetTopology {
        connections: list[EthernetPointToPointConnection | EthernetMultidropConnection]
    }

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

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

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

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

    class BASET1S {
        mode: Literal['base_t1s'] = 'base_t1s'
        speed: Literal[10] = 10
        duplex: Literal['half', 'full'] = 'half'
        topology: Literal['p2p', 'multidrop'] = 'p2p'
        autonegotiation: bool = False
    }

    ECUPort ..> RMII
    ECUPort ..> XFI
    ECUPort ..> MII
    ECUPort ..> BASET
    ECUPort ..> RGMII
    ECUPort ..> BASET1S
    ECUPort ..> SGMII
    ECUPort ..> BASET1
    CANBusTopology ..> BusAttachmentPoint
    LINBusTopology ..> BusAttachmentPoint
    EthernetMultidropConnection ..> PLCACycle
    EthernetMultidropConnection ..> EthernetMultidropNode
    EthernetTopology ..> EthernetMultidropConnection
    EthernetTopology ..> EthernetPointToPointConnection
    FLYNCTopology ..> LINBusTopology
    FLYNCTopology ..> EthernetTopology
    FLYNCTopology ..> CANBusTopology


    
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
  - type: ethernet_multidrop
    id: RearLampSegment
    plca:
      transmit_opportunity_count: 4
      to_timer: 32
    nodes:
      - ecu_port: z1_p2
        node_id: 0
      - ecu_port: rear_lamp_left_p1
        node_id: 1
      - ecu_port: rear_lamp_center_p1
        node_id: 2
      - ecu_port: rear_lamp_right_p1
        node_id: 3

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 EthernetPointToPointConnection or EthernetMultidropConnection

The links between ECU ports, discriminated by type: ecu_port_to_ecu_port wires two ports, ethernet_multidrop wires N ports onto one shared medium.

Private Attributes

_flync_modelFLYNCModel

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

ExternalConnection

Former name of EthernetPointToPointConnection.

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 bus or segment, 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, LIN or Ethernet multidrop interface attached to the bus.

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

Role the interface plays on the bus.

Ethernet Multidrop

A point-to-point connection wires two ports. An ethernet_multidrop connection wires N onto one shared medium, so it also carries the PLCA cycle those ports have to agree on: plca.transmit_opportunity_count (how many slots one cycle has), plca.to_timer (how long a slot whose owner has nothing to send stays open, in bit times of 100 ns, default 32), and each node’s node_id (which slot that port owns).

A node without a node_id takes no part in PLCA and competes for the medium instead. Node id 0 makes a node the coordinator, which opens each cycle; there is exactly one. Leaving the plca block off altogether makes the segment a plain CSMA/CD medium.

What stays on each port is what nodes may legitimately differ in: the PHY itself, and burst_count and burst_timer per node. The connection stores no PHY type, so a segment mixing PHY variants needs no model change.

Expand for Schematic
        classDiagram

    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 ECUPort {
        name: str
        mdi_config: BASET1 | BASET1S | BASET = BASET1
        mii_config: MII | RMII | SGMII | RGMII | XFI | None = None
    }

    class PLCACycle {
        transmit_opportunity_count: int
        to_timer: int = 32
    }

    class EthernetMultidropConnection {
        type: Literal['ethernet_multidrop'] = 'ethernet_multidrop'
        id: str
        plca: PLCACycle | None = None
        nodes: list[EthernetMultidropNode]
    }

    class EthernetMultidropNode {
        ecu_port_name: str
        node_id: int | None = None
        burst_count: int = 0
        burst_timer: int = 128
    }

    class BASET1S {
        mode: Literal['base_t1s'] = 'base_t1s'
        speed: Literal[10] = 10
        duplex: Literal['half', 'full'] = 'half'
        topology: Literal['p2p', 'multidrop'] = 'p2p'
        autonegotiation: bool = False
    }

    class FLYNCBaseModel {
    }

    ECUPort ..> RMII
    ECUPort ..> XFI
    ECUPort ..> MII
    ECUPort ..> BASET
    ECUPort ..> RGMII
    ECUPort ..> BASET1S
    ECUPort ..> SGMII
    ECUPort ..> BASET1
    EthernetMultidropConnection ..> PLCACycle
    EthernetMultidropConnection ..> EthernetMultidropNode


    
Expand for a YAML example - 📄 topology/ethernet_topology.flync.yaml
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
  - type: ethernet_multidrop
    id: RearLampSegment
    plca:
      transmit_opportunity_count: 4
      to_timer: 32
    nodes:
      - ecu_port: z1_p2
        node_id: 0
      - ecu_port: rear_lamp_left_p1
        node_id: 1
      - ecu_port: rear_lamp_center_p1
        node_id: 2
      - ecu_port: rear_lamp_right_p1
        node_id: 3

Each rule reports a FLYNC-TOP-... identifier that the error catalog explains in full, with its severity and message.

class EthernetMultidropConnection

Bases: FLYNCBaseModel

Connects N ECU ports on one shared medium.

Parameters

typeLiteral[“ethernet_multidrop”]

The type of the connection. Defaults to "ethernet_multidrop".

idstr

Unique identifier of the connection, and the name the segment is known by.

plcaPLCACycle, optional

The cycle shared by the nodes below. Leaving it off makes the segment a plain CSMA/CD medium, and no node may then claim a slot.

nodeslist of EthernetMultidropNode

The ports sharing this medium.

class EthernetMultidropNode

Bases: FLYNCBaseModel

One ECU port on a multidrop segment and the slot of the cycle it transmits in.

Parameters

ecu_port_namestr

Name of the ECU port on the segment (alias: ecu_port).

node_idint, optional

Its slot in the PLCA cycle, counted from 0. Slot 0 makes it the coordinator. Leave it off to opt the node out of PLCA: it then competes for the medium by CSMA/CD.

burst_countint, optional

How many extra frames this node may send back-to-back inside its own slot. Defaults to 0, one frame per slot.

burst_timerint, optional

How long the node may keep the medium between those frames, in bit times. Defaults to 128. Has to stay above the 96 bit interframe gap, or the burst ends before the next frame starts.

class PLCACycle

Bases: FLYNCBaseModel

The PLCA parameters for a segment.

Parameters

transmit_opportunity_countint

How many slots one cycle has, 1 to 255. May exceed the slots handed out: a spare one costs to_timer bit times per cycle and leaves room for a node added later.

to_timerint, optional

How long an unused slot stays open, in bit times of 100 ns. Defaults to 32.

TSN on a shared medium is narrowed. gPTP works under two constraints (rejects cmlds_linkport_enabled and two_step: false; errors 263, 264), several time transmitters must sit in different domains (warning 265), and an egress shaper loses its latency bound to the cycle (warning 259). Each rule’s severity and message live in the error catalog.