~
BEGIN
outf: IO.STREAM;
lineCount,k : CARD;
BitDWord: TYPE = LONG CARDINAL;
nr:INT = 10; --number of colums in the right side of the line
nl:INT = 10; --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;
Variable of the Data path
datain, dataout : ARRAY [0..2) OF BitDWord;
supin,supout : BitDWord;
removex: BOOL;
Special variables of the Debug-Bus
Signal : TYPE = {T,F,X};
nDSerialOut,MDSerialIn,MDExecute,MDAddress : Signal;
MDShiftCK,MnFreeze,MnDReset : Signal;
MDSerialOut,nDSerialIn,nDExecute,nDAddress : Signal;
nDShiftClock,DFreeze,DReset : Signal;
Init:
PROC []
RETURNS [] ~ {
datain[0] ← 1;
datain[1] ← 1;
supin ← 0;
nDSerialOut ← F;
MDSerialIn ← F;
MDExecute ← F;
MDAddress ← F;
MDShiftCK ← F;
MnFreeze ← T;
MnDReset ← F;
removex ← TRUE;
dataout[0] ← 1;
dataout[1] ← 1;
supout ← 0;
MDSerialOut ← X;
nDSerialIn ← X;
nDExecute ← X;
nDAddress ← X;
nDShiftClock ← X;
DFreeze ← X;
DReset ← X;
};
RopeFromSignal:
PROC [s: Signal]
RETURNS [r: Rope.
ROPE] ~ {
Convert a signal {F,T,X} into the corresponding Rope {0,1,X}
SELECT s
FROM
F => r ← "0";
T => r ← "1";
ENDCASE => r ← "X";
};
Inv:
PROC [s: Signal]
RETURNS [t: Signal] ~ {
t gets the invert of s
SELECT s
FROM
F => t ← T;
T => t ← F;
ENDCASE => t ← X;
};
MergeOut:
PROC []
RETURNS [] ~ {
This proc merge into two Rope Right and Left different elements of the line
and write the result in the output stream
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 [] ~ {
This Proc convert the variables into ropes rl[i] & ll[i] for generating the line
then call MergeOut for writing the line
nDSerialIn ← Inv[MDSerialIn];
nDExecute ← Inv[MDExecute];
nDAddress ← Inv[MDAddress];
nDShiftClock ← Inv[MDShiftCK];
DFreeze ← Inv[MnFreeze];
DReset ← Inv[MnDReset];
ll[0] ← OracleGen.LExtend[OracleGen.Hex[datain[0]],8];
ll[1] ← OracleGen.LExtend[OracleGen.Hex[datain[1]],8];
ll[2] ← OracleGen.LExtend[OracleGen.Hex[supin],1];
ll[3] ← RopeFromSignal[nDSerialOut];
ll[4] ← RopeFromSignal[MDSerialIn];
ll[5] ← RopeFromSignal[MDExecute];
ll[6] ← RopeFromSignal[MDAddress];
ll[7] ← RopeFromSignal[MDShiftCK];
ll[8] ← RopeFromSignal[MnFreeze];
ll[9] ← RopeFromSignal[MnDReset];
IF removex =
TRUE
THEN
{
rl[0] ← "XXXXXXXX";
rl[1] ← "XXXXXXXX";
rl[2] ← "X";
} ELSE
{
rl[0] ← OracleGen.LExtend[OracleGen.Hex[dataout[0]],8];
rl[1] ← OracleGen.LExtend[OracleGen.Hex[dataout[1]],8];
rl[2] ← OracleGen.LExtend[OracleGen.Hex[supout],1];
};
rl[3] ← RopeFromSignal[MDSerialOut];
rl[4] ← RopeFromSignal[nDSerialIn];
rl[5] ← RopeFromSignal[nDExecute];
rl[6] ← RopeFromSignal[nDAddress];
rl[7] ← RopeFromSignal[nDShiftClock];
rl[8] ← RopeFromSignal[DFreeze];
rl[9] ← RopeFromSignal[DReset];
MergeOut;
lineCount ← lineCount+ 1;
};
SendAddress:
PROC [address:
CARDINAL]
RETURNS [] ~ {
This Proc send an address on the DebugBus
adrs: CARDINAL ← address;
s: INT;
MDAddress ← T;
MDSerialOut ← X;
FOR s
IN [0..16)
DO
MDShiftCK ← F;
IF (BitOps.WShift[adrs,s-15] MOD 2) = 0 THEN MDSerialIn ← F
ELSE MDSerialIn ← T;
Send;
MDShiftCK ← T;
Send;
ENDLOOP;
MDAddress ← F;
MDShiftCK ← F;
Send;
};
ReadandCheck:
PROC [v:
CARD, c:
INT ← 16]
RETURNS [] ~ {
Reading of a path with c transitions of ShiftCK
s: INT;
value: CARD ← v;
MDAddress ← F;
MDShiftCK ← F;
IF (BitOps.WShift[value,1-c] MOD 2) = 0 THEN MDSerialOut ← F
ELSE MDSerialOut ← T;
Send;
FOR s
IN [1..c)
DO
MDShiftCK ← T;
IF (BitOps.WShift[value,s-c+1] MOD 2) = 0 THEN MDSerialOut ← F
ELSE MDSerialOut ← T;
Send;
MDShiftCK ← F;
Send;
ENDLOOP;
};
SendReset:
PROC []
RETURNS [] ~ {
This proc set the Reset line at active and remove it
FOR i:
NAT
IN [0..10)
DO
MnDReset ← F;
Send;
ENDLOOP;
FOR i:
NAT
IN [0..6)
DO
MnDReset ← T;
Send;
ENDLOOP;
};
AdDBus: PROC [bd,hyb,Int,ci,pth: CARDINAL 𡤀] RETURNS [ad: CARDINAL 𡤀] ~ {
Address in the DBus is :
<BoardNum:4><HybridNum:4><InterfaceNum:3><ChipNum:2><PathNum:3>
<ChipNum>=0 is for BIC
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] ~ {
The structure of the Identificator is "0101 cccc ccrr rrrr"
cccccc is the Type, rrrrrr is the Version
id ← 5000H + BitOps.WShift[t,6] + v;
};
Start of the Program
Here the program start :
Create or Append the file
outf ← FS.StreamOpen["///Chip/BackLinkData3.oracle", $create];
outf.PutF["-- Test Data Bus for Oracle\n"];
outf.PutF[" \n"];
outf.PutF["-- Output :\n"];
outf.PutF["-- nBusIn: A & B, nSpareIn & nHeaderIn & nParityIn: C\n"];
outf.PutF["-- nDSerialOut: D, MDSerialIn: E, MDExecute: F, MDAddress: G, \n"];
outf.PutF["-- MDShiftCK: H,MnFreeze: I, MnDReset:J\n"];
outf.PutF["-- Input :\n"];
outf.PutF["-- nBusOut: M & N, nSpareOut & nHeaderOut & nParityOut: O \n"];
outf.PutF["-- MDSerialOut:P, nDSerialIn:Q, nDExecute:R, nDAddress:S, \n"];
outf.PutF["-- nDShiftClock:T, DFreeze:U,DReset:V,\n"];
outf.PutF[" \n"];
outf.PutF["-- A B C D E F G H I J ~ M N O P Q R S T U V\n"];
outf.PutF["\n"];
Start Generation :
lineCount← 0;
Init;
Send;
SendReset;
FOR k
IN [0..3)
DO
datain[0] ← BitOps.DShift[datain[0],1];
datain[1] ← BitOps.DShift[datain[1],1];
supin ← supin +1;
IF k > 1 THEN removex ← FALSE;
Send;
ENDLOOP;
FOR k
IN [0..32)
DO
datain[0] ← BitOps.DShift[datain[0],1];
datain[1] ← BitOps.DShift[datain[1],1];
dataout[0] ← BitOps.DShift[dataout[0],1];
dataout[1] ← BitOps.DShift[dataout[1],1];
IF supin < 15 THEN supin ← supin+1 ELSE supin 𡤁
IF supout < 15 THEN supout ← supout+1 ELSE supout 𡤁
Send;
comment ← "Address of the Arbiter 0 ID path";
SendAddress[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:0]];
comment ← "ID of the Arbiter type:1, Version 5";
ReadandCheck[IdCte[t:1,v:5]];
comment ← "Address of the Arbiter 1 ID path";
SendAddress[AdDBus[bd:2,hyb:0,Int:0,ci:0,pth:0]];
comment ← "ID of the Arbiter type:1, Version 3";
ReadandCheck[IdCte[t:1,v:3]];
comment ← "Address of the BIC 0 ID path";
SendAddress[AdDBus[bd:0,hyb:1,Int:0,ci:0,pth:0]];
comment ← "ID of BIC type 2, Version 8";
ReadandCheck[IdCte[t:2,v:8]];
outf.PutF[". \n"]; -- end
outf.Close[];