CMosBCommands.mesa (part of ChipNDale)
Copyright © 1983, 1986 by Xerox Corporation. All rights reserved.
Created by Christian Jacobi, June 24, 1983 5:03 pm
Last edited by: Jacobi June 6, 1986 4:22:18 pm PDT
Last edited by: Christian Jacobi, September 4, 1986 5:40:53 pm PDT
DIRECTORY
CD,
CDAtomicObjects,
CDLayers,
CDOps,
CDCommandOpsExtras3,
CDPanelFonts,
CDSequencer,
CDViewer,
Commander USING [CommandProc, Register],
IO,
Rope,
TerminalIO,
CMosB;
CMosBCommands: CEDAR PROGRAM
IMPORTS CDAtomicObjects, CDCommandOpsExtras3, 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.key 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.IncludeObjectI[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.key 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.IncludeObjectI[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.key 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.IncludeObjectI[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.key 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.IncludeObjectI[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.key 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.IncludeObjectI[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.IncludeObjectI[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.IncludeObjectI[design: comm.design, ob: ob, location: comm.pos, orientation: 0]
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 = {
design: CD.Design ← CDOps.CreateDesign[CMosB.cmosB];
[] ← CDViewer.CreateViewer[design];
cmd.out.PutRope["cmosB design created\n"];
};
Load: Commander.CommandProc = {
cmd.out.PutRope["cmosB loaded\n"];
};
Init: PROC [] = {
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", "4 TimesRoman8", "4 Helvetica8I", "4 Helvetica8", "2 TimesRoman8", "2 Helvetica8I", "2 Helvetica8"];
CDCommandOpsExtras3.RegisterCurrentLayerCommand[$SetLayerComment, CD.commentLayer, CMosB.cmosB];
CDCommandOpsExtras3.RegisterCurrentLayerCommand[$SetLayerNWell, CMosB.nwell, CMosB.cmosB];
CDCommandOpsExtras3.RegisterCurrentLayerCommand[$SetLayerPWell, CMosB.pwell, CMosB.cmosB];
CDCommandOpsExtras3.RegisterCurrentLayerCommand[$SetLayerNDif, CMosB.ndif, CMosB.cmosB];
CDCommandOpsExtras3.RegisterCurrentLayerCommand[$SetLayerPol, CMosB.pol, CMosB.cmosB];
CDCommandOpsExtras3.RegisterCurrentLayerCommand[$SetLayerMet2, CMosB.met2, CMosB.cmosB];
CDCommandOpsExtras3.RegisterCurrentLayerCommand[$SetLayerMet, CMosB.met, CMosB.cmosB];
CDCommandOpsExtras3.RegisterCurrentLayerCommand[$SetLayerPDif, CMosB.wpdif, CMosB.cmosB];
CDCommandOpsExtras3.RegisterCurrentLayerCommand[$SetLayerNWCnt, CMosB.nwellCont, CMosB.cmosB];
CDCommandOpsExtras3.RegisterCurrentLayerCommand[$SetLayerPWCnt, CMosB.pwellCont, CMosB.cmosB];
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: "///Commands/CDNewCMosB",
proc: NewCWorld,
doc: "Creates new CMosB design"
];
Commander.Register[
key: "///Commands/CDCMosB",
proc: Load,
doc: "loads CMosB ChipNDale"
];
CDPanelFonts.ImplementIt[tech: CMosB.cmosB, installCommands: TRUE, layerProc: CommentLayer, defaultFonts: fontNames];
--for compatibility
Commander.Register[
key: "///Commands/CDCMos",
proc: Load,
doc: "loads CMosB ChipNDale"
];
Commander.Register[
key: "///Commands/CDNewCMos",
proc: NewCWorld,
doc: "Creates new CMosB design"
];
};
CommentLayer: PROC [CD.Layer] RETURNS [CD.Layer] = {
RETURN [CD.commentLayer];
};
Init[];
END.