CMosBImpl.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, August 25, 1987 5:46:26 pm PDT
DIRECTORY
CD,
CDColors,
CDLayers,
CDEnvironment,
CDEvents,
CDPanel,
CDPrivate,
CDProperties,
CDRects,
CMosB,
CMosBExtras,
Imager,
ImagerColor,
ImagerDitherContext,
Rope,
TerminalIO,
TokenIO;
CMosBImpl:
CEDAR
PROGRAM
IMPORTS CD, CDColors, CDEnvironment, CDEvents, CDLayers, CDPanel, CDPrivate, CDProperties, CDRects, CMosB, Imager, ImagerColor, TerminalIO, TokenIO
EXPORTS CMosB,CMosBExtras
SHARES CDLayers, CDRects =
cmosB: PUBLIC CD.Technology ← CD.RegisterTechnology[$cmosB, "CMosB", lambda];
lambda: CD.Number = CMosB.lambda;
wellSurround: CD.Number = CMosB.wellSurround;
wellCntSurround: CD.Number = CMosB.wellCntSurround;
ndif: PUBLIC CD.Layer;
pdif: PUBLIC CD.Layer;
pwellCont: PUBLIC CD.Layer;
nwellCont: PUBLIC CD.Layer;
wndif: PUBLIC CD.Layer;
wpdif: PUBLIC CD.Layer;
wpwellCont: PUBLIC CD.Layer;
wnwellCont: PUBLIC CD.Layer;
pwell: PUBLIC CD.Layer;
nwell: PUBLIC CD.Layer;
pol: PUBLIC CD.Layer;
met: PUBLIC CD.Layer;
met2: PUBLIC CD.Layer;
ovg: PUBLIC CD.Layer;
cut: PUBLIC CD.Layer;
cut2: PUBLIC CD.Layer;
bur: PUBLIC CD.Layer;
imp: PUBLIC CD.Layer;
bond: PUBLIC CD.Layer;
wpdifClass:
CD.ObjectClass =
CD.RegisterObjectClass[$C2PDifRect, [
internalRead: CDRects.wellRectClass.internalRead,
technology: CMosB.cmosB
]];
wndifClass:
CD.ObjectClass =
CD.RegisterObjectClass[$C2NDifRect, [
internalRead: CDRects.wellRectClass.internalRead,
technology: CMosB.cmosB
]];
WriteTechnologyKey: CDEvents.EventProc = {
h: TokenIO.Handle ← NARROW[x];
TokenIO.WriteAtom[h, $CMosB];
TokenIO.WriteInt[h, 1];
ReadTechnologyKey: CDEvents.EventProc = {
h: TokenIO.Handle ← NARROW[x];
dont ← TRUE;
IF TokenIO.ReadAtom[h]=$CMosB
THEN {
version: INT = TokenIO.ReadInt[h];
IF version=1 THEN dont ← FALSE
ELSE
IF version=0
THEN {
TerminalIO.PutRope["WARNING: Old version: p-diffusion may be displaced\n"];
dont ← FALSE
};
};
IF dont THEN TerminalIO.PutRope["CMosB version miss-match\n"];
};
InitKernel:
PROC [] = {
--layers
ndif ← CD.NewLayer[cmosB, $ndif];
pdif ← CD.NewLayer[cmosB, $pdif];
wndif ← CD.NewLayer[cmosB, $wndif];
wpdif ← CD.NewLayer[cmosB, $wpdif];
pwell ← CD.NewLayer[cmosB, $pwel];
nwell ← CD.NewLayer[cmosB, $nwel];
pwellCont ← CD.NewLayer[cmosB, $pwelCont];
nwellCont ← CD.NewLayer[cmosB, $nwelCont];
wpwellCont ← CD.NewLayer[cmosB, $wPWellCont];
wnwellCont ← CD.NewLayer[cmosB, $wNWellCont];
pol ← CD.NewLayer[cmosB, $pol];
met ← CD.NewLayer[cmosB, $met];
met2 ← CD.NewLayer[cmosB, $met2];
ovg ← CD.NewLayer[cmosB, $ovg];
cut ← CD.NewLayer[cmosB, $cut];
cut2 ← CD.NewLayer[cmosB, $cut2];
imp ← CD.NewLayer[cmosB, $imp];
bur ← CD.NewLayer[cmosB, $bur];
bond ← CD.NewLayer[cmosB, $bond];
CDPrivate.ConvertLayer[cmosB, $comment, CD.commentLayer];
CDLayers.MakeSuppressIR[nwell];
CDLayers.MakeSuppressIR[pwell];
CDLayers.MakeAbstract[abstract: wpdif, paint: pdif, well: nwell, wSurr: wellSurround];
CDLayers.MakeAbstract[abstract: wndif, paint: ndif, well: pwell, wSurr: wellSurround];
CDLayers.MakeAbstract[abstract: wnwellCont, paint: nwellCont, well: nwell, wSurr: wellCntSurround];
CDLayers.MakeAbstract[abstract: wpwellCont, paint: pwellCont, well: pwell, wSurr: wellCntSurround];
--events
CDEvents.RegisterEventProc[$WriteTechnologyPrivate, WriteTechnologyKey, cmosB];
CDEvents.RegisterEventProc[$ReadTechnologyPrivate, ReadTechnologyKey, cmosB];
};
InitBricks:
PROC [] = {
bw: CDColors.DisplayType = CDColors.DisplayType[bw];
--8 bit colors--
nDiffColor: CARDINAL = 1;
pDiffColor: CARDINAL = 2;
met1Color: CARDINAL = 4;
met2Color: CARDINAL = 8;
polyColor: CARDINAL = 16;
nWellColor: CARDINAL = 32;
pWellColor: CARDINAL = 64;
black: CARDINAL = 127;
Checker8:
PROC [col1, col2:
CARDINAL]
RETURNS[
REF CDColors.Brick] = {
RETURN[NEW[CDColors.Brick ← [col1*256+col2, col2*256+col1, col1*256+col2, col2*256+col1]]]
};
DefineDimmer8:
PROC [lev:
CD.Layer, color:
CARDINAL] = {
CDColors.DefineColor[lev, Checker8[color, 0], bit8, pushedOut];
};
--8 bit colors
CDColors.DefineColor[ndif, Checker8[nDiffColor, nDiffColor], bit8];
CDColors.DefineColor[pdif, Checker8[pDiffColor, pDiffColor], bit8];
CDColors.DefineColor[met, Checker8[met1Color, met1Color], bit8];
CDColors.DefineColor[met2, Checker8[met2Color, met2Color], bit8];
CDColors.DefineColor[pol, Checker8[polyColor, polyColor], bit8];
CDColors.DefineColor[nwell, Checker8[nWellColor, nWellColor], bit8];
CDColors.DefineColor[pwell, Checker8[pWellColor, pWellColor], bit8];
CDColors.DefineColor[cut, Checker8[black, black], bit8];
CDColors.DefineColor[cut2, Checker8[black, met1Color], bit8];
CDColors.DefineColor[nwellCont, Checker8[pDiffColor, met1Color], bit8];
CDColors.DefineColor[pwellCont, Checker8[nDiffColor, met1Color], bit8];
CDColors.DefineColor[ovg, Checker8[met1Color, met2Color], bit8];
CDColors.DefineColor[bur, Checker8[black, 0], bit8];
CDColors.DefineColor[imp, NEW[CDColors.Brick←[14, 14, 0, 0]], bit8];
CDColors.DefineColor[bond, NEW[CDColors.Brick←[14, 14, 0, 0]], bit8];
DefineDimmer8[ndif, nDiffColor];
DefineDimmer8[pdif, pDiffColor];
DefineDimmer8[met, met1Color];
DefineDimmer8[met2, met2Color];
DefineDimmer8[pol, polyColor];
DefineDimmer8[nwell, nWellColor];
DefineDimmer8[cut, black];
DefineDimmer8[cut2, black];
-- no dimmers for nwelCont, pwelCont, and ovg
CDColors.DefineColor[cut, NEW[CDColors.Brick←[7777H, 0BBBBH, 7777H, 0BBBBH]], bw];
CDColors.DefineColor[ndif, NEW[CDColors.Brick←[4444H, 1111H, 4444H, 1111H]], bw];
CDColors.DefineColor[pdif, NEW[CDColors.Brick←[5555H, 1111H, 4444H, 1111H]], bw];
CDColors.DefineColor[pwellCont, NEW[CDColors.Brick←[0, 1111H, 4444H, 1111H]], bw];
CDColors.DefineColor[nwellCont, NEW[CDColors.Brick←[2222H, 1111H, 4444H, 1111H]], bw];
CDColors.DefineColor[pol, NEW[CDColors.Brick←[8888H, 4444H, 2222H, 1111H]], bw];
CDColors.DefineColor[met, NEW[CDColors.Brick←[8888H, 2222H, 0, 0]], bw];
CDColors.DefineColor[met2, NEW[CDColors.Brick←[8888H, 8888H, 2222H, 2222H]], bw];
CDColors.DefineColor[nwell, NEW[CDColors.Brick←[4444H, 0, 0, 0]], bw];
CDColors.DefineColor[pwell, NEW[CDColors.Brick←[2222H, 0, 0, 0]], bw];
CDColors.DefineColor[ovg, NEW[CDColors.Brick←[4444H, 0EEEEH, 4444H, 0]], bw];
CDColors.DefineColor[cut2, NEW[CDColors.Brick←[3333H, 0EEEEH, 3333H, 0EEEEH]], bw];
CDColors.DefineColor[bur, NEW[CDColors.Brick←[4444H, 0EEEEH, 4444H, 0]], bw];
CDColors.DefineColor[imp, NEW[CDColors.Brick←[2222H, 0, 2222H, 0]], bw];
CDColors.DefineColor[bond, NEW[CDColors.Brick←[2222H, 0, 2222H, 0]], bw];
CDColors.DefineColor[wpdif,
NEW[CDColors.Brick←[3333H, 0EEEEH, 3333H, 0EEEEH]], bw];
--wpdif must never be drawn
CDColors.DefineIColor[ndif, ImagerColor.ColorFromRGB[[0, 1, 0]], bit8];
CDColors.DefineIColor[pdif, ImagerColor.ColorFromRGB[[0, 1, 0]], bit8];
CDColors.DefineIColor[nwell, ImagerColor.ColorFromRGB[[0.8, 0.8, 0.5]], bit8];
CDColors.DefineIColor[pwellCont, ImagerColor.ColorFromRGB[[0, 1, 0]], bit8];
CDColors.DefineIColor[nwellCont, 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[met,
ImagerDitherContext.MakeSpecialColor[
ordinaryColor: ImagerColor.ColorFromRGB[[1, 0, 0]],
specialPixel: [met1Color, or],
name: "Xerox/Research/ChipNDale/CMosB/met"
],
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[bond, ImagerColor.ColorFromRGB[[1, 1, 0]], bit8];
CDColors.DefineIColor[imp, ImagerColor.ColorFromRGB[[1, 1, 0]], bit8];
CDProperties.PutLayerProp[cut, $CDxInterpressPlotColor, Imager.black];
CDProperties.PutLayerProp[cut2, $CDxInterpressPlotColor, Imager.black];
};
InitUserInterface:
PROC [] = {
CDPanel.Layer[ndif, "ndif", 0, 2*lambda, 1, cmosB];
CDPanel.Layer[wpdif, "w-pdif", 0, 2*lambda, 1, cmosB];
CDPanel.Layer[pol, "pol", 0, 2*lambda, 1, cmosB];
CDPanel.Layer[met, "met", 0, 3*lambda, 1, cmosB];
CDPanel.Layer[pwellCont, "pWCt", 0, 2*lambda, 1, cmosB];
CDPanel.Layer[wnwellCont, "w-nWCt", 0, 2*lambda, 1, cmosB];
CDPanel.Layer[nwell, "nwell", 0, 0, 1, cmosB];
CDPanel.Layer[met2, "met2", 0, 4*lambda, 1, cmosB];
CDPanel.Layer[CD.commentLayer, " black ", 0, lambda/2, 0, cmosB];
CDPanel.Layer[CD.FetchLayer[NIL, $red], " red ", 0, lambda/2, 0, cmosB];
CDPanel.Layer[CD.FetchLayer[NIL, $green], " green ", 0, lambda/2, 0, cmosB];
CDPanel.Layer[CD.FetchLayer[NIL, $blue], " blue ", 0, lambda/2, 0, cmosB];
CDPanel.Layer[CD.FetchLayer[NIL, $yellow], " dirty-yellow", 0, lambda/2, 0, cmosB];
CDPanel.Layer[ovg, "ovg", 0, 0, 2, cmosB];
CDPanel.Layer[cut, "cut", 0, 0, 2, cmosB];
CDPanel.Layer[cut2, "cut2", 0, 0, 2, cmosB];
CDPanel.Layer[bur, "bur", 0, 0, 2, cmosB];
CDPanel.Layer[imp, "imp", 0, 0, 2, cmosB];
CDPanel.Layer[bond, "bond", 0, 4*lambda, 2, cmosB];
CDPanel.Layer[pdif, "[pdif]", 0, 2*lambda, 2, cmosB];
CDPanel.Layer[nwellCont, "[nWCt]", 0, 2*lambda, 2, cmosB];
CDPanel.Layer[pwell, "[pwell]", 0, 0, 2, cmosB];
CDPanel.Layer[wndif, "[w-ndif]", 0, 2*lambda, 2, cmosB];
CDPanel.Layer[wpwellCont, "[w-pWCt]", 0, 2*lambda, 2, cmosB];
CDPanel.Number[number: [cdValueKey: $CDxStepValue, redisplay: TRUE], tech: cmosB, button: [text: "step move dist:"], min: 0, default: 0, lambda: lambda];
CDPanel.Number[number: [cdValueKey: $CDxSelectNewMode], tech: cmosB, button: [text: "select new mode:", xpos: 180], min: 0, max: 1, default: 1, lambda: 1];
CDPanel.Line[cmosB];
CDEnvironment.SetIcon[cmosB, "Chipndale.icons", 3];
CDEnvironment.SetPanelIcon[cmosB, "Chipndale.icons", 4];
CDEnvironment.SetTipTable[cmosB, "Standard"];
CDProperties.PutTechnologyProp[cmosB, $CDxDefaultPrintScaleNum, NEW[INT𡤂]];
TerminalIO.PutRope["cmos-B impl\n"];
};
InitKernel[];
InitBricks[];
InitUserInterface[];
END.