RequestQueueFSM.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Last Edited by: Gasbarro September 9, 1986 5:01:26 pm PDT
Barth, September 8, 1986 3:49:28 pm PDT
DIRECTORY Boole, CoreCreate, CoreOps, FiniteStateAutomata;
RequestQueueFSM: CEDAR PROGRAM
IMPORTS Boole, CoreCreate, CoreOps, FiniteStateAutomata =
BEGIN OPEN Boole, CoreCreate, FiniteStateAutomata;
Create: PROC RETURNS [ct: CellType] = {
fsa: StateMachine;
Post5Cyc: Wire ← CoreOps.CreateWire[name: "Post5Cyc"];
Post2Cyc: Wire ← CoreOps.CreateWire[name: "Post2Cyc"];
Grant: Wire ← CoreOps.CreateWire[name: "Grant"];
QueueIdle: Wire ← CoreOps.CreateWire[name: "QueueIdle"];
Req2Cyc: Wire ← CoreOps.CreateWire[name: "Req2Cyc"];
Req5Cyc: Wire ← CoreOps.CreateWire[name: "Req5Cyc"];
TwoReqPend: Wire ← CoreOps.CreateWire[name: "TwoReqPend"];
public: Wire ← WireList[LIST["Vdd", "Gnd", "Clock", "Reset",
Post5Cyc, Post2Cyc, Grant,
QueueIdle, Req2Cyc, Req5Cyc, TwoReqPend]];
states: LIST OF ATOMLIST[$Idle, $R2, $R2P2, $R2P5, $R5, $R5P2, $R5P5];
fsa ← NewMachine[states];
Mealy[fsa, $Idle,
LIST [QueueIdle],
LIST [
[$Idle, And[Not[Post2Cyc], Not[Post5Cyc]]],
[$R2, Post2Cyc],
[$R5, Post5Cyc]
]];
Mealy[fsa, $R2,
LIST[Req2Cyc],
LIST [
[$Idle, And[Grant, Not[Post2Cyc], Not[Post5Cyc]]],
[$R2, And[Grant, Post2Cyc, Not[Post5Cyc]]],
[$R2, And[Not[Grant], Not[Post2Cyc], Not[Post5Cyc]]],
[$R2P2, And[Not[Grant], Post2Cyc, Not[Post5Cyc]]],
[$R2P5, And[Not[Grant], Not[Post2Cyc], Post5Cyc]],
[$R5, And[Grant, Not[Post2Cyc], Post5Cyc]]
]];
Mealy[fsa, $R2P2, LIST[Req2Cyc, TwoReqPend], LIST[[$R2, Grant], [$R2P2, Not[Grant]]]];
Mealy[fsa, $R2P5, LIST[Req2Cyc, TwoReqPend], LIST[[$R2, Grant], [$R2P5, Not[Grant]]]];
Mealy[fsa, $R5,
LIST[Req5Cyc],
LIST [
[$Idle, And[Grant, Not[Post2Cyc], Not[Post5Cyc]]],
[$R2, And[Grant, Post2Cyc, Not[Post5Cyc]]],
[$R5P2, And[Not[Grant], Post2Cyc, Not[Post5Cyc]]],
[$R5P5, And[Not[Grant], Not[Post2Cyc], Post5Cyc]],
[$R5, And[Not[Grant], Not[Post2Cyc], Not[Post5Cyc]]],
[$R5, And[Grant, Not[Post2Cyc], Post5Cyc]]
]];
Mealy[fsa, $R5P2, LIST[Req5Cyc, TwoReqPend], LIST[[$R5, Grant], [$R5P2, Not[Grant]]]];
Mealy[fsa, $R5P5, LIST[Req5Cyc, TwoReqPend], LIST[[$R5, Grant], [$R5P5, Not[Grant]]]];
fsa.initialState ← FindState[fsa, $Idle];
ct ← StateMachineCell[public, fsa];
};
END.