<> <> <> <<>> 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. <<>>