<> <> <> <> DIRECTORY CD, CDColors, CDEvents, CDOps, CDPanel, CDProperties, CDSequencer, CDTipEtc, CDViewer, Commander USING [CommandProc, Register], IO, NMos, Rope, TerminalIO, TokenIO; NMosImpl: CEDAR PROGRAM IMPORTS CD, CDColors, CDEvents, CDOps, CDPanel, CDProperties, CDSequencer, CDTipEtc, CDViewer, Commander, IO, TerminalIO, TokenIO EXPORTS NMos = BEGIN nmos: PUBLIC CD.Technology; pol: PUBLIC CD.Layer; dif: PUBLIC CD.Layer; met: PUBLIC CD.Layer; met2: PUBLIC CD.Layer; imp: PUBLIC CD.Layer; imp0: PUBLIC CD.Layer; impWeak: PUBLIC CD.Layer; ovg: PUBLIC CD.Layer; bur: PUBLIC CD.Layer; cut: PUBLIC CD.Layer; cut2: PUBLIC CD.Layer; RegisterObjectClass: PUBLIC PROC [a: ATOM] RETURNS [REF CD.ObjectClass] = BEGIN RETURN [ CD.RegisterObjectClass[a, nmos] ]; END; Load: Commander.CommandProc = BEGIN cmd.out.PutRope["nmos loaded\n"]; END; NewNWorld: Commander.CommandProc = BEGIN design: CD.Design _ CDOps.CreateDesign[nmos]; [] _ CDViewer.CreateViewer[design]; END; CifName: PROC [lev: CD.Layer, name: Rope.ROPE] = BEGIN CDProperties.PutPropOnLayer[onto: lev, prop: $CDxCIFName, val: name] END; SetLayerDif: PROC [comm: CDSequencer.Command] = BEGIN TerminalIO.WriteRope["diffusion for default\n"]; CDPanel.StoreDefaultLayer[comm.design, dif] END; SetLayerPol: PROC [comm: CDSequencer.Command] = BEGIN TerminalIO.WriteRope["poly for default\n"]; CDPanel.StoreDefaultLayer[comm.design, pol] END; SetLayerMet: PROC [comm: CDSequencer.Command] = BEGIN TerminalIO.WriteRope["metal for default\n"]; CDPanel.StoreDefaultLayer[comm.design, met] END; SetLayerMet2: PROC [comm: CDSequencer.Command] = BEGIN TerminalIO.WriteRope["metal-2 for default\n"]; CDPanel.StoreDefaultLayer[comm.design, met2] END; WriteTechnologyKey: CDEvents.EventProc = BEGIN TokenIO.WriteAtom[$Version]; TokenIO.WriteInt[0]; END; ReadTechnologyKey: CDEvents.EventProc = BEGIN dont_TRUE; IF TokenIO.ReadAtom[]=$Version THEN IF TokenIO.ReadInt[]=0 THEN dont_FALSE; IF dont THEN TerminalIO.WriteRope["NMos version miss-match\n"]; END; InitBricks: PROC [] = BEGIN s1: CARDINAL = 1; s2: CARDINAL = 16; s3: CARDINAL = 16*16; s4: CARDINAL = 16*16*16; ss: CARDINAL = s1+s2+s3+s4; sf: CARDINAL = s1+s3; <<--4bit colors-->> 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[cut, NEW[CDColors.Brick_[7*sf, 11*sf, 7*sf, 11*sf]], bit8]; CDColors.DefineColor[dif, NEW[CDColors.Brick_[green*ss, green*ss, green*ss, green*ss]], bit4]; CDColors.DefineColor[dif, NEW[CDColors.Brick_[4*ss, ss, 4*ss, ss]], bw]; CDColors.DefineColor[dif, NEW[CDColors.Brick_[1*sf, 1*sf, 1*sf, 1*sf]], bit8]; CDColors.DefineColor[pol, NEW[CDColors.Brick_[8*ss, 4*ss, 2*ss, 1*ss]], bw]; CDColors.DefineColor[pol, NEW[CDColors.Brick_[1*sf, 1*sf, 1*sf, 1*sf]], bit8]; CDColors.DefineColor[pol, NEW[CDColors.Brick_[red*ss, red*ss, red*ss, red*ss]], bit4]; CDColors.DefineColor[met, NEW[CDColors.Brick_[8*ss, 2*ss, 0, 0]], bw]; CDColors.DefineColor[met, NEW[CDColors.Brick_[2*sf, 2*sf, 2*sf, 2*sf]], bit8]; CDColors.DefineColor[met, NEW[CDColors.Brick_[blue*ss, blue*ss, blue*ss, blue*ss]], bit4]; 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[imp, NEW[CDColors.Brick_[14, 14, 0, 0]], bit8]; CDColors.DefineColor[imp0, NEW[CDColors.Brick_[14, 14, 0, 1]], bit4]; CDColors.DefineColor[imp0, NEW[CDColors.Brick_[2*ss, 0, 2*ss, 1]], bw]; CDColors.DefineColor[imp0, NEW[CDColors.Brick_[14, 14, 0, 1]], bit8]; CDColors.DefineColor[impWeak, NEW[CDColors.Brick_[14, 14, 0, 2]], bit4]; CDColors.DefineColor[impWeak, NEW[CDColors.Brick_[2*ss, 0, 2*ss, 2]], bw]; CDColors.DefineColor[impWeak, NEW[CDColors.Brick_[14, 14, 0, 2]], bit8]; 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[met2, NEW[CDColors.Brick_[2*sf, 29*sf, 2*sf, 37*sf]], bit8]; 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_[4*ss, 14*ss, 4*ss, 0*ss]], bw]; CDColors.DefineColor[ovg, NEW[CDColors.Brick_[8*sf, 8*sf, 8*sf, 8*sf]], bit8]; CDColors.DefineColor[ovg, NEW[CDColors.Brick_[8*ss, 8*ss, 8*ss, 8*ss]], bit4]; CDColors.DefineColor[cut2, NEW[CDColors.Brick_[3*ss, 14*ss, 3*ss, 14*ss]], bw]; CDColors.DefineColor[cut2, NEW[CDColors.Brick_[2*ss, 10*ss, 4*ss, 5*ss]], bit8]; CDColors.DefineColor[cut2, NEW[CDColors.Brick_[3*ss, 14*ss, 3*ss, 14*ss]], bit4]; END; Init: PROC [] = BEGIN nmos _ CD.RegisterTechnology[$nmos, "nmos"]; IF nmos=NIL THEN ERROR; cut _ CD.NewLayer[nmos, $cut]; pol _ CD.NewLayer[nmos, $pol]; dif _ CD.NewLayer[nmos, $dif]; met _ CD.NewLayer[nmos, $met]; imp _ CD.NewLayer[nmos, $imp]; imp0 _ CD.NewLayer[nmos, $imp0]; impWeak _ CD.NewLayer[nmos, $impWeak]; ovg _ CD.NewLayer[nmos, $ovg]; bur _ CD.NewLayer[nmos, $bur]; met2 _ CD.NewLayer[nmos, $met2]; cut2 _ CD.NewLayer[nmos, $cut2]; CDTipEtc.SetTipTable[nmos, "Standard"]; CifName[cut, "$NC"]; CifName[dif, "$N"]; CifName[pol, "$NP"]; CifName[met, "$NM"]; CifName[imp, "$NI"]; CifName[imp0, "$ERROR"]; CifName[impWeak, "$ERROR"]; CifName[ovg, "$NG"]; CifName[bur, "$NB"]; CifName[met2, "$NM2"]; CifName[cut2, "$NC2"]; CDPanel.DefineLayerEntry[nmos, dif, "dif", 0, 2*CD.lambda]; CDPanel.DefineLayerEntry[nmos, pol, "pol", 0, 2*CD.lambda]; CDPanel.DefineLayerEntry[nmos, met, "met", 0, 3*CD.lambda]; CDPanel.DefineLayerEntry[nmos, met2, "met2", 0, 4*CD.lambda]; CDPanel.DefineLayerEntry[nmos, cut, "cut", 0, 0]; CDPanel.DefineLayerEntry[nmos, cut2, "cut2", 0, 0]; CDPanel.DefineLayerEntry[nmos, ovg, "ovg", 0, 0]; <<>> CDPanel.DefineLayerEntry[nmos, imp, "imp", 0, 0]; <> <> <<>> CDPanel.DefineIntEntry[cdValueKey: $CDxSelectNewMode, tech: nmos, text: "select new:", min: 0, max: 1, default: 1]; CDPanel.DefineNewLine[nmos]; CDPanel.DefineIntEntry[cdValueKey: $CDxStepValue, tech: nmos, text: "step moves size:", min: 1, default: 1]; CDPanel.DefineNewLine[nmos]; CDEvents.RegisterEventProc[$WriteTechnologyPrivate, WriteTechnologyKey, nmos]; CDEvents.RegisterEventProc[$ReadTechnologyPrivate, ReadTechnologyKey, nmos]; CDSequencer.ImplementCommand[$SetLayerNDif, SetLayerDif, nmos]; CDSequencer.ImplementCommand[$SetLayerPol, SetLayerPol, nmos]; CDSequencer.ImplementCommand[$SetLayerMet, SetLayerMet, nmos]; CDSequencer.ImplementCommand[$SetLayerMet2, SetLayerMet2, nmos]; CDTipEtc.SetIcon[nmos, "Chipndale.icons", 5]; CDTipEtc.SetPanelIcon[nmos, "Chipndale.icons", 4]; InitBricks[]; Commander.Register[ key: "CDNmos", proc: Load, doc: "loads nmos ChipNDale" ]; Commander.Register[ key: "CDNewNmos", proc: NewNWorld, doc: "Creates new nmos design" ]; TerminalIO.WriteRope["nmos impl\n"]; END; Init[]; END.