NMosImpl.mesa
Copyright © 1983, 1987 by Xerox Corporation. All rights reserved.
Created by Christian Jacobi, August 11, 1983 3:56 pm
Last Edited by: Christian Jacobi, March 19, 1987 4:47:54 pm PST
DIRECTORY
CD,
CDCommandOps,
CDColors,
CDEvents,
CDLayers,
CDPanel,
CDPrivate,
CDSequencer,
CDEnvironment,
ImagerColor USING [ColorFromRGB],
NMos,
Rope,
TerminalIO,
TokenIO;
NMosImpl: CEDAR PROGRAM
IMPORTS CD, CDCommandOps, CDColors, CDEvents, CDLayers, CDPanel, CDPrivate, CDSequencer, CDEnvironment, ImagerColor, 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 [CD.ObjectClass] =
BEGIN
RETURN [ CD.RegisterObjectClass[a, [technology: nmos]] ];
END;
SetLayerDif: PROC [comm: CDSequencer.Command] =
BEGIN
TerminalIO.PutRope["diffusion for default\n"];
CDLayers.SetCurrentLayer[comm.design, dif]
END;
SetLayerPol: PROC [comm: CDSequencer.Command] =
BEGIN
TerminalIO.PutRope["poly for default\n"];
CDLayers.SetCurrentLayer[comm.design, pol]
END;
SetLayerMet: PROC [comm: CDSequencer.Command] =
BEGIN
TerminalIO.PutRope["metal for default\n"];
CDLayers.SetCurrentLayer[comm.design, met]
END;
SetLayerMet2: PROC [comm: CDSequencer.Command] =
BEGIN
TerminalIO.PutRope["metal-2 for default\n"];
CDLayers.SetCurrentLayer[comm.design, met2]
END;
WriteTechnologyKey: CDEvents.EventProc =
BEGIN
h: TokenIO.Handle ← NARROW[x];
TokenIO.WriteAtom[h, $Version];
TokenIO.WriteInt[h, 0];
END;
ReadTechnologyKey: CDEvents.EventProc =
BEGIN
h: TokenIO.Handle ← NARROW[x];
dont←TRUE;
IF TokenIO.ReadAtom[h]=$Version THEN
IF TokenIO.ReadInt[h]=0 THEN dont←FALSE;
IF dont THEN TerminalIO.PutRope["NMos version miss-match\n"];
END;
InitBricks: PROC [] =
BEGIN
Init8Patterns: PROC [] =
--all parameter are discarded
BEGIN
green1: CARDINAL = 1;
yellow: CARDINAL = 2;
blue: CARDINAL = 4;
pinktr: CARDINAL = 8;
red: CARDINAL = 16;
black: CARDINAL = 127;
Checker8: PROC[col1, col2: CARDINAL] RETURNS[REF CDColors.Brick] =
BEGIN
RETURN[NEW[CDColors.Brick ← [col1*256+col2, col2*256+col1, col1*256+col2, col2*256+col1]]]
END;
DefineDimmer8: PROC[lev: CD.Layer, color: CARDINAL] =
BEGIN
CDColors.DefineColor[lev, Checker8[color, 0], bit8, pushedOut];
END;
Full8: PROC[color: CARDINAL] RETURNS [b: REF CDColors.Brick] =
BEGIN
RETURN[Checker8[color, color]]
END;
CDColors.DefineColor[dif, Full8[green1], bit8];
CDColors.DefineColor[met, Full8[blue], bit8];
CDColors.DefineColor[met2, Full8[pinktr], bit8];
CDColors.DefineColor[pol, Full8[red], bit8];
CDColors.DefineColor[cut, Full8[black], bit8];
CDColors.DefineColor[imp, Full8[yellow], bit8];
CDColors.DefineColor[imp0, Checker8[yellow, 0], bit8];
CDColors.DefineColor[impWeak, Checker8[yellow, 0], bit8];
CDColors.DefineColor[cut2, Checker8[black, blue], bit8];
CDColors.DefineColor[bur, Checker8[black, 0], bit8];
CDColors.DefineColor[ovg, Checker8[blue, pinktr], bit8];
CDColors.DefineColor[CD.backgroundLayer, NEW[CDColors.Brick ← [8, 0, 256*8, 0]], bit8];
CDColors.DefineColor[CD.errorLayer, NEW[CDColors.Brick ← [255, 0, 0, 0]], bit8];
CDColors.DefineColor[CD.shadeLayer, NEW[CDColors.Brick←[0, 255,0 , 255]], bit8];
DefineDimmer8[dif, green1];
DefineDimmer8[met, blue];
DefineDimmer8[met2, pinktr];
DefineDimmer8[pol, red];
DefineDimmer8[imp, yellow];
DefineDimmer8[cut, black];
DefineDimmer8[cut2, black];
-- no change for bur and ovgc for this background
-- no change for bur, nwelCont, pwelCont, and ovgc for this background
END;
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[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[pol, NEW[CDColors.Brick←[8*ss, 4*ss, 2*ss, 1*ss]], bw];
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←[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[imp0, NEW[CDColors.Brick←[14, 14, 0, 1]], bit4];
CDColors.DefineColor[imp0, NEW[CDColors.Brick←[2*ss, 0, 2*ss, 1]], bw];
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[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[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*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←[3*ss, 14*ss, 3*ss, 14*ss]], bit4];
CDColors.DefineIColor[dif, ImagerColor.ColorFromRGB[[0, 1, 0]], bit8];
CDColors.DefineIColor[pol, ImagerColor.ColorFromRGB[[1, 0, 0]], bit8];
CDColors.DefineIColor[met, ImagerColor.ColorFromRGB[[0, 0, 1]], bit8];
CDColors.DefineIColor[met2, ImagerColor.ColorFromRGB[[0.7, 0.4, 0.7]], bit8];
CDColors.DefineIColor[ovg, ImagerColor.ColorFromRGB[[0.5, 0.5, 0.5]], bit8];
CDColors.DefineIColor[cut, ImagerColor.ColorFromRGB[[0, 0, 0.1]], bit8];
CDColors.DefineIColor[cut2, ImagerColor.ColorFromRGB[[0, 0.1, 0]], bit8];
CDColors.DefineIColor[bur, ImagerColor.ColorFromRGB[[0.1, 0.1, 0]], bit8];
CDColors.DefineIColor[imp, ImagerColor.ColorFromRGB[[1, 1, 0]], bit8];
CDColors.DefineIColor[imp0, ImagerColor.ColorFromRGB[[0.8, 0.8, 0]], bit8];
CDColors.DefineIColor[impWeak, ImagerColor.ColorFromRGB[[0.9, 0.9, 0]], bit8];
Init8Patterns[]
END;
Init: PROC [] =
BEGIN
nmos ← CD.RegisterTechnology[$NMosA, "NMosA", 2];
CDPrivate.ConvertTechnologyKey[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];
CDPanel.Layer[dif, "dif", 0, 2*NMos.lambda, 1, nmos];
CDPanel.Layer[pol, "pol", 0, 2*NMos.lambda, 1, nmos];
CDPanel.Layer[met, "met", 0, 3*NMos.lambda, 1, nmos];
CDPanel.Layer[met2, "met2", 0, 4*NMos.lambda, 1, nmos];
CDPanel.Layer[cut, "cut", 0, 0, 2, nmos];
CDPanel.Layer[cut2, "cut2", 0, 0, 2, nmos];
CDPanel.Layer[ovg, "ovg", 0, 0, 2, nmos];
CDPanel.Layer[imp, "imp", 0, 0, 2, nmos];
CDPanel.Layer[imp0, "imp0", 0, 0, 2, nmos];
CDPanel.Layer[impWeak, "impWeak", 0, 0, 2, nmos];
CDPanel.Layer[CD.commentLayer, " black ", 0, NMos.lambda, 0, nmos];
CDPanel.Number[number: [cdValueKey: $CDxSelectNewMode], tech: nmos, button: [text: "select new:"], min: 0, max: 1, default: 1, lambda: 1];
CDPanel.Number[number: [cdValueKey: $CDxStepValue], tech: nmos, button: [text: "step move size:"], min: 0, default: 0, lambda: NMos.lambda];
CDPanel.Line[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];
CDEnvironment.SetTipTable[nmos, "Standard"];
CDEnvironment.SetIcon[nmos, "Chipndale.icons", 5];
CDEnvironment.SetPanelIcon[nmos, "Chipndale.icons", 4];
InitBricks[];
CDCommandOps.RegisterCommanderNewDesign[nmos];
TerminalIO.PutRope["NMosA impl\n"];
END;
Init[];
END.