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.DefineLayerEntry[nmos, dif, "dif", 0, 2*NMos.lambda];
CDPanel.DefineLayerEntry[nmos, pol, "pol", 0, 2*NMos.lambda];
CDPanel.DefineLayerEntry[nmos, met, "met", 0, 3*NMos.lambda];
CDPanel.DefineLayerEntry[nmos, met2, "met2", 0, 4*NMos.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, lambda: 1];
CDPanel.DefineIntEntry[cdValueKey: $CDxStepValue, tech: nmos, text: "step moves size:", min: 0, default: 0, lambda: nmos.lambda];
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];
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;