#ifndef _PIN_ROLE_HPP_ #define _PIN_ROLE_HPP_ #include "pin_spec.hpp" #include #include class Part; // For a given connector type and pin position, return the expected PinSpec // (function/direction/pad + source). Used at `set-connector-type` to populate // each pin's `spec`, then later by `verify` to flag mismatches between the // connector's expectation and the actual signal's inferred/declared type. // // Returns a default PinSpec (function Unknown, source None) for unknown // connector types or unmatched pins — i.e. "no expectation, no constraint". PinSpec pin_role(const std::string &connector_type, const std::string &pin_name); // Canonical full pin-name list for the connector type (e.g. for VPX 3U, // every (col, row) position the connector physically has). Returns an empty // vector for connector types that don't have a registered layout — callers // must treat that as "unknown, do not auto-fill". // // Used at `set-connector-type` to materialise NC pins for positions absent from the // imported netlist (Altium drops NC, Mentor doesn't). Stub today: every // known kind returns {} — populate alongside `vpx_3u_role`. std::vector pin_layout(const std::string &connector_type); // For each canonical pin in `pin_layout(kind)` not already present on `p`, // add a NC pin using the canonical name. Returns the number created. // No-op when the layout is empty (unknown kind). int FillPartFromLayout(Part *p, const std::string &connector_type); #endif // _PIN_ROLE_HPP_