DEVEL: Added stream numbers to TB messages

This commit is contained in:
Oliver Bruendler
2018-09-05 08:50:27 +02:00
parent 5c56188a96
commit ecae623b53
5 changed files with 40 additions and 34 deletions

Binary file not shown.

View File

@ -150,7 +150,7 @@ package body psi_ms_daq_tb_str0_pkg is
case Str0WinCheck is
when 0 =>
-- Windows full because dat received for quite some time
IntCompare(Str0WinSize_c, wincnt, "WINCNT wrong");
IntCompare(Str0WinSize_c, wincnt, "Stream0: WINCNT wrong");
-- Check Values
addr := winlast;
@ -160,34 +160,34 @@ package body psi_ms_daq_tb_str0_pkg is
else
addr := addr + 1;
end if;
StdlvCompareInt (i mod 256, Memory(addr), "Wrong value at 0x" & to_hstring(to_unsigned(addr,32)), false);
StdlvCompareInt (i mod 256, Memory(addr), "Stream0: Wrong value at 0x" & to_hstring(to_unsigned(addr,32)), false);
end loop;
when 1 =>
-- Trigger following each other with 30 samples difference
IntCompare(30, wincnt, "WINCNT wrong");
IntCompare(30*2, tslo-Str0LastTs, "TS difference wrong");
IntCompare(30, wincnt, "Stream0: WINCNT wrong");
IntCompare(30*2, tslo-Str0LastTs, "Stream0: TS difference wrong");
-- Check Values
addr := winstart;
for i in 34 to 63 loop
StdlvCompareInt (i, Memory(addr), "Wrong value", false);
StdlvCompareInt (i, Memory(addr), "Stream0: Wrong value", false);
addr := addr + 1; -- does never wrap
end loop;
when 2 =>
-- Trigger following each other with 30 samples difference
IntCompare(30, wincnt, "WINCNT wrong");
IntCompare(30*2, tslo-Str0LastTs, "TS difference wrong");
IntCompare(30, wincnt, "Stream0: WINCNT wrong");
IntCompare(30*2, tslo-Str0LastTs, "Stream0: TS difference wrong");
-- Check Values
addr := winstart;
for i in 64 to 93 loop
StdlvCompareInt (i, Memory(addr), "Wrong value", false);
StdlvCompareInt (i, Memory(addr), "Stream0: Wrong value", false);
addr := addr + 1; -- does never wrap
end loop;
when 3 =>
-- Full buffer recorded after emptying first buffer
IntCompare(100, wincnt, "WINCNT wrong");
IntCompare((256-2*30)*2, tslo-Str0LastTs, "TS difference wrong");
IntCompare(100, wincnt, "Stream0: WINCNT wrong");
IntCompare((256-2*30)*2, tslo-Str0LastTs, "Stream0: TS difference wrong");
-- Disable stream IRQ
TmemRead32(REG_CONF_IRQENA_ADDR, v, clk, rqst, rsp);
v := IntAnd(v, 16#0FE#);
@ -199,7 +199,7 @@ package body psi_ms_daq_tb_str0_pkg is
-- Check Values
addr := winlast + 1;
for i in 256+30+3-99 to 256+30+3 loop
StdlvCompareInt (i mod 256, Memory(addr), "Wrong value", false);
StdlvCompareInt (i mod 256, Memory(addr), "Stream0: Wrong value", false);
if addr = winend then
addr := winstart;
else

View File

@ -121,19 +121,19 @@ package body psi_ms_daq_tb_str1_pkg is
print("PTR: " & to_string(v), PrintStr1_c);
HlGetCurWin(1, clk, rqst, rsp, curwin);
print("CURWIN: " & to_string(curwin), PrintStr1_c);
IntCompare(0, curwin, "CURWIN wrong");
IntCompare(0, curwin, "Stream1: CURWIN wrong");
-- Check window content
HlGetWinCnt(1, 0, clk, rqst, rsp, wincnt);
print("WINCNT: " & to_string(wincnt), PrintStr1_c);
IntCompare(250, wincnt, "WINCNT wrong");
IntCompare(250, wincnt, "Stream1:WINCNT wrong");
HlGetWinLast(1, 0, clk, rqst, rsp, winlast);
print("WINLAST: " & to_string(winlast), PrintStr1_c);
IntCompare(16#2000#+498, winlast, "WINLAST wrong");
IntCompare(16#2000#+498, winlast, "Stream1:WINLAST wrong");
for spl in 0 to 249 loop
valRead(7 downto 0) := unsigned(Memory1(spl*2));
valRead(15 downto 8) := unsigned(Memory1(spl*2+1));
-- first 100 samples are before arming
StdlvCompareInt (spl+100, std_logic_vector(valRead), "Wrong value", false);
StdlvCompareInt (spl+100, std_logic_vector(valRead), "Stream1:Wrong value", false);
end loop;
print("", PrintStr1_c);
Str1WinCheck := Str1WinCheck + 1;

View File

@ -122,7 +122,7 @@ package body psi_ms_daq_tb_str2_pkg is
variable splNr : integer;
variable valRead : unsigned(15 downto 0);
variable splInWin : integer;
variable isRecording : boolean;
variable isTrig : boolean;
begin
print("------------ Stream 2 Handler ------------", PrintStr2_c);
HlGetMaxLvl(2, clk, rqst, rsp, v);
@ -131,30 +131,36 @@ package body psi_ms_daq_tb_str2_pkg is
print("PTR: " & to_string(v), PrintStr2_c);
HlGetCurWin(2, clk, rqst, rsp, curwin);
print("CURWIN: " & to_string(curwin), PrintStr2_c);
-- Calculate window to read
if curwin = 0 then
curwin := Str2Windows_c-1;
else
curwin := curwin-1;
end if;
-- Read window data
-- Check if recording is finished
HlIsRecording(2, clk, rqst, rsp, isRecording);
if isRecording then
print("Skipped: Recording still ongoing", PrintStr2_c);
HlIsTrigWin(2, curwin, clk, rqst, rsp, isTrig);
if not isTrig then
print("Skipped: not a trigger window", PrintStr2_c);
else
-- Check Data (last 128 samples)
splNr := Str2PostTrig_c;
while splNr >= 0 loop
-- Calculate window to read
print("check window " & to_string(curwin), PrintStr2_c);
HlGetWinLast(2, curwin, clk, rqst, rsp, spladdr);
print("WINLAST: " & to_string(spladdr), PrintStr2_c);
while (splNr >= 0) and (spladdr >= Str2BufStart_c+curwin*Str2WinSize_c) loop
StdlvCompareInt(splNr, Memory(spladdr), "Stream2: Sample " & to_string(Str2ExpFrame) & ":" & to_string(splNr) & " wrong CNT", false);
StdlvCompareInt(Str2ExpFrame, Memory(spladdr+1), "Stream2: Sample " & to_string(Str2ExpFrame) & ":" & to_string(splNr) & " wrong FRAME", false);
spladdr := spladdr - 2;
splNr := splNr - 1;
end loop;
-- Next Window
if curwin = 0 then
curwin := Str2Windows_c-1;
else
curwin := curwin-1;
end if;
-- Read window data
print("check window " & to_string(curwin), PrintStr2_c);
HlGetWinLast(2, curwin, clk, rqst, rsp, spladdr);
print("WINLAST: " & to_string(spladdr), PrintStr2_c);
while (splNr >= 0) and (spladdr >= Str2BufStart_c+curwin*Str2WinSize_c) loop
StdlvCompareInt(splNr, Memory(spladdr), "Sample " & to_string(Str2ExpFrame) & ":" & to_string(splNr) & " wrong CNT", false);
StdlvCompareInt(Str2ExpFrame, Memory(spladdr+1), "Sample " & to_string(Str2ExpFrame) & ":" & to_string(splNr) & " wrong FRAME", false);
spladdr := spladdr - 2;
splNr := splNr - 1;
end loop;
end loop;
Str2WinCheck := Str2WinCheck + 1;
end if;

View File

@ -148,8 +148,8 @@ package body psi_ms_daq_tb_str3_pkg is
print("WINLAST: " & to_string(winlast), PrintStr3_c);
spladdr := winlast;
while splNr >= 0 loop
StdlvCompareInt(splNr, Memory(spladdr+1) & Memory(spladdr), "Sample " & to_string(Str3ExpFrame) & ":" & to_string(splNr) & " wrong CNT", false);
StdlvCompareInt(Str3ExpFrame, Memory(spladdr+3) & Memory(spladdr+2), "Sample " & to_string(Str3ExpFrame) & ":" & to_string(splNr) & " wrong FRAME", false);
StdlvCompareInt(splNr, Memory(spladdr+1) & Memory(spladdr), "Stream3: Sample " & to_string(Str3ExpFrame) & ":" & to_string(splNr) & " wrong CNT", false);
StdlvCompareInt(Str3ExpFrame, Memory(spladdr+3) & Memory(spladdr+2), "Stream3: Sample " & to_string(Str3ExpFrame) & ":" & to_string(splNr) & " wrong FRAME", false);
-- Wraparound
if spladdr = Str3BufStart_c+curwin*Str3WinSize_c then
spladdr := Str3BufStart_c+(curwin+1)*Str3WinSize_c-4;
@ -163,8 +163,8 @@ package body psi_ms_daq_tb_str3_pkg is
print("check pre-trigger", PrintStr3_c);
splNr := 999;
while spladdr /= winlast loop
StdlvCompareInt(splNr, Memory(spladdr+1) & Memory(spladdr), "Sample " & to_string(Str3ExpFrame-1) & ":" & to_string(splNr) & " wrong CNT", false);
StdlvCompareInt(Str3ExpFrame-1, Memory(spladdr+3) & Memory(spladdr+2), "Sample " & to_string(Str3ExpFrame-1) & ":" & to_string(splNr) & " wrong FRAME", false);
StdlvCompareInt(splNr, Memory(spladdr+1) & Memory(spladdr), "Stream3: Sample " & to_string(Str3ExpFrame-1) & ":" & to_string(splNr) & " wrong CNT", false);
StdlvCompareInt(Str3ExpFrame-1, Memory(spladdr+3) & Memory(spladdr+2), "Stream3: Sample " & to_string(Str3ExpFrame-1) & ":" & to_string(splNr) & " wrong FRAME", false);
-- Wraparound
if spladdr = Str3BufStart_c+curwin*Str3WinSize_c then
spladdr := Str3BufStart_c+(curwin+1)*Str3WinSize_c-4;