MainThread: ThreadProc = {
OPEN value;
DoAReset[];
R[A]; R[];
ThreadStart[MCommand, NEW[MCommandRec ← [slave: TRUE, WQ: TRUE, WQAddress: 0, WQData0: 1, WQData1: 2, WQData2: 3, WQData3: 4]]];
THROUGH [0..5) DO R[B]; R[]; R[A]; R[]; ENDLOOP;
ThreadStart[MCommand, NEW[MCommandRec ← [slave: TRUE, RQ: TRUE, RQAddress: 5, RQData0: 6, RQData1: 7, RQData2: 8, RQData3: 9]]];
THROUGH [0..6) DO R[B]; R[]; R[A]; R[]; ENDLOOP;
ThreadStart[MCommand, NEW[MCommandRec ← [slave: TRUE, WS: TRUE, WSAddress: 10, WSData: 11]]];
THROUGH [0..2) DO R[B]; R[]; R[A]; R[]; ENDLOOP;
ThreadStart[MCommand, NEW[MCommandRec ← [slave: TRUE, CF: TRUE, CFData: 12]]];
THROUGH [0..2) DO R[B]; R[]; R[A]; R[]; ENDLOOP;
R[B]; R[];
ThreadStart[PReference, NEW[PReferenceRec ← [command: IOFetchHold, address: 2, data: 00060001H, rejects: 5]]]; R[A]; R[];
ThreadStart[MCommand, NEW[MCommandRec ← [arb: TRUE, releaseBus: FALSE, IOR: TRUE, IOAddress: 2, IOData: 00060001H]]];
R[B]; R[]; R[A]; R[]; R[B]; R[]; R[A]; R[]; -- arbitrate
R[B]; R[]; R[A]; R[]; R[B]; R[]; R[A]; R[]; -- io
R[B]; R[]; R[A]; R[]; R[B]; R[];
ThreadStart[PReference, NEW[PReferenceRec ← [command: IOStoreHold, address: 3, data: 00070001H, rejects: 4]]]; R[A]; R[]; R[B]; R[]; R[A]; R[];
ThreadStart[MCommand, NEW[MCommandRec ← [releaseBus: FALSE, IOW: TRUE, IOAddress: 3, IOData: 00070001H]]];
R[B]; R[]; R[A]; R[]; R[B]; R[]; R[A]; R[]; -- io
R[B]; R[]; R[A]; R[]; R[B]; R[];
ThreadStart[PReference, NEW[PReferenceRec ← [command: IOFetch, address: 4, data: 00080001H, rejects: 4]]]; R[A]; R[]; R[B]; R[]; R[A]; R[];
ThreadStart[MCommand, NEW[MCommandRec ← [IOR: TRUE, IOAddress: 4, IOData: 00080001H]]];
R[B]; R[]; R[A]; R[]; R[B]; R[]; R[A]; R[]; -- io
R[B]; R[]; R[A]; R[]; R[B]; R[]; R[A]; R[]; R[B]; R[]; -- release bus
ThreadStart[PReference, NEW[PReferenceRec ← [command: Store, address: 1, data: 2, rejects: 15]]];
R[A];
R[];
ThreadStart[MCommand, NEW[MCommandRec ← [arb: TRUE, IOR: TRUE, IOAddress: 0C0H, IOData:00010000H, RQ: TRUE, rqNotReadyCount: 2, shared: TRUE, RQAddress:00010001H, RQData0: 00020001H, RQData1: 00020002H, RQData2: 00020003H, RQData3: 00020004H, WS: TRUE, WSAddress:00010001H, WSData:02H]]];
THROUGH [0..16) DO R[B]; R[]; R[A]; R[]; ENDLOOP;
P[B]; drive.MCmdBA ← TRUE; MCmdBA ← NoOp; MNShared ← TRUE; F[]; drive.MCmdBA ← FALSE;
R[B]; R[];
ThreadStart[PReference, NEW[PReferenceRec ← [command: Fetch, address: 1, data: 2]]]; R[A]; R[]; R[B]; R[];
ThreadStart[PReference, NEW[PReferenceRec ← [command: Fetch, address: 0, data: 00020004H]]]; R[A]; R[]; R[B]; R[];
ThreadStart[PReference, NEW[PReferenceRec ← [command: Fetch, address: 2, data: 00020002H]]]; R[A]; R[]; R[B]; R[];
ThreadStart[PReference, NEW[PReferenceRec ← [command: Fetch, address: 3, data: 00020003H]]]; R[A]; R[]; R[B]; R[];
ThreadStart[PReference, NEW[PReferenceRec ← [command: Fetch, address: 4, data: 00040000H, rejects: 5]]]; R[A]; R[];
ThreadStart[MCommand, NEW[MCommandRec ← [arb: TRUE, RQ: TRUE, RQAddress:00010004H, RQData0: 00040000H, RQData1: 00040001H, RQData2: 00040002H, RQData3: 00040003H]]];
THROUGH [0..8) DO R[B]; R[]; R[A]; R[]; ENDLOOP;
P[B]; drive.MCmdBA ← TRUE; MCmdBA ← NoOp; E[]; R[]; drive.MCmdBA ← FALSE;
ThreadStart[PReference, NEW[PReferenceRec ← [command: FetchHold, address: 6, data: 00040002H, rejects: 3]]]; R[A]; R[];
ThreadStart[MCommand, NEW[MCommandRec ← [arb: TRUE, releaseBus: FALSE]]];
R[B]; R[]; R[A]; R[]; R[B]; R[]; R[A]; R[];
drive.MCmdBA ← TRUE; MCmdBA ← Reserve14; E[]; drive.MCmdBA ← FALSE;
P[B]; MCmdBA ← NoOp; E[]; R[]; R[A]; R[]; R[B]; R[];
ThreadStart[PReference, NEW[PReferenceRec ← [command: Store, address: 6, data: 00040012H]]]; R[A]; R[]; R[B]; R[];
ThreadStart[PReference, NEW[PReferenceRec ← [command: StoreHold, address: 6, data: 00040112H, rejects: 3]]]; R[A]; R[];
ThreadStart[MCommand, NEW[MCommandRec ← [arb: TRUE, newRequest: TRUE, releaseBus: FALSE]]];
R[B]; R[]; R[A]; R[]; R[B]; R[]; R[A]; R[];
drive.MCmdBA ← TRUE; MCmdBA ← Reserve14; E[]; drive.MCmdBA ← FALSE;
P[B]; MCmdBA ← NoOp; E[]; R[]; R[A]; R[]; R[B]; R[];
ThreadStart[PReference, NEW[PReferenceRec ← [command: Fetch, address: 6, data: 00040112H]]]; R[A]; R[]; R[B]; R[];
R[A]; R[]; ThreadStart[MCommand, NEW[MCommandRec ← []]];
R[B]; R[]; R[A]; R[]; R[B]; R[]; R[A]; R[];
P[B]; drive.MCmdBA ← TRUE; MCmdBA ← NoOp; MNShared ← TRUE; E[]; drive.MCmdBA ← FALSE; R[];
ThreadStart[PReference, NEW[PReferenceRec ← [command: Fetch, address: 8, data: 00080000H, rejects: 5]]]; R[A]; R[];
ThreadStart[MCommand, NEW[MCommandRec ← [arb: TRUE, RQ: TRUE, RQAddress:00010008H, RQData0: 00080000H, RQData1: 00080001H, RQData2: 00080002H, RQData3: 00080003H]]];
THROUGH [0..8) DO R[B]; R[]; R[A]; R[]; ENDLOOP;
P[B]; drive.MCmdBA ← TRUE; MCmdBA ← NoOp; E[]; R[]; drive.MCmdBA ← FALSE;
ThreadStart[PReference, NEW[PReferenceRec ← [command: Fetch, address: 0CH, data: 000C0000H, rejects: 5]]]; R[A]; R[];
ThreadStart[MCommand, NEW[MCommandRec ← [arb: TRUE, RQ: TRUE, RQAddress:0001000CH, RQData0: 000C0000H, RQData1: 000C0001H, RQData2: 000C0002H, RQData3: 000C0003H]]];
THROUGH [0..8) DO R[B]; R[]; R[A]; R[]; ENDLOOP;
P[B]; drive.MCmdBA ← TRUE; MCmdBA ← NoOp; E[]; R[]; drive.MCmdBA ← FALSE;
ThreadStart[PReference, NEW[PReferenceRec ← [command: Fetch, address: 10H, data: 00100000H, rejects: 13]]]; R[A]; R[];
ThreadStart[MCommand, NEW[MCommandRec ← [arb: TRUE, WQ: TRUE, wqNotReadyCount: 3, WQAddress: 00010000H, WQData0: 00020004H, WQData1: 00000002H, WQData2: 00020002H, WQData3: 00020003H, RQ: TRUE, RQAddress:00010010H, RQData0: 00100000H, RQData1: 00100001H, RQData2: 00100002H, RQData3: 00100003H]]];
THROUGH [0..16) DO R[B]; R[]; R[A]; R[]; ENDLOOP;
P[B]; drive.MCmdBA ← TRUE; MCmdBA ← NoOp; E[]; R[]; drive.MCmdBA ← FALSE;
ThreadStart[PReference, NEW[PReferenceRec ← [command: Fetch, address: 14H, data: 00140000H, rejects: 10]]]; R[A]; R[];
ThreadStart[MCommand, NEW[MCommandRec ← [arb: TRUE, WQ: TRUE, WQAddress: 00010004H, WQData0: 00040000H, WQData1: 00040001H, WQData2: 00040112H, WQData3: 00040003H, RQ: TRUE, RQAddress:00010014H, RQData0: 00140000H, RQData1: 00140001H, RQData2: 00140002H, RQData3: 00140003H]]];
THROUGH [0..13) DO R[B]; R[]; R[A]; R[]; ENDLOOP;
P[B]; drive.MCmdBA ← TRUE; MCmdBA ← NoOp; E[]; R[]; drive.MCmdBA ← FALSE;
ThreadStart[PReference, NEW[PReferenceRec ← [command: Fetch, address: 18H, data: 00180000H, rejects: 5]]]; R[A]; R[];
ThreadStart[MCommand, NEW[MCommandRec ← [arb: TRUE, RQ: TRUE, RQAddress:00010018H, RQData0: 00180000H, RQData1: 00180001H, RQData2: 00180002H, RQData3: 00180003H]]];
THROUGH [0..8) DO R[B]; R[]; R[A]; R[]; ENDLOOP;
P[B]; drive.MCmdBA ← TRUE; MCmdBA ← NoOp; E[]; R[]; drive.MCmdBA ← FALSE;
R[A]; R[];
ThreadStart[MCommand, NEW[MCommandRec ← [slave: TRUE, WQ: TRUE, WQAddress: 00010018H, WQData0: 00190001H, WQData1: 00190002H, WQData2: 00190003H, WQData3: 00190004H]]];
THROUGH [0..5) DO R[B]; R[]; R[A]; R[]; ENDLOOP;
ThreadStart[MCommand, NEW[MCommandRec ← [slave: TRUE, RQ: TRUE, shared: TRUE, RQAddress: 00010018H, RQData0: 00190001H, RQData1: 00190002H, RQData2: 00190003H, RQData3: 00190004H]]];
THROUGH [0..6) DO R[B]; R[]; R[A]; R[]; ENDLOOP;
ThreadStart[MCommand, NEW[MCommandRec ← [slave: TRUE, WS: TRUE, WSAddress: 00010018H, WSData: 00200001H]]];
THROUGH [0..2) DO R[B]; R[]; R[A]; R[]; ENDLOOP;
ThreadStart[MCommand, NEW[MCommandRec ← [slave: TRUE, RQ: TRUE, shared: TRUE, RQAddress: 00010018H, RQData0: 00200001H, RQData1: 00190002H, RQData2: 00190003H, RQData3: 00190004H]]];
THROUGH [0..6) DO R[B]; R[]; R[A]; R[]; ENDLOOP;
ThreadStart[MCommand, NEW[MCommandRec ← [slave: TRUE, CF: TRUE, CFData: 00010000H]]];
THROUGH [0..2) DO R[B]; R[]; R[A]; R[]; ENDLOOP;
R[B]; R[];
ThreadStart[PReference, NEW[PReferenceRec ← [command: Store, address: 1, data: 2, rejects: 6, fault: WriteProtectFault]]];
R[A]; R[];
ThreadStart[MCommand, NEW[MCommandRec ← [arb: TRUE, IOR: TRUE, IOAddress: 0C0H, IOData:00000002H]]];
THROUGH [0..6) DO R[B]; R[]; R[A]; R[]; ENDLOOP;
R[B]; R[];
ThreadStart[PReference, NEW[PReferenceRec ← [command: IOFetch, address: 0, data: 00050000H, rejects: 5]]]; R[A]; R[];
ThreadStart[MCommand, NEW[MCommandRec ← [arb: TRUE, IOR: TRUE, IOAddress: 0, IOData: 00050000H]]];
R[B]; R[]; R[A]; R[]; R[B]; R[]; R[A]; R[]; -- arbitrate
R[B]; R[]; R[A]; R[]; R[B]; R[]; R[A]; R[]; -- io
R[B]; R[]; R[A]; R[]; R[B]; R[]; R[A]; R[]; -- release bus
R[B]; R[];
ThreadStart[PReference, NEW[PReferenceRec ← [command: IOStore, address: 2, data: 00050001H, rejects: 5]]]; R[A]; R[];
ThreadStart[MCommand, NEW[MCommandRec ← [arb: TRUE, IOW: TRUE, IOAddress: 2, IOData: 00050001H]]];
R[B]; R[]; R[A]; R[]; R[B]; R[]; R[A]; R[]; -- arbitrate
R[B]; R[]; R[A]; R[]; R[B]; R[]; R[A]; R[]; -- io
R[B]; R[]; R[A]; R[]; R[B]; R[]; R[A]; R[]; -- release bus
R[B]; R[];
DoAReset[];
Check that a write single causes master to be reset.
ThreadStart[PReference, NEW[PReferenceRec ← [command: Store, address: 00010000H, data: 00000011H, rejects: 9]]]; R[A]; R[];
ThreadStart[MCommand, NEW[MCommandRec ← [arb: TRUE, IOR: TRUE, IOAddress: 00010080H, IOData:00020000H, RQ: TRUE, RQAddress:00020000H, RQData0: 00000001H, RQData1: 00000002H, RQData2: 00000003H, RQData3: 00000004H]]];
THROUGH [0..12) DO R[B]; R[]; R[A]; R[]; ENDLOOP;
R[B]; R[];
ThreadStart[PReference, NEW[PReferenceRec ← [command: Fetch, address: 00010004H, data: 00000005H, rejects: 5]]]; R[A]; R[];
ThreadStart[MCommand, NEW[MCommandRec ← [arb: TRUE, RQ: TRUE, RQAddress:00020004H, RQData0: 00000005H, RQData1: 00000006H, RQData2: 00000007H, RQData3: 00000008H]]];
THROUGH [0..8) DO R[B]; R[]; R[A]; R[]; ENDLOOP;
R[B]; R[];
ThreadStart[PReference, NEW[PReferenceRec ← [command: Fetch, address: 00010008H, data: 00000009H, rejects: 5]]]; R[A]; R[];
ThreadStart[MCommand, NEW[MCommandRec ← [arb: TRUE, RQ: TRUE, RQAddress:00020008H, RQData0: 00000009H, RQData1: 0000000AH, RQData2: 0000000BH, RQData3: 0000000CH]]];
THROUGH [0..8) DO R[B]; R[]; R[A]; R[]; ENDLOOP;
R[B]; R[];
ThreadStart[PReference, NEW[PReferenceRec ← [command: Fetch, address: 0001000CH, data: 0000000DH, rejects: 5]]]; R[A]; R[];
ThreadStart[MCommand, NEW[MCommandRec ← [arb: TRUE, RQ: TRUE, RQAddress:0002000CH, RQData0: 0000000DH, RQData1: 0000000EH, RQData2: 0000000FH, RQData3: 00000010H]]];
THROUGH [0..8) DO R[B]; R[]; R[A]; R[]; ENDLOOP;
ThreadStart[MCommand, NEW[MCommandRec ← [slave: TRUE, RQ: TRUE, shared: TRUE, RQAddress: 00020000H, RQData0: 00000011H, RQData1: 00000002H, RQData2: 00000003H, RQData3: 00000004H]]];
THROUGH [0..6) DO R[B]; R[]; R[A]; R[]; ENDLOOP;
ThreadStart[MCommand, NEW[MCommandRec ← [slave: TRUE, WS: TRUE, WSAddress: 00010000H, WSData: 00200001H]]];
THROUGH [0..2) DO R[B]; R[]; R[A]; R[]; ENDLOOP;
R[B]; R[];
ThreadStart[PReference, NEW[PReferenceRec ← [command: Fetch, address: 00010010H, data: 00000011H, rejects: 5]]]; R[A]; R[];
ThreadStart[MCommand, NEW[MCommandRec ← [arb: TRUE, RQ: TRUE, RQAddress:00020010H, RQData0: 00000011H, RQData1: 00000012H, RQData2: 00000013H, RQData3: 00000014H]]];
THROUGH [0..8) DO R[B]; R[]; R[A]; R[]; ENDLOOP;
};