DIRECTORY CDCommandOps, CDProperties, CDSequencer, Core, CoreCreate, CoreFlat, Ports, Rosemary, RosemaryUser, Sisyph; FSMTest: CEDAR PROGRAM IMPORTS CDCommandOps, CDProperties, CoreFlat, Ports, Rosemary, RosemaryUser, Sisyph = BEGIN Vdd, Gnd, Reset, Clock, CountRowAdr, DriveCharMatch, LoadMatchAddress, ForceMatchLoad, SetReady, WriteMatchEnable, WriteCharEnable, LoadRowAdr, ReadStateEnable, RowAdrEqual, MatchChar, ReadCharMatch, WriteChar, WriteCharMatch: NAT _ LAST[NAT]; InitPortIndicies: PROC [p: Core.Wire] ~ { [Vdd, Gnd, Reset, Clock, CountRowAdr, DriveCharMatch, LoadMatchAddress, ForceMatchLoad, SetReady] _ Ports.PortIndexes[p, "Vdd", "Gnd", "Reset", "Clock", "CountRowAdr", "DriveCharMatch", "LoadMatchAddress", "ForceMatchLoad", "SetReady"]; [WriteMatchEnable, WriteCharEnable, LoadRowAdr, ReadStateEnable, RowAdrEqual, MatchChar, ReadCharMatch, WriteChar, WriteCharMatch] _ Ports.PortIndexes[p, "WriteMatchEnable", "WriteCharEnable", "LoadRowAdr", "ReadStateEnable", "RowAdrEqual", "MatchChar", "ReadCharMatch", "WriteChar", "WriteCharMatch"]; }; InitializeTest: PROC ~ { CDCommandOps.RegisterWithMenu[menu: $ProgramMenu, entry: "Simulate FSM", key: $FSMExtractAndSimulate, proc: FSMExtractAndSimulate, queue: doQueue]; RosemaryUser.RegisterTestProc["FSMTest", FSMTestProc]; }; FSMExtractAndSimulate: PROC [comm: CDSequencer.Command] ~ { cellType: Core.CellType _ Sisyph.ExtractSchematicByName["FSMExample.icon", Sisyph.Create[comm.design]]; public: Core.Wire _ cellType.public; InitPortIndicies[public]; Ports.IPList[public, LIST[Vdd, Gnd, Reset, Clock, CountRowAdr, DriveCharMatch, LoadMatchAddress, ForceMatchLoad, SetReady, WriteMatchEnable, WriteCharEnable, LoadRowAdr, ReadStateEnable, RowAdrEqual, MatchChar, ReadCharMatch, WriteChar, WriteCharMatch], b]; CDProperties.PutDesignProp[comm.design, $DAUserRoseDisplay, FSMSimulate[cellType].display]; }; FSMSimulate: PROC [cellType: Core.CellType] RETURNS [tester: RosemaryUser.Tester] ~ { public: Core.Wire _ cellType.public; Ports.ITDList[public, LIST[Reset, Clock, RowAdrEqual, MatchChar, ReadCharMatch, WriteChar, WriteCharMatch], force]; Ports.ITDList[public, LIST[CountRowAdr, DriveCharMatch, LoadMatchAddress, ForceMatchLoad, SetReady, WriteMatchEnable, WriteCharEnable, LoadRowAdr, ReadStateEnable], expect]; [] _ Rosemary.SetFixedWire[cellType.public[Vdd], H]; [] _ Rosemary.SetFixedWire[cellType.public[Gnd], L]; tester _ RosemaryUser.TestProcedureViewer[ cellType: cellType, testButtons: LIST["FSMTest"], name: "FSM Test", displayWires: RosemaryUser.DisplayPortLeafWires[cellType], cutSet: CoreFlat.CreateCutSet[labels: LIST["FSM"]]]; }; FSMTestProc: RosemaryUser.TestProc ~ { MyEval: RosemaryUser.TestEvalProc ~ { Eval[memory: TRUE, clockEval: TRUE]; Eval[memory: TRUE, clockEval: FALSE]; }; Init: PROC = { p[Reset].b _ TRUE; p[Clock].b _ FALSE; MyEval[]; p[SetReady].b _ TRUE; p[Clock].b _ TRUE; MyEval[]; }; InitPortIndicies[cellType.public]; Init[! Rosemary.Stop => IF reason = $BoolWireHasX THEN RESUME ELSE REJECT]; p[Reset].b _ FALSE; p[Clock].b _ FALSE; MyEval[]; p[SetReady].b _ FALSE; p[LoadRowAdr].b _ TRUE; p[Clock].b _ TRUE; MyEval[]; p[Clock].b _ FALSE; MyEval[]; p[Clock].b _ TRUE; MyEval[]; p[MatchChar].b _ TRUE; p[Clock].b _ FALSE; MyEval[]; -- M1 p[LoadRowAdr].b _ FALSE; p[CountRowAdr].b _ TRUE; p[DriveCharMatch].b _ TRUE; p[Clock].b _ TRUE; MyEval[]; p[MatchChar].b _ FALSE; p[Clock].b _ FALSE; MyEval[]; -- M11 p[ForceMatchLoad].b _ TRUE; p[LoadMatchAddress].b _ TRUE; p[Clock].b _ TRUE; MyEval[]; p[Clock].b _ FALSE; MyEval[]; -- M2 p[ForceMatchLoad].b _ FALSE; p[Clock].b _ TRUE; MyEval[]; p[Clock].b _ FALSE; MyEval[]; -- M2 p[Clock].b _ TRUE; MyEval[]; p[RowAdrEqual].b _ TRUE; p[Clock].b _ FALSE; MyEval[]; -- M3 p[CountRowAdr].b _ FALSE; p[Clock].b _ TRUE; MyEval[]; p[RowAdrEqual].b _ FALSE; p[Clock].b _ FALSE; MyEval[]; -- M4 p[DriveCharMatch].b _ FALSE; p[SetReady].b _ TRUE; p[Clock].b _ TRUE; MyEval[]; p[RowAdrEqual].b _ FALSE; p[Clock].b _ FALSE; MyEval[]; -- Idle p[LoadMatchAddress].b _ FALSE; p[SetReady].b _ FALSE; p[LoadRowAdr].b _ TRUE; p[Clock].b _ TRUE; MyEval[]; }; InitializeTest[]; END. ฦFSMTest.mesa Copyright c 1987 by Xerox Corporation. All rights reserved. Barth, June 15, 1987 5:01:36 pm PDT Last Edited by: Don Curry July 20, 1987 10:28:58 am PDT Binding Test Start Code สx˜codešœ ™ Kšœ ฯmœ1™