InitKernel:
PROC [] =
BEGIN
cmosB ← CD.RegisterTechnology[$cmosB, "CMosB", lambda];
--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];
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];
ovg ← CD.NewLayer[cmosB, $ovg];
imp ← CD.NewLayer[cmosB, $imp];
bur ← CD.NewLayer[cmosB, $bur];
comment ← CD.NewLayer[cmosB, $comment];
CDLayers.MakeAbstract[abstract: wpdif, represents: pdif];
CDLayers.MakeAbstract[abstract: wndif, represents: ndif];
--events
CDEvents.RegisterEventProc[$WriteTechnologyPrivate, WriteTechnologyKey, cmosB];
CDEvents.RegisterEventProc[$ReadTechnologyPrivate, ReadTechnologyKey, cmosB];
END;
InitBricks:
PROC [] =
BEGIN
bit4: CDColors.DisplayType = CDColors.DisplayType[bit4];
bw: CDColors.DisplayType = CDColors.DisplayType[bw];
f: CARDINAL = 1111h;
--8bit 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] =
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;
--8 bit colors
CDColors.DefineColor[ndif, Full8[nDiffColor], bit8];
CDColors.DefineColor[pdif, Full8[pDiffColor], bit8];
CDColors.DefineColor[met, Full8[met1Color], bit8];
CDColors.DefineColor[met2, Full8[met2Color], bit8];
CDColors.DefineColor[pol, Full8[polyColor], bit8];
CDColors.DefineColor[nwell, Full8[nWellColor], bit8];
CDColors.DefineColor[pwell, Full8[pWellColor], bit8];
CDColors.DefineColor[cut, Full8[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[CD.backGround, NEW[CDColors.Brick ← [8, 0, 256*8, 0]], bit8];
CDColors.DefineColor[CD.highLightError, NEW[CDColors.Brick ← [255, 0, 0, 0]], bit8];
CDColors.DefineColor[CD.highLightShade, NEW[CDColors.Brick←[0, 255,0 , 255]], bit8];
CDColors.DefineColor[comment, Full8[black], 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];
DefineDimmer8[comment, black];
-- no dimmers for nwelCont, pwelCont, and ovg
CDColors.DefineColor[cut, NEW[CDColors.Brick←[7*f, 11*f, 7*f, 11*f]], bit4];
CDColors.DefineColor[cut, NEW[CDColors.Brick←[7*f, 11*f, 7*f, 11*f]], bw];
CDColors.DefineColor[comment, NEW[CDColors.Brick←[11*f, 11*f, 11*f, 11*f]], bit4];
CDColors.DefineColor[comment, NEW[CDColors.Brick←[7*f, 11*f, 13*f, 14*f]], bw];
CDColors.DefineColor[ndif, NEW[CDColors.Brick←[1*f, 1*f, 1*f, 1*f]], bit4];
CDColors.DefineColor[ndif, NEW[CDColors.Brick←[4*f, f, 4*f, f]], bw];
CDColors.DefineColor[pdif, NEW[CDColors.Brick←[1*f, 3*f, 1*f, 1*f]], bit4];
CDColors.DefineColor[pdif, NEW[CDColors.Brick←[5*f, f, 4*f, f]], bw];
CDColors.DefineColor[pwellCont, NEW[CDColors.Brick←[1*f, 1*f, 0*f, 1*f]], bit4];
CDColors.DefineColor[pwellCont, NEW[CDColors.Brick←[0*f, f, 4*f, f]], bw];
CDColors.DefineColor[nwellCont, NEW[CDColors.Brick←[1*f, 1*f, 2*f, 1*f]], bit4];
CDColors.DefineColor[nwellCont, NEW[CDColors.Brick←[2*f, f, 4*f, f]], bw];
CDColors.DefineColor[pol, NEW[CDColors.Brick←[4*f, 4*f, 4*f, 4*f]], bit4];
CDColors.DefineColor[pol, NEW[CDColors.Brick←[8*f, 4*f, 2*f, 1*f]], bw];
CDColors.DefineColor[met, NEW[CDColors.Brick←[2*f, 2*f, 2*f, 2*f]], bit4];
CDColors.DefineColor[met, NEW[CDColors.Brick←[8*f, 2*f, 0, 0]], bw];
CDColors.DefineColor[met2, NEW[CDColors.Brick←[222h, 2222h, 0F222h, 2222h]], bit4];
CDColors.DefineColor[met2, NEW[CDColors.Brick←[8*f, 8*f, 2*f, 2*f]], bw];
CDColors.DefineColor[nwell, NEW[CDColors.Brick←[8, 0, 0, 0]], bit4];
CDColors.DefineColor[nwell, NEW[CDColors.Brick←[4*f, 0, 0, 0]], bw];
CDColors.DefineColor[pwell, NEW[CDColors.Brick←[4, 0, 0, 0]], bit4];
CDColors.DefineColor[pwell, NEW[CDColors.Brick←[2*f, 0, 0, 0]], bw];
CDColors.DefineColor[ovg, NEW[CDColors.Brick←[8*f, 8*f, 8*f, 8*f]], bit4];
CDColors.DefineColor[ovg, NEW[CDColors.Brick←[4*f, 14*f, 4*f, 0*f]], bw];
CDColors.DefineColor[cut2, NEW[CDColors.Brick←[3*f, 14*f, 3*f, 14*f]], bit4];
CDColors.DefineColor[cut2, NEW[CDColors.Brick←[3*f, 14*f, 3*f, 14*f]], bw];
CDColors.DefineColor[bur, NEW[CDColors.Brick←[11*f, 11*f, 11*f, 11*f]], bit4];
CDColors.DefineColor[bur, NEW[CDColors.Brick←[4*f, 14*f, 4*f, 0*f]], bw];
CDColors.DefineColor[imp, NEW[CDColors.Brick←[14*f, 14*f, 14*f, 14*f]], bit4];
CDColors.DefineColor[imp, NEW[CDColors.Brick←[2*f, 0, 2*f, 0]], bw];
--wpdif must never be drawn
CDColors.DefineColor[wpdif, NEW[CDColors.Brick←[3*f, 14*f, 3*f, 14*f]], bit4];
CDColors.DefineColor[wpdif, NEW[CDColors.Brick←[3*f, 14*f, 3*f, 14*f]], bw];
ColorMaps.RegisterMenu["cmos-b", CDIO.MakeName["cmosb", "ColorMap", FileNames.CurrentWorkingDirectory[]]];
END;
InitUserInterface:
PROC [] =
BEGIN
CDPanel.DefineLayerEntry[cmosB, ndif, "ndif", 0, 2*lambda];
CDPanel.DefineLayerEntry[cmosB, wpdif, "wpdif", 0, 2*lambda];
CDPanel.DefineLayerEntry[cmosB, pol, "pol", 0, 2*lambda];
CDPanel.DefineLayerEntry[cmosB, met, "met", 0, 3*lambda];
CDPanel.DefineLayerEntry[cmosB, pwellCont, "p-wCnt", 0, 2*lambda];
CDPanel.DefineLayerEntry[cmosB, nwellCont, "n-wCnt", 0, 2*lambda];
CDPanel.DefineLayerEntry[cmosB, nwell, "nwell", 0, 0];
CDPanel.DefineLayerEntry[cmosB, met2, "met2", 0, 4*lambda];
CDPanel.DefineLayerEntry[cmosB, comment, "comment", 0, lambda/2];
CDPanel.DefineLayerEntry[cmosB, ovg, "ovg", 0, 0];
CDPanel.DefineLayerEntry[cmosB, cut, "cut", 0, 0];
CDPanel.DefineLayerEntry[cmosB, cut2, "cut2", 0, 0];
CDPanel.DefineLayerEntry[cmosB, pwell, "(pwell)", 0, 0];
CDPanel.DefineLayerEntry[cmosB, pdif, "(pdif)", 0, 2*lambda];
CDPanel.DefineLayerEntry[cmosB, wndif, "(wndif)", 0, 2*lambda];
CDPanel.DefineLayerEntry[cmosB, bur, "bur", 0, 0];
CDPanel.DefineLayerEntry[cmosB, imp, "imp", 0, 0];
CDPanel.DefineIntEntry[cdValueKey: $CDxSelectNewMode, tech: cmosB,
text: "select new:", min: 0, max: 1, default: 1];
CDPanel.DefineNewLine[cmosB];
CDPanelExtras.DefineIntEntryX[cdValueKey: $CDxStepValue, tech: cmosB, text: "step moves size:", min: 1, default: lambda];
CDPanel.DefineNewLine[cmosB];
CDTipEtc.SetIcon[cmosB, "Chipndale.icons", 3];
CDTipEtc.SetPanelIcon[cmosB, "Chipndale.icons", 4];
CDTipEtc.SetTipTable[cmosB, "Standard"];
TerminalIO.WriteRope["cmos-B impl\n"];
END;