34 const CLAIM& claim = *aSummary.best;
36 if( claim.priority ==
PRIORITY::PIN && ( !aSummary.pinWitnesses[1] || aSummary.noConnect ) )
39 return claim.fullName;
48 for(
const auto& [node, version] : aPartition.
identity )
52 std::optional<SLOT_KEY> sourceSlot;
54 if( std::holds_alternative<NAME_KEY>( key ) && version == 0 )
57 if(
const auto* record = std::get_if<RECORD_NODE>( &key ) )
59 const auto* entry = aRecords.
Find( record->record );
61 if( record->kind !=
KIND::SIGNAL || !entry || entry->version != version
63 throw std::invalid_argument(
"Signal partition does not match current records" );
65 source =
MakeSummary( record->record, entry->value );
67 for(
const KIID& item : entry->value.items )
68 result.items.push_back( { item, record->record.inst } );
70 else if(
const auto* slot = std::get_if<SLOT_KEY>( &key ) )
72 const auto* entry = aSlots.
Find( *slot );
74 if( !entry || entry->version != version || entry->value.key != *slot )
75 throw std::invalid_argument(
"Signal partition does not match current slots" );
77 source.
best = entry->value.claim;
78 source.
netclasses = entry->value.parentNetclasses;
80 result.slots.push_back( *slot );
84 throw std::invalid_argument(
"Signal partition contains an invalid name version" );
90 result.nameSlot = sourceSlot;
91 else if( sourceSlot && source.
best == joined.
best
93 result.nameSlot = sourceSlot;
95 result.summary = std::move( joined );
100 std::ranges::sort(
result.items, less );
101 std::ranges::sort(
result.slots, less );
const ENTRY * Find(const KEY &aKey) const
Entry references survive unchanged writes, but not replacement or erasure of their key.
CACHE_TABLE< RECORD_KEY, ISLAND_RECORD, KEY_LESS > RECORD_CACHE
Session IDs are dense handles, never a canonical ordering.
const NODE_KEY & Node(NODE_ID aId) const
bool Less(const ITEM_KEY &aLeft, const ITEM_KEY &aRight) const
CACHE_TABLE< SLOT_KEY, SLOT_INPUT, KEY_LESS > SLOT_CACHE
Value keys and the key session of the schematic connectivity engine.
std::variant< RECORD_NODE, NAME_KEY, SLOT_KEY > NODE_KEY
Any node of the union-find graph.
uint32_t NAME_ID
Session handle of a name, ordered by UTF-8 value through NAME_LESS.
SUMMARY MakeSummary(const RECORD_KEY &aKey, const ISLAND_RECORD &aRecord)
Consumes a canonical BuildIslandRecord() result.
constexpr uint32_t INVALID_ID
Marks an unset handle.
@ PIN
Symbol pin that is not a power input. The name is "Net-(...)".
SIGNAL_RESULT DeriveSignal(const PARTITION &aPartition, const RECORD_STORE::RECORD_CACHE &aRecords, const SLOT_STORE::SLOT_CACHE &aSlots, const SESSION_KEYS &aKeys)
Fold current signal inputs and retain canonical membership for publication and succession.
The claim of one item for the name of its island.
NAME_ID ncName
Name of an unconnected pin net.
Orders keys by value through SESSION_KEYS::Less().
Exact identity of one connected component.
std::vector< std::pair< NODE_ID, uint64_t > > identity
Derived state of one net before publication.
std::optional< CLAIM > best
Greatest claim by CLAIM_LESS.
static SUMMARY Join(const SUMMARY &aLeft, const SUMMARY &aRight, const SESSION_KEYS &aKeys)
Inputs are canonical folds from one source snapshot.
std::vector< NAME_ID > netclasses
Sorted by name.
wxString result
Test unit parsing edge cases and error handling.