<> <> <> 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: ROPE _ IF 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; <> [] _ 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. << >>