diff --git a/applications/lofar1/pfs/tb/vhdl/tb_pfs.vhd b/applications/lofar1/pfs/tb/vhdl/tb_pfs.vhd index 0bc95c243f62e140e4a656bbd1af46dcf2a344bb..3d1420b1709690fe4e1a32cc92479cfb7129f71b 100644 --- a/applications/lofar1/pfs/tb/vhdl/tb_pfs.vhd +++ b/applications/lofar1/pfs/tb/vhdl/tb_pfs.vhd @@ -69,19 +69,34 @@ BEGIN in_dat_x <= TO_UVEC(0, in_dat_x'LENGTH); WAIT FOR 1 us; WAIT UNTIL rising_edge(clk); + -- LOFAR1 sync is active one clk cycle before sync interval + -- create sync for first sync interval + in_sync <= '1'; + WAIT UNTIL rising_edge(clk); + in_sync <= '0'; in_val <= '1'; - FOR j IN 1 TO 16 LOOP - FOR i IN 1 TO 1024 LOOP - IF j = 1 THEN - in_dat_x <= TO_UVEC(2**10, in_dat_x'LENGTH); - ELSE - in_dat_x <= TO_UVEC(0, in_dat_x'LENGTH); - END IF; - WAIT UNTIL rising_edge(clk); + FOR k IN 1 TO 2 LOOP + + -- issue impulse + FOR j IN 1 TO 16 LOOP + FOR i IN 1 TO 1024 LOOP + IF j = 1 THEN + in_dat_x <= TO_UVEC(2**10, in_dat_x'LENGTH); + ELSE + in_dat_x <= TO_UVEC(0, in_dat_x'LENGTH); + END IF; + WAIT UNTIL rising_edge(clk); + END LOOP; END LOOP; + + -- continue some more per sync interval + proc_common_wait_some_cycles(clk, 1024*4-1); -- -1 to create sync for next sync interval + in_sync <= '1'; + WAIT UNTIL rising_edge(clk); + in_sync <= '0'; END LOOP; - -- continue some more - proc_common_wait_some_cycles(clk, 1024*4); + -- continue some more to observe last pfs_sync + proc_common_wait_some_cycles(clk, 1024*1); tb_end <= '1'; WAIT; END PROCESS;