DIRECTORY BitOps, CD, CDCommandOps, CDSequencer, Core, CoreFlat, Ports, Random, Rosemary, RosemaryUser, Sisyph; TestECC: CEDAR PROGRAM IMPORTS BitOps, CDCommandOps, CoreFlat, Ports, Random, Rosemary, RosemaryUser, Sisyph ~ BEGIN GoodData, BadData, CorrectedData, Parity, CheckZero: NAT; Vdd, Gnd: NAT; ROPE: TYPE = Core.ROPE; Port: TYPE = Ports.Port; Quad: TYPE = BitOps.BitQWord; qZero: Quad = BitOps.BitQWordZero; cellType: Core.CellType _ NIL; tester: RosemaryUser.Tester; design: CD.Design _ NIL; SimpleTest: RosemaryUser.TestProc = { p[GoodData].q _ [0,0,0, 010h]; p[BadData].q _ [0,0,0, 010h]; p[CorrectedData].q _ [0,0,0, 010h]; Eval[]; }; OldSimpleTest: RosemaryUser.TestProc = { RandomQ: PROC RETURNS [q: Quad] ~ { FOR i: NAT IN [0..4) DO q[i] _ Random.ChooseInt[min:0, max: LAST[CARDINAL]]; ENDLOOP; }; MakeSingleError: PROC [good: Quad] RETURNS [bad: Quad] ~ { bit: INT _ Random.ChooseInt[min:0, max: 63]; mask: Quad _ BitOps.QuadShift[[0,0,0,1], bit]; bad _ BitOps.QXOR[mask, good]; }; MakeDoubleError: PROC [q: Quad] RETURNS [bad: Quad] ~ { }; good, bad, mask: Quad; p[Parity].b _ TRUE; p[CheckZero].b _ FALSE; p[CorrectedData].d _ expect; good _ [0AAAAh, 0AAAAh, 0AAAAh, 0AAAAh]; FOR i: NAT IN [0..64) DO mask _ BitOps.QuadShift[[0,0,0,1], i]; bad _ BitOps.QXOR[mask, good]; p[GoodData].q _ good; p[BadData].q _ bad; p[CorrectedData].q _ good; Eval[]; ENDLOOP; p[Parity].b _ FALSE; p[CheckZero].b _ FALSE; p[CorrectedData].d _ none; FOR i: NAT IN [1..64) DO mask _ BitOps.QuadShift[[0,0,0,1], i]; bad _ BitOps.QXOR[mask, good]; bad _ BitOps.QXOR[[0,0,0,1], bad]; p[GoodData].q _ good; p[BadData].q _ bad; Eval[]; ENDLOOP; p[Parity].b _ TRUE; p[CheckZero].b _ FALSE; p[CorrectedData].d _ expect; FOR i: NAT IN [0..100) DO good _ RandomQ[]; bad _ MakeSingleError[good]; p[GoodData].q _ good; p[BadData].q _ bad; p[CorrectedData].q _ good; Eval[]; ENDLOOP; }; CDExtractECC: PROC [comm: CDSequencer.Command] = { design _ comm.design; cellType _ Sisyph.ExtractSchematicByName["ErrorCorrector.sch", Sisyph.Create[design]]; InitPortIndicies[cellType]; }; InitPortIndicies: PROC [ct: Core.CellType] ~ { [GoodData, BadData, CorrectedData, Parity, CheckZero, Vdd, Gnd] _ Ports.PortIndexes[ct.public, "GoodData", "BadData", "CorrectedData", "Parity", "CheckZero", "Vdd", "Gnd"]; }; Simulate: PROC [ct: Core.CellType _ NIL] = { IF ct=NIL THEN ct _ cellType; InitPortIndicies[ct]; Ports.InitTesterDrives[ct, force, "GoodData", "BadData",]; Ports.InitTesterDrives[ct, expect, "CorrectedData", "Parity", "CheckZero"]; Ports.InitPorts[ct, q, none, "GoodData", "BadData", "CorrectedData"]; Ports.InitPorts[ct, b, none, "Parity", "CheckZero"]; [] _ Rosemary.SetFixedWire[ct.public[Vdd], H]; [] _ Rosemary.SetFixedWire[ct.public[Gnd], L]; tester _ RosemaryUser.TestProcedureViewer[cellType: ct, testButtons: LIST["SimpleTest"], name: "ECC Tester", displayWires: RosemaryUser.DisplayPortLeafWires[ct], cutSet: CoreFlat.CreateCutSet[labels: LIST["Logic", "LogicMacro"]]]; }; RosemaryUser.RegisterTestProc["SimpleTest", SimpleTest]; CDCommandOps.RegisterWithMenu[ menu: $ProgramMenu, entry: "Extract ECC", doc: "", proc: CDExtractECC ];END. TTestECC.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Gasbarro October 23, 1986 10:10:34 pm PDT Last Edited by: Gasbarro October 28, 1986 9:20:25 am PST --PROC [cellType: Core.CellType, p: Ports.Port, Eval: PROC]-- Check each bit position for single error correct Check each bit position for double error detect ΚΩ˜™ Icodešœ Οmœ1™