DIRECTORY BasicTime USING [GMT], CD USING [Design, Object], CDDirectory USING [Fetch, Name], CDIO USING [ReadDesign], CDProperties USING [GetObjectProp, RegisterProperty], Commander USING [CommandProc, Register], CommandTool USING [NextArgument], CoreClasses USING [recordCellClass, RecordCellType], CoreGeometry USING [GetObject], CoreProperties USING [GetProp, PutProp, RegisterProperty], DesignRules USING [FetchRulesID, GetRuleSet, Rules], Drc USING [CheckDesignRules, CoreCell, DRV, DRVkey, Layout, Tech], DrcCmosb USING [cMosBcompleteKey, cMosBsimpleKey, NewTechnology], IO USING [rope], Rope USING [Cat, Equal, IsEmpty, ROPE], Sinix USING [Extract, Mode], SinixOps USING [GetExtractMode], TerminalIO USING [PutF, PutRope, PutRopes], UserProfile USING [Boolean, CallWhenProfileChanges, ProfileChangedProc]; TestGenista: CEDAR PROGRAM IMPORTS CDDirectory, CDIO, CDProperties, Commander, CommandTool, CoreClasses, CoreGeometry, CoreProperties, DesignRules, Drc, DrcCmosb, IO, Rope, Sinix, SinixOps, TerminalIO, UserProfile ~ BEGIN OPEN DrcCmosb; ROPE: TYPE ~ Rope.ROPE; religion: BOOL _ UserProfile.Boolean ["Genista.EmulateSoS", FALSE]; hint: ROPE; Misc: TYPE ~ REF Stuff; Stuff: TYPE ~ RECORD [design: CD.Design, geom: Drc.Layout]; TimeStamp: TYPE ~ REF Titius; Titius: TYPE ~ RECORD [caius: BasicTime.GMT]; sessionKey: ATOM ~ CoreProperties.RegisterProperty [$DrcEnumerationSession]; regressionDesignDragon: ROPE _ "[DATools]Saguaro>DragonRules.dale"; regressionDesignVTI: ROPE _ "[DATools]Saguaro>VTIRules.dale"; EachCell: TYPE ~ PROC [cell: Drc.CoreCell, data: REF ANY _ NIL]; EnumerateCore: PROC [cell: Drc.CoreCell, action: EachCell, session: TimeStamp, data: REF ANY _ NIL, stopFlag: REF BOOL] ~ BEGIN IF (session # NIL) THEN BEGIN visited: TimeStamp ~ NARROW [CoreProperties.GetProp [cell.properties, sessionKey], TimeStamp]; IF (visited = NIL) OR (session.caius # visited.caius) THEN cell.properties _ CoreProperties.PutProp [cell.properties, sessionKey, session] ELSE RETURN END; SELECT cell.class FROM CoreClasses.recordCellClass => BEGIN cellData: CoreClasses.RecordCellType ~ NARROW [cell.data]; FOR sub: NAT IN [0 .. cellData.size) DO IF stopFlag^ THEN ERROR ABORTED; EnumerateCore [cellData.instances[sub].type, action, session, data, stopFlag] ENDLOOP; action [cell, data] END; ENDCASE => NULL END; -- EnumerateCore ProblemMessage: EachCell ~ BEGIN state: Misc ~ NARROW [data]; cdCell: CD.Object ~ CoreGeometry.GetObject [state.geom, cell]; IF (CoreProperties.GetProp [cell.properties, Drc.DRVkey] # NIL) THEN BEGIN TerminalIO.PutRopes [CDDirectory.Name [cdCell, state.design], " is not verified correctly ("]; TerminalIO.PutRopes [NARROW [CDProperties.GetObjectProp [cdCell, $rule], ROPE], ")\n"] END END; -- ProblemMessage UncheckedMessage: EachCell ~ BEGIN state: Misc ~ NARROW [data]; cdCell: CD.Object ~ CoreGeometry.GetObject [state.geom, cell]; drv: Drc.DRV ~ NARROW [CoreProperties.GetProp [cell.properties, Drc.DRVkey]]; IF (drv = NIL) OR (drv.count # 1) THEN BEGIN description: ROPE ~ NARROW [CDProperties.GetObjectProp [cdCell, $rule]]; flat: BOOL ~ (CDProperties.GetObjectProp [cdCell, $flat] # NIL); IF flat THEN TerminalIO.PutF ["%g is verified flat (%g)\n", IO.rope [CDDirectory.Name [cdCell, state.design]], IO.rope [description]] ELSE TerminalIO.PutF ["%g is not verified correctly (%g)\n", IO.rope [CDDirectory.Name [cdCell, state.design]], IO.rope [description]] END END; -- UncheckedMessage RegressionTest: Commander.CommandProc ~ BEGIN technology: ROPE ~ CommandTool.NextArgument [cmd]; state: Misc ~ NEW [Stuff]; dummy: REF BOOL ~ NEW [BOOL _ FALSE]; lapCounter: REF CARDINAL _ NEW [CARDINAL]; currentCell: REF ROPE _ NEW [ROPE]; regressionDesign: ROPE; usedRuleKey: ATOM; rules: DesignRules.Rules; techE: Sinix.Mode; techD: Drc.Tech; ok, ko: CD.Object; SELECT TRUE FROM technology.IsEmpty => RETURN [$Failure, "Please specify a technology, such as VTI"]; technology.Equal ["VTI", FALSE] => regressionDesign _ regressionDesignVTI; technology.Equal ["Dragon", FALSE] => regressionDesign _ regressionDesignDragon; ENDCASE => RETURN [$Failure, "Unknown technology"]; state.design _ CDIO.ReadDesign [regressionDesign]; IF (state.design = NIL) THEN {hint _ "Cannot read regression design"; GOTO maintenanceProblem}; usedRuleKey _ DesignRules.FetchRulesID [state.design]; IF (usedRuleKey = NIL) THEN usedRuleKey _ $VTI; rules _ DesignRules.GetRuleSet [usedRuleKey]; techE _ SinixOps.GetExtractMode [state.design.technology]; state.geom _ techE.decoration; techD _ DrcCmosb.NewTechnology [IF religion THEN cMosBsimpleKey ELSE cMosBcompleteKey, rules]; IF (techD = NIL) THEN {hint _ "Genista technology not found"; GOTO maintenanceProblem}; ok _ CDDirectory.Fetch [state.design, "ok.mask"].object; IF (ok = NIL) THEN {hint _ "Heretic regression design"; GOTO maintenanceProblem}; TerminalIO.PutRope ["\n"]; WITH Sinix.Extract [obj: ok, mode: techE].result SELECT FROM coreCell: Drc.CoreCell => IF (Drc.CheckDesignRules [cell: coreCell, tech: techD, viaFlatness: TRUE, external: coreCell.public, stopFlag: dummy, lap: lapCounter, currentCell: currentCell, layout: state.geom] > 0) THEN EnumerateCore [coreCell, ProblemMessage, NIL, state, dummy]; ENDCASE => ERROR; TerminalIO.PutRope ["\n"]; ko _ CDDirectory.Fetch [state.design, "ko.mask"].object; IF (ko = NIL) THEN {hint _ "Heretic regression design"; GOTO maintenanceProblem}; WITH Sinix.Extract [obj: ko, mode: techE].result SELECT FROM coreCell: Drc.CoreCell => BEGIN [] _ Drc.CheckDesignRules [cell: coreCell, tech: techD, viaFlatness: TRUE, external: coreCell.public, stopFlag: dummy, lap: lapCounter, currentCell: currentCell, layout: state.geom]; EnumerateCore [coreCell, UncheckedMessage, NIL, state, dummy] END; ENDCASE => ERROR; EXITS maintenanceProblem => BEGIN TerminalIO.PutRope [hint.Cat ["\nPlease inform DRC maintainers that the self verification might be broken.\n"]]; RETURN [$Failure, Rope.Cat ["Regression test might be broken [", hint, "]"]] END END; -- RegressionTest EmulateSoS: UserProfile.ProfileChangedProc ~ BEGIN religion _ UserProfile.Boolean ["Genista.EmulateSoS", FALSE] END; -- EmulateSoS Registrations: PROC ~ BEGIN [] _ CDProperties.RegisterProperty [$DrcNr, $gbb]; Commander.Register [key: "TestGenista", proc: RegressionTest, doc: "Makes a DRC run over the test file to assess the correctnes of the implementation."]; UserProfile.CallWhenProfileChanges [EmulateSoS] END; -- Registrations Registrations END. °TestGenista.mesa Copyright Σ 1987 by Xerox Corporation. All rights reserved. Written by gbb May 14, 1987 12:48:54 pm PDT gbb May 14, 1987 2:15:21 pm PDT Regression Test for Genista. Enumerates the cell and does action on each subcell. If session = NIL a cell is visited only once, otherwise it is visited on every instance. [cell: Drc.CoreCell, data: REF ANY _ NIL] Asserts that correct cells are not flagged for violations [cell: Drc.CoreCell, data: REF ANY _ NIL] Asserts that correct cells are not flagged for violations [cmd: Commander.Handle] RETURNS [result: REF ANY _ NIL, msg: ROPE _ NIL] Makes a DRC run over the test file to assess the correctnes of the implementation. Κ˜šœ™Jšœ<™šžœ9žœžœž˜JKšœ^˜^Kšœžœ.žœ ˜VKšž˜—Kšžœ£˜—š œ ž˜"Kšœžœžœžœ™)K™9Kšœžœ˜Kšœžœ4˜>Kšœ žœžœ8˜Mš žœžœžœžœž˜,Kšœ žœžœ.˜HKšœžœ1žœ˜@Kšžœžœ0žœ1žœ˜…Kšžœ9žœ1žœ˜†Kšž˜—Kšžœ£˜—š œž˜-Kš œžœ žœžœžœžœžœ™HK™RKšœ žœ"˜2Kšœžœ ˜Kš œžœžœžœžœžœ˜%Kš œ žœžœžœžœ˜*Kš œ žœžœžœžœ˜#Kšœžœžœ˜DKšœ#˜#Kšœžœ˜šžœžœž˜Kšœ’œ8˜TKšœžœ,˜JKšœžœ/˜PKšžœ’œ"˜3—Mšœžœ˜2Kšžœžœžœ*žœ˜_Kšœ6˜6Kšžœžœžœ˜/Kšœ-˜-Kšœ:˜:Kšœ˜Kšœ žœ žœžœ˜^Kšžœ žœžœ)žœ˜WKšœ8˜8Kšžœžœžœ&žœ˜QKšœ˜šžœ-žœž˜<šœ˜KšžœBžœržœ*žœ˜ϋ—Kšžœžœ˜—Kšœ˜Kšœ8˜8Kšžœžœžœ&žœ˜Qšžœ-žœž˜<šœž˜KšœEžœm˜ΆKšœ+žœ˜=Kšžœ˜—Kšžœžœ˜—šž˜šœž˜Kšœp˜pKš’œF˜LKšž˜——Kšžœ£˜—š  œ#ž˜2Lšœ6žœ˜