DIRECTORY FS, IO, Rope, Convert, OracleGen, BitOps; GenFullBDDBus1Impl: CEDAR PROGRAM IMPORTS FS, IO, Rope, Convert, OracleGen, BitOps ~ BEGIN outf: IO.STREAM; lineCount : CARD; nr:INT = 1; --number of colums in the right side of the line nl:INT = 4; --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}; MDSerialIn,MDExecute,MDAddress : Signal; MDShiftCK,MnDFreeze,MnDReset : Signal; MDSerialOut: Signal; IOWPC,IORPC,nIOWPC,nIORPC: Signal; Address, DataIn, DataOut, dregister : INT; --negative Data & Address means X Init: PROC [] RETURNS [] ~ { MDSerialIn _ X; MDExecute _ X; MDAddress _ X; MDShiftCK _ X; MnDFreeze _ T; MnDReset _ T; Address _ 0; DataIn _ -1; --negative INT means X DataOut _ -1; IOWPC _ F; IORPC _ F; MDSerialOut _ F; }; 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; }; Send: PROC [] RETURNS [] ~ { nIOWPC _ Inv[IOWPC]; nIORPC _ Inv[IORPC]; IF Address >= 0 THEN ll[0] _ OracleGen.LExtend[OracleGen.Hex[Address],5] ELSE ll[0] _ "XXXXX"; IF DataOut >= 0 THEN ll[1] _ OracleGen.LExtend[OracleGen.Hex[DataOut],2] ELSE ll[1] _ "XX"; ll[1] _ Rope.Concat["XX",ll[1]]; ll[2] _ RopeFromSignal[nIOWPC]; ll[3] _ RopeFromSignal[nIORPC]; IF DataIn >= 0 THEN rl[0] _ OracleGen.LExtend[OracleGen.Hex[DataIn],2] ELSE rl[0] _ "XX"; rl[0] _ Rope.Concat["XX",rl[0]]; MergeOut; lineCount _ lineCount+ 1; }; 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 _ "" }; Write: PROC [adrs : INT,da : INT] RETURNS [] ~ { Address _ adrs; DataOut _ da; Send; IOWPC _ T; Send; IOWPC _ F; Send; comment _ " Write Data out"; DataOut _ -1; Send; }; ReadAndCheck: PROC [adrs : INT,da : INT] RETURNS [] ~ { Address _ adrs; Send; IORPC _ T; Send; comment _ " ReadAndCheck Data"; DataIn _ da; Send; IORPC _ F; DataIn _ -1; Send; }; AssembleDbus: PROC [] RETURNS [da: INT] ~ { IF (MnDReset=T) THEN da _ 32 ELSE da _ 0; IF (MnDFreeze=T) THEN da _ da + 16; IF (MDExecute=T) THEN da _ da + 8; IF (MDSerialIn=T) THEN da _ da + 4; IF (MDAddress=T) THEN da _ da + 2; IF (MDShiftCK=T) THEN da _ da + 1; dregister _ da; }; DBusWrite: PROC [] RETURNS [] ~ { Write[600FH,AssembleDbus[]]; -- Address of the DBus Register is "600FH" }; DBusCheck: PROC [] RETURNS [] ~ { r : INT; IF (MDSerialOut=T) THEN r _ dregister+128 ELSE r _ dregister; ReadAndCheck[600FH,r]; }; SendDBusAddress: PROC [address: CARDINAL] RETURNS [] ~ { adrs: CARDINAL _ address; s: INT; MDAddress _ T; FOR s IN [0..16) DO MDShiftCK _ F; IF (BitOps.WShift[adrs,s-15] MOD 2) = 0 THEN MDSerialIn _ F ELSE MDSerialIn _ T; DBusWrite; MDShiftCK _ T; DBusWrite; ENDLOOP; MDAddress _ F; MDShiftCK _ F; DBusWrite; }; ReadDBusAndCheck: PROC [v: CARD, c: INT _ 16] RETURNS [] ~ { s: INT; value: CARD _ v; MDAddress _ F; MDShiftCK _ F; IF (BitOps.WShift[value,1-c] MOD 2) = 0 THEN MDSerialOut _ F ELSE MDSerialOut _ T; DBusWrite; DBusCheck; FOR s IN [1..c) DO MDShiftCK _ T; IF (BitOps.WShift[value,s-c+1] MOD 2) = 0 THEN MDSerialOut _ F ELSE MDSerialOut _ T; DBusWrite; DBusCheck; MDShiftCK _ F; DBusWrite; ENDLOOP; }; 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["FullBDDBus1.oracle", $create]; outf.PutF["-- Test D-Bus by PC interface\n"]; outf.PutF[" \n"]; outf.PutF["-- Output :\n"]; outf.PutF["-- Address: A, DataOut: B, nIOWPC: C, nIORPC: D \n"]; outf.PutF["-- Input :\n"]; outf.PutF["-- DataIn :M \n"]; outf.PutF[" \n"]; outf.PutF["-- A B C D ~ M \n"]; outf.PutF["\n"]; lineCount_ 0; Init; Send; comment _ "Address of the Arbiter 1 ID path"; SendDBusAddress[AdDBus[bd:1,hyb:0,Int:0,ci:0,pth:0]]; comment _ "ID of Display : type 1, version 1"; ReadDBusAndCheck[IdCte[t:1,v:1]]; comment _ "Address of the Arbiter 0 ID path"; SendDBusAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:0]]; comment _ "ID of Display : type 1, version 1"; ReadDBusAndCheck[IdCte[t:1,v:1]]; comment _ "Address of the BIC 0 ID path"; SendDBusAddress[AdDBus[bd:0,hyb:1,Int:0,ci:0,pth:0]]; comment _ "ID of BIC type 2, Version 8"; ReadDBusAndCheck[IdCte[t:2,v:8]]; comment _ "Address of the BIC 1 ID path"; SendDBusAddress[AdDBus[bd:0,hyb:1,Int:1,ci:0,pth:0]]; comment _ "ID of BIC type 2, Version 9"; ReadDBusAndCheck[IdCte[t:2,v:9]]; outf.PutF[". \n"]; -- end outf.Close[]; END. dGenFullBDDBus1Impl.mesa Copyright Σ 1987 by Xerox Corporation. All rights reserved. Jean Gastinel September 30, 1987 4:32:11 pm PDT Oracle Generation for the DBus from the PC Bus Variables for the Oracle File Special variables of the PC-Bus Convert a signal {F,T,X} into the corresponding Rope {0,1,X} t gets the invert of s This Proc convert the variables into ropes rl[i] & ll[i] for generating the line then call MergeOut for writing the line Verification : Send : This proc merge into two Rope Right and Left different elements of the line and write the result in the output stream This Proc send an address on the DebugBus Reading of a path with c transitions of ShiftCK 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 : Board 2 controlled by Arbiter 1 Hybrid 0 contains only the Arbiter 1 Board 0 controlled by Arbiter 0 Hybrid 0 contains only the Arbiter 0 Hybrid 1 contains 7 BICs comment _ "Address of the BIC 2 ID path"; SendDBusAddress[AdDBus[bd:0,hyb:1,Int:2,ci:0,pth:0]]; comment _ "ID of BIC type 2, Version 10"; ReadDBusAndCheck[IdCte[t:2,v:10]]; comment _ "Address of the BIC 3 ID path"; SendDBusAddress[AdDBus[bd:0,hyb:1,Int:3,ci:0,pth:0]]; comment _ "ID of BIC type 2, Version 11"; ReadDBusAndCheck[IdCte[t:2,v:11]]; comment _ "Address of the BIC 4 ID path"; SendDBusAddress[AdDBus[bd:0,hyb:1,Int:4,ci:0,pth:0]]; comment _ "ID of BIC type 2, Version 12"; ReadDBusAndCheck[IdCte[t:2,v:12]]; comment _ "Address of the BIC 5 ID path"; SendDBusAddress[AdDBus[bd:0,hyb:1,Int:5,ci:0,pth:0]]; comment _ "ID of BIC type 2, Version 13"; ReadDBusAndCheck[IdCte[t:2,v:13]]; comment _ "Address of the BIC 6 ID path"; SendDBusAddress[AdDBus[bd:0,hyb:1,Int:6,ci:0,pth:0]]; comment _ "ID of BIC type 2, Version 14"; ReadDBusAndCheck[IdCte[t:2,v:14]]; Hybrid 2 contains Display, MapCache, Cache IOB & 4 BICs comment _ "Address of the Display ID path"; SendDBusAddress[AdDBus[bd:0,hyb:2,Int:0,ci:1,pth:0]]; -- "0000 0010 000 01 000" comment _ "ID of Display : type 8, version 1"; ReadDBusAndCheck[IdCte[t:8,v:1]]; -- "0101 001000 000001" comment _ "Address of the Map-Cache ID path"; SendDBusAddress[AdDBus[bd:0,hyb:2,Int:1,ci:1,pth:0]]; -- "0000 0010 001 01 000" comment _ "ID of Map-Cache : type 9, version 1"; ReadDBusAndCheck[IdCte[t:9,v:1]]; -- "0101 001001 000001" comment _ "Address of the Cache ID path"; SendDBusAddress[AdDBus[bd:0,hyb:2,Int:2,ci:1,pth:0]]; -- "0000 0010 010 01 000" comment _ "ID of Cache : type 5, version 1"; ReadDBusAndCheck[IdCte[t:5,v:1]]; -- "0101 000101 000001" comment _ "Address of the IOB ID path"; SendDBusAddress[AdDBus[bd:0,hyb:2,Int:3,ci:1,pth:0]]; -- "0000 0010 011 01 000" comment _ "ID of IOB : type 7, version 1"; ReadDBusAndCheck[IdCte[t:7,v:1]]; -- "0101 000111 000001" comment _ "Address of the BIC 0 ID path"; SendDBusAddress[AdDBus[bd:0,hyb:2,Int:0,ci:0,pth:0]]; -- "0000 0010 000 00 000" comment _ "ID of BIC type 2, Version 0"; ReadDBusAndCheck[IdCte[t:2,v:0]]; -- "0101 000010 000000" comment _ "Address of the BIC 1 ID path"; SendDBusAddress[AdDBus[bd:0,hyb:2,Int:1,ci:0,pth:0]]; -- "0000 0010 001 00 000" comment _ "ID of BIC type 2, Version 1"; ReadDBusAndCheck[IdCte[t:2,v:1]]; -- "0101 000010 000001" comment _ "Address of the BIC 2 ID path"; SendDBusAddress[AdDBus[bd:0,hyb:2,Int:2,ci:0,pth:0]]; -- "0000 0010 010 00 000" comment _ "ID of BIC type 2, Version 2"; ReadDBusAndCheck[IdCte[t:2,v:2]]; -- "0101 000010 000010" comment _ "Address of the BIC 3 ID path"; SendDBusAddress[AdDBus[bd:0,hyb:2,Int:3,ci:0,pth:0]]; -- "0000 0010 011 00 000" comment _ "ID of BIC type 2, Version 3"; ReadDBusAndCheck[IdCte[t:2,v:3]]; -- "0101 000010 000011" Κ m˜codešœ™Kšœ<™