ganimede-multipacket #19

Merged
Adam merged 13 commits from ganimede-multipacket into ganimede-rework 2025-05-27 15:18:08 +02:00
Showing only changes of commit 1146970be5 - Show all commits

View File

@ -13,7 +13,7 @@ use grlib.stdlib.all;
entity socbridge_driver is entity socbridge_driver is
generic( generic(
MAX_PKT_SIZE : integer range 1 to 128 := 32 MAX_PKT_SIZE : integer range 1 to 128 := 8
); );
port( port(
clk : in std_logic; clk : in std_logic;
@ -184,7 +184,9 @@ begin
-- Responses -- Responses
elsif st.curr_rx_transaction = READ_RESPONSE then elsif st.curr_rx_transaction = READ_RESPONSE then
next_rx_state <= RX_R_BODY; next_rx_state <= RX_R_BODY;
else elsif local_next_rx_transaction /= NO_OP then
next_rx_state <= RX_HEADER;
else
next_rx_state <= IDLE; next_rx_state <= IDLE;
end if; end if;
when RX_R_BODY => when RX_R_BODY =>
@ -510,6 +512,16 @@ begin
if not (st.curr_tx_state = TX_HEADER and (st.curr_tx_transaction = WRITE or st.curr_tx_transaction = WRITE_ADD)) then if not (st.curr_tx_state = TX_HEADER and (st.curr_tx_transaction = WRITE or st.curr_tx_transaction = WRITE_ADD)) then
st.write_in_flight <= false; st.write_in_flight <= false;
end if; end if;
if next_rx_transaction /= NO_OP then
st.curr_rx_transaction <= next_rx_transaction;
st.rx_data_size <= next_rx_data_size;
if next_rx_transaction = WRITE_ADD or next_rx_transaction = WRITE
or next_rx_transaction = READ_RESPONSE then
st.rx_stage <= next_rx_data_size;
else
st.rx_stage <= 0;
end if;
end if;
elsif st.curr_rx_transaction = READ_RESPONSE then elsif st.curr_rx_transaction = READ_RESPONSE then
if not (st.curr_tx_state = TX_HEADER and (st.curr_tx_transaction = READ or st.curr_tx_transaction = READ_ADD)) then if not (st.curr_tx_state = TX_HEADER and (st.curr_tx_transaction = READ or st.curr_tx_transaction = READ_ADD)) then
st.read_in_flight <= false; st.read_in_flight <= false;
@ -618,7 +630,8 @@ begin
end if; end if;
if trans_st.write.curr_inst.seq_mem_access_count mod 256 = 0 then if trans_st.write.curr_inst.seq_mem_access_count mod 256 = 0 then
trans_st.write.is_first_word <= '1'; trans_st.write.is_first_word <= '1';
elsif trans_st.read.curr_inst.instruction /= NO_OP then elsif st.last_sent_transaction = READ or st.last_sent_transaction = READ_ADD
or next_tx_transaction = READ or next_tx_transaction = READ_ADD then
trans_st.write.is_first_word <= '1'; trans_st.write.is_first_word <= '1';
else else
trans_st.write.is_first_word <= '0'; trans_st.write.is_first_word <= '0';
@ -633,6 +646,14 @@ begin
end if; end if;
trans_st.read.is_first_word <= '1'; trans_st.read.is_first_word <= '1';
when SEND => when SEND =>
if trans_st.read.curr_inst.seq_mem_access_count mod 256 = 0 then
trans_st.read.is_first_word <= '1';
elsif st.last_sent_transaction = WRITE or st.last_sent_transaction = WRITE_ADD
or next_tx_transaction = WRITE or next_tx_transaction = WRITE_ADD then
trans_st.read.is_first_word <= '1';
else
trans_st.read.is_first_word <= '0';
end if;
when SEND_ACCEPTED => when SEND_ACCEPTED =>
trans_st.read.curr_inst.seq_mem_access_count <= trans_st.read.curr_inst.seq_mem_access_count - MAX_PKT_SIZE; trans_st.read.curr_inst.seq_mem_access_count <= trans_st.read.curr_inst.seq_mem_access_count - MAX_PKT_SIZE;
trans_st.read.curr_inst.address <= std_logic_vector(unsigned(trans_st.read.curr_inst.address) + MAX_PKT_SIZE); trans_st.read.curr_inst.address <= std_logic_vector(unsigned(trans_st.read.curr_inst.address) + MAX_PKT_SIZE);
@ -645,7 +666,8 @@ begin
end if; end if;
if trans_st.read.curr_inst.seq_mem_access_count mod 256 = 0 then if trans_st.read.curr_inst.seq_mem_access_count mod 256 = 0 then
trans_st.read.is_first_word <= '1'; trans_st.read.is_first_word <= '1';
elsif trans_st.write.curr_inst.instruction /= NO_OP then elsif st.last_sent_transaction = WRITE or st.last_sent_transaction = WRITE_ADD
or next_tx_transaction = WRITE or next_tx_transaction = WRITE_ADD then
trans_st.read.is_first_word <= '1'; trans_st.read.is_first_word <= '1';
else else
trans_st.read.is_first_word <= '0'; trans_st.read.is_first_word <= '0';