//**************************************************************************************
//RDC9.tst
//Wake Generator Tests
//By J. F. Cameron
July 11, 1978
//Last modified by J. F. Cameron
June 12, 1980
//**************************************************************************************
//**************************************************************************************
//To include the following definition files in the compilation
get "tester.d"
get "RDC.d"

//**************************************************************************************
//To define bus structure
//{CTask: CTask.0, CTask.1, CTask.2, CTask.3}
//{WakeP’: WakeP3’, WakeP2’, WakeP1’}

//**************************************************************************************
//Test91
To test:RDC Generated Wake & Reset

let Test91() be
[
L91: Start()
EnableDevClk()
let PHiVal = table[ 7; 7; 7; 7; 6; 6; 6; 6; 5; 5; 5; 5; 3; 3; 3; 3 ]
let PLoVal = table[ 7; 6; 5; 3; 7; 6; 5; 3; 7; 6; 5; 3; 7; 6; 5; 3 ]
OData(DevOpRegLd, 4000b)//Sets AllowWake
{Phase1Next’} = 0
{CTask} =0
SetCaddr(0)
{IOStrobe} = 1
EClock()//Clears Transmit
{IOStrobe} = 0
EClock()//Clears WakeReqF

//Checks SectorWakeS
{dSectorWake’} = 1
for n = 0 to 2 do//Generates ByteClk
[
OData(TestRegLd, 405b)
OData(TestRegLd, 404b)
]
EClock()//Sets SectorWakeS’ FF
EClock()//Sets WakeReqF
for n = 0 to 17b do
[
{Phase1Next’} = 0
{CTask} = n + 1
SetCaddr(n)
EClock()//Should set Transmit

//SubTest91.1.n; checks that SectorWakeS sets Transmit, and all combinations of WakeP in Phase1


if not Compare("WakeP[0:2]", {WakeP’}, PHiVal!n, "WakeP bus wrong*n in Phase1; check WakeReqF and SectorWakeS.", 2, 1, n) goto L91

//SubTest91.2.n; checks Transmit, and all combinations of WakeP in Phase1’
{Phase1Next’} = 1
EClock()//Resets Phase1; Transmit should remain set
EClock()//Transmit should remain set


if not Compare("WakeP[0:2]", {WakeP’}, PLoVal!n, "WakeP bus wrong*n in Phase1’; check Phase1 FF, dTx’, Transmit FF, G1, G2, G3, and Wake PROM.", 2, 2, n) goto L91
]

for n = 0 to 17b do
[
{Phase1Next’} = 0
{CTask} = n
SetCaddr(n)
EClock()//Should reset Transmit

//SubTest91.3.n; checks that MyTask’ resets Transmit
if not Compare("WakeP[0:2]", {WakeP’}, 7b, "WakeP not inhibited*n by Transmit; check MyTask’, dTx’, Transmit FF, and WakeP’ drivers.", 2, 3, n) goto L91

//SubTest91.4.n; checks that WakeP remains inhibited in Phase1’
{Phase1Next’} = 1
EClock()//Resets Phase1; Transmit should remain reset
EClock()//Transmit should remain reset
if not Compare("WakeP[0:2]", {WakeP’}, 7b, "WakeP not inhibited*n in Phase1’; check MyTask’, dTx’, Transmit FF, and WakeP’ drivers.", 2, 4, n) goto L91
]

//SubTest91.5.n; checks Wake priorities
{Phase1Next’} = 0
{CTask} = 0
//SubTest91.5.0; checks WakeP1’ priority
SetCaddr(3b)
EClock()//Should set Transmit
{WakeP1’} = 0
{Phase1Next’} = 1
EClock()//Resets Phase1; Transmit should reset
if not Compare("WakeP[0:2]", {WakeP’}, 6b, "WakeP bus wrong*n for priority level 1 in Phase1’; check dTx’ and WakeP’ inputs.", 2, 5) goto L91
{WakeP1’} = ###

//SubTest91.5.1; checks WakeP2’ priority
SetCaddr(5b)
EClock()//Should set Transmit
{WakeP2’} = 0
{Phase1Next’} = 1
EClock()//Resets Phase1; Transmit should reset
if not Compare("WakeP[0:2]", {WakeP’}, 5b, "WakeP bus wrong*n for priority level 2 in Phase1’; check dTx’ and WakeP’ inputs.", 2, 5, 1) goto L91
{WakeP2’} = ###

//SubTest91.5.2; checks WakeP3’ priority
SetCaddr(12b)
EClock()//Should set Transmit
{WakeP3’} = 0
{Phase1Next’} = 1
EClock()//Resets Phase1; Transmit should reset
if not Compare("WakeP[0:2]", {WakeP’}, 3b, "WakeP bus wrong*n for priority level 3 in Phase1’; check dTx’ and WakeP’ inputs.", 2, 5, 2) goto L91
{WakeP3’} = ###

//SubTest91.6.n; checks that IOStrobe resets WakeReqF
{dSectorWake’} = 0
OData(TestRegLd, 405b)//Cycles ByteClk
OData(TestRegLd, 404b)//Cycles ByteClk
{CTask} = 12b
{IOStrobe} = 1
EClock()//Should set MyStrobeF
{IOStrobe} = 0
EClock()//Should reset WakeReqF
for n = 0 to 17b do
[
{Phase1Next’} = 0
{CTask} = n + 1
SetCaddr(n)
EClock()//Should not set Transmit
if not Compare("WakeP[0:2]", {WakeP’}, 7b, "WakeReqF not reset*n by IOStrobe; check IOStrobe receiver, MyStrobe, MyStrobeF, and dWakeReqF.", 2, 6, n) goto L91
]

if Stop() goto L91
return
]