cell.class=CoreClasses.recordCellClass => {
InsertRecordPublic:
PROC [wire: Core.Wire] = {
[] ← RefTab.Insert[publicTable, wire, $Public];
};
CheckWireCount:
PROC [wire: Core.Wire] = {
wireInfo: WireInfo ← NARROW[RefTab.Fetch[internalTable, wire].val];
publicWire: BOOL ← RefTab.Fetch[publicTable, wire].found;
IF RefTab.Fetch[visitCheck, wire].found THEN RETURN;
IF NOT RefTab.Insert[visitCheck, wire, $Visited] THEN ERROR;
eachWireCount[wireInfo.count, rct.internal, wire, publicWire, cell, wireInfo.unconnectedOK];
};
rct: CoreClasses.RecordCellType ← NARROW[cell.data];
publicTable: RefTab.Ref ← RefTab.Create[];
internalTable: RefTab.Ref ← RefTab.Create[];
visitCheck: RefTab.Ref ← RefTab.Create[];
PropagateUnconnectedOK[rct.internal, internalTable];
FOR i:
NAT
IN [0..rct.size)
DO
ComputeInternalCount: CoreOps.EachWirePairProc = {
actualInfo: WireInfo;
IF publicWire.size>0 THEN RETURN;
IF RefTab.Fetch[visitCompute, publicWire].found THEN RETURN;
IF NOT RefTab.Insert[visitCompute, publicWire, $Visited] THEN ERROR;
actualInfo ← NARROW[RefTab.Fetch[internalTable, actualWire].val];
actualInfo.count ← actualInfo.count + 1;
};
visitCompute: RefTab.Ref ← RefTab.Create[];
IF CoreOps.VisitBindingSeq[rct[i].actual, rct[i].type.public, ComputeInternalCount] THEN ERROR;
Check[rct[i].type, [CoreFlat.ExtendPath[flatCell.path, i, rct], 0], rct[i]];
ENDLOOP;
CoreOps.VisitRootAtomics[cell.public, InsertRecordPublic];
CoreOps.VisitRootAtomics[rct.internal, CheckWireCount];
};
ENDCASE => {
new: Core.CellType ← CoreOps.Recast[cell];
IF cell=new THEN Check[cell, flatCell, instance]
ELSE Check[new, [flatCell.path, flatCell.recastCount+1], instance];
};