P3.2: source precedence + model-vs-netlist conflict check
Rank the spec sources (spec_source_rank: UserOverride > Bsdl > ConnectorModel > Inferred > Imported); apply_model now refuses to overwrite a spec owned by a higher-rank source, so one model never clobbers a more authoritative one. New check_source_conflicts(System*) emits SourceConflict for a pin the BSDL declares power/ground (a must-connect rail) that the netlist leaves unconnected — a rail floated in the schematic; surfaced as a sixth `verify` pass. Unit tests (75 cases) green; the real 8-card system reports 0 conflicts (its rails are all connected) while the JTAG findings remain. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -51,4 +51,21 @@ inline PinFunction function_from_signal_type(SignalType t)
|
||||
}
|
||||
}
|
||||
|
||||
// Precedence of spec sources: a higher rank wins when two sources speak for the
|
||||
// same pin. A user override beats any model; a device model (BSDL) beats a
|
||||
// connector layout; both beat plain import / inference. Used by apply_model to
|
||||
// avoid clobbering a more authoritative spec.
|
||||
inline int spec_source_rank(SpecSource s)
|
||||
{
|
||||
switch (s) {
|
||||
case SpecSource::None: return 0;
|
||||
case SpecSource::Imported: return 1;
|
||||
case SpecSource::Inferred: return 2;
|
||||
case SpecSource::ConnectorModel: return 3;
|
||||
case SpecSource::Bsdl: return 4;
|
||||
case SpecSource::UserOverride: return 5;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif // _PIN_SPEC_HPP_
|
||||
|
||||
Reference in New Issue
Block a user