DMProcessorModelImpl.mesa
Written By: Jean Vuillemin and Pradeep Sindhu
Last Edited By: Pradeep Sindhu September 2, 1985 10:41:20 pm PDT
DIRECTORY
DM
,
DMProcessorModel,
DMPBusModel;
DMProcessorModelImpl:
CEDAR
PROGRAM
IMPORTS
DM
, DMPBusModel
EXPORTS
DMProcessorModel =
BEGIN
OPEN
DMProcessorModel;
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,
subComponents:
NIL
,
specific:
NEW
[ProcessorSpecificRec ← [commandList: commandList, pbus: pbus]]]]
};
EmptyCommandList
:
PUBLIC
SIGNAL
=
CODE
;
PhA
:
DM
.ActionProc = {
ps: ProcessorSpecific ←
NARROW
[component.specific];
IF
ps.commandList =
NIL
THEN
SIGNAL
EmptyCommandList[];
DMPBusModel.DrCmd[ps.pbus, ps.commandList.first.cmd];
DMPBusModel.DrData[ps.pbus, ps.commandList.first.adrs]
};
EvPhA
:
DM
.ActionProc = {
};
PhB
:
DM
.ActionProc = {
ps: ProcessorSpecific ←
NARROW
[component.specific];
IF
ps.commandList.first.cmd = Store
THEN
DMPBusModel.DrData[ps.pbus, ps.commandList.first.data]
};
EvPhB
:
DM
.ActionProc = {
ps: ProcessorSpecific ←
NARROW
[component.specific];
IF
DMPBusModel.Reject[ps.pbus]
THEN
component.history ←
DM
.ConsHistory[EvPhB, ps.commandList.first, component.history]
ELSE
{
IF
ps.commandList.first.cmd = Fetch
THEN
ps.commandList.first.data ← DMPBusModel.Data[ps.pbus];
component.history ←
DM
.ConsHistory[EvPhB, ps.commandList.first, component.history];
ps.commandList ← ps.commandList.rest
};
};
Reset
:
DM
.ActionProc = {
};
END
.