-- g_pipeline => 2 -- 0 for wires, > 0 for registers,
-- )
-- PORT MAP (
-- rst => dp_rst,
-- clk => dp_clk,
-- snk_in => bin_reader_mosi,
-- src_out => bin_reader_mosi_pp
-- );
-- rd_cnt_allowed <= snk_in.valid WHEN (bin_reader_mosi.address = prev_bin_reader_mosi.address AND init_phase = '0') ELSE '0'; -- AND snk_in.sync='0'
-- Only count sequential valid data on the same address when: address is the same as last and 1 or 2 cycles after the sync when in sync_detect; address is the same as last and past the initialisation and outside sync_detect
toggle_detect<=snk_in.validWHEN(bin_reader_mosi_pp.address=bin_reader_mosi.addressANDbin_reader_mosi_pp.address/=prev_bin_reader_mosi.addressANDtoggle_detect_false='0')ELSE'0';--AND (snk_in.sync='0' OR dp_pipeline_src_out_p.sync='0')
-- Detect a (valid) repeating address seperated by one other address past the initialisation and outside the first two cycles of a (new) sync
nxt_bin_arbiter_wr_mosi<=bin_writer_mosi;--TODO - The rd and wr mosi should not have the same address. v met 2 cycles rd mag, met 3 cycles niet, dus klopt dit wel?, moet hier niet bin_reader_mosi_pp staan? --AND !(A=B)
nxt_bin_arbiter_wr_mosi<=bin_writer_mosi;
-- Read RAM when subsequent addresses are not the same, when there is no toggle detected and only when the same address is not going to be written to