From 14220c50a013e01b9deec3478ed35e9410282871 Mon Sep 17 00:00:00 2001 From: hadeshyp Date: Tue, 26 May 2009 13:53:48 +0000 Subject: [PATCH] minor fixes --- testbenches/trb_net16_dummy_apl.vhd | 8 ++++---- trb_net16_api_base.vhd | 7 ++++++- trb_net16_ibuf.vhd | 2 +- trb_net16_regIO.vhd | 6 ++---- trb_net16_trigger.vhd | 2 +- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/testbenches/trb_net16_dummy_apl.vhd b/testbenches/trb_net16_dummy_apl.vhd index 5868774..fa22c75 100644 --- a/testbenches/trb_net16_dummy_apl.vhd +++ b/testbenches/trb_net16_dummy_apl.vhd @@ -67,11 +67,11 @@ begin -- address <= x"0008"; -- reghigh <= x"DEAD"; -- reglow <= x"AFFE"; - reg_F0 <= x"8010"; --x"0001"; - reg_F1 <= x"8004"; - reg_F2 <= x"0000";--xor_all(APL_DATA_IN) & "000000000000011"; + reg_F0 <= x"0020"; --x"0001"; + reg_F1 <= x"abcd"; + reg_F2 <= x"1234";--xor_all(APL_DATA_IN) & "000000000000011"; reg_F3 <= x"0000"; - APL_DTYPE_OUT <= x"A"; + APL_DTYPE_OUT <= x"9"; APL_TARGET_ADDRESS_OUT <= x"f003"; --TARGET_ADDRESS; process(current_state) diff --git a/trb_net16_api_base.vhd b/trb_net16_api_base.vhd index 7d0d6f8..b3f5f16 100644 --- a/trb_net16_api_base.vhd +++ b/trb_net16_api_base.vhd @@ -767,7 +767,7 @@ INT_MASTER_DATAREADY_OUT <= buf_INT_MASTER_DATAREADY_OUT; slave_start <= '1'; end if; if INT_SLAVE_PACKET_NUM_IN = c_F1 then - if (INT_SLAVE_DATA_IN = APL_MY_ADDRESS_IN) or (and_all(not(not INT_SLAVE_DATA_IN and (x"FF" & BROADCAST_BITMASK))) = '1') then + if (INT_SLAVE_DATA_IN = APL_MY_ADDRESS_IN) or (and_all(not((not INT_SLAVE_DATA_IN) and (x"FF" & BROADCAST_BITMASK))) = '1') then next_state_to_apl <= sa_MY_ADDR; slave_start <= '1'; else @@ -1035,6 +1035,11 @@ INT_MASTER_DATAREADY_OUT <= buf_INT_MASTER_DATAREADY_OUT; registered_trailer_F1 <= combined_trailer_F1; registered_trailer_F2 <= combined_trailer_F2; registered_trailer_F3 <= combined_trailer_F3; + elsif send_trm_wrong_addr = '1' then + registered_trailer_F0 <= (others => '0'); + registered_trailer_F1 <= (others => '0'); + registered_trailer_F2 <= (others => '0'); + registered_trailer_F3 <= (others => '0'); end if; end if; end process; diff --git a/trb_net16_ibuf.vhd b/trb_net16_ibuf.vhd index 77ffbc2..9263c96 100644 --- a/trb_net16_ibuf.vhd +++ b/trb_net16_ibuf.vhd @@ -387,7 +387,7 @@ counter_match <= '1'; got_ack_reply_internal <= saved_packet_type(3); end if; if reg_MED_PACKET_NUM_IN = c_F1 then - next_rec_buffer_size_out <= MED_DATA_IN(3 downto 0); + next_rec_buffer_size_out <= reg_MED_DATA_IN(3 downto 0); end if; elsif not (saved_packet_type(2 downto 0) = TYPE_ILLEGAL) then fifo_write <= '1'; diff --git a/trb_net16_regIO.vhd b/trb_net16_regIO.vhd index d1e8edd..ca81170 100644 --- a/trb_net16_regIO.vhd +++ b/trb_net16_regIO.vhd @@ -427,11 +427,9 @@ begin next_Reg_low <= API_DATA_IN; if or_all(address(15 downto 8)) = '0' then if address(7 downto 6) = "11" then - next_REGISTERS_OUT_write_enable <= reg_enable_pattern(2**NUM_CTRL_REGS-1 downto 0) or - reg_enable_pattern(2**NUM_CTRL_REGS+31 downto 32); + next_REGISTERS_OUT_write_enable <= reg_enable_pattern(2**NUM_CTRL_REGS-1 downto 0); else - next_COMMON_REGISTERS_OUT_write_enable <= reg_enable_pattern(std_COMCTRLREG-1 downto 0) or - reg_enable_pattern(std_COMCTRLREG+31 downto 32); + next_COMMON_REGISTERS_OUT_write_enable <= reg_enable_pattern(std_COMCTRLREG-1 downto 0); end if; next_state <= REG_READ; else diff --git a/trb_net16_trigger.vhd b/trb_net16_trigger.vhd index 7f632d5..ba3c755 100644 --- a/trb_net16_trigger.vhd +++ b/trb_net16_trigger.vhd @@ -131,7 +131,7 @@ begin elsif transfer_counter = c_F1_next then next_INT_DATA_OUT <= buf_TRG_ERROR_PATTERN_IN(31 downto 16); elsif transfer_counter = c_F2_next then - next_INT_DATA_OUT <= buf_TRG_ERROR_PATTERN_IN(15 downto 0); + next_INT_DATA_OUT <= buf_TRG_ERROR_PATTERN_IN(15 downto 1) & '1'; else next_INT_DATA_OUT <= (others => '0'); next_INT_DATA_OUT(11 downto 4) <= reg_TRG_NUMBER_OUT(7 downto 0); -- 2.43.0