DEVEL: Implemented Multi-Stream Tests
This commit is contained in:
@ -519,7 +519,7 @@ begin
|
||||
r.WinProtected <= (others => '0');
|
||||
r.Dma_Resp_Rdy <= '0';
|
||||
r.Ts_Rdy <= (others => '0');
|
||||
r.NewBuffer <= (others => '0');
|
||||
r.NewBuffer <= (others => '1'); -- Remember for enable!
|
||||
end if;
|
||||
end if;
|
||||
end process;
|
||||
|
@ -73,7 +73,70 @@ package body psi_ms_daq_daq_sm_tb_case_multi_window is
|
||||
signal Dma_Cmd_Vld : in std_logic;
|
||||
constant Generics_c : Generics_t) is
|
||||
begin
|
||||
assert false report "Case MULTI_WINDOW Procedure CONTROL: No Content added yet!" severity warning;
|
||||
print(">> -- multi window --");
|
||||
|
||||
-- Linear write with Overwrite
|
||||
print(">> Linear write with Overwrite");
|
||||
InitTestCase(Clk, Rst);
|
||||
TestCase := 0;
|
||||
ConfigureAuto( WinSize => 4096*2, Ringbuf => '0', Overwrite => '1', Wincnt => 2, Wincur => 0);
|
||||
Inp_Level(2) <= LvlThreshold_c;
|
||||
for i in 0 to 6 loop
|
||||
wait until rising_edge(Clk) and Dma_Cmd_Vld = '1';
|
||||
end loop;
|
||||
Inp_Level(2) <= (others => '0');
|
||||
ControlWaitCompl(Clk);
|
||||
|
||||
-- Ringbuf with overwrite
|
||||
print(">> Ringbuf with overwrite");
|
||||
InitTestCase(Clk, Rst);
|
||||
TestCase := 1;
|
||||
ConfigureAuto( WinSize => 4096*2, Ringbuf => '1', Overwrite => '1', Wincnt => 2, Wincur => 0);
|
||||
Inp_Level(2) <= LvlThreshold_c;
|
||||
for i in 0 to 7 loop
|
||||
wait until rising_edge(Clk) and Dma_Cmd_Vld = '1';
|
||||
end loop;
|
||||
Inp_Level(2) <= (others => '0');
|
||||
ControlWaitCompl(Clk);
|
||||
|
||||
-- Linear without overwrite, no trigger
|
||||
print(">> Linear without overwrite, no trigger");
|
||||
InitTestCase(Clk, Rst);
|
||||
TestCase := 2;
|
||||
ConfigureAuto( WinSize => 4096*2, Ringbuf => '0', Overwrite => '0', Wincnt => 2, Wincur => 0);
|
||||
Inp_Level(2) <= LvlThreshold_c;
|
||||
for i in 0 to 10 loop
|
||||
wait until rising_edge(Clk) and Dma_Cmd_Vld = '1';
|
||||
end loop;
|
||||
Inp_Level(2) <= (others => '0');
|
||||
ControlWaitCompl(Clk);
|
||||
|
||||
-- Linear without overwrite, trigger
|
||||
print(">> Linear without overwrite, trigger");
|
||||
InitTestCase(Clk, Rst);
|
||||
TestCase := 3;
|
||||
ConfigureAuto( WinSize => 4096*2, Ringbuf => '0', Overwrite => '0', Wincnt => 2, Wincur => 0);
|
||||
Inp_Level(2) <= LvlThreshold_c;
|
||||
for i in 0 to 5 loop
|
||||
wait until rising_edge(Clk) and Dma_Cmd_Vld = '1';
|
||||
end loop;
|
||||
Inp_Level(2) <= (others => '0');
|
||||
ControlWaitCompl(Clk);
|
||||
|
||||
-- Ringbuf without overwrite
|
||||
wait for 10 us;
|
||||
print(">> Ringbuf without overwrite");
|
||||
InitTestCase(Clk, Rst);
|
||||
TestCase := 4;
|
||||
ConfigureAuto( WinSize => 4096*2, Ringbuf => '1', Overwrite => '0', Wincnt => 2, Wincur => 0);
|
||||
Inp_Level(2) <= LvlThreshold_c;
|
||||
for i in 0 to 7 loop
|
||||
wait until rising_edge(Clk) and Dma_Cmd_Vld = '1';
|
||||
end loop;
|
||||
Inp_Level(2) <= (others => '0');
|
||||
ControlWaitCompl(Clk);
|
||||
|
||||
|
||||
end procedure;
|
||||
|
||||
procedure dma_cmd (
|
||||
@ -82,7 +145,98 @@ package body psi_ms_daq_daq_sm_tb_case_multi_window is
|
||||
signal Dma_Cmd_Vld : in std_logic;
|
||||
constant Generics_c : Generics_t) is
|
||||
begin
|
||||
assert false report "Case MULTI_WINDOW Procedure DMA_CMD: No Content added yet!" severity warning;
|
||||
-- Linear write with Overwrite
|
||||
WaitForCase(0, Clk);
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, Msg => "Wr0.0",
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, Msg => "Wr0.1", NextWin => true,
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
--> Finished by trigger
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, ExeSize => 512, Msg => "Wr1.0", NextWin => true,
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, Msg => "Wr2.0",
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, Msg => "Wr2.1", NextWin => true,
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
--> Finished by trigger
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, ExeSize => 512, Msg => "Wr3.0", NextWin => true,
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, Msg => "Wr4.0",
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
ProcDone(2) := '1';
|
||||
|
||||
-- Ringbuf with overwrite
|
||||
WaitForCase(1, Clk);
|
||||
-- Win0
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, Msg => "Wr0.0",
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, Msg => "Wr0.1",
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, ExeSize => 512, Msg => "Wr0.2", NextWin => true,
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
-- Win1
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, ExeSize => 512, Msg => "Wr1.0", NextWin => true,
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
-- Win2
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, Msg => "Wr2.0",
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, ExeSize => 768, Msg => "Wr2.1", NextWin => true,
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
-- Win 0 (second time)
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, Msg => "Wr3.0",
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, Msg => "Wr3.1",
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
ProcDone(2) := '1';
|
||||
|
||||
-- Linear without overwrite, no trigger
|
||||
WaitForCase(2, Clk);
|
||||
for win in 0 to 4 loop
|
||||
for burst in 0 to 1 loop
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, NextWin => (burst = 1), Msg => "Wr" & to_string(win) & "." & to_string(burst),
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
end loop;
|
||||
end loop;
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, Msg => "Wr5.0",
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
ProcDone(2) := '1';
|
||||
|
||||
-- Linear without overwrite, trigger
|
||||
WaitForCase(3, Clk);
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, ExeSize => 512, Msg => "Wr0.0", NextWin => true,
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, Msg => "Wr1.0",
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, Msg => "Wr1.1",
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld, NextWin => true);
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, ExeSize => 512, Msg => "Wr2.0", NextWin => true,
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, ExeSize => 512, Msg => "Wr3.0", NextWin => true,
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, Msg => "Wr4.0",
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
ProcDone(2) := '1';
|
||||
|
||||
-- Ringbuf without overwrite
|
||||
WaitForCase(4, Clk);
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, ExeSize => 512, Msg => "Wr0.0", NextWin => true,
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, Msg => "Wr1.0",
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, Msg => "Wr1.1",
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, ExeSize => 512, Msg => "Wr1.2", NextWin => true,
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, ExeSize => 512, Msg => "Wr2.0", NextWin => true,
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, Msg => "Wr3.0",
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, ExeSize => 512, Msg => "Wr3.1", NextWin => true,
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
ExpectDmaCmdAuto( Stream => 2, MaxSize => 4096, Msg => "Wr4.0",
|
||||
Clk => Clk, Dma_Cmd => Dma_Cmd, Dma_Vld => Dma_Cmd_Vld);
|
||||
ProcDone(2) := '1';
|
||||
|
||||
end procedure;
|
||||
|
||||
procedure dma_resp (
|
||||
@ -92,7 +246,91 @@ package body psi_ms_daq_daq_sm_tb_case_multi_window is
|
||||
signal Dma_Resp_Rdy : in std_logic;
|
||||
constant Generics_c : Generics_t) is
|
||||
begin
|
||||
assert false report "Case MULTI_WINDOW Procedure DMA_RESP: No Content added yet!" severity warning;
|
||||
-- Linear write with Overwrite
|
||||
WaitForCase(0, Clk);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '0',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '0',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '1',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '0',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '0',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '1',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '0',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ProcDone(1) := '1';
|
||||
|
||||
-- Ringbuf with overwrite
|
||||
WaitForCase(1, Clk);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '0',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '0',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '1',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '1',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '0',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '1',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '0',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '0',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ProcDone(1) := '1';
|
||||
|
||||
-- Linear without overwrite, no trigger
|
||||
WaitForCase(2, Clk);
|
||||
for win in 0 to 4 loop
|
||||
for burst in 0 to 1 loop
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '0',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
end loop;
|
||||
end loop;
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '0',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ProcDone(1) := '1';
|
||||
|
||||
-- Linear without overwrite, trigger
|
||||
WaitForCase(3, Clk);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '1',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '0',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '0',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '1',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '1',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '0',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ProcDone(1) := '1';
|
||||
|
||||
-- Ringbuf without overwrite
|
||||
WaitForCase(3, Clk);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '1',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '0',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '0',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '1',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '1',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '0',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '1',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ApplyDmaRespAuto( Stream => 2, Trigger => '0',
|
||||
Clk => Clk, Dma_Resp => Dma_Resp, Dma_Resp_Vld => Dma_Resp_Vld, Dma_Resp_Rdy => Dma_Resp_Rdy);
|
||||
ProcDone(1) := '1';
|
||||
end procedure;
|
||||
|
||||
procedure ctx (
|
||||
@ -103,7 +341,132 @@ package body psi_ms_daq_daq_sm_tb_case_multi_window is
|
||||
signal CtxWin_Resp : inout FromCtx_t;
|
||||
constant Generics_c : Generics_t) is
|
||||
begin
|
||||
assert false report "Case MULTI_WINDOW Procedure CTX: No Content added yet!" severity warning;
|
||||
-- Linear write with Overwrite
|
||||
WaitForCase(0, Clk);
|
||||
ExpCtxFullBurstAuto( Stream => 2, Msg => "Wr0.0",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxFullBurstAuto( Stream => 2, NextWin => true, Msg => "Wr0.1",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxFullBurstAuto( Stream => 2, NextWin => true, Msg => "Wr1.0",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxFullBurstAuto( Stream => 2, Msg => "Wr2.0",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxFullBurstAuto( Stream => 2, NextWin => true, Msg => "Wr2.1",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxFullBurstAuto( Stream => 2, NextWin => true, Msg => "Wr3.0",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxFullBurstAuto( Stream => 2, Msg => "Wr4.0",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ProcDone(0) := '1';
|
||||
|
||||
-- Ringbuf with overwrite
|
||||
WaitForCase(1, Clk);
|
||||
ExpCtxFullBurstAuto( Stream => 2, Msg => "Wr0.0",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxFullBurstAuto( Stream => 2, Msg => "Wr0.1",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxFullBurstAuto( Stream => 2, NextWin => true, Msg => "Wr0.2",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxFullBurstAuto( Stream => 2, NextWin => true, Msg => "Wr1.0",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxFullBurstAuto( Stream => 2, Msg => "Wr2.0",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxFullBurstAuto( Stream => 2, NextWin => true, Msg => "Wr2.1",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxFullBurstAuto( Stream => 2, Msg => "Wr3.0",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxFullBurstAuto( Stream => 2, Msg => "Wr3.1",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ProcDone(0) := '1';
|
||||
|
||||
-- Linear without overwrite, no trigger
|
||||
WaitForCase(2, Clk);
|
||||
for win in 0 to 2 loop
|
||||
for burst in 0 to 1 loop
|
||||
ExpCtxFullBurstAuto( Stream => 2, NextWin => (burst=1), Msg => "Wr" & to_string(win) & "." & to_string(burst),
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
end loop;
|
||||
end loop;
|
||||
ExpCtxReadAuto( Stream => 2, Msg => "SW not ready 0.0",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxReadAuto( Stream => 2, Msg => "SW not ready 0.1",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
SplsWinStr_v(2)(0) := 0;
|
||||
ExpCtxFullBurstAuto( Stream => 2, Msg => "Wr3.0",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxFullBurstAuto( Stream => 2, NextWin => true, Msg => "Wr3.1",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxReadAuto( Stream => 2, Msg => "SW not ready 1.0",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxReadAuto( Stream => 2, Msg => "SW not ready 1.1",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
SplsWinStr_v(2)(1) := 0;
|
||||
SplsWinStr_v(2)(2) := 0;
|
||||
ExpCtxFullBurstAuto( Stream => 2, Msg => "Wr4.0",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxFullBurstAuto( Stream => 2, NextWin => true, Msg => "Wr4.1",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxFullBurstAuto( Stream => 2, Msg => "Wr5.0",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ProcDone(0) := '1';
|
||||
|
||||
-- Linear without overwrite, trigger
|
||||
WaitForCase(3, Clk);
|
||||
SplsWinStr_v(2) := (others => 4096/4);
|
||||
ExpCtxReadAuto( Stream => 2, Msg => "SW not ready 0.0",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
SplsWinStr_v(2)(0 to 2) := (others => 0);
|
||||
ExpCtxFullBurstAuto( Stream => 2, Msg => "Wr0.0", NextWin => true,
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxFullBurstAuto( Stream => 2, Msg => "Wr1.0",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxFullBurstAuto( Stream => 2, NextWin => true, Msg => "Wr1.1",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxFullBurstAuto( Stream => 2, NextWin => true, Msg => "Wr2.0",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxReadAuto( Stream => 2, Msg => "SW not ready 1.0",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxReadAuto( Stream => 2, Msg => "SW not ready 1.1",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
SplsWinStr_v(2)(0) := 0;
|
||||
ExpCtxFullBurstAuto( Stream => 2, NextWin => true, Msg => "Wr3.0",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxReadAuto( Stream => 2, Msg => "SW not ready 2.0",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxReadAuto( Stream => 2, Msg => "SW not ready 2.1",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
SplsWinStr_v(2)(1) := 0;
|
||||
ExpCtxFullBurstAuto( Stream => 2, Msg => "Wr4.0",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ProcDone(0) := '1';
|
||||
|
||||
-- Ringbuf without overwrite
|
||||
WaitForCase(4, Clk);
|
||||
ExpCtxFullBurstAuto( Stream => 2, Msg => "Wr0.0", NextWin => true,
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxFullBurstAuto( Stream => 2, Msg => "Wr1.0",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxFullBurstAuto( Stream => 2, Msg => "Wr1.1",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxFullBurstAuto( Stream => 2, NextWin => true, Msg => "Wr1.2",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxFullBurstAuto( Stream => 2, NextWin => true, Msg => "Wr2.0",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxReadAuto( Stream => 2, Msg => "SW not ready 0.0",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxReadAuto( Stream => 2, Msg => "SW not ready 0.1",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
SplsWinStr_v(2)(0) := 0;
|
||||
ExpCtxFullBurstAuto( Stream => 2, Msg => "Wr3.0",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxFullBurstAuto( Stream => 2, NextWin => true, Msg => "Wr3.1",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ExpCtxReadAuto( Stream => 2, Msg => "SW not ready 1.0",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
SplsWinStr_v(2)(1) := 0;
|
||||
ExpCtxFullBurstAuto( Stream => 2, Msg => "Wr4.0",
|
||||
Clk => Clk, CtxStr_Cmd => CtxStr_Cmd, CtxStr_Resp => CtxStr_Resp, CtxWin_Cmd => CtxWin_Cmd, CtxWin_Resp => CtxWin_Resp);
|
||||
ProcDone(0) := '1';
|
||||
end procedure;
|
||||
|
||||
end;
|
||||
|
@ -337,7 +337,7 @@ package body psi_ms_daq_daq_sm_tb_pkg is
|
||||
variable WinNext_v : integer;
|
||||
begin
|
||||
-- No window change by default
|
||||
if WinNext = 0 then
|
||||
if WinNext = -1 then
|
||||
WinNext_v := Wincur;
|
||||
else
|
||||
WinNext_v := WinNext;
|
||||
@ -635,7 +635,7 @@ package body psi_ms_daq_daq_sm_tb_pkg is
|
||||
CtxWin_Resp => CtxWin_Resp,
|
||||
Msg => Msg);
|
||||
SplsWinStr_v(Stream)(AutoWincur_v(Stream)) := work.psi_common_math_pkg.min(AutoWinSize_v/(StreamWidth_g(Stream)/8), SplsWinStr_v(Stream)(AutoWincur_v(Stream))+AutoAccessSize_v(Stream)/(StreamWidth_g(Stream)/8));
|
||||
if NextWin then
|
||||
if NextWin then
|
||||
if AutoWincur_v(Stream) = AutoWincnt_v then
|
||||
AutoWincur_v(Stream) := 0;
|
||||
else
|
||||
@ -643,9 +643,9 @@ package body psi_ms_daq_daq_sm_tb_pkg is
|
||||
end if;
|
||||
else
|
||||
-- wraparound for ringbuffer case
|
||||
if (PtrStr_v(Stream) - BufStart_c(Stream) > AutoWinSize_v) then
|
||||
if (PtrStr_v(Stream) - BufStart_c(Stream) - AutoWincur_v(Stream)*AutoWinSize_v > AutoWinSize_v) then
|
||||
report "###ERROR### TB assertion, unhandled window crossing" severity error;
|
||||
elsif (PtrStr_v(Stream) - BufStart_c(Stream) = AutoWinSize_v) then
|
||||
elsif (PtrStr_v(Stream) - BufStart_c(Stream) - AutoWincur_v(Stream)*AutoWinSize_v = AutoWinSize_v) then
|
||||
if AutoRingbuf_v = '1' then
|
||||
PtrStr_v(Stream) := BufStart_c(Stream);
|
||||
end if;
|
||||
@ -730,11 +730,11 @@ package body psi_ms_daq_daq_sm_tb_pkg is
|
||||
else
|
||||
PtrDma_v(Stream) := PtrDma_v(Stream) + ExeSize_v;
|
||||
-- wraparound for ringbuffer case
|
||||
if (PtrDma_v(Stream) - BufStart_c(Stream) > AutoWinSize_v) then
|
||||
if (PtrDma_v(Stream) - BufStart_c(Stream) - AutoWincur_v(Stream)*AutoWinSize_v > AutoWinSize_v) then
|
||||
report "###ERROR### TB assertion, unhandled window crossing" severity error;
|
||||
elsif (PtrDma_v(Stream) - BufStart_c(Stream) = AutoWinSize_v) then
|
||||
elsif (PtrDma_v(Stream) - BufStart_c(Stream) - AutoWincur_v(Stream)*AutoWinSize_v = AutoWinSize_v) then
|
||||
if AutoRingbuf_v = '1' then
|
||||
PtrDma_v(Stream) := BufStart_c(Stream);
|
||||
PtrDma_v(Stream) := BufStart_c(Stream) + AutoWincur_v(Stream)*AutoWinSize_v;
|
||||
end if;
|
||||
end if;
|
||||
end if;
|
||||
|
Reference in New Issue
Block a user