NMosImpl.mesa
Copyright © 1983, 1985 by Xerox Corporation. All rights reserved.
by Ch. Jacobi, August 11, 1983 3:56 pm
last edited Christian Jacobi, April 11, 1985 3:23:31 pm PST
DIRECTORY
CD,
CDColors,
CDEvents,
CDOps,
CDPanel,
CDProperties,
CDSequencer,
CDTipEtc,
CDViewer,
Commander USING [CommandProc, Register],
GraphicsColor,
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;
cut: PUBLIC CD.Layer;
pol: PUBLIC CD.Layer;
dif: PUBLIC CD.Layer;
met: PUBLIC CD.Layer;
imp: PUBLIC CD.Layer;
imp0: PUBLIC CD.Layer;
impWeak: PUBLIC CD.Layer;
ovg: PUBLIC CD.Layer;
bur: PUBLIC CD.Layer;
snerd: PUBLIC CD.Layer ← CD.highLightError;
nwel: PUBLIC CD.Layer;
nwelCont: PUBLIC CD.Layer;
NOcOL: PUBLIC CD.Layer ← CD.highLightError;
met2: PUBLIC CD.Layer;
cut2: PUBLIC CD.Layer;
RegisterObjectType: PUBLIC PROC [a: ATOM] RETURNS [REF CD.ObjectProcs] =
BEGIN
RETURN [ CD.RegisterObjectType[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[nwelCont, NEW[CDColors.Brick←[1*ss, 1*ss, 2*ss, 1*ss]], bit4];
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[nwel, NEW[CDColors.Brick←[8*s1, 0, 0, 0]], bit4];
CDColors.DefineColor[nwel, NEW[CDColors.Brick←[4*ss, 0, 0, 0]], bw];
CDColors.DefineColor[nwel, NEW[CDColors.Brick←[8*s1, 0, 0, 0]], 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[snerd, NEW[CDColors.Brick←[12345, 7865, 543, 0]], 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];
snerd ← CD.NewLayer[nmos, $snerd];
nwel ← CD.NewLayer[nmos, $nwel];
nwelCont ← CD.NewLayer[nmos, $nwelCont];
NOcOL ← CD.NewLayer[nmos, $NOcOL];
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[nwel, "$Y"];
CifName[ovg, "$NG"];
CifName[bur, "$NB"];
CifName[snerd, "$U"];
CifName[nwelCont, "$W"];
CifName[NOcOL, "$X"];
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.DefineLayerEntry[nmos, imp0, "imp0", 0, 0];
CDPanel.DefineLayerEntry[nmos, impWeak, "impWeak", 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.