<> <> <> <> 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_doQueue] = { 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.