FormalIFU:
PUBLIC
PROC
RETURNS[ifu: CellType] = {
formalName: ROPE ← "FormalIFU";
subCell: CellType ← CoreOps.Recast[CoreIO.RestoreCellType["IFUComplete"]];
rec: CoreClasses.RecordCellType;
publics: Wires ← NIL;
actual: Wire ← CoreOps.CreateWires[size: subCell.public.size];
nameFields: Table ← HashTable.Create[];
newPubs: Table ← HashTable.Create[];
Register:
PROC[old, new:
ROPE, size:
INT ← 0, index:
INT ← -1, adj:
BOOL ←
TRUE] = {
f: Field;
wire: Wire;
new ← CoreName.RopeNm[new];
wire ← NARROW[HashTable.Fetch[newPubs, new].value];
IF wire=
NIL
THEN {
wire ← CoreCreate.Seq[name: new, size: size];
[] ← HashTable.Store[newPubs, new, wire]};
IF wire.size#size THEN ERROR;
f ←
NEW[FieldRec ← [
root: CoreName.RopeNm[old],
wire: (IF index#-1 THEN wire[index] ELSE wire),
adj: adj] ];
publics ← CONS[wire, publics];
[] ← HashTable.Store[nameFields, f.root, f]};
[] ← MarkWeakTransistors[subCell, "VBB"];
Register[ "Pad-IPAddr", "IPData", 32 ];
Register[ "Pad-NewFetchBAA", "IPCmdA", 8, 7 ];
Register[ "Pad-IPFaultingB", "IPFaultB", 4, 0 ];
Register[ "Pad-IPRejectB", "IPRejectB" ];
Register[ "Pad-DPCmnd3ABB", "DPCmdA", 8 ];
Register[ "Pad-DPFaultB", "DPFaultB", 4 ];
Register[ "Pad-DPRejectB", "DPRejectB" ];
Register[ "Pad-EUAluOp2ABB", "EUAluOp2AB", 4 ];
Register[ "Pad-EUCondSel2ABB", "EUCondSel2AB", 4 ];
Register[ "Pad-EURdFromPBus3ABB", "EURdFromPBus3AB" ];
Register[ "Pad-EUWriteToPBus3ABB", "EUWriteToPBus3AB" ];
Register[ "Pad-EUCondition2B", "EUCondition2B" ];
Register[ "Pad-XBus", "KBus", 32 ];
Register[ "Pad-ResetAB", "ResetAB" ];
Register[ "Pad-RescheduleAB", "RescheduleAB" ];
Register[ "PhA", "PhA" ];
Register[ "PhB", "PhB" ];
Register[ "NotPhA", "NotPhA" ];
Register[ "NotPhB", "NotPhB" ];
Register[ "NotPreChg", "NotPhA" ];
Register[ "DShA", "DShA" ];
Register[ "DShB", "DShB" ];
Register[ "DShRd", "DShRd" ];
Register[ "DShWt", "DShWt" ];
Register[ "Pad-DShIn", "DShIn" ];
Register[ "Pad-DShOut", "DShOut" ];
Register[ "VDD", "Vdd" ];
Register[ "GND", "Gnd" ];
Register[ "PadVDD", "PadVdd" ];
Register[ "PadGND", "PadGnd" ];
Register[ "VBB", "Vdd" ];
Register[ "FireControlV", "Vdd" ];
FOR index:
INT
IN [0..actual.size)
DO
f: Field;
name: ROPE ← CoreName.WireNm[subCell.public[index]].n;
sigRec: CoreName.SigRec ← NameSig[name];
idx: INT ← sigRec.idx;
IF subCell.public[index].size#0 THEN ERROR;
sigRec.idx ← -1;
name ← CoreName.SigName[sigRec];
f ← NARROW[HashTable.Fetch[nameFields, name].value];
IF f=NIL THEN ERROR;
actual[index] ←
IF f.wire.size=0
THEN f.wire
ELSE
IF f.adj
THEN f.wire[ Adj[ idx ] ]
ELSE f.wire[ idx ];
ENDLOOP;
rec ← NEW [CoreClasses.RecordCellTypeRec[1]];
ifu ←
NEW [Core.CellTypeRec ← [
class: CoreClasses.recordCellClass,
public: CoreOps.CreateWire[publics],
data: rec ]];
rec.internal ← CoreOps.CreateWire[publics];
rec[0] ← NEW [CoreClasses.CellInstanceRec ← [actual: actual, type: subCell]];
[ ] ← CoreOps.SetCellTypeName[ifu, formalName]};