CreateCellTypeFromDag:
PUBLIC PROC [tree: Dag, fanout:
INT ← 4]
RETURNS [Core.CellType] ~ {
Given a tree, this will construct a CellType which implements the equations described by the tree
ctcoll: Treeset ← MakeNewCTreeSet[];
AssembleCTree[ctcoll];
FOR ctiter: Dag ← ctcoll^.top, ctiter^.next
UNTIL ctiter =
NIL DO
RemoveOrs[ctiter];
ENDLOOP;
TwoifyAllTrees[ctcoll];
SimplifyDag[tree];
EstablishLevels[tree];
TwoifyTree[tree];
ReduceFanout[tree, fanout];
RemoveOrs[tree];
WHILE RemoveAllIdenticalLinks[tree] OR RemoveDuplicateNodes[tree] DO ENDLOOP;
BufferNecessaryNodes[tree];
ReduceFanout[tree, fanout];
KillHangingNodes[tree, FALSE];
ProduceTotalCovering[tree, ctcoll];
RETURN[FromDagToCellType[tree]]
};
AssembleCTree:
PROC [ctcoll: Treeset] ~ {
This is where the trees to be used in the cover are created.
1 input
AddInputToCover["X ← ~I", ctcoll];
ctcoll^.top^.cell ← NARROW[SymTab.Fetch[CoreDirectory.FetchLibrary["CMOSB"], "inv"].val];
ctcoll^.top^.val ← NARROW[CoreProperties.GetCellTypeProp[ctcoll^.top^.cell, $CellArea], REF INT]^;
2 inputs
AddInputToCover["X ← ~(I-A * I-B)", ctcoll];
ctcoll^.top^.cell ← NARROW[SymTab.Fetch[CoreDirectory.FetchLibrary["CMOSB"], "nand2"].val];
ctcoll^.top^.val ← NARROW[CoreProperties.GetCellTypeProp[ctcoll^.top^.cell, $CellArea], REF INT]^;
AddInputToCover["X ← I-A * I-B", ctcoll];
ctcoll^.top^.cell ← NARROW[SymTab.Fetch[CoreDirectory.FetchLibrary["CMOSB"], "and2"].val];
ctcoll^.top^.val ← NARROW[CoreProperties.GetCellTypeProp[ctcoll^.top^.cell, $CellArea], REF INT]^;
AddInputToCover["X ← ~(I-A + I-B)", ctcoll];
ctcoll^.top^.cell ← NARROW[SymTab.Fetch[CoreDirectory.FetchLibrary["CMOSB"], "nor2"].val];
ctcoll^.top^.val ← NARROW[CoreProperties.GetCellTypeProp[ctcoll^.top^.cell, $CellArea], REF INT]^;
AddInputToCover["X ← I-A + I-B", ctcoll];
ctcoll^.top^.cell ← NARROW[SymTab.Fetch[CoreDirectory.FetchLibrary["CMOSB"], "or2"].val];
ctcoll^.top^.val ← NARROW[CoreProperties.GetCellTypeProp[ctcoll^.top^.cell, $CellArea], REF INT]^;
3 inputs (some missing)
AddInputToCover["X ← ~(I-A * I-B * I-C)", ctcoll];
ctcoll^.top^.cell ← NARROW[SymTab.Fetch[CoreDirectory.FetchLibrary["CMOSB"], "nand3"].val];
ctcoll^.top^.val ← NARROW[CoreProperties.GetCellTypeProp[ctcoll^.top^.cell, $CellArea], REF INT]^;
AddInputToCover["X ← (I-A * I-B * I-C)", ctcoll];
ctcoll^.top^.cell ← NARROW[SymTab.Fetch[CoreDirectory.FetchLibrary["CMOSB"], "and3"].val];
ctcoll^.top^.val ← NARROW[CoreProperties.GetCellTypeProp[ctcoll^.top^.cell, $CellArea], REF INT]^;
AddInputToCover["X ← ~(I-A + I-B + I-C)", ctcoll];
ctcoll^.top^.cell ← NARROW[SymTab.Fetch[CoreDirectory.FetchLibrary["CMOSB"], "nor3"].val];
ctcoll^.top^.val ← NARROW[CoreProperties.GetCellTypeProp[ctcoll^.top^.cell, $CellArea], REF INT]^;
AddInputToCover["X ← (I-A + I-B + I-C)", ctcoll];
ctcoll^.top^.cell ← NARROW[SymTab.Fetch[CoreDirectory.FetchLibrary["CMOSB"], "or3"].val];
ctcoll^.top^.val ← NARROW[CoreProperties.GetCellTypeProp[ctcoll^.top^.cell, $CellArea], REF INT]^;
4 inputs (many missing)
AddInputToCover["X ← ~(I-A * I-B * I-C * I-D)", ctcoll];
ctcoll^.top^.cell ← NARROW[SymTab.Fetch[CoreDirectory.FetchLibrary["CMOSB"], "nand4"].val];
ctcoll^.top^.val ← NARROW[CoreProperties.GetCellTypeProp[ctcoll^.top^.cell, $CellArea], REF INT]^;
AddInputToCover["X ← ~(I-A + I-B + I-C + I-D)", ctcoll];
ctcoll^.top^.cell ← NARROW[SymTab.Fetch[CoreDirectory.FetchLibrary["CMOSB"], "nor4"].val];
ctcoll^.top^.val ← NARROW[CoreProperties.GetCellTypeProp[ctcoll^.top^.cell, $CellArea], REF INT]^;
xors
AddInputToCover["X ← (I-A * I-B + ~I-A * ~I-B)", ctcoll];
ctcoll^.top^.cell ← NARROW[SymTab.Fetch[CoreDirectory.FetchLibrary["CMOSB"], "xor2"].val];
ctcoll^.top^.val ← NARROW[CoreProperties.GetCellTypeProp[ctcoll^.top^.cell, $CellArea], REF INT]^;
};
Commander.Register[key: "Gen", proc: MakeGenerator, doc: "Standard cells from logic equations"];