From: hadeshyp Date: Thu, 24 Jan 2008 12:02:16 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: oldGBE~614 X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=1d371425958984a869688db1d3bbfeeeb4ac5b5c;p=trbnet.git *** empty log message *** --- diff --git a/lattice/lattice_scm_bram_fifo.vhd b/lattice/lattice_scm_bram_fifo.vhd index d65b10a..cef4e8e 100644 --- a/lattice/lattice_scm_bram_fifo.vhd +++ b/lattice/lattice_scm_bram_fifo.vhd @@ -7,8 +7,8 @@ library IEEE; use IEEE.std_logic_1164.all; -- synopsys translate_off -library SCM; -use SCM.COMPONENTS.all; +--library SCM; +--use SCM.COMPONENTS.all; -- synopsys translate_on entity lattice_scm_bram_fifo is @@ -169,13 +169,13 @@ begin end Structure; -- synopsys translate_off -library SCM; -configuration Structure_CON of lattice_scm_bram_fifo is - for Structure - for all:VHI use entity SCM.VHI(V); end for; - for all:VLO use entity SCM.VLO(V); end for; - for all:FIFO16KA use entity SCM.FIFO16KA(V); end for; - end for; -end Structure_CON; +-- library SCM; +-- configuration Structure_CON of lattice_scm_bram_fifo is +-- for Structure +-- for all:VHI use entity SCM.VHI(V); end for; +-- for all:VLO use entity SCM.VLO(V); end for; +-- for all:FIFO16KA use entity SCM.FIFO16KA(V); end for; +-- end for; +-- end Structure_CON; -- synopsys translate_on diff --git a/lattice/trb_net_fifo_arch.vhd b/lattice/trb_net_fifo_arch.vhd index 4e406de..45b987d 100644 --- a/lattice/trb_net_fifo_arch.vhd +++ b/lattice/trb_net_fifo_arch.vhd @@ -1,8 +1,8 @@ library IEEE; use IEEE.std_logic_1164.all; -- synopsys translate_off -library SCM; -use SCM.COMPONENTS.all; +--library SCM; +--use SCM.COMPONENTS.all; -- synopsys translate_on -- entity trb_net_fifo is @@ -28,7 +28,7 @@ use SCM.COMPONENTS.all; -- -- end trb_net_fifo; -architecture Structure of trb_net_fifo_arch is +architecture Structure of trb_net_fifo is component lattice_scm_bram_fifo is port ( Data: in std_logic_vector(17 downto 0); diff --git a/trb_net16_endpoint_0_trg_1_api.vhd b/trb_net16_endpoint_0_trg_1_api.vhd index 6b37c90..5b295cb 100644 --- a/trb_net16_endpoint_0_trg_1_api.vhd +++ b/trb_net16_endpoint_0_trg_1_api.vhd @@ -14,15 +14,15 @@ entity trb_net16_endpoint_0_trg_1_api is generic ( API_TYPE : integer range 0 to 1 := c_API_PASSIVE; - INIT_DEPTH : integer range 0 to 6 := c_FIFO_SMALL; - REPLY_DEPTH : integer range 0 to 6 := c_FIFO_SMALL; + INIT_DEPTH : integer range 0 to 6 := c_FIFO_BRAM; + REPLY_DEPTH : integer range 0 to 6 := c_FIFO_NONE; FIFO_TO_INT_DEPTH : integer range 0 to 6 := c_FIFO_SMALL; FIFO_TO_APL_DEPTH : integer range 0 to 6 := c_FIFO_SMALL; SBUF_VERSION : integer range 0 to 1 := c_SBUF_FULL; MUX_SECURE_MODE : integer range 0 to 1 := c_NON_SECURE_MODE; - IBUF_SECURE_MODE : integer range 0 to 1 := c_SECURE_MODE; + IBUF_SECURE_MODE : integer range 0 to 1 := c_NON_SECURE_MODE; OBUF_DATA_COUNT_WIDTH : integer range 0 to 7 := std_DATA_COUNT_WIDTH; - INIT_CAN_SEND_DATA : integer range 0 to 1 := c_YES; + INIT_CAN_SEND_DATA : integer range 0 to 1 := c_NO; REPLY_CAN_SEND_DATA : integer range 0 to 1 := c_YES; DAT_CHANNEL : integer range 0 to 3 := c_SLOW_CTRL_CHANNEL ); diff --git a/trb_net16_ibuf.vhd b/trb_net16_ibuf.vhd index 7278ccb..285aeb4 100644 --- a/trb_net16_ibuf.vhd +++ b/trb_net16_ibuf.vhd @@ -151,7 +151,7 @@ begin begin if rising_edge(CLK) then if RESET = '1' then - saved_packet_type <= "111"; + saved_packet_type <= TYPE_ILLEGAL; elsif MED_PACKET_NUM_IN = "00" then saved_packet_type <= MED_DATA_IN(2 downto 0); end if; @@ -161,8 +161,8 @@ begin process(CLK) begin if rising_edge(CLK) then - if RESET = '1' then - saved_fifo_packet_type <= "111"; + if RESET = '1' or fifo_packet_num_out = "11" then + saved_fifo_packet_type <= TYPE_ILLEGAL; elsif fifo_packet_num_out = "00" then saved_fifo_packet_type <= fifo_data_out(2 downto 0); end if; @@ -268,11 +268,13 @@ begin else fifo_read <= INT_READ_IN and buf_INT_DATAREADY_OUT and not fifo_empty; end if; - if current_fifo_packet_type = TYPE_EOB and fifo_packet_num_out = "00" and USE_ACKNOWLEDGE = 1 then - tmp_INT_DATA_OUT(2 downto 0) <= TYPE_DAT; - end if; +-- if current_fifo_packet_type = TYPE_EOB and fifo_packet_num_out = "00" and USE_ACKNOWLEDGE = 1 then +-- tmp_INT_DATA_OUT(2 downto 0) <= TYPE_DAT; +-- end if; if fifo_empty = '0' and sbuf_free = '1' then - tmp_INT_DATAREADY_OUT <= '1'; + if current_fifo_packet_type /= TYPE_EOB then + tmp_INT_DATAREADY_OUT <= '1'; + end if; if USE_ACKNOWLEDGE = 1 then if (current_fifo_packet_type = TYPE_EOB or current_fifo_packet_type = TYPE_TRM) and fifo_packet_num_out = "11" then diff --git a/trb_net16_obuf.vhd b/trb_net16_obuf.vhd index f95a998..1946a6a 100644 --- a/trb_net16_obuf.vhd +++ b/trb_net16_obuf.vhd @@ -93,7 +93,7 @@ architecture trb_net16_obuf_arch of trb_net16_obuf is signal saved_packet_type : std_logic_vector(2 downto 0); signal reg_SEND_ACK_IN_2,next_SEND_ACK_IN_2 : std_logic; - type sending_state_t is (idle, sending_ack); + type sending_state_t is (idle, sending_ack, sending_eob); signal next_sending_state, sending_state : sending_state_t; signal sending_state_bits : std_logic; @@ -163,16 +163,18 @@ begin begin current_NOP_word <= (others => '0'); current_ACK_word <= (others => '0'); - current_EOB_word <= INT_DATA_IN; + current_EOB_word <= (others => '0'); +-- current_EOB_word <= INT_DATA_IN; current_DATA_word <= INT_DATA_IN; if transfer_counter = "10" then current_ACK_word(3 downto 0) <= SEND_BUFFER_SIZE_IN; + current_EOB_word(DATA_COUNT_WIDTH-1 downto 0) <= CURRENT_DATA_COUNT; end if; if transfer_counter = "00" then current_NOP_word(2 downto 0) <= TYPE_ILLEGAL; current_ACK_word(2 downto 0) <= TYPE_ACK; - current_EOB_word(2 downto 0) <= TYPE_EOB or INT_DATA_IN(2 downto 0); - --this makes an EOB out of an DAT and keeps a TRM + current_EOB_word(2 downto 0) <= TYPE_EOB; + -- or INT_DATA_IN(2 downto 0) this makes an EOB out of an DAT and keeps a TRM end if; end process; @@ -220,14 +222,14 @@ begin if (reg_INT_READ_OUT = '1' and INT_DATAREADY_IN = '1') then --can only happen if idle or sending_data - if send_EOB = '1' then - current_output_data_buffer <= current_EOB_word; - else +-- if send_EOB = '1' then +-- current_output_data_buffer <= current_EOB_word; +-- else current_output_data_buffer <= current_DATA_word; - end if; +-- end if; comb_dataready <= '1'; --I hope sbuf can store if transfer_counter = "11" then - if saved_packet_type = TYPE_TRM or saved_packet_type = TYPE_EOB then --TRM means EOB + if saved_packet_type = TYPE_TRM then -- or saved_packet_type = TYPE_EOB next_DATA_COUNT <= (others => '0'); increase_TRANSMITTED_BUFFERS <= '1'; if TRANSMITTED_BUFFERS(0) = '1' then @@ -236,6 +238,10 @@ begin else next_DATA_COUNT <= CURRENT_DATA_COUNT +1; end if; + if send_EOB = '1' then + next_INT_READ_OUT <= '0'; + next_sending_state <= sending_eob; + end if; if send_ACK = '1' then next_INT_READ_OUT <= '0'; next_sending_state <= sending_ack; @@ -243,6 +249,22 @@ begin end if; end if; + if sending_state = sending_eob then + next_INT_READ_OUT <= '0'; + current_output_data_buffer <= current_EOB_word; + if sbuf_free = '1' then + comb_dataready <= '1'; + if (transfer_counter = "11") then + next_sending_state <= idle; + next_DATA_COUNT <= (others => '0'); + increase_TRANSMITTED_BUFFERS <= '1'; + if TRANSMITTED_BUFFERS(0) = '1' then + next_INT_READ_OUT <= '0'; + end if; + end if; + end if; + end if; + if sending_state = sending_ack then next_INT_READ_OUT <= '0'; current_output_data_buffer <= current_ACK_word; @@ -255,16 +277,21 @@ begin end if; end if; + if send_EOB = '1' and transfer_counter = "00" and (reg_INT_READ_OUT and INT_DATAREADY_IN) = '0' then + next_sending_state <= sending_eob; + next_INT_READ_OUT <= '0'; + end if; if send_ACK = '1' and transfer_counter = "00" and (reg_INT_READ_OUT and INT_DATAREADY_IN) = '0' then next_sending_state <= sending_ack; next_INT_READ_OUT <= '0'; end if; + if sbuf_free = '0' or send_DATA = '0' then next_INT_READ_OUT <= '0'; end if; end process; -sending_state_bits <= '1' when sending_state = sending_ack else '0'; +--sending_state_bits <= '1' when sending_state = sending_ack else '0' when sending_state = sending_eob else 'U'; REG1 : process(CLK) begin