DIRECTORY RoseTypes, IFUData3, RoseCreate, IFUPLAMainControl, DragOpsCross, IFUPLAInstrDecode, DragonRosemary, DragonRoseExtras, ClusterParams, LizardRosemary, Rope, IO, SwitchTypes, PrintTV, AMBridge, Dragon; IFUData3Impl: CEDAR PROGRAM IMPORTS RoseCreate, DragonRosemary, DragonRoseExtras, ClusterParams, LizardRosemary, Rope, IO, PrintTV, AMBridge EXPORTS IFUData3 = BEGIN OPEN RoseTypes, IFUData3; ExceptionCode: TYPE = IFUPLAMainControl.ExceptionCode; MicroCycleNext: TYPE = IFUPLAInstrDecode.MicroCycleNext; PCBusSrc: TYPE = IFUPLAInstrDecode.PCBusSrc; PBusCommands: TYPE = Dragon.PBusCommands; PBusFaults: TYPE = Dragon.PBusFaults; RegisterCells: PROC = BEGIN IFUStatus _ RoseCreate.RegisterCellType[name: "IFUStatus", expandProc: NIL, ioCreator: CreateIFUStatusIO, driveCreator: CreateIFUStatusDrive, initializer: InitializeIFUStatus, evals: [EvalSimple: IFUStatusEvalSimple], tests: LIST[], ports: CreateIFUStatusPorts[] ]; KBusPads _ RoseCreate.RegisterCellType[name: "KBusPads", expandProc: NIL, ioCreator: CreateKBusPadsIO, driveCreator: CreateKBusPadsDrive, evals: [EvalSimple: KBusPadsEvalSimple], tests: LIST[], ports: CreateKBusPadsPorts[] ]; Misc _ RoseCreate.RegisterCellType[name: "Misc", expandProc: NIL, ioCreator: CreateMiscIO, driveCreator: CreateMiscDrive, evals: [EvalSimple: MiscEvalSimple], tests: LIST[], ports: CreateMiscPorts[] ]; END; otherss: SymbolTable _ RoseCreate.GetOtherss["IFUData3.partsAssertions"]; defaultStatus: DragOpsCross.IFUStatusRec = [ userMode: FALSE, trapsEnabled: FALSE, reschedule: FALSE]; IFUStatus: PUBLIC CellType; CreateIFUStatusPorts: PROC RETURNS [ports: Ports] = {ports _ RoseCreate.PortsFromFile["IFUData3.IFUStatus.rosePorts"]}; IFUStatusSwitchIORef: TYPE = REF IFUStatusSwitchIORec; IFUStatusSwitchIORec: TYPE = RECORD [ XBus: PACKED ARRAY [0 .. 32) OF SwitchTypes.SwitchVal ,RescheduleBA: SwitchTypes.SwitchVal ,ClearTrapsEnbledBA: SwitchTypes.SwitchVal ,ClearUserModeBA: SwitchTypes.SwitchVal ,RschWaiting2BA: SwitchTypes.SwitchVal ,TrapsEnbled2BA: SwitchTypes.SwitchVal ,UserMode0AB: SwitchTypes.SwitchVal ,LoadStage1Ac: SwitchTypes.SwitchVal ,LoadStage1Bc: SwitchTypes.SwitchVal ,LoadStage2Ac: SwitchTypes.SwitchVal ,LoadStage3Ac: SwitchTypes.SwitchVal ,X2ASrcStatusBA: SwitchTypes.SwitchVal ,X1ADstStatusBA: SwitchTypes.SwitchVal ,PhA: SwitchTypes.SwitchVal ,PhB: SwitchTypes.SwitchVal ]; IFUStatusSimpleIORef: TYPE = REF IFUStatusSimpleIORec; IFUStatusSimpleIORec: TYPE = RECORD [ XBus: ARRAY [0..2) OF CARDINAL ,fill1: [0 .. 32767], RescheduleBA: BOOLEAN ,fill2: [0 .. 32767], ClearTrapsEnbledBA: BOOLEAN ,fill3: [0 .. 32767], ClearUserModeBA: BOOLEAN ,fill4: [0 .. 32767], RschWaiting2BA: BOOLEAN ,fill5: [0 .. 32767], TrapsEnbled2BA: BOOLEAN ,fill6: [0 .. 32767], UserMode0AB: BOOLEAN ,fill7: [0 .. 32767], LoadStage1Ac: BOOLEAN ,fill8: [0 .. 32767], LoadStage1Bc: BOOLEAN ,fill9: [0 .. 32767], LoadStage2Ac: BOOLEAN ,fill10: [0 .. 32767], LoadStage3Ac: BOOLEAN ,fill11: [0 .. 32767], X2ASrcStatusBA: BOOLEAN ,fill12: [0 .. 32767], X1ADstStatusBA: BOOLEAN ,fill13: [0 .. 32767], PhA: BOOLEAN ,fill14: [0 .. 32767], PhB: BOOLEAN ]; IFUStatusDriveRef: TYPE = REF IFUStatusDriveRec; IFUStatusDriveRec: TYPE = RECORD [driveRecordInitialPadding: DriveTagType, drive: PACKED ARRAY IFUStatusPort OF DriveLevel]; IFUStatusPort: TYPE = { XBus, RescheduleBA, ClearTrapsEnbledBA, ClearUserModeBA, RschWaiting2BA, TrapsEnbled2BA, UserMode0AB, LoadStage1Ac, LoadStage1Bc, LoadStage2Ac, LoadStage3Ac, X2ASrcStatusBA, X1ADstStatusBA, PhA, PhB, IFUStatusPortTypePad15}; CreateIFUStatusIO: PROC [ct: CellType, switch: BOOL] RETURNS [ioAsAny: REF ANY] --IOCreator-- = { ioAsAny _ IF switch THEN NEW[IFUStatusSwitchIORec] ELSE NEW[IFUStatusSimpleIORec]; }; CreateIFUStatusDrive: PROC [ct: CellType] RETURNS [driveAsAny: REF ANY] --DriveCreator-- = { driveAsAny _ NEW[IFUStatusDriveRec]; }; IFUStatusStateRef: TYPE = REF IFUStatusStateRec; IFUStatusStateRec: TYPE = RECORD [ status: ARRAY Dragon.Phase OF DragOpsCross.IFUStatusRec, rsPipe: ARRAY Dragon.Phase OF BOOL, x2ASrcStatus: ARRAY Dragon.Phase OF BOOL, statPipe: ARRAY Dragon.Phase OF DragOpsCross.IFUStatusRec ]; InitializeIFUStatus: Initializer = { state: IFUStatusStateRef _ NEW[IFUStatusStateRec]; cell.realCellStuff.state _ state; }; IFUStatusEvalSimple: SimpleEval = BEGIN drive: IFUStatusDriveRef _ NARROW[cell.realCellStuff.newDriveAsAny]; sw: IFUStatusSwitchIORef _ NARROW[cell.realCellStuff.switchIO]; newIO: IFUStatusSimpleIORef _ NARROW[cell.realCellStuff.newIO]; state: IFUStatusStateRef _ NARROW[cell.realCellStuff.state]; BEGIN OPEN drive, newIO, state; IF PhA THEN { newstatusRec: DragOpsCross.IFUStatusRec _ LOOPHOLE[XBus]; rsPipe[a] _ RescheduleBA; status[a] _ [rescheduleKeep: TRUE]; status[a].reschedule _ (NOT X1ADstStatusBA AND status[b].reschedule) OR (X1ADstStatusBA AND newstatusRec.rescheduleKeep AND status[b].reschedule) OR (X1ADstStatusBA AND NOT newstatusRec.rescheduleKeep AND newstatusRec.reschedule) OR (RescheduleBA AND NOT rsPipe[b]); status[a].userMode _ (NOT ClearUserModeBA AND NOT X1ADstStatusBA AND status[b].userMode) OR (NOT ClearUserModeBA AND X1ADstStatusBA AND newstatusRec.userModeKeep AND status[b].userMode) OR (NOT ClearUserModeBA AND X1ADstStatusBA AND NOT newstatusRec.userModeKeep AND newstatusRec.userMode); status[a].trapsEnabled _ (NOT ClearTrapsEnbledBA AND NOT X1ADstStatusBA AND status[b].trapsEnabled) OR (NOT ClearTrapsEnbledBA AND X1ADstStatusBA AND newstatusRec.trapsEnabledKeep AND status[b].trapsEnabled) OR (NOT ClearTrapsEnbledBA AND X1ADstStatusBA AND NOT newstatusRec.trapsEnabledKeep AND newstatusRec.trapsEnabled); }; IF PhB THEN { status[b] _ status[a]; rsPipe[b] _ rsPipe[a]; }; IF LoadStage1Ac THEN {x2ASrcStatus[a] _ X2ASrcStatusBA; statPipe[a] _ status[b]}; IF LoadStage1Bc THEN {x2ASrcStatus[b] _ x2ASrcStatus[a]; statPipe[b] _ statPipe[a]}; IF PhA AND x2ASrcStatus[b] THEN { drive[XBus] _ drive; XBus _ LOOPHOLE[statPipe[b]]; } ELSE drive[XBus] _ ignore; UserMode0AB _ status[a].userMode; RschWaiting2BA _ status[b].reschedule AND NOT X1ADstStatusBA; -- just in case TrapsEnbled2BA _ status[b].trapsEnabled AND NOT ClearTrapsEnbledBA; END; END; KBusPads: PUBLIC CellType; CreateKBusPadsPorts: PROC RETURNS [ports: Ports] = {ports _ RoseCreate.PortsFromFile["IFUData3.KBusPads.rosePorts"]}; KBusPadsSwitchIORef: TYPE = REF KBusPadsSwitchIORec; KBusPadsSwitchIORec: TYPE = RECORD [ KBus: PACKED ARRAY [0 .. 32) OF SwitchTypes.SwitchVal ,XBus: PACKED ARRAY [0 .. 32) OF SwitchTypes.SwitchVal ,KPadsIn3BA: SwitchTypes.SwitchVal ,PhA: SwitchTypes.SwitchVal ,PhB: SwitchTypes.SwitchVal ]; KBusPadsSimpleIORef: TYPE = REF KBusPadsSimpleIORec; KBusPadsSimpleIORec: TYPE = RECORD [ KBus: ARRAY [0..2) OF CARDINAL ,XBus: ARRAY [0..2) OF CARDINAL ,fill2: [0 .. 32767], KPadsIn3BA: BOOLEAN ,fill3: [0 .. 32767], PhA: BOOLEAN ,fill4: [0 .. 32767], PhB: BOOLEAN ]; KBusPadsDriveRef: TYPE = REF KBusPadsDriveRec; KBusPadsDriveRec: TYPE = RECORD [driveRecordInitialPadding: DriveTagType, drive: PACKED ARRAY KBusPadsPort OF DriveLevel]; KBusPadsPort: TYPE = { KBus, XBus, KPadsIn3BA, PhA, PhB, KBusPadsPortTypePad5, KBusPadsPortTypePad6, KBusPadsPortTypePad7}; CreateKBusPadsIO: PROC [ct: CellType, switch: BOOL] RETURNS [ioAsAny: REF ANY] --IOCreator-- = { ioAsAny _ IF switch THEN NEW[KBusPadsSwitchIORec] ELSE NEW[KBusPadsSimpleIORec]; }; CreateKBusPadsDrive: PROC [ct: CellType] RETURNS [driveAsAny: REF ANY] --DriveCreator-- = { driveAsAny _ NEW[KBusPadsDriveRec]; }; KBusPadsEvalSimple: SimpleEval = BEGIN drive: KBusPadsDriveRef _ NARROW[cell.realCellStuff.newDriveAsAny]; sw: KBusPadsSwitchIORef _ NARROW[cell.realCellStuff.switchIO]; newIO: KBusPadsSimpleIORef _ NARROW[cell.realCellStuff.newIO]; BEGIN OPEN drive, newIO; SELECT TRUE FROM PhB => {drive[KBus] _ drive; drive[XBus] _ ignore; KBus _ XBus}; PhA AND NOT KPadsIn3BA => {drive[KBus] _ drive; drive[XBus] _ ignore; KBus _ XBus}; PhA -- AND KPadsIn3BA AND NOT PhB -- => {drive[KBus] _ ignore; drive[XBus] _ drive; XBus _ KBus}; ENDCASE -- NOT PhA AND NOT PhB -- => {drive[KBus] _ drive[XBus] _ ignore}; END; END; Misc: PUBLIC CellType; CreateMiscPorts: PROC RETURNS [ports: Ports] = {ports _ RoseCreate.PortsFromFile["IFUData3.Misc.rosePorts"]}; MiscSwitchIORef: TYPE = REF MiscSwitchIORec; MiscSwitchIORec: TYPE = RECORD [ ResetAB: SwitchTypes.SwitchVal ,ResetBA: SwitchTypes.SwitchVal ,RescheduleAB: SwitchTypes.SwitchVal ,RescheduleBA: SwitchTypes.SwitchVal ,DHoldAB: SwitchTypes.SwitchVal ,DHold0BA: SwitchTypes.SwitchVal ,DHold1AB: SwitchTypes.SwitchVal ,DPRejectB: SwitchTypes.SwitchVal ,DPRejectedBA: SwitchTypes.SwitchVal ,PhA: SwitchTypes.SwitchVal ,PhB: SwitchTypes.SwitchVal ]; MiscSimpleIORef: TYPE = REF MiscSimpleIORec; MiscSimpleIORec: TYPE = RECORD [ fill0: [0 .. 32767], ResetAB: BOOLEAN ,fill1: [0 .. 32767], ResetBA: BOOLEAN ,fill2: [0 .. 32767], RescheduleAB: BOOLEAN ,fill3: [0 .. 32767], RescheduleBA: BOOLEAN ,fill4: [0 .. 32767], DHoldAB: BOOLEAN ,fill5: [0 .. 32767], DHold0BA: BOOLEAN ,fill6: [0 .. 32767], DHold1AB: BOOLEAN ,fill7: [0 .. 32767], DPRejectB: BOOLEAN ,fill8: [0 .. 32767], DPRejectedBA: BOOLEAN ,fill9: [0 .. 32767], PhA: BOOLEAN ,fill10: [0 .. 32767], PhB: BOOLEAN ]; MiscDriveRef: TYPE = REF MiscDriveRec; MiscDriveRec: TYPE = RECORD [driveRecordInitialPadding: DriveTagType, drive: PACKED ARRAY MiscPort OF DriveLevel]; MiscPort: TYPE = { ResetAB, ResetBA, RescheduleAB, RescheduleBA, DHoldAB, DHold0BA, DHold1AB, DPRejectB, DPRejectedBA, PhA, PhB, MiscPortTypePad11}; CreateMiscIO: PROC [ct: CellType, switch: BOOL] RETURNS [ioAsAny: REF ANY] --IOCreator-- = { ioAsAny _ IF switch THEN NEW[MiscSwitchIORec] ELSE NEW[MiscSimpleIORec]; }; CreateMiscDrive: PROC [ct: CellType] RETURNS [driveAsAny: REF ANY] --DriveCreator-- = { driveAsAny _ NEW[MiscDriveRec]; }; MiscEvalSimple: SimpleEval = BEGIN drive: MiscDriveRef _ NARROW[cell.realCellStuff.newDriveAsAny]; sw: MiscSwitchIORef _ NARROW[cell.realCellStuff.switchIO]; newIO: MiscSimpleIORef _ NARROW[cell.realCellStuff.newIO]; BEGIN OPEN drive, newIO; IF PhA THEN {DHold1AB _ DHold0BA}; IF PhB THEN { DHold0BA _ DHoldAB; ResetBA _ ResetAB; RescheduleBA _ RescheduleAB; DPRejectedBA _ DPRejectB; }; END; END; MicroInstDisposition: TYPE = {unready, valid, interlocked, killed2b, killed3a, killed3b}; LogPipeState: TYPE = RECORD [ pc: Dragon.HexWord, op: DragOpsCross.Inst _ x374B, alpha, beta, gamma, delta: Dragon.HexByte _ 0, microCyc: NAT _ 0, disposition: MicroInstDisposition _ unready ]; OldIFULogger: TYPE = RECORD [args: IFULoggerArgs, ct: CellType]; oldIFULogger: LIST OF OldIFULogger _ NIL; IFULogger: PUBLIC PROC [args: IFULoggerArgs] RETURNS [ct: CellType] = BEGIN FOR old: LIST OF OldIFULogger _ oldIFULogger, old.rest WHILE old # NIL DO IF old.first.args = args THEN RETURN [old.first.ct] ENDLOOP; ct _ RoseCreate.RegisterCellType[name: IFULoggerName[args], expandProc: NIL, ioCreator: CreateIFULoggerIO, driveCreator: CreateIFULoggerDrive, initializer: InitializeIFULogger, evals: [EvalSimple: IFULoggerEvalSimple], tests: LIST[], ports: CreateIFULoggerPorts[args] , typeData: NEW [IFULoggerArgs _ args]]; oldIFULogger _ CONS[[args, ct], oldIFULogger]; END; IFULoggerName: PROC [args: IFULoggerArgs] RETURNS [name: ROPE] = { to: IO.STREAM _ IO.ROS[]; to.PutRope["IFULogger"]; TRUSTED {PrintTV.Print[tv: AMBridge.TVForReferent[NEW [IFULoggerArgs _ args]], put: to, depth: 2]}; name _ IO.RopeFromROS[to]}; CreateIFULoggerPorts: PROC [args: IFULoggerArgs] RETURNS [ports: Ports] = {ports _ RoseCreate.PortsFromFile["IFUData3.IFULogger.rosePorts"]}; IFULoggerSwitchIORef: TYPE = REF IFULoggerSwitchIORec; IFULoggerSwitchIORec: TYPE = RECORD [ XBus: PACKED ARRAY [0 .. 32) OF SwitchTypes.SwitchVal ,DPRejectedBA: SwitchTypes.SwitchVal ,OpAB: PACKED ARRAY [0 .. 8) OF SwitchTypes.SwitchVal ,AlphaAB: PACKED ARRAY [0 .. 8) OF SwitchTypes.SwitchVal ,BetaAB: PACKED ARRAY [0 .. 8) OF SwitchTypes.SwitchVal ,GammaAB: PACKED ARRAY [0 .. 8) OF SwitchTypes.SwitchVal ,DeltaAB: PACKED ARRAY [0 .. 8) OF SwitchTypes.SwitchVal ,OpLengthBA: PACKED ARRAY [0 .. 3) OF SwitchTypes.SwitchVal ,InstReadyAB: SwitchTypes.SwitchVal ,ExceptionCodeAB: PACKED ARRAY [0 .. 8) OF SwitchTypes.SwitchVal ,MicroCycleAB: PACKED ARRAY [0 .. 8) OF SwitchTypes.SwitchVal ,MicroCycleNextBA: PACKED ARRAY [0 .. 3) OF SwitchTypes.SwitchVal ,MacroJumpBA: SwitchTypes.SwitchVal ,PCBusSrcB: PACKED ARRAY [0 .. 8) OF SwitchTypes.SwitchVal ,PCForLogAB: PACKED ARRAY [0 .. 32) OF SwitchTypes.SwitchVal ,LAB: PACKED ARRAY [0 .. 8) OF SwitchTypes.SwitchVal ,SAB: PACKED ARRAY [0 .. 8) OF SwitchTypes.SwitchVal ,AReg0BA: PACKED ARRAY [0 .. 8) OF SwitchTypes.SwitchVal ,BReg0BA: PACKED ARRAY [0 .. 8) OF SwitchTypes.SwitchVal ,CReg0BA: PACKED ARRAY [0 .. 8) OF SwitchTypes.SwitchVal ,DPCmnd3A: PACKED ARRAY [0 .. 8) OF SwitchTypes.SwitchVal ,DPData: PACKED ARRAY [0 .. 32) OF SwitchTypes.SwitchVal ,DPRejectB: SwitchTypes.SwitchVal ,DPFaultB: PACKED ARRAY [0 .. 4) OF SwitchTypes.SwitchVal ,LoadStage1Ac: SwitchTypes.SwitchVal ,LoadStage1Bc: SwitchTypes.SwitchVal ,LoadStage2Ac: SwitchTypes.SwitchVal ,BubbleStage2A1BA: SwitchTypes.SwitchVal ,NormalStage2A1BA: SwitchTypes.SwitchVal ,AbortStage2B2AB: SwitchTypes.SwitchVal ,NormalStage2B2AB: SwitchTypes.SwitchVal ,LoadStage3Ac: SwitchTypes.SwitchVal ,AbortStage3A2BA: SwitchTypes.SwitchVal ,NormalStage3A2BA: SwitchTypes.SwitchVal ,PhA: SwitchTypes.SwitchVal ,PhB: SwitchTypes.SwitchVal ]; IFULoggerSimpleIORef: TYPE = REF IFULoggerSimpleIORec; IFULoggerSimpleIORec: TYPE = RECORD [ XBus: ARRAY [0..2) OF CARDINAL ,fill1: [0 .. 32767], DPRejectedBA: BOOLEAN ,fill2: [0 .. 255], OpAB: [0..255] ,fill3: [0 .. 255], AlphaAB: [0..255] ,fill4: [0 .. 255], BetaAB: [0..255] ,fill5: [0 .. 255], GammaAB: [0..255] ,fill6: [0 .. 255], DeltaAB: [0..255] ,fill7: [0 .. 8191], OpLengthBA: [0..7] ,fill8: [0 .. 32767], InstReadyAB: BOOLEAN ,fill9: [0 .. 255], ExceptionCodeAB: ExceptionCode ,fill10: [0 .. 255], MicroCycleAB: [0..255] ,fill11: [0 .. 8191], MicroCycleNextBA: MicroCycleNext ,fill12: [0 .. 32767], MacroJumpBA: BOOLEAN ,fill13: [0 .. 255], PCBusSrcB: PCBusSrc ,PCForLogAB: ARRAY [0..2) OF CARDINAL ,fill15: [0 .. 255], LAB: [0..255] ,fill16: [0 .. 255], SAB: [0..255] ,fill17: [0 .. 255], AReg0BA: [0..255] ,fill18: [0 .. 255], BReg0BA: [0..255] ,fill19: [0 .. 255], CReg0BA: [0..255] ,fill20: [0 .. 255], DPCmnd3A: PBusCommands ,DPData: ARRAY [0..2) OF CARDINAL ,fill22: [0 .. 32767], DPRejectB: BOOLEAN ,fill23: [0 .. 4095], DPFaultB: PBusFaults ,fill24: [0 .. 32767], LoadStage1Ac: BOOLEAN ,fill25: [0 .. 32767], LoadStage1Bc: BOOLEAN ,fill26: [0 .. 32767], LoadStage2Ac: BOOLEAN ,fill27: [0 .. 32767], BubbleStage2A1BA: BOOLEAN ,fill28: [0 .. 32767], NormalStage2A1BA: BOOLEAN ,fill29: [0 .. 32767], AbortStage2B2AB: BOOLEAN ,fill30: [0 .. 32767], NormalStage2B2AB: BOOLEAN ,fill31: [0 .. 32767], LoadStage3Ac: BOOLEAN ,fill32: [0 .. 32767], AbortStage3A2BA: BOOLEAN ,fill33: [0 .. 32767], NormalStage3A2BA: BOOLEAN ,fill34: [0 .. 32767], PhA: BOOLEAN ,fill35: [0 .. 32767], PhB: BOOLEAN ]; IFULoggerDriveRef: TYPE = REF IFULoggerDriveRec; IFULoggerDriveRec: TYPE = RECORD [driveRecordInitialPadding: DriveTagType, drive: PACKED ARRAY IFULoggerPort OF DriveLevel]; IFULoggerPort: TYPE = { XBus, DPRejectedBA, OpAB, AlphaAB, BetaAB, GammaAB, DeltaAB, OpLengthBA, InstReadyAB, ExceptionCodeAB, MicroCycleAB, MicroCycleNextBA, MacroJumpBA, PCBusSrcB, PCForLogAB, LAB, SAB, AReg0BA, BReg0BA, CReg0BA, DPCmnd3A, DPData, DPRejectB, DPFaultB, LoadStage1Ac, LoadStage1Bc, LoadStage2Ac, BubbleStage2A1BA, NormalStage2A1BA, AbortStage2B2AB, NormalStage2B2AB, LoadStage3Ac, AbortStage3A2BA, NormalStage3A2BA, PhA, PhB}; CreateIFULoggerIO: PROC [ct: CellType, switch: BOOL] RETURNS [ioAsAny: REF ANY] --IOCreator-- = { args: REF IFULoggerArgs _ NARROW[ct.typeData]; {OPEN args; ioAsAny _ IF switch THEN NEW[IFULoggerSwitchIORec] ELSE NEW[IFULoggerSimpleIORec]; }; }; CreateIFULoggerDrive: PROC [ct: CellType] RETURNS [driveAsAny: REF ANY] --DriveCreator-- = { args: REF IFULoggerArgs _ NARROW[ct.typeData]; {OPEN args; driveAsAny _ NEW[IFULoggerDriveRec]; }; }; IFULoggerStateRef: TYPE = REF IFULoggerStateRec; IFULoggerStateRec: TYPE = RECORD [ opPipe: ARRAY [0..3] OF ARRAY Dragon.Phase OF LogPipeState, last: {a,ab,b,ba}, firstMicroOfMacro: LogPipeState, dpRejectedAB: BOOL, dpFaultedBA: BOOL, dpFaultedAB: BOOL, doTrap3BA: BOOL, xbusBCopy: Dragon.HexWord, logRegistersB: BOOL, interruptPending: BOOL, trapped: BOOL ]; InitializeIFULogger: Initializer = { args: REF IFULoggerArgs _ NARROW [cell.type.typeData]; {OPEN args; state: IFULoggerStateRef _ NEW[IFULoggerStateRec]; cell.realCellStuff.state _ state; }; }; IFULoggerEvalSimple: SimpleEval = BEGIN args: REF IFULoggerArgs _ NARROW[cell.type.typeData]; drive: IFULoggerDriveRef _ NARROW[cell.realCellStuff.newDriveAsAny]; sw: IFULoggerSwitchIORef _ NARROW[cell.realCellStuff.switchIO]; newIO: IFULoggerSimpleIORef _ NARROW[cell.realCellStuff.newIO]; state: IFULoggerStateRef _ NARROW[cell.realCellStuff.state]; BEGIN OPEN drive, newIO, args, state; NewDisposition: PROC [ pipeState: LogPipeState, disp: MicroInstDisposition ] RETURNS [ newPipeState: LogPipeState ] = { newPipeState _ pipeState; newPipeState.disposition _ disp; }; log: IO.STREAM; IF NOT PhB AND last=b THEN { last _ ba; IF logRegistersB AND (log _ logRef^) # IO.noWhereStream THEN { log.PutF[" a:%02x", IO.card[AReg0BA]]; log.PutF[ " b:%02x", IO.card[BReg0BA]]; log.PutF[ " c:%02x", IO.card[CReg0BA]]; }; logRegistersB _ FALSE; SELECT opPipe[3][b].microCyc FROM 117 => { -- Reset finished ClusterParams.clusterPanel.instrCount _ -1; trapped _ FALSE; }; 120 => { -- first cycle of trap trapped _ TRUE; }; 0 => IF NOT DPRejectedBA AND (SELECT opPipe[3][b].disposition FROM valid => TRUE, killed3a, killed3b => (MicroCycleAB = 120 -- trap that will apply to the new instruction -- ), ENDCASE => FALSE) THEN { ClusterParams.clusterPanel.instrCount _ ClusterParams.clusterPanel.instrCount+ LizardRosemary.CheckSynch[ lizardSimRef: lizardSimRef, clusterInst: [ -- the completed instruction cycle: ClusterParams.clusterPanel.cycle, instr: ClusterParams.clusterPanel.instrCount, trapped: trapped, trapPC: IF trapped THEN opPipe[3][b].pc ELSE 0, pc: firstMicroOfMacro.pc, op: firstMicroOfMacro.op, alpha: firstMicroOfMacro.alpha, beta: firstMicroOfMacro.beta, gamma: firstMicroOfMacro.gamma, delta: firstMicroOfMacro.delta ] ].deltaInstrCount; firstMicroOfMacro _ opPipe[3][b]; trapped _ FALSE; }; ENDCASE => NULL; }; IF PhA THEN {dpRejectedAB _ DPRejectedBA; dpFaultedAB _ dpFaultedBA}; IF PhB THEN opPipe[0][b] _ [ pc: DragonRoseExtras.LFD[PCForLogAB], op: LOOPHOLE[OpAB], alpha: AlphaAB, beta: BetaAB, gamma: GammaAB, delta: DeltaAB, microCyc: MicroCycleAB, disposition: IF InstReadyAB THEN valid ELSE unready ]; IF LoadStage1Ac THEN opPipe[1][a] _ opPipe[0][b]; IF LoadStage1Bc THEN opPipe[1][b] _ opPipe[1][a]; IF LoadStage2Ac THEN opPipe[2][a] _ (SELECT TRUE FROM NormalStage2A1BA => opPipe[1][b], BubbleStage2A1BA => NewDisposition[opPipe[1][b], interlocked], ENDCASE => ERROR); IF PhB THEN opPipe[2][b] _ (SELECT TRUE FROM NormalStage2B2AB => opPipe[2][a], AbortStage2B2AB => NewDisposition[opPipe[2][a], killed2b], ENDCASE => ERROR); IF LoadStage3Ac THEN opPipe[3][a] _ (SELECT TRUE FROM NormalStage3A2BA => opPipe[2][b], AbortStage3A2BA => NewDisposition[opPipe[2][b], killed3a], ENDCASE => ERROR); IF PhB THEN {opPipe[3][b] _ opPipe[3][a]; IF dpFaultedAB THEN opPipe[3][b].disposition _ killed3b}; IF PhB THEN { xbusBCopy _ DragonRoseExtras.LFD[XBus]; dpFaultedBA _ DPFaultB # none; doTrap3BA _ SELECT ExceptionCodeAB FROM none, cJump => FALSE, ENDCASE => TRUE; IF last#b THEN { last _ b; IF ((log _ logRef^) # IO.noWhereStream) AND (ExceptionCodeAB # reset) THEN { IF (ExceptionCodeAB # none) OR InstReadyAB THEN { log.PutF["\n%5g%5g", IO.int[ClusterParams.clusterPanel.cycle], IO.int[ClusterParams.clusterPanel.instrCount] ]; SELECT TRUE FROM ExceptionCodeAB=reseting => log.PutF["**Reseting "]; ExceptionCodeAB=reset => log.PutF["**Reset "]; ExceptionCodeAB=dpFault => log.PutF["**DPFault "]; dpRejectedAB => log.PutF["**DPReject "]; ExceptionCodeAB=cTrap => log.PutF["**EUCC "]; ExceptionCodeAB=bubble => log.PutF["**Bubble "]; ExceptionCodeAB=cJump => log.PutF["**CJRestrt "]; ExceptionCodeAB=rschlWait => log.PutF["**Reschdl "]; ExceptionCodeAB=iStkOFlow => log.PutF["**IStkOver "]; ExceptionCodeAB=eStkOFlow => log.PutF["**EStkOver "]; ExceptionCodeAB=ipFault => log.PutF["**IPgFault "]; ExceptionCodeAB=none => log.PutRope[" "]; ENDCASE => log.PutF[" cy: %2g ", IO.card[ExceptionCodeAB.ORD]]; log.PutF["pc:%08x", IO.card[DragonRoseExtras.LFD[PCForLogAB]] ]; SELECT TRUE FROM dpRejectedAB => log.PutF[" --EU reject delay..."]; NOT InstReadyAB => log.PutF[" --IFetch delay..."]; ENDCASE => { opLength: [0..5] = DragonRosemary.OpLength[OpAB]; log.PutF[" %-7g", IO.rope[Rope.Cat[DragonRosemary.OpName[OpAB], (IF MicroCycleAB=0 THEN "" ELSE IO.PutFR["-%g", IO.int[MicroCycleAB]])]]]; IF opLength > 1 THEN log.PutF[" %02x", IO.card[AlphaAB]] ELSE log.PutF[" "]; IF opLength > 2 THEN log.PutF["%02x", IO.card[BetaAB]] ELSE log.PutF[" "]; IF opLength > 3 THEN log.PutF["%02x%02x", IO.card[GammaAB], IO.card[DeltaAB]] ELSE log.PutF[" "]; log.PutF[" l:%02x", IO.card[LAB]]; -- at beginning of instruction log.PutF[ " s:%02x", IO.card[SAB]]; -- at beginning of instruction logRegistersB _ TRUE; }; }; }; IF ExceptionCodeAB=reset THEN ClusterParams.clusterPanel.instrCount _ -1; }; }; END; END; RegisterCells[]; END. ~IFUData3Impl.Mesa created by RoseTranslate 3.1.3 of September 5, 1985 12:14:34 pm PDT created from IFUData3.Rose of March 11, 1986 11:41:03 am PST created for McCreight.pa created at March 11, 1986 11:53:01 am PST Signal Type decls explicitly requested CEDAR: Pipe explicitly requested CEDAR: The first microinstruction of a new macroinstruction instrCount+1 is now committed to retire, either in victory or defeat (as in "trapped"). This means that all register stores for the macroinstruction instrCount are completed, and none for macroinstruction instrCount+1 have yet occurred. Pipe Log instruction at the beginning of Ph0B. Κm˜Icodešœ™KšœC™CKšœ<™šœœ˜>šœœ˜šœœ˜˜J˜9—šœœœ˜J˜9—šœ  œ˜(J˜9—šœ œ˜$J˜%———Kšœ˜—Kšœ˜—Kšœœ ˜K˜KšŸœœœP˜mK˜Kšœœœ˜,šœœœ˜ K˜K˜K˜$K˜$K˜K˜ K˜ K˜!K˜$K˜K˜K˜—K˜Kšœœœ˜,šœœœ˜ K˜Kšœ ˜K˜Kšœ ˜K˜Kšœ˜K˜Kšœ˜K˜Kšœ ˜K˜Kšœ ˜K˜Kšœ ˜K˜Kšœ ˜K˜Kšœ˜K˜Kšœ˜ K˜Kšœ˜ K˜—K˜Kšœœœ˜&Kš œœœ2œœ œ ˜ršœ œ˜K˜—K˜šŸ œœœœ œœ  œ˜\Kš œ œœœœœ˜HK˜—K˜š Ÿœœœœœ œ˜WKšœ œ˜K˜—K˜˜Kš˜Kšœœ#˜?Kšœœ˜:šœœ˜:šœœ˜Jšœœ˜#šœœ˜ J˜J˜J˜J˜J˜——Kšœ˜—Kšœ˜—K˜šœ™Jšœœ?˜Yšœœœ˜J˜J˜J˜.Jšœ œ˜J˜+J˜——K˜K˜Kšœœœ%˜@Kšœœœœ˜)šŸ œœœœ˜CKšœ˜š œœœ'œœ˜IKšœœœ˜3Kšœ˜—˜;Kšœ œ˜K˜cK˜)Kšœœ˜K˜!K˜Kšœ œ˜&—Kšœœ˜.Kšœ˜—K˜šŸ œœœœ˜BKš œœœœœ˜2Kšœ+œ.˜cKšœœ˜—K˜KšŸœœœU˜K˜Kšœœœ˜6šœœœ˜%Kšœœœ œ˜5K˜$Kšœœœ œ˜5Kšœ œœ œ˜8Kšœ œœ œ˜7Kšœ œœ œ˜8Kšœ œœ œ˜8Kšœ œœ œ˜;K˜#Kšœœœ œ˜@Kšœœœ œ˜=Kšœœœ œ˜AK˜#Kšœ œœ œ˜:Kšœ œœ œ˜Jšœœ˜'Jšœœ˜'Jšœœ˜'J˜—Jšœœ˜J˜Jšœ˜!˜šœ  ˜J˜+Jšœ œ˜J˜J˜—šœ  ˜Jšœ œ˜J˜J˜—š œœœœœ˜BJšœ œ˜˜Jšœ 1œ˜H—Jšœœœ˜—J˜˜J™’—˜J˜˜N˜˜šœ ˜+J˜+J˜0J˜Jšœ œ œœ˜1J˜J˜J˜"J˜ J˜!J˜!J˜—J˜———J™J˜!Jšœ œ˜J˜J˜—Jšœœ˜—J˜—J˜Jšœœ:˜EJ˜J™šœœ˜Jšœœ ˜%Jšœœ˜J˜J˜ J˜J˜J˜Jšœ œ œœ˜3J˜—Jšœœ˜1Jšœœ˜2š œœœœ˜5J˜!J˜>Jšœœ˜—š œœœœ˜,J˜!J˜:Jšœœ˜—š œœœœ˜5J˜!J˜:Jšœœ˜—šœ˜ Jšœœ œ&˜W—J˜Jšœœ˜ ˜Jšœœ˜'J˜J˜šœ œ˜'Jšœœ˜Jšœœ˜J˜—šœœ˜J˜ J™)šœœœœ˜Lšœœ œ˜1Jšœœ(œ.˜ošœœ˜˜J˜—˜J˜—˜J˜—˜ J˜—˜J˜—˜J˜—˜J˜—˜J˜—˜J˜—˜J˜—˜J˜—˜J˜—š˜Jšœœœ˜:——Jšœœœ˜@šœœ˜J˜2Jšœ/˜2šœ˜ J˜1šœœ+˜?Jš œœœœœœ˜J—šœ ˜Jšœœœ˜>—šœ ˜Jšœœœ˜;—šœ ˜Jšœœœ˜=Jšœ˜—Jšœœœ ˜BJšœœœ ˜BJšœœ˜J˜——J˜—J˜J˜—šœ˜J˜+J˜—J˜—J˜——Kšœ˜—Kšœ˜—K˜K˜K˜Kšœ˜—…—T.m