Store:
PUBLIC
PROC [cellType: CellType, withCuteFonts:
BOOL ←
FALSE] = {
name: ROPE ← CoreOps.GetCellTypeName[cellType];
layout: CD.Object ← PWCore.Layout[cellType];
layoutFileName: ROPE ← Rope.Cat[name, "Layout"];
shellFileName: ROPE ← Rope.Cat[name, "Shell"];
layoutDesign: CD.Design ← CDOps.CreateDesign[CD.FetchTechnology[$cmosB]];
shellDesign: CD.Design ← CDOps.CreateDesign[CD.FetchTechnology[$cmosB]];
shell: CD.Object;
Core
TerminalIO.PutF["Saving the Core for cell %g ...\n", IO.rope[name]];
[] ← CoreIO.ReportSaveCellType[cellType];
Shell
We wan to store the bbox of layout somewhere. Not on the Layout, because we want to avoid reading the whole layout file, so we store them on the Shell.
CDProperties.PutDesignProp[shellDesign, $BBOXX1, NEW [INT ← layout.bbox.x1]];
CDProperties.PutDesignProp[shellDesign, $BBOXX2, NEW [INT ← layout.bbox.x2]];
CDProperties.PutDesignProp[shellDesign, $BBOXY1, NEW [INT ← layout.bbox.y1]];
CDProperties.PutDesignProp[shellDesign, $BBOXY2, NEW [INT ← layout.bbox.y2]];
TerminalIO.PutF["Making shell for cell %g ...\n", IO.rope[name]];
shell ← CoreGeometry.CreateShell[PWCore.extractMode.decoration, cellType, withCuteFonts];
shellDesign.name ← shellFileName;
[] ← CDDirectory.Include[shellDesign, shell, name];
CDOps.IncludeObjectI[shellDesign, shell];
TerminalIO.PutF["Storing Shell for cell %g ...\n", IO.rope[name]];
[] ← CDIO.WriteDesign[shellDesign, shellFileName];
Layout
layoutDesign.name ← layoutFileName;
layout ← PWObjects.CreateCell[LIST [CDInstances.NewInst[layout]], CD.InterestRect[layout], name];
[] ← CDDirectory.Include[layoutDesign, layout, name];
CDOps.IncludeObjectI[layoutDesign, layout];
TerminalIO.PutF["Storing Layout for cell %g ...\n", IO.rope[name]];
[] ← CDIO.WriteDesign[layoutDesign, layoutFileName];
TerminalIO.PutF["... layout checkpoint stored in %g.core, %gLayout.dale and %gShell.dale\n", IO.rope[name], IO.rope[name], IO.rope[name]];
};