ProcessorModelImpl.mesa
Written By: Jean Vuillemin and Pradeep Sindhu
Last Edited By: Pradeep Sindhu August 21, 1985 7:21:22 pm PDT
DIRECTORY
PBusModel,
ProcessorModel;
ProcessorModelImpl:
CEDAR
PROGRAM
EXPORTS ProcessorModel =
BEGIN
OPEN ProcessorModel;
Create:
PUBLIC
PROC [commandList:
LIST
OF ProcessorCommand ←
NIL, pbus:
DM.Component]
RETURNS [processor:
DM.Component] = {
processor ←
NEW [
DM.ComponentRec ← [
action: [Reset, PhA, EvPhA, PhB, EvPhB],
history:
NIL,
componentType: $Processor,
specific:
NEW [ProcessorSpecificRec ← [commandList: commandList, pbus: pbus]]]]
};
PhA:
DM.ActionProc = {
private:
DM.Component ←
NARROW[component];
IF processor.commandList =
NIL
THEN
ERROR;
processor.pbus.pbusWires.pCmdA ← processor.commandList.first.cmd;
processor.pbus.pbusWires.pData ← processor.commandList.first.adrs;
};
EvPhA:
DM.ActionProc = {
};
PhB:
DM.ActionProc = {
IF processor.commandList.first.cmd = Store
THEN processor.pbus.pbusWires.pData ← processor.commandList.first.data;
};
EvPhB:
DM.ActionProc = {
IF processor.pbus.pbusWires.pRejectB
THEN
NULL
ELSE {
IF processor.commandList.first.cmd = Fetch
THEN processor.commandList.first.data ← processor.pbus.pbusWires.pData;
processor.history ←
CONS[processor.commandList.first, processor.history];
processor.commandList ← processor.commandList.rest
};
};
Reset:
DM.ActionProc = {
};
END.