DIRECTORY CD, CDColors, CDDefaults, CDDefaultsExtras, CDEvents, CDOps, CDPanel, CDProperties, CDSequencer, CDTipEtc, CDValue, CDViewer, CMos, Commander USING [CommandProc, Register], GraphicsColor, IO, Rope, TerminalIO, TokenIO; CMosImpl: CEDAR PROGRAM IMPORTS CD, CDColors, CDDefaults, CDDefaultsExtras, CDEvents, CDOps, CDPanel, CDProperties, CDSequencer, CDTipEtc, CDValue, CDViewer, Commander, IO, TerminalIO, TokenIO EXPORTS CMos SHARES CDDefaultsExtras = BEGIN cmos: PUBLIC CD.Technology; cut: PUBLIC CD.Layer; pol: PUBLIC CD.Layer; ndif: PUBLIC CD.Layer; met: PUBLIC CD.Layer; imp: PUBLIC CD.Layer; ovg: PUBLIC CD.Layer; bur: PUBLIC CD.Layer; snerd: PUBLIC CD.Layer _ CD.highLightError; pdif: PUBLIC CD.Layer; wpdif: PUBLIC CD.Layer; pwelCont: PUBLIC CD.Layer; met2: PUBLIC CD.Layer; pwel: PUBLIC CD.Layer; nwel: PUBLIC CD.Layer; nwelCont: PUBLIC CD.Layer; NOcOL: PUBLIC CD.Layer _ CD.highLightError; cut2: PUBLIC CD.Layer; HackContextColors: PROC [] = BEGIN WITH CDValue.Fetch[boundTo: NIL, key: $ContextFilter] SELECT FROM rcf: REF CD.ContextFilter => { rcf[pol].color _ [r: 255, g: 0, b: 0]; rcf[met].color _ [r: 0, g: 0, b: 255]; rcf[ndif].color _ [r: 0, g: 255, b: 0]; rcf[pdif].color _ [r: 0, g: 255, b: 0]; rcf[met2].color _ [r: 128, g: 0, b: 128]; }; ENDCASE => NULL END; CurrentDiffusion: PUBLIC PROC [design: CD.Design] RETURNS [CD.Layer] = BEGIN lev: CD.Layer _ CDPanel.FetchDefaultLayer[design]; IF lev=wpdif THEN RETURN [pdif]; IF lev=ndif OR lev=pdif OR lev=pwelCont OR lev=nwelCont THEN RETURN [lev] ELSE RETURN [CD.combined] END; CifName: PROC [lev: CD.Layer, name: Rope.ROPE] = BEGIN CDProperties.PutPropOnLayer[onto: lev, prop: $CDxCIFName, val: name] END; SetLayerNWell: PROC [comm: CDSequencer.Command] = BEGIN TerminalIO.WriteRope["NWell for default\n"]; CDPanel.StoreDefaultLayer[comm.design, nwel] END; SetLayerDif: PROC [comm: CDSequencer.Command] = BEGIN TerminalIO.WriteRope["diffusion for default\n"]; CDPanel.StoreDefaultLayer[comm.design, ndif] END; SetLayerPol: PROC [comm: CDSequencer.Command] = BEGIN TerminalIO.WriteRope["poly for default\n"]; CDPanel.StoreDefaultLayer[comm.design, pol] END; SetLayerMet2: PROC [comm: CDSequencer.Command] = BEGIN TerminalIO.WriteRope["metal-2 for default\n"]; CDPanel.StoreDefaultLayer[comm.design, met2] END; SetLayerMet: PROC [comm: CDSequencer.Command] = BEGIN TerminalIO.WriteRope["metal for default\n"]; CDPanel.StoreDefaultLayer[comm.design, met] END; SetLayerPDif: PROC [comm: CDSequencer.Command] = BEGIN TerminalIO.WriteRope["p-diff for default\n"]; CDPanel.StoreDefaultLayer[comm.design, wpdif] END; SetLayerNWCnt: PROC [comm: CDSequencer.Command] = BEGIN TerminalIO.WriteRope["N-Well Cnt for default\n"]; CDPanel.StoreDefaultLayer[comm.design, nwelCont] END; SetLayerPWCnt: PROC [comm: CDSequencer.Command] = BEGIN TerminalIO.WriteRope["P-Well Cnt for default\n"]; CDPanel.StoreDefaultLayer[comm.design, pwelCont] END; DiffToPWorld: PROC [comm: CDSequencer.Command] = BEGIN layer: CD.Layer = CDDefaults.CurrentLayer[comm.design]; TerminalIO.WriteRope["Switch diffusion to P type"]; SELECT layer FROM ndif => CDPanel.StoreDefaultLayer[comm.design, wpdif]; pwelCont => CDPanel.StoreDefaultLayer[comm.design, nwelCont]; ENDCASE => TerminalIO.WriteRope[" not done"]; TerminalIO.WriteLn[]; END; DiffToNWorld: PROC [comm: CDSequencer.Command] = BEGIN layer: CD.Layer = CDDefaults.CurrentLayer[comm.design]; TerminalIO.WriteRope["Switch diffusion to N type"]; SELECT layer FROM pdif => CDPanel.StoreDefaultLayer[comm.design, ndif]; wpdif => CDPanel.StoreDefaultLayer[comm.design, ndif]; nwelCont => CDPanel.StoreDefaultLayer[comm.design, pwelCont]; ENDCASE => TerminalIO.WriteRope[" not done"]; TerminalIO.WriteLn[]; END; RegisterObjectType: PUBLIC PROC [a: ATOM] RETURNS [REF CD.ObjectProcs] = BEGIN RETURN [ CD.RegisterObjectType[a, cmos] ]; END; Load: Commander.CommandProc = BEGIN cmd.out.PutRope["cmos loaded\n"]; END; NewCWorld: Commander.CommandProc = BEGIN design: CD.Design _ CDOps.CreateDesign[cmos]; [] _ CDViewer.CreateViewer[design]; END; WriteTechnologyKey: CDEvents.EventProc = BEGIN TokenIO.WriteAtom[$CMos]; TokenIO.WriteInt[1]; END; ReadTechnologyKey: CDEvents.EventProc = BEGIN dont_TRUE; IF TokenIO.ReadAtom[]=$CMos THEN { version: INT = TokenIO.ReadInt[]; IF version=1 THEN dont_FALSE ELSE IF version=0 THEN { TerminalIO.WriteRope["***********************\n"]; TerminalIO.WriteRope["WARNING: objects using p-diffusion\n"]; TerminalIO.WriteRope["may be displaced; chat with Christian\n"]; TerminalIO.WriteRope["***********************\n"]; dont_FALSE }; }; IF dont THEN TerminalIO.WriteRope["CMos version miss-match\n"]; END; InitBricks: PROC [] = BEGIN bit4: CDColors.DisplayType = CDColors.DisplayType[bit4]; bw: CDColors.DisplayType = CDColors.DisplayType[bw]; s1: CARDINAL = 1; s2: CARDINAL = 16; s3: CARDINAL = 16*16; s4: CARDINAL = 16*16*16; ss: CARDINAL = s1+s2+s3+s4; green: CARDINAL = 1; blue: CARDINAL = 2; red: CARDINAL = 4; yellow: CARDINAL = 14; CDColors.DefineColor[cut, NEW[CDColors.Brick_[7*ss, 11*ss, 7*ss, 11*ss]], bit4]; CDColors.DefineColor[cut, NEW[CDColors.Brick_[7*ss, 11*ss, 7*ss, 11*ss]], bw]; CDColors.DefineColor[ndif, NEW[CDColors.Brick_[green*ss, green*ss, green*ss, green*ss]], bit4]; CDColors.DefineColor[ndif, NEW[CDColors.Brick_[4*ss, ss, 4*ss, ss]], bw]; CDColors.DefineColor[pdif, NEW[CDColors.Brick_[1*ss, 3*ss, 1*ss, 1*ss]], bit4]; CDColors.DefineColor[pdif, NEW[CDColors.Brick_[5*ss, ss, 4*ss, ss]], bw]; CDColors.DefineColor[pwelCont, NEW[CDColors.Brick_[1*ss, 1*ss, 0*ss, 1*ss]], bit4]; CDColors.DefineColor[pwelCont, NEW[CDColors.Brick_[0*ss, ss, 4*ss, ss]], bw]; CDColors.DefineColor[nwelCont, NEW[CDColors.Brick_[1*ss, 1*ss, 2*ss, 1*ss]], bit4]; CDColors.DefineColor[nwelCont, NEW[CDColors.Brick_[2*ss, ss, 4*ss, ss]], bw]; CDColors.DefineColor[pol, NEW[CDColors.Brick_[red*ss, red*ss, red*ss, red*ss]], bit4]; CDColors.DefineColor[pol, NEW[CDColors.Brick_[8*ss, 4*ss, 2*ss, 1*ss]], bw]; CDColors.DefineColor[met, NEW[CDColors.Brick_[blue*ss, blue*ss, blue*ss, blue*ss]], bit4]; CDColors.DefineColor[met, NEW[CDColors.Brick_[8*ss, 2*ss, 0, 0]], bw]; CDColors.DefineColor[imp, NEW[CDColors.Brick_[yellow*ss, yellow*ss, yellow*ss, yellow*ss]], bit4]; CDColors.DefineColor[imp, NEW[CDColors.Brick_[2*ss, 0, 2*ss, 0]], bw]; CDColors.DefineColor[met2, NEW[CDColors.Brick_[2*(s1+s2+s3), 2*ss, 2*(s1+s2+s3)+15*s4, 2*ss]], bit4]; CDColors.DefineColor[met2, NEW[CDColors.Brick_[8*ss, 8*ss, 2*ss, 2*ss]], bw]; CDColors.DefineColor[nwel, NEW[CDColors.Brick_[8*s1, 0, 0, 0]], bit4]; CDColors.DefineColor[nwel, NEW[CDColors.Brick_[4*ss, 0, 0, 0]], bw]; CDColors.DefineColor[pwel, NEW[CDColors.Brick_[4*s1, 0, 0, 0]], bit4]; CDColors.DefineColor[pwel, NEW[CDColors.Brick_[2*ss, 0, 0, 0]], bw]; CDColors.DefineColor[bur, NEW[CDColors.Brick_[11*ss, 11*ss, 11*ss, 11*ss]], bit4]; CDColors.DefineColor[bur, NEW[CDColors.Brick_[4*ss, 14*ss, 4*ss, 0*ss]], bw]; CDColors.DefineColor[ovg, NEW[CDColors.Brick_[8*ss, 8*ss, 8*ss, 8*ss]], bit4]; CDColors.DefineColor[ovg, NEW[CDColors.Brick_[4*ss, 14*ss, 4*ss, 0*ss]], bw]; CDColors.DefineColor[cut2, NEW[CDColors.Brick_[3*ss, 14*ss, 3*ss, 14*ss]], bit4]; CDColors.DefineColor[cut2, NEW[CDColors.Brick_[3*ss, 14*ss, 3*ss, 14*ss]], bw]; CDColors.DefineColor[wpdif, NEW[CDColors.Brick_[3*ss, 14*ss, 3*ss, 14*ss]], bit4]; CDColors.DefineColor[wpdif, NEW[CDColors.Brick_[3*ss, 14*ss, 3*ss, 14*ss]], bw]; END; Init: PROC [] = BEGIN cmos _ CD.RegisterTechnology[$cmos, "cmos"]; IF cmos=NIL THEN ERROR; cut _ CD.NewLayer[cmos, $cut]; pol _ CD.NewLayer[cmos, $pol]; ndif _ CD.NewLayer[cmos, $ndif]; met _ CD.NewLayer[cmos, $met]; imp _ CD.NewLayer[cmos, $imp]; ovg _ CD.NewLayer[cmos, $ovg]; bur _ CD.NewLayer[cmos, $bur]; pdif _ CD.NewLayer[cmos, $pdif]; wpdif _ CD.NewLayer[cmos, $wpdif]; pwelCont _ CD.NewLayer[cmos, $pwelCont]; met2 _ CD.NewLayer[cmos, $met2]; pwel _ CD.NewLayer[cmos, $pwel]; nwel _ CD.NewLayer[cmos, $nwel]; nwelCont _ CD.NewLayer[cmos, $nwelCont]; cut2 _ CD.NewLayer[cmos, $cut2]; CDDefaultsExtras.Substitute[abstract: wpdif, pure: pdif]; InitBricks[]; CifName[cut, "CC"]; CifName[ndif, "CD"]; CifName[pol, "CP"]; CifName[met, "CM"]; CifName[imp, "CI"]; CifName[nwel, "CNW"]; CifName[ovg, "CG"]; CifName[bur, "CB"]; CifName[nwelCont, "CD"]; CifName[met2, "CM2"]; CifName[cut2, "CC2"]; CifName[pdif, "CPI"]; CifName[pwelCont, "CPI"]; CifName[pwel, "CPW"]; CDPanel.DefineLayerEntry[cmos, ndif, "ndif", 0, 2*CD.lambda]; CDPanel.DefineLayerEntry[cmos, wpdif, "pdif", 0, 2*CD.lambda]; CDPanel.DefineLayerEntry[cmos, pol, "pol", 0, 2*CD.lambda]; CDPanel.DefineLayerEntry[cmos, met, "met", 0, 3*CD.lambda]; CDPanel.DefineLayerEntry[cmos, pwelCont, "p-wCnt", 0, 2*CD.lambda]; CDPanel.DefineLayerEntry[cmos, nwelCont, "n-wCnt", 0, 2*CD.lambda]; CDPanel.DefineLayerEntry[cmos, nwel, "nwel", 0, 0]; CDPanel.DefineLayerEntry[cmos, met2, "met2", 0, 4*CD.lambda]; CDPanel.DefineLayerEntry[cmos, cut, "cut", 0, 0]; CDPanel.DefineLayerEntry[cmos, cut2, "cut2", 0, 0]; CDPanel.DefineLayerEntry[cmos, ovg, "ovg", 0, 0]; CDPanel.DefineLayerEntry[cmos, bur, "bur", 0, 0]; CDPanel.DefineIntEntry[cdValueKey: $CDxSelectNewMode, tech: cmos, text: "select new:", min: 0, max: 1, default: 1]; CDPanel.DefineNewLine[cmos]; CDPanel.DefineIntEntry[cdValueKey: $CDxStepValue, tech: cmos, text: "step moves size:", min: 1, default: 1]; CDPanel.DefineNewLine[cmos]; CDSequencer.ImplementCommand[$SetLayerNWell, SetLayerNWell, cmos, doQueue]; CDSequencer.ImplementCommand[$SetLayerNDif, SetLayerDif, cmos, doQueue]; CDSequencer.ImplementCommand[$SetLayerPol, SetLayerPol, cmos, doQueue]; CDSequencer.ImplementCommand[$SetLayerMet, SetLayerMet, cmos, doQueue]; CDSequencer.ImplementCommand[$SetLayerMet2, SetLayerMet2, cmos, doQueue]; CDSequencer.ImplementCommand[$SetLayerPDif, SetLayerPDif, cmos, doQueue]; CDSequencer.ImplementCommand[$SetLayerNWCnt, SetLayerNWCnt, cmos, doQueue]; CDSequencer.ImplementCommand[$SetLayerPWCnt, SetLayerPWCnt, cmos, doQueue]; CDSequencer.ImplementCommand[$TestDifFlipToPWorld, DiffToPWorld, cmos, doQueue]; CDSequencer.ImplementCommand[$TestDifFlipToNWorld, DiffToNWorld, cmos, doQueue]; CDSequencer.ImplementCommand[$DiffToPWorld, DiffToPWorld, cmos, doQueue]; CDSequencer.ImplementCommand[$DiffToNWorld, DiffToNWorld, cmos, doQueue]; CDEvents.RegisterEventProc[$WriteTechnologyPrivate, WriteTechnologyKey, cmos]; CDEvents.RegisterEventProc[$ReadTechnologyPrivate, ReadTechnologyKey, cmos]; CDTipEtc.SetIcon[cmos, "Chipndale.icons", 3]; CDTipEtc.SetPanelIcon[cmos, "Chipndale.icons", 4]; CDTipEtc.SetTipTable[cmos, "Standard"]; HackContextColors[]; Commander.Register[ key: "CDNewCmos", proc: NewCWorld, doc: "Creates new cmos design" ]; Commander.Register[ key: "CDCmos", proc: Load, doc: "loads cmos ChipNDale" ]; TerminalIO.WriteRope["cmos impl\n"]; END; Init[]; END. 6CMosImpl.mesa Copyright c 1983, 1985 by Xerox Corporation. All rights reserved. by Ch. Jacobi, August 11, 1983 3:56 pm last edited Christian Jacobi, April 11, 1985 10:51:35 am PST --4bit colors-- CDColors.DefineColor[snerd, NEW[CDColors.Brick_[12345, 7865, 543, 0]], bit4]; CDColors.DefineColor[snerd, NEW[CDColors.Brick_[12345, 7865, 543, 0]], bw]; --wpdif should never be drawn snerd _ CD.NewLayer[cmos, $snerd]; NOcOL _ CD.NewLayer[cmos, $NOcOL]; CifName[snerd, "CX"]; CifName[NOcOL, "CY"]; CDPanel.DefineLayerEntry[cmos, pdif, "(p-dif)", 0, 2*CD.lambda]; Ê ¢˜šœ ™ Jšœ Ïmœ7™BJšœ&™&Jšœ<™Jšœ0žœ ˜;Jšœ0žœ ˜;Jšœ8žœ ˜CJšœ8žœ ˜CJšœ3˜3Jšœ2žœ ˜=Jšœ1˜1Jšœ3˜3Jšœ1˜1Jšœ1˜1Jšœ5žœ ™@J˜šœA˜AJ˜1—J˜Jšœn˜nJ˜J˜JšœK˜KJšœH˜HJšœG˜GJšœG˜GJšœI˜IJšœI˜IJšœK˜KJšœK˜KJ˜JšœP˜PJšœP˜PJšœI˜IJšœI˜IJ˜JšœN˜NJšœL˜LJ˜Jšœ-˜-Jšœ2˜2J˜Jšœ'˜'J˜Jšœ˜J˜šœ˜J˜J˜˜Jšœ˜——šœ˜J˜J˜ ˜Jšœ˜——J˜$Jšžœ˜—J˜J˜Jšžœ˜J˜—…—*X80