Start of the Program
Here the program start :
Create or Append the file
outf ← FS.StreamOpen["DynaBusInterfaceDBus3.oracle", $create];
outf.PutF["-- Test D-Bus for DynaBusInterface\n"];
outf.PutF[" \n"];
outf.PutF["-- Output :\n"];
outf.PutF["--DSerialIn: A, nDReset: B, nFreeze: C, DExecute: D, \n"];
outf.PutF["-- DAddress: E,nDShiftCK: F \n"];
outf.PutF["-- Input :\n"];
outf.PutF["-- DSerialOut:M \n"];
outf.PutF[" \n"];
outf.PutF["-- A B C D E F ~ M \n"];
outf.PutF["\n"];
Start Generation :
lineCount← 0;
Init;
Send;
SendReset;
Test Transmission 5 words packets
Init EXECUTE
comment ← "Address of EXECUTE path nb 3";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:3]];
comment ← "Set Execute to 0";
SendData[0,1];
Init parameter for sending
comment ← "Address of SENDPAR path nb 2";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:2]];
comment ← "Set parameter for five words request & Clear";
SendData[0E470H,16];
SendReset; -- only for external counter
Init Data to send
comment ← "Address of DATACMD path nb 1";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:1]];
SendData[8,4]; -- Header on
SendData[08234567H,32]; --ReadBlockReply 5 words length
SendData[89ABCDEFH,32];
comment ← "Address of DATAVAL path nb 4";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:4]];
SendData[1,4];
SendData[12345678H,32];
SendData[9ABCDEF0H,32];
SendData[2,4];
SendData[23456789H,32];
SendData[0BCDEF01H,32];
SendData[3,4];
SendData[3456789AH,32];
SendData[0CDEF012H,32];
SendData[4,4];
SendData[456789ABH,32];
SendData[0DEF0123H,32];
Init parameter for receiving
comment ← "Address of RECPAR path nb 6";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:6]];
comment ← "Set parameter for receive first message, any ID";
SendData[1,15];
Send DATA
comment ← "Address of EXECUTE path nb 3";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:3]];
comment ← "Pulse Execute";
SendData[0,1];
SendData[1,1];
SendData[0,1];
FOR sometime: INT IN [0..10) DO -- for tempo
Send;
ENDLOOP;
Test reception 5 words packets
Verify a msg has been send, and has been received and the length is 5
comment ← "Address of STATUS path nb 7";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:7]];
SendExecute;
ReadandCheck[0D0H,8];
Read Data Received
comment ← "read first Word DATAR path 5";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:5]];
SendExecute;
ReadandCheck[8,4];
ReadandCheck[08234567H,32];
ReadandCheck[89ABCDEFH,32];
comment ← "Address of the RECPAR path nb 6";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:6]];
comment ← "Set parameter for addressing second word";
SendData[5,15];
comment ← "read second Word DATAR path 5";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:5]];
SendExecute;
ReadandCheck[1,4];
ReadandCheck[12345678H,32];
ReadandCheck[9ABCDEF0H,32];
comment ← "Address of the RECPAR path nb 6";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:6]];
comment ← "Set parameter for addressing third word";
SendData[9,15];
comment ← "read third Word DATAR path 5";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:5]];
SendExecute;
ReadandCheck[2,4];
ReadandCheck[23456789H,32];
ReadandCheck[0BCDEF01H,32];
comment ← "Address of the RECPAR path nb 6";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:6]];
comment ← "Set parameter for addressing fourth word";
SendData[13,15];
comment ← "read fourth Word DATAR path 5";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:5]];
SendExecute;
ReadandCheck[3,4];
ReadandCheck[3456789AH,32];
ReadandCheck[0CDEF012H,32];
comment ← "Address of the RECPAR path nb 6";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:6]];
comment ← "Set parameter for addressing fith word";
SendData[17,15];
comment ← "read fith Word DATAR path 5";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:5]];
SendExecute;
ReadandCheck[4,4];
ReadandCheck[456789ABH,32];
ReadandCheck[0DEF0123H,32];
Test Transmission Two words packets
Change the Command Word
comment ← "Address of DATACMD path nb 1";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:1]];
SendData[8,4]; -- Header on
SendData[013579BDH,32]; --ReadBlockRequest 2 words length
SendData[9BDF2468H,32];
Init parameter for sending and clears Msg Here and al
comment ← "Address of SENDPAR path nb 2";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:2]];
comment ← "Set parameter for two words request & Clear all";
SendData[08470H,16];
Change Data to send in shifting of one word
comment ← "Address of DATAVAL path nb 4";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:4]];
SendData[5,4]; -- the value we will obtain will be different
SendData[2468ACEFH,32];
SendData[13579BDFH,32];
Send DATA
comment ← "Address of EXECUTE path nb 3";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:3]];
comment ← "Pulse Execute";
SendData[1,1];
SendData[0,1];
Test receiving two words packets
Verify a msg has been send, and has been received and the length is 2
comment ← "Address of STATUS path nb 7";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:7]];
SendExecute;
ReadandCheck[0C0H,8];
Read Data Received
comment ← "Address of the RECPAR path nb 6";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:6]];
comment ← "Set parameter for addressing the first word";
SendData[0,15];
comment ← "read first Word DATAR path 5";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:5]];
SendExecute;
ReadandCheck[8,4];
ReadandCheck[013579BDH,32];
ReadandCheck[9BDF2468H,32];
comment ← "Address of the RECPAR path nb 6";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:6]];
comment ← "Set parameter for addressing second word";
SendData[5,15];
comment ← "read second Word DATAR path 5";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:5]];
SendExecute;
ReadandCheck[2,4];
ReadandCheck[23456789H,32];
ReadandCheck[0BCDEF01H,32];
Test that we receive only one message in this mode
Change the Command Word to see if the received data change
comment ← "Address of DATACMD path nb 1";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:1]];
SendData[8,4]; -- Header on
SendData[01333333H,32]; --ReadBlockRequest 2 words length
SendData[55555555H,32];
Init parameter for sending and dont clear Msg Here
comment ← "Address of SENDPAR path nb 2";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:2]];
comment ← "Set parameter for two words request & not Clear all";
SendData[08430H,16];
Send DATA
comment ← "Address of EXECUTE path nb 3";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:3]];
comment ← "Pulse Execute";
SendData[1,1];
SendData[0,1];
Verify a msg has been send, and a msg is still here and the length is 2
comment ← "Address of STATUS path nb 7";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:7]];
SendExecute;
ReadandCheck[0C0H,8];
Check Data is still the same on the first word
comment ← "Address of the RECPAR path nb 6";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:6]];
comment ← "Set parameter for addressing the first word";
SendData[0,15];
comment ← "read first Word DATAR path 5";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:5]];
SendExecute;
ReadandCheck[8,4];
ReadandCheck[013579BDH,32];
ReadandCheck[9BDF2468H,32];
Test Receiving all messages
Init parameter for receiving all messages
comment ← "Address of RECPAR path nb 6";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:6]];
comment ← "Set parameter for receive first message, any ID";
SendData[3,15];
Send DATA
comment ← "Address of EXECUTE path nb 3";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:3]];
comment ← "Pulse Execute";
SendData[1,1];
SendData[0,1];
Verify a msg has been send, and a msg is still here and the length is 2
comment ← "Address of STATUS path nb 7";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:7]];
SendExecute;
ReadandCheck[0C0H,8];
Check Data has now been changed in the first word
comment ← "read first Word DATAR path 5";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:5]];
SendExecute;
ReadandCheck[8,4];
ReadandCheck[01333333H,32];
ReadandCheck[55555555H,32];
Change the Command Word to see if the received data change
comment ← "Address of DATACMD path nb 1";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:1]];
SendData[8,4]; -- Header on
SendData[01444444H,32]; --ReadBlockRequest 2 words length
SendData[66666666H,32];
Send DATA
comment ← "Address of EXECUTE path nb 3";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:3]];
comment ← "Pulse Execute";
SendData[1,1];
SendData[0,1];
Verify Data received
comment ← "read first Word DATAR path 5";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:5]];
SendExecute;
ReadandCheck[8,4];
ReadandCheck[01444444H,32];
ReadandCheck[66666666H,32];
Test receiving selectivly with the identifier
Init RECPAR for receiving with identifier=35AH
comment ← "Address of RECPAR path nb 6";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:6]];
comment ← "Set parameter for receive msg with ID=35AH";
SendData[6B40H,15];
Init parameter for sending and clear Msg Here
comment ← "Address of SENDPAR path nb 2";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:2]];
comment ← "Set parameter for two words request & Clear all";
SendData[08470H,16];
Change the Command Word to see if the received data change
comment ← "Address of DATACMD path nb 1";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:1]];
SendData[8,4]; -- Header on
SendData[01555555H,32]; --ReadBlockRequest 2 words length
SendData[77777777H,32];
Send DATA
comment ← "Address of EXECUTE path nb 3";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:3]];
comment ← "Pulse Execute";
SendData[1,1];
SendData[0,1];
Verify a msg has been send, and no msg arrived
comment ← "Address of STATUS path nb 7";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:7]];
SendExecute;
ReadandCheck[080H,8];
comment ← "read first Word DATAR path 5";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:5]];
SendExecute;
ReadandCheck[8,4];
ReadandCheck[01444444H,32];
ReadandCheck[66666666H,32];
Now change the data with the good identifier
comment ← "Address of DATACMD path nb 1";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:1]];
SendData[8,4]; -- Header on
SendData[01AD0123H,32]; --ReadBlockRequest 2 words length
SendData[456789ABH,32];
Send DATA
comment ← "Address of EXECUTE path nb 3";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:3]];
comment ← "Pulse Execute";
SendData[1,1];
SendData[0,1];
Verify a msg has been send, and a msg has arrived
comment ← "Address of STATUS path nb 7";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:7]];
SendExecute;
ReadandCheck[0C0H,8];
Verify Data received
comment ← "read first Word DATAR path 5";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:5]];
SendExecute;
ReadandCheck[8,4];
ReadandCheck[01AD0123H,32];
ReadandCheck[456789ABH,32];
outf.PutF[". \n"]; -- end
outf.Close[];