CMosBCommands.mesa (part of ChipNDale)
Copyright © 1983, 1985 by Xerox Corporation. All rights reserved.
by Christian Jacobi, June 24, 1983 5:03 pm
last edited Christian Jacobi, January 28, 1986 10:33:11 am PST
DIRECTORY
CD,
CDAtomicObjects,
CDLayers,
CDOps,
CDPanelFonts,
CDSequencer,
CDViewer,
Commander USING [CommandProc, Register],
IO,
Rope,
TerminalIO,
CMosB;
CMosBCommands:
CEDAR
PROGRAM
IMPORTS CDAtomicObjects, CDLayers, CDOps, CDPanelFonts, CDSequencer, CDViewer, Commander, IO, TerminalIO, CMosB =
BEGIN
lambda: CD.Number = CMosB.lambda;
CreateXstr:
PROC [comm: CDSequencer.Command] =
BEGIN
ob: CD.Object;
layer: CD.Layer;
size: CD.Position ← [8*lambda, 8*lambda];
TerminalIO.WriteRope["create transistor "];
SELECT comm.a
FROM
$DrawNXstr => layer ← CMosB.ndif;
$DrawWNXstr => layer ← CMosB.wndif;
$DrawPXstr => layer ← CMosB.pdif;
$DrawWPXstr => layer ← CMosB.wpdif;
ENDCASE => layer ← CMosB.ndif;
TerminalIO.WriteRopes[CDOps.LayerName[layer], "\n"];
ob ← CDAtomicObjects.CreateAtomicOb[$C2Trans, size, comm.design.technology, layer];
IF ob=
NIL
THEN
TerminalIO.WriteRope["not done\n"]
ELSE
CDOps.AddAnObject[design: comm.design, ob: ob, location: comm.pos, orientation: 0]
END;
CreateLXstr:
PROC [comm: CDSequencer.Command] =
BEGIN
ob: CD.Object;
layer: CD.Layer;
TerminalIO.WriteRope["create L transistor "];
SELECT comm.a
FROM
$DrawAngleNXstr => layer ← CMosB.ndif;
$DrawAngleWNXstr => layer ← CMosB.wndif;
$DrawAnglePXstr => layer ← CMosB.pdif;
$DrawAngleWPXstr => layer ← CMosB.wpdif;
ENDCASE => layer ← CMosB.ndif;
TerminalIO.WriteRopes[CDOps.LayerName[layer], "\n"];
ob ← CDAtomicObjects.CreateAtomicOb[$C2LTrans, [0, 0], comm.design.technology, layer];
IF ob=
NIL
THEN
TerminalIO.WriteRope["not done\n"]
ELSE
CDOps.AddAnObject[design: comm.design, ob: ob, location: comm.pos, orientation: 0]
END;
CreateCont:
PROC [comm: CDSequencer.Command] =
BEGIN
ob: CD.Object;
layer: CD.Layer;
TerminalIO.WriteRope["create contact "];
SELECT comm.a
FROM
$DrawNDifCon => layer ← CMosB.ndif;
$DrawWNDifCon => layer ← CMosB.wndif;
$DrawPDifCon => layer ← CMosB.pdif;
$DrawWPDifCon => layer ← CMosB.wpdif;
$DrawPolCon => layer ← CMosB.pol;
$DrawNWCntCon => layer ← CMosB.nwellCont;
$DrawPWCntCon => layer ← CMosB.pwellCont;
ENDCASE => layer ← CMosB.pol;
TerminalIO.WriteRopes[CDOps.LayerName[layer], "\n"];
ob ← CDAtomicObjects.CreateAtomicOb[$C2SimpleCon, [0, 0], comm.design.technology, layer];
IF ob=
NIL
THEN
TerminalIO.WriteRope["not done\n"]
ELSE
CDOps.AddAnObject[design: comm.design, ob: ob, location: comm.pos, orientation: 0]
END;
CreateLargeCont:
PROC [comm: CDSequencer.Command] =
BEGIN
ob: CD.Object;
layer: CD.Layer;
TerminalIO.WriteRope["create large contact "];
SELECT comm.a
FROM
$DrawLNDifCon => layer ← CMosB.ndif;
$DrawLWNDifCon => layer ← CMosB.wndif;
$DrawLPDifCon => layer ← CMosB.pdif;
$DrawLWPDifCon => layer ← CMosB.wpdif;
$DrawLPolCon => layer ← CMosB.pol;
$DrawLNWCntCon => layer ← CMosB.nwellCont;
$DrawLPWCntCon => layer ← CMosB.pwellCont;
ENDCASE => layer ← CMosB.pol;
TerminalIO.WriteRopes[CDOps.LayerName[layer], "\n"];
ob ← CDAtomicObjects.CreateAtomicOb[$C2LargeSimpleCon, [0, 0], comm.design.technology, layer];
IF ob=
NIL
THEN
TerminalIO.WriteRope["not done\n"]
ELSE
CDOps.AddAnObject[design: comm.design, ob: ob, location: comm.pos, orientation: 0]
END;
CreateDiffShortCont:
PROC [comm: CDSequencer.Command] =
BEGIN
ob: CD.Object;
layer: CD.Layer;
TerminalIO.WriteRope["create diff short contact "];
SELECT comm.a
FROM
$DrawNDifShortCon => layer ← CMosB.ndif;
$DrawWNDifShortCon => layer ← CMosB.wndif;
$DrawPDifShortCon => layer ← CMosB.pdif;
$DrawWPDifShortCon => layer ← CMosB.wpdif;
ENDCASE => layer ← CMosB.ndif;
TerminalIO.WriteRopes[CDOps.LayerName[layer], "\n"];
ob ← CDAtomicObjects.CreateAtomicOb[$C2DifShortCon, [0, 0], comm.design.technology, layer];
IF ob=
NIL
THEN
TerminalIO.WriteRope["not done\n"]
ELSE
CDOps.AddAnObject[design: comm.design, ob: ob, location: comm.pos, orientation: 0]
END;
CreateVia:
PROC [comm: CDSequencer.Command] =
BEGIN
ob: CD.Object;
TerminalIO.WriteRope["create via\n"];
ob ← CDAtomicObjects.CreateAtomicOb[$C2Via, [0, 0], comm.design.technology];
IF ob=
NIL
THEN
TerminalIO.WriteRope["not done\n"]
ELSE
CDOps.AddAnObject[design: comm.design, ob: ob, location: comm.pos, orientation: 0]
END;
CreateLargeVia:
PROC [comm: CDSequencer.Command] =
BEGIN
ob: CD.Object;
TerminalIO.WriteRope["create large via\n"];
ob ← CDAtomicObjects.CreateAtomicOb[$C2LargeVia, [0, 0], comm.design.technology];
IF ob=
NIL
THEN
TerminalIO.WriteRope["not done\n"]
ELSE
CDOps.AddAnObject[design: comm.design, ob: ob, location: comm.pos, orientation: 0]
END;
SetLayerComment:
PROC [comm: CDSequencer.Command] =
BEGIN
TerminalIO.WriteRope["comment for default\n"];
CDLayers.SetCurrentLayer[comm.design, CMosB.comment];
END;
SetLayerNWell:
PROC [comm: CDSequencer.Command] =
BEGIN
TerminalIO.WriteRope["NWell for default\n"];
CDLayers.SetCurrentLayer[comm.design, CMosB.nwell]
END;
SetLayerPWell:
PROC [comm: CDSequencer.Command] =
BEGIN
TerminalIO.WriteRope["PWell for default\n"];
CDLayers.SetCurrentLayer[comm.design, CMosB.pwell];
END;
SetLayerDif:
PROC [comm: CDSequencer.Command] =
BEGIN
TerminalIO.WriteRope["diffusion for default\n"];
CDLayers.SetCurrentLayer[comm.design, CMosB.ndif]
END;
SetLayerPol:
PROC [comm: CDSequencer.Command] =
BEGIN
TerminalIO.WriteRope["poly for default\n"];
CDLayers.SetCurrentLayer[comm.design, CMosB.pol]
END;
SetLayerMet2:
PROC [comm: CDSequencer.Command] =
BEGIN
TerminalIO.WriteRope["metal-2 for default\n"];
CDLayers.SetCurrentLayer[comm.design, CMosB.met2]
END;
SetLayerMet:
PROC [comm: CDSequencer.Command] =
BEGIN
TerminalIO.WriteRope["metal for default\n"];
CDLayers.SetCurrentLayer[comm.design, CMosB.met]
END;
SetLayerPDif:
PROC [comm: CDSequencer.Command] =
BEGIN
TerminalIO.WriteRope["p-diff for default\n"];
CDLayers.SetCurrentLayer[comm.design, CMosB.wpdif]
END;
SetLayerNWCnt:
PROC [comm: CDSequencer.Command] =
BEGIN
TerminalIO.WriteRope["N-Well Cnt for default\n"];
CDLayers.SetCurrentLayer[comm.design, CMosB.nwellCont]
END;
SetLayerPWCnt:
PROC [comm: CDSequencer.Command] =
BEGIN
TerminalIO.WriteRope["P-Well Cnt for default\n"];
CDLayers.SetCurrentLayer[comm.design, CMosB.pwellCont]
END;
DiffToPWorld:
PROC [comm: CDSequencer.Command] =
BEGIN
layer: CD.Layer = CDLayers.CurrentLayer[comm.design];
TerminalIO.WriteRope["Switch diffusion to P type"];
SELECT layer
FROM
CMosB.ndif => CDLayers.SetCurrentLayer[comm.design, CMosB.wpdif];
CMosB.pwellCont => CDLayers.SetCurrentLayer[comm.design, CMosB.nwellCont];
ENDCASE => TerminalIO.WriteRope[" not done"];
TerminalIO.WriteLn[];
END;
DiffToNWorld:
PROC [comm: CDSequencer.Command] =
BEGIN
layer: CD.Layer = CDLayers.CurrentLayer[comm.design];
TerminalIO.WriteRope["Switch diffusion to N type"];
SELECT layer
FROM
CMosB.pdif => CDLayers.SetCurrentLayer[comm.design, CMosB.ndif];
CMosB.wpdif => CDLayers.SetCurrentLayer[comm.design, CMosB.ndif];
CMosB.nwellCont => CDLayers.SetCurrentLayer[comm.design, CMosB.pwellCont];
ENDCASE => TerminalIO.WriteRope[" not done"];
TerminalIO.WriteLn[];
END;
NewCWorld: Commander.CommandProc =
BEGIN
design: CD.Design ← CDOps.CreateDesign[CMosB.cmosB];
[] ← CDViewer.CreateViewer[design];
cmd.out.PutRope["cmosB design created\n"];
END;
Load: Commander.CommandProc =
BEGIN
cmd.out.PutRope["cmosB loaded\n"];
END;
Init:
PROC [] =
BEGIN
MakeComm:
PROC [key:
ATOM, p: CDSequencer.CommandProc, qm: CDSequencer.QueueMethod𡤍oQueue] = {
CDSequencer.ImplementCommand[key, p, CMosB.cmosB, qm];
};
fontNames: LIST OF Rope.ROPE = LIST["4 Gates32", "2 Helvetica8I", "2 Helvetica8", "4 Helvetica8I", "4 Helvetica8", "8 Helvetica8I", "8 Helvetica8", "8 TimesRoman14"];
MakeComm[$SetLayerComment, SetLayerComment];
MakeComm[$SetLayerNWell, SetLayerNWell];
MakeComm[$SetLayerNDif, SetLayerDif];
MakeComm[$SetLayerPol, SetLayerPol];
MakeComm[$SetLayerMet, SetLayerMet];
MakeComm[$SetLayerMet2, SetLayerMet2];
MakeComm[$SetLayerPDif, SetLayerPDif];
MakeComm[$SetLayerNWCnt, SetLayerNWCnt];
MakeComm[$SetLayerPWCnt, SetLayerPWCnt];
MakeComm[$TestDifFlipToPWorld, DiffToPWorld];
MakeComm[$TestDifFlipToNWorld, DiffToNWorld];
MakeComm[$DiffToPWorld, DiffToPWorld];
MakeComm[$DiffToNWorld, DiffToNWorld];
MakeComm[$DrawNXstr, CreateXstr, doQueueAndMark];
MakeComm[$DrawPXstr, CreateXstr, doQueueAndMark];
MakeComm[$DrawWNXstr, CreateXstr, doQueueAndMark];
MakeComm[$DrawWPXstr, CreateXstr, doQueueAndMark];
MakeComm[$DrawAngleNXstr, CreateLXstr, doQueueAndMark];
MakeComm[$DrawAnglePXstr, CreateLXstr, doQueueAndMark];
MakeComm[$DrawAngleWNXstr, CreateLXstr, doQueueAndMark];
MakeComm[$DrawAngleWPXstr, CreateLXstr, doQueueAndMark];
MakeComm[$DrawNDifCon, CreateCont, doQueueAndMark];
MakeComm[$DrawWNDifCon, CreateCont, doQueueAndMark];
MakeComm[$DrawPDifCon, CreateCont, doQueueAndMark];
MakeComm[$DrawWPDifCon, CreateCont, doQueueAndMark];
MakeComm[$DrawPolCon, CreateCont, doQueueAndMark];
MakeComm[$DrawNWCntCon, CreateCont, doQueueAndMark];
MakeComm[$DrawPWCntCon, CreateCont, doQueueAndMark];
MakeComm[$DrawLNDifCon, CreateLargeCont, doQueueAndMark];
MakeComm[$DrawLWNDifCon, CreateLargeCont, doQueueAndMark];
MakeComm[$DrawLPDifCon, CreateLargeCont, doQueueAndMark];
MakeComm[$DrawLWPDifCon, CreateLargeCont, doQueueAndMark];
MakeComm[$DrawLPolCon, CreateLargeCont, doQueueAndMark];
MakeComm[$DrawLNWCntCon, CreateLargeCont, doQueueAndMark];
MakeComm[$DrawLPWCntCon, CreateLargeCont, doQueueAndMark];
MakeComm[$DrawNDifShortCon, CreateDiffShortCont, doQueueAndMark];
MakeComm[$DrawWNDifShortCon, CreateDiffShortCont, doQueueAndMark];
MakeComm[$DrawPDifShortCon, CreateDiffShortCont, doQueueAndMark];
MakeComm[$DrawWPDifShortCon, CreateDiffShortCont, doQueueAndMark];
MakeComm[$DrawMm2Con, CreateVia, doQueueAndMark];
MakeComm[$DrawLVia, CreateLargeVia, doQueueAndMark];
Commander.Register[
key: "CDNewCMosB",
proc: NewCWorld,
doc: "Creates new CMosB design"
];
Commander.Register[
key: "CDCMosB",
proc: Load,
doc: "loads CMosB ChipNDale"
];
CDPanelFonts.ImplementIt[tech: CMosB.cmosB, installCommands: TRUE, layerProc: CommentLayer, defaultFonts: fontNames, defaultSize: 1];
--for compatibility
Commander.Register[
key: "CDCMos",
proc: Load,
doc: "loads CMosB ChipNDale"
];
Commander.Register[
key: "CDNewCMos",
proc: NewCWorld,
doc: "Creates new CMosB design"
];
END;
CommentLayer:
PROC [
CD.Layer]
RETURNS [
CD.Layer] =
BEGIN
RETURN [CMosB.comment];
END;
Init[];
END.