StixCmdsImpl.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Louis Monier November 25, 1985 5:13:19 pm PST
DIRECTORY
CD, CDCells, CDDirectory, CDLayers, CDMenus, CDOps, CDProperties, CDSequencer, CDSimpleRules, CDSymbolicObjects,
Core,
PW, Sinix, Stix, StixCmds, StixParser, StixRules, TerminalIO;
StixCmdsImpl: CEDAR PROGRAM
IMPORTS CDCells, CDDirectory, CDLayers, CDMenus, CDOps, CDProperties, CDSequencer, CDSimpleRules, CDSymbolicObjects, PW, StixParser, TerminalIO
EXPORTS StixCmds =
BEGIN OPEN Stix;
StickModeCommand: PROC [comm: CDSequencer.Command] =
BEGIN
StickMode: PROC [design: CD.Design] ~ {
lambda: INT ← design.technology.lambda;
ndif: Layer ← CDSimpleRules.GetLayer[design.technology, "ndif"];
wpdif: Layer ← CDSimpleRules.GetLayer[design.technology, "wpdif"];
pol: Layer ← CDSimpleRules.GetLayer[design.technology, "pol"];
met: Layer ← CDSimpleRules.GetLayer[design.technology, "met"];
met2: Layer ← CDSimpleRules.GetLayer[design.technology, "met2"];
genericCtObj: Object ← GenericCt[design];
genericNeTr: Object ← GenericTr[design, FALSE];
genericPeTr: Object ← GenericTr[design, TRUE];
-- test which layers exist first!
CDLayers.SetLayerWidth[design, ndif, lambda];
CDLayers.SetLayerWidth[design, wpdif, lambda];
CDLayers.SetLayerWidth[design, pol, lambda];
CDLayers.SetLayerWidth[design, met, lambda];
CDLayers.SetLayerWidth[design, met2, lambda];
};
StickMode[comm.design];
END;
SetSimplifyOn: PROC [ob: Object, n: NAT] ~ {
cell: CD.CellPtr ← NARROW[ob.specificRef];
cell.simplifyOn ← n;
};
GenericCt: PUBLIC PROC [design: CD.Design] RETURNS [ob: Object] ~ {
ob ← CDDirectory.Fetch[design, StixParser.contactName].object;
IF ob=NIL THEN {
lambda: INT ← design.technology.lambda;
layer: Layer ← CDSimpleRules.GetLayer[design.technology, "cut"];
pin: Object ← CDSymbolicObjects.CreatePin[[lambda, lambda]];
cut: Object ← CDSimpleRules.Rect[[lambda, lambda], layer];
ob ← PW.CreateEmptyCell[];
[] ← PW.IncludeInCell[ob, pin];
[] ← PW.IncludeInCell[ob, cut];
SetSimplifyOn[ob, 2];
PW.IncludeInDirectory[design, ob, StixParser.contactName]; -- no conflict possible
};
};
GenericTr: PUBLIC PROC [design: CD.Design, pType: BOOL] RETURNS [ob: Object] ~ {
name: ROPEIF pType THEN StixParser.pTransistorName ELSE StixParser.nTransistorName;
ob ← CDDirectory.Fetch[design, name].object;
IF ob=NIL THEN {
ch1, gate, ch2: Instance;
lambda: INT ← design.technology.lambda;
dif: Layer ← CDSimpleRules.GetLayer[design.technology, IF pType THEN "wpdif" ELSE "ndif"];
pol: Layer ← CDSimpleRules.GetLayer[design.technology, "pol"];
-- components of the iconic cell
pin : Object ← CDSymbolicObjects.CreatePin[[lambda, lambda]];
green: Object ← CDSimpleRules.Rect[[3*lambda, 9*lambda], dif];
red: Object ← CDSimpleRules.Rect[[5*lambda, lambda], pol];
-- assembly
ob ← PW.CreateEmptyCell[];
[] ← PW.IncludeInCell[ob, green, [-lambda, 0]];
[] ← PW.IncludeInCell[ob, red, [-2*lambda, 4*lambda]];
ch1 ← PW.IncludeInCell[ob, pin, [0, 0]];
gate ← PW.IncludeInCell[ob, pin, [0, 4*lambda]];
ch2 ← PW.IncludeInCell[ob, pin, [0, 8*lambda]];
CDSymbolicObjects.SetName[ch1, "ch1"];
CDSymbolicObjects.SetName[gate, "gate"];
CDSymbolicObjects.SetName[ch2, "ch2"];
CDSymbolicObjects.SetLayer[ch1, dif];
CDSymbolicObjects.SetLayer[gate, pol];
CDSymbolicObjects.SetLayer[ch2, dif];
-- set the interestRect
CDCells.SetInterestRect[ob, [0, 0, lambda, 9*lambda]];
PW.IncludeInDirectory[design, ob, name];
};
};
DrawContactCommand: PROC [comm: CDSequencer.Command] =
BEGIN
ob: CD.Object ← GenericCt[comm.design]; -- another cache? per design or techno?
TerminalIO.WriteRope["create generic contact\n"];
CDOps.AddAnObject[design: comm.design, ob: ob, location: comm.pos, orientation: 0]
END;
DrawNeTrCommand: PROC [comm: CDSequencer.Command] =
BEGIN
ob: CD.Object ← GenericTr[comm.design, FALSE];
TerminalIO.WriteRope["create generic N transistor\n"];
CDOps.AddAnObject[design: comm.design, ob: ob, location: comm.pos, orientation: 0]
END;
DrawPeTrCommand: PROC [comm: CDSequencer.Command] =
BEGIN
ob: CD.Object ← GenericTr[comm.design, TRUE];
TerminalIO.WriteRope["create generic P transistor\n"];
CDOps.AddAnObject[design: comm.design, ob: ob, location: comm.pos, orientation: 0]
END;
Initialization
[] ← CDProperties.RegisterProperty[$StickMode, $Stix];
CDSequencer.ImplementCommand[a: $StickMode, p: StickModeCommand, queue: doQueue];
CDMenus.CreateEntry[menu: $ProgramMenu, entry: "Stick Mode", key: $StickMode];
[] ← CDProperties.RegisterProperty[$DrawGenericContact, $Stix];
CDSequencer.ImplementCommand[a: $DrawGenericContact, p: DrawContactCommand, queue: doQueue];
CDMenus.CreateEntry[menu: $RectProgramMenu, entry: "Draw Generic Contact", key: $DrawGenericContact];
[] ← CDProperties.RegisterProperty[$DrawGenericNeTr, $Stix];
CDSequencer.ImplementCommand[a: $DrawGenericNeTr, p: DrawNeTrCommand, queue: doQueue];
CDMenus.CreateEntry[menu: $RectProgramMenu, entry: "Draw Generic NeTr", key: $DrawGenericNeTr];
[] ← CDProperties.RegisterProperty[$DrawGenericPeTr, $Stix];
CDSequencer.ImplementCommand[a: $DrawGenericPeTr, p: DrawPeTrCommand, queue: doQueue];
CDMenus.CreateEntry[menu: $RectProgramMenu, entry: "Draw Generic PeTr", key: $DrawGenericPeTr];
END.