<> <> <> <<>> DIRECTORY Core, Boole, CoreCreate, CoreOps, FiniteStateAutomata; RequestControlFSM: CEDAR PROGRAM IMPORTS Boole, CoreCreate, CoreOps, FiniteStateAutomata = BEGIN OPEN Boole, CoreCreate, FiniteStateAutomata; Create: PROC RETURNS [ct: CellType] = { fsa: StateMachine; PostReq: Wire _ CoreOps.CreateWire[name: "PostReq"]; PostNeedO: Wire _ CoreOps.CreateWire[name: "PostNeedO"]; PostNeedS: Wire _ CoreOps.CreateWire[name: "PostNeedS"]; Post2Cycle: Wire _ CoreOps.CreateWire[name: "Post2Cycle"]; PostCWS: Wire _ CoreOps.CreateWire[name: "PostCWS"]; OSAvail: Wire _ CoreOps.CreateWire[name: "OSAvail"]; Owner: Wire _ CoreOps.CreateWire[name: "Owner"]; Shared: Wire _ CoreOps.CreateWire[name: "Shared"]; Priority: Wire _ CoreOps.CreateWire[name: "Priority"]; Done: Wire _ CoreOps.CreateWire[name: "Done"]; CWSReq: Wire _ CoreOps.CreateWire[name: "CWSReq"]; SetShared: Wire _ CoreOps.CreateWire[name: "SetShared"]; OwnerAbort: Wire _ CoreOps.CreateWire[name: "OwnerAbort"]; FiveCycReq: Wire _ CoreOps.CreateWire[name: "FiveCycReq"]; TwoCycReq: Wire _ CoreOps.CreateWire[name: "TwoCycReq"]; NeedOS : Wire _ CoreOps.CreateWire[name: "NeedOS"]; PopReq : Wire _ CoreOps.CreateWire[name: "PopReq"]; nReqPend: Wire _ CoreOps.CreateWire[name: "nReqPend"]; public: Wire _ WireList[LIST["Vdd", "Gnd", "Clock", "Reset", PostReq, PostNeedO, PostNeedS, Post2Cycle, PostCWS, OSAvail, Owner, Shared, Priority, Done, CWSReq, SetShared, OwnerAbort, FiveCycReq, TwoCycReq, NeedOS, PopReq, nReqPend]]; states: LIST OF ATOM _ LIST[$Idle]; states _ StateSeq[states, "RD", 4]; states _ StateSeq[states, "WR", 2]; states _ StateSeq[states, "WS", 3]; states _ StateSeq[states, "CWS", 3]; fsa _ NewMachine[states]; Mealy[fsa, $Idle, LIST[nReqPend], LIST [ [$Idle, Not[PostReq]], [$RD0, And[PostReq, PostNeedO, PostNeedS]], [$WR0, And[PostReq, Post2Cycle, Not[PostNeedS]]], [$WS0, And[PostReq, Post2Cycle, PostNeedS]], [$CWS0, And[PostReq, PostCWS, PostNeedS]] ]]; Mealy[fsa, $RD0, LIST[NeedOS], LIST [ [$RD0, Or[Not[Priority], Not[OSAvail]]], [$RD1, And[Priority, OSAvail, Owner]], [$RD2, And[Priority, OSAvail, Not[Owner], Shared]], [$RD3, And[Priority, OSAvail, Not[Owner], Not[Shared]]] ]]; Mealy[fsa, $RD1, LIST[OwnerAbort], LIST [[$RD1, Not[Done]]]]; Mealy[fsa, $RD1, LIST[OwnerAbort], LIST [[$Idle, Done]]]; Mealy[fsa, $RD2, LIST[SetShared, FiveCycReq], LIST [[$RD2, Not[Done]]]]; Mealy[fsa, $RD2, LIST[SetShared, FiveCycReq], LIST [[$Idle, Done]]]; Mealy[fsa, $RD3, LIST[FiveCycReq], LIST [[$RD3, Not[Done]]]]; Mealy[fsa, $RD3, LIST[FiveCycReq], LIST [[$Idle, Done]]]; Mealy[fsa, $WR0, LIST[PopReq], LIST[[$WR0, Not[Priority]]]]; Mealy[fsa, $WR0, LIST[PopReq], LIST[[$WR1, Priority]]]; Mealy[fsa, $WR1, LIST[TwoCycReq], LIST [[$WR1, Not[Done]]]]; Mealy[fsa, $WR1, LIST[TwoCycReq], LIST [[$Idle, Done]]]; Mealy[fsa, $WS0, LIST[NeedOS], LIST [ [$WS0, Or[Not[Priority], Not[OSAvail]]], [$WS1, And[Priority, OSAvail, Shared]], [$WS2, And[Priority, OSAvail, Not[Shared]]] ]]; Mealy[fsa, $WS1, LIST[SetShared, TwoCycReq], LIST [[$WS1, Not[Done]]]]; Mealy[fsa, $WS1, LIST[SetShared, TwoCycReq], LIST [[$Idle, Done]]]; Mealy[fsa, $WS2, LIST[TwoCycReq], LIST [[$WS2, Not[Done]]]]; Mealy[fsa, $WS2, LIST[TwoCycReq], LIST [[$Idle, Done]]]; Mealy[fsa, $CWS0, LIST[NeedOS], LIST [ [$CWS0, Or[Not[Priority], Not[OSAvail]]], [$CWS1, And[Priority, OSAvail, Shared]], [$CWS2, And[Priority, OSAvail, Not[Shared]]] ]]; Mealy[fsa, $CWS1, LIST[CWSReq, SetShared, FiveCycReq], LIST [[$CWS1, Not[Done]]]]; Mealy[fsa, $CWS1, LIST[CWSReq, SetShared, FiveCycReq], LIST [[$Idle, Done]]]; Mealy[fsa, $CWS2, LIST[CWSReq, FiveCycReq], LIST [[$CWS2, Not[Done]]]]; Mealy[fsa, $CWS2, LIST[CWSReq, FiveCycReq], LIST [[$Idle, Done]]]; fsa.initialState _ FindState[fsa, $Idle]; ct _ StateMachineCell[public, fsa]; }; END.