/** * Net validation — schema types and naming convention definitions. * * Defines the input contract for net validation functions and the * convention sets used to classify net names into analog, digital, * power, ground, and high-voltage domains. * * @module */ /** * Electrical domain inferred from a net name. * * Used by naming-convention rules to detect misclassifications * (e.g. an analog signal connected to a digital rail). */ export declare enum NetDomain { /** General-purpose analogue signal (e.g. "SENSE", "FB", "VREF"). */ Analog = "analog", /** Digital signal, bus, or protocol (e.g. "I2C_SCL", "UART_TXD"). */ Digital = "digital", /** Power rail or voltage supply (e.g. "3V3", "VIN", "VCC"). */ Power = "power", /** Ground or return (e.g. "GND", "AGND", "DGND", "PGND"). */ Ground = "ground", /** AC mains or high-voltage domain (e.g. "L", "N", "HV_BULK"). */ HighVoltage = "high-voltage", /** Clock or timing signal (e.g. "CLK_32K", "MCO"). */ Clock = "clock", /** Reset or control signal (e.g. "nRST", "EN", "PWR_ON"). */ Control = "control", /** Unclassified or custom. */ Other = "other" } /** * Naming convention pattern sets used to classify a net name into a domain. * * Each entry is a list of **case-insensitive** substrings / regex patterns * that, when matched against a net name, assign it to the corresponding * {@link NetDomain}. */ export declare const NET_DOMAIN_PATTERNS: Record, RegExp[]>; /** * Net names that are reserved for specific purposes and should not be * reassigned to other signal types. */ export declare const RESERVED_NET_NAMES: Set; /** * Minimum set of power nets that a complete design should contain * (case-insensitive matching). */ export declare const REQUIRED_POWER_NETS: Set; /** * Minimum set of ground nets that a complete design should contain. */ export declare const REQUIRED_GROUND_NETS: Set; /** * Map from NetType to expected naming convention domain. * A net with a given NetType should have a name matching the * corresponding domain(s). */ export declare const NET_TYPE_EXPECTED_DOMAIN: Record; /** * A minimal net representation for validation purposes. * * This is intentionally decoupled from the full CircuitIR NetSchema * so that validation can operate on net data from any source * (CircuitIR, EasyEDA bridge, hand-authored test data). */ export type PinElectricalType = 'input' | 'output' | 'bidirectional' | 'passive' | 'power_input' | 'power_output' | 'power_source' | 'open_drain' | 'tri_state' | 'no_connect'; /** How a pin should be interpreted by semantic ERC. */ export interface PinValidationMetadata { /** Pin number or name as it appears in net nodes. */ pin: string; /** Human-readable pin name, e.g. VDD, GND, EN, OUT. */ name?: string; /** Electrical type used for compatibility checks. */ electricalType: PinElectricalType; /** Whether this pin must be connected for the device to be valid. */ required?: boolean; /** Expected net classification for required power/ground/signal pins. */ expectedNetType?: 'power' | 'signal' | 'ground'; /** Expected nominal voltage for voltage-domain checks. */ expectedVoltage?: number; /** Whether this pin intentionally allows no-connect. */ noConnectAllowed?: boolean; } /** A connected device pin, optionally carrying semantic pin metadata. */ export interface NetValidationNode { deviceRef: string; pin: string; /** Optional per-node electrical type; device pin metadata takes precedence when both exist. */ electricalType?: PinElectricalType; /** Optional human-readable pin name. */ pinName?: string; /** Optional expected nominal voltage for this pin. */ expectedVoltage?: number; } export interface NetValidationEntry { /** Unique net identifier. */ id: string; /** Human-readable net name (e.g. "3V3", "I2C_SCL", "GND"). */ name: string; /** Net type classification. */ type: 'power' | 'signal' | 'ground'; /** Optional nominal voltage for voltage-domain checks. */ voltage?: number; /** Connected device pins, may be empty for floating nets. */ nodes: NetValidationNode[]; } /** * A minimal device representation for validation. */ export interface DeviceValidationEntry { /** Device identifier (matches deviceRef in net nodes). */ id: string; /** Reference designator (e.g. "U1", "R3"). */ ref: string; /** Functional category for determining required pins. */ category?: string; /** Semantic pin metadata used by ERC rules. */ pins?: PinValidationMetadata[]; /** Require at least one local capacitor between each power input rail and ground. */ requiresDecoupling?: boolean; } /** * A hierarchical port / interface for cross-sheet validation. */ export interface InterfaceValidationEntry { /** Interface identifier. */ id: string; /** Interface / port name. */ name: string; /** Pins on this interface. */ pinout: Array<{ pin: string; signal: string; type?: string; }>; } /** * Complete input to the net validation function. */ export interface NetValidationInput { /** Nets to validate. */ nets: NetValidationEntry[]; /** Optional device list for unconnected-pin checks. */ devices?: DeviceValidationEntry[]; /** Optional interface list for cross-sheet checks. */ interfaces?: InterfaceValidationEntry[]; }