DIRECTORY FS, IO, Rope, Convert, BitOps; GenDynaBusInterfaceDBus3Impl: CEDAR PROGRAM IMPORTS FS, IO, Rope, Convert, BitOps ~ BEGIN outf: IO.STREAM; lineCount : CARD; nr:INT = 1; --number of colums in the right side of the line nl:INT = 6; --number of colums in the left side of the line NbRight : TYPE = [0..nr); NbLeft : TYPE = [0..nl); RightLine: TYPE = ARRAY NbRight OF Rope.ROPE; LeftLine: TYPE = ARRAY NbLeft OF Rope.ROPE; rl: RightLine; ll: LeftLine; comment: Rope.ROPE; Signal : TYPE = {T,F,X}; DSerialOut,DSerialIn,DExecute,DAddress : Signal; DShiftCK,nFreeze,nDReset: Signal; Init: PROC [] RETURNS [] ~ { DSerialIn _ F; DExecute _ F; DAddress _ F; DShiftCK _ F; nFreeze _ T; nDReset _ F; DSerialOut _ X; }; RopeFromSignal: PROC [s: Signal] RETURNS [r: Rope.ROPE] ~ { SELECT s FROM F => r _ "0"; T => r _ "1"; ENDCASE => r _ "X"; }; Inv: PROC [s: Signal] RETURNS [t: Signal] ~ { SELECT s FROM F => t _ T; T => t _ F; ENDCASE => t _ X; }; MergeOut: PROC [] RETURNS [] ~ { column : INT; r : Rope.ROPE; r _ " "; FOR column IN [0..nl) DO r _ Rope.Cat[r,ll[column]," "]; ENDLOOP; r _ Rope.Cat[r," | "]; FOR column IN [0..nr) DO r _ Rope.Cat[r,rl[column]," "]; ENDLOOP; outf.PutF["%g -- %g %g \n",IO.rope[r],IO.rope[Convert.RopeFromInt[lineCount]],IO.rope[comment]]; comment _ "" }; Send: PROC [] RETURNS [] ~ { ll[0] _ RopeFromSignal[DSerialIn]; ll[1] _ RopeFromSignal[nDReset]; ll[2] _ RopeFromSignal[nFreeze]; ll[3] _ RopeFromSignal[DExecute]; ll[4] _ RopeFromSignal[DAddress]; ll[5] _ RopeFromSignal[DShiftCK]; rl[0] _ RopeFromSignal[DSerialOut]; MergeOut; lineCount _ lineCount+ 1; }; SendAddress: PROC [address: CARDINAL] RETURNS [] ~ { adrs: CARDINAL _ address; s: INT; DAddress _ T; DSerialOut _ X; FOR s IN [0..16) DO DShiftCK _ F; IF (BitOps.WShift[adrs,s-15] MOD 2) = 0 THEN DSerialIn _ F ELSE DSerialIn _ T; Send; DShiftCK _ T; Send; ENDLOOP; DAddress _ F; DShiftCK _ F; Send; }; SendData: PROC [data: LONG CARDINAL, c: INT _ 16] RETURNS [] ~ { FOR s: INT DECREASING IN [0..c) DO DShiftCK _ F; IF (BitOps.DShift[data,-s] MOD 2) = 0 THEN DSerialIn _ F ELSE DSerialIn _ T; Send; DShiftCK _ T; Send; ENDLOOP; }; ReadandCheck: PROC [v: CARD, c: INT _ 16] RETURNS [] ~ { DAddress _ F; DShiftCK _ F; IF (BitOps.DShift[v,1-c] MOD 2) = 0 THEN DSerialOut _ F ELSE DSerialOut _ T; Send; FOR s: INT IN [1..c) DO DShiftCK _ T; IF (BitOps.DShift[v,s-c+1] MOD 2) = 0 THEN DSerialOut _ F ELSE DSerialOut _ T; Send; DShiftCK _ F; Send; ENDLOOP; DShiftCK _ T; DSerialOut _ X; Send; DShiftCK _ F; Send; }; SendReset: PROC [] RETURNS [] ~ { nDReset _ F; FOR i: NAT IN [0..10) DO Send; ENDLOOP; nDReset _ T; }; SendShiftClock: PROC [] RETURNS [] ~ { FOR i: NAT IN [0..4) DO DShiftCK _ T; Send; DShiftCK _ F; Send; ENDLOOP; }; SendExecute: PROC [] RETURNS [] ~ { DExecute _ T; Send; DShiftCK _ T; Send; DExecute _ F; DShiftCK _ F; Send; }; AdDBus: PROC [bd,hyb,Int,ci,pth: CARDINAL _0] RETURNS [ad: CARDINAL _0] ~ { ad _ BitOps.WShift[bd,12]+BitOps.WShift[hyb,8]; ad _ ad+BitOps.WShift[Int,5]+BitOps.WShift[ci,3]+pth; }; IdCte: PROC [t,v:CARDINAL] RETURNS [id:CARDINAL] ~ { id _ 5000H + BitOps.WShift[t,6] + v; }; 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"]; lineCount_ 0; Init; Send; SendReset; 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]; 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 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]; 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]; 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]; comment _ "Address of STATUS path nb 7"; SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:7]]; SendExecute; ReadandCheck[0D0H,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[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]; 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]; 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]; 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]; 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]; comment _ "Address of STATUS path nb 7"; SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:7]]; SendExecute; ReadandCheck[0C0H,8]; 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]; 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]; 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]; 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]; comment _ "Address of STATUS path nb 7"; SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:7]]; SendExecute; ReadandCheck[0C0H,8]; 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 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]; 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]; comment _ "Address of STATUS path nb 7"; SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:7]]; SendExecute; ReadandCheck[0C0H,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[01333333H,32]; ReadandCheck[55555555H,32]; 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]; 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]; 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]; 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]; 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]; 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]; 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]; 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]; 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]; 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]; comment _ "Address of STATUS path nb 7"; SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:7]]; SendExecute; ReadandCheck[0C0H,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[01AD0123H,32]; ReadandCheck[456789ABH,32]; outf.PutF[". \n"]; -- end outf.Close[]; END. GenDynaBusInterfaceDBus3Impl.mesa Copyright Σ 1987 by Xerox Corporation. All rights reserved. Jean Gastinel November 20, 1987 3:30:32 pm PST Oracle Generation for the DBus Special variables of the Debug-Bus Convert a signal {F,T,X} into the corresponding Rope {0,1,X} t gets the invert of s This proc merge into two Rope Right and Left different elements of the line and write the result in the output stream This Proc convert the variables into ropes rl[i] & ll[i] for generating the line then call MergeOut for writing the line This Proc send an address on the DebugBus This proc send a data on the Debug Bus Reading of a path with c transitions of ShiftCK This proc set the Reset SStop lines at active, then remove the SStop line and finally remove the Reset. This proc send 4 pulse of ShiftClock to allow the initialisation of DBus constant This proc send 1 pulse of ShiftClock with Execute high to load shadow registers Address in the DBus is : =0 is for BIC The structure of the Identificator is "0101 cccc ccrr rrrr" cccccc is the Type, rrrrrr is the Version Start of the Program Here the program start : Create or Append the file Start Generation : Test Transmission 5 words packets Init EXECUTE Init parameter for sending Init Data to send Init parameter for receiving Send DATA 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 Read Data Received Test Transmission Two words packets Change the Command Word Init parameter for sending and clears Msg Here and al Change Data to send in shifting of one word Send DATA Test receiving two words packets Verify a msg has been send, and has been received and the length is 2 Read Data Received Test that we receive only one message in this mode Change the Command Word to see if the received data change Init parameter for sending and dont clear Msg Here Send DATA Verify a msg has been send, and a msg is still here and the length is 2 Check Data is still the same on the first word Test Receiving all messages Init parameter for receiving all messages Send DATA Verify a msg has been send, and a msg is still here and the length is 2 Check Data has now been changed in the first word Change the Command Word to see if the received data change Send DATA Verify Data received Test receiving selectivly with the identifier Init RECPAR for receiving with identifier=35AH Init parameter for sending and clear Msg Here Change the Command Word to see if the received data change Send DATA Verify a msg has been send, and no msg arrived Now change the data with the good identifier Send DATA Verify a msg has been send, and a msg has arrived Verify Data received Κ―˜codešœ!™!Kšœ<™Kšœ  œ  œ˜3Kšœ  œ˜Kšœ   œ˜Kšœ  5œ˜EKšœ  œ œ˜,Kšœ   œ˜Kšœ  œ  œ˜ Kšœ  œ˜Kšœ  œ˜(Kšœ˜K˜K˜K˜K™K™Kšœ ˜ K˜K˜Kšœ ˜ K˜KšΠbl!™!K™Kšœ ™ Kšœ)˜)Kšœ1˜1Kšœ˜K˜K˜K™Kšœ)˜)Kšœ1˜1Kšœ9˜9K˜K˜Kšœ Ÿ˜'K˜K™Kšœ)˜)Kšœ1˜1KšœŸ ˜KšœŸ˜7K˜K˜Kšœ)˜)Kšœ1˜1K˜K˜K˜K˜K˜K˜K˜K˜K˜K˜K˜K˜K˜K™Kšœ(˜(Kšœ1˜1Kšœ<˜