Building block view¶
arc42 §5 — the building blocks that realise EtherCAT network-config cod... (FEAT_0080), showing
the codegen data flow from network.yaml through the parse and codegen
layers to the generated &'static tables consumed at runtime.
Structural overview¶
The toolchain is four layers that depend only leftwards. An integrator
authors network.yaml; the build-script glue (ethercat-netcfg SM-watchdog... (BB_0096) is the
SM-watchdog slice) drives the parse and codegen layers into OUT_DIR;
the consumer crate pulls in the emitted module via include!.
graph LR
yaml["network.yaml<br/>(integrator-authored)"]
esi["ESI files<br/>(vendored, pinned)"]
parser["ethercat-netcfg<br/>(parse layer)<br/>depends on ethercat-esi<br/>+ fieldbus-od-core"]
ir["NetworkConfig IR<br/>(typed, in-memory)"]
codegen["ethercat-netcfg-codegen<br/>(codegen layer)<br/>IR → TokenStream<br/>prettyplease formatting"]
build["ethercat-netcfg-build<br/>(build-script glue)<br/>invoked from build.rs<br/>writes to OUT_DIR"]
cli["ethercat-netcfg-cli<br/>(netcfg expand / fetch)<br/>vendor-and-pin action"]
out["OUT_DIR/network.rs<br/>pub static PDO_MAP<br/>EthercatRouting consts<br/>bring-up assertions"]
consumer["consumer crate<br/>include!(…/network.rs)"]
yaml --> parser
esi --> parser
parser --> ir
ir --> codegen
codegen --> build
build --> out
out --> consumer
yaml -.->|"netcfg fetch"| cli
cli -.->|"vendors + pins"| esi
5. Building blocks¶
The SM-watchdog resolution and validation building block is the only arc42 building block named in this v1 slice; the broader parse / codegen pipeline is described by the capability-cluster features (Network-config parser and IR (FEAT_0081) – Validation and bring-up ass... (FEAT_0085)) and their decisions.
The parse-layer code that, at |