Checkpoint:
PUBLIC
PROC [cellType: CellType, withCuteFonts:
BOOL ←
FALSE] = {
sourceObj: CD.Object ← PWC.Layout[cellType];
ir: CD.Rect ← PWC.InterestRect[cellType];
name: ROPE ← CoreOps.GetCellTypeName[cellType];
layoutFileName: ROPE ← IO.PutFR["%gLayout", IO.rope[name]];
shellFileName: ROPE ← IO.PutFR["%gShell", IO.rope[name]];
layoutDesign: CD.Design ← CDOps.CreateDesign[CD.FetchTechnology[$cmosB]];
shellDesign: CD.Design ← CDOps.CreateDesign[CD.FetchTechnology[$cmosB]];
layout: CD.Object ← PW.CreateEmptyCell[];
shell: CD.Object;
tCount: INT ← PWC.CountTransistors[cellType];
PW.WriteF["Making shell for cell %g\n", IO.rope[name]];
shell ← PWC.CellShell[cellType];
[] ← PW.IncludeInCell[layout, sourceObj];
PW.SetInterestRect[layout, CD.InterestSize[sourceObj]];
PW.RepositionCell[layout];
layoutDesign.name ← layoutFileName;
shellDesign.name ← shellFileName;
[] ← CDDirectory.Include[layoutDesign, layout, name];
[] ← CDDirectory.Include[shellDesign, shell, name];
CDOps.IncludeObjectI[layoutDesign, sourceObj];
CDOps.IncludeObjectI[shellDesign, shell];
CDValue.Store[layoutDesign, $KeepObjects, $KeepObjects]; -- to avoid finalization!!!
CDValue.Store[shellDesign, $KeepObjects, $KeepObjects]; -- to avoid finalization!!!
We want to store the ir and tCnt Props of the CellType on the Shell
CDProperties.PutDesignProp[shellDesign, PWC.transistorCount, NEW [INT ← tCount]];
CDProperties.PutDesignProp[shellDesign, $IRX1, NEW [INT ← ir.x1]];
CDProperties.PutDesignProp[shellDesign, $IRX2, NEW [INT ← ir.x2]];
CDProperties.PutDesignProp[shellDesign, $IRY1, NEW [INT ← ir.y1]];
CDProperties.PutDesignProp[shellDesign, $IRY2, NEW [INT ← ir.y2]];
PW.WriteF["Writing layout for cell %g\n", IO.rope[name]];
[] ← CDIO.WriteDesign[layoutDesign, layoutFileName];
PW.WriteF["Writing shell for cell %g\n", IO.rope[name]];
[] ← CDIO.WriteDesign[shellDesign, shellFileName];
PW.WriteF["Layout checkpoint stored in %g.dale and %g.dale\n",
IO.rope[layoutFileName], IO.rope[shellFileName]]};
RetrieveLayout: PWC.LayoutProc = {
fileName: ROPE ← NARROW [cellType.data];
name: ROPE ← Rope.Substr[fileName, 0 , Rope.Length[fileName]-5]; -- strip ".core"
layoutFileName: ROPE ← IO.PutFR["%gLayout", IO.rope[name]];
layoutDesign: CD.Design ← OpenDesign[layoutFileName];
obj ← PW.Get[layoutDesign, name];
IF CD.InterestRect[obj]#PWC.InterestRect[cellType] THEN ERROR};
RetrieveDecorate: PWC.DecorateProc = {
fileName: ROPE ← NARROW [cellType.data];
name: ROPE ← Rope.Substr[fileName, 0 , Rope.Length[fileName]-5]; -- strip ".core"
shellFileName: ROPE ← IO.PutFR["%gShell", IO.rope[name]];
shellDesign: CD.Design ← OpenDesign[shellFileName];
tCountRef:
REF
INT ←
NARROW [CDProperties.GetDesignProp[shellDesign, PWC.transistorCount]];
ir:
CD.Rect ← [
x1: NARROW [CDProperties.GetDesignProp[shellDesign, $IRX1], REF INT]^,
x2: NARROW [CDProperties.GetDesignProp[shellDesign, $IRX2], REF INT]^,
y1: NARROW [CDProperties.GetDesignProp[shellDesign, $IRY1], REF INT]^,
y2: NARROW [CDProperties.GetDesignProp[shellDesign, $IRY2], REF INT]^ ];
shell: CD.Object ← PW.Get [shellDesign, name];
cellPtr: CD.CellPtr ← NARROW [shell.specificRef];
offset:
CD.Position ← CDBasics.SubPoints
[CDBasics.BaseOfRect[ir], CDBasics.BaseOfRect[CD.InterestRect[shell]]];
IF CD.InterestSize[shell]#CDBasics.SizeOfRect[ir] THEN ERROR;
CoreProperties.PutCellTypeProp[cellType, $PWCShell, shell];
CoreGeometry.PutIR[PWC.extractMode.decoration, cellType, ir];
IF tCountRef#
NIL
THEN CoreProperties.PutCellTypeProp
[cellType, PWC.transistorCount, NEW [INT ← tCountRef^]];
FOR list:
LIST
OF
CD.Instance ← cellPtr.contents, list.rest
WHILE list#
NIL
DO
wireName: ROPE;
wire: Wire;
instance: CD.Instance;
IF list.first.ob.class # CDRects.bareRectClass THEN LOOP;
instance ← NEW [CD.InstanceRep ← list.first^]; instance.properties ← NIL;
wireName ← NARROW [CDProperties.GetInstanceProp[list.first, $InstanceName]];
wire ← FindWire[cellType.public, wireName];
IF wireName=NIL OR wire=NIL THEN ERROR;
CDInstances.Translate[instance, offset];
AddUniquePinsProp[PWC.extractMode.decoration, wire, instance];
ENDLOOP};