USE_VAR_ENDPOINT_ID : integer range c_NO to c_YES := c_NO;
HARDWARE_VERSION : std_logic_vector(31 downto 0) := x"12345678";
CLOCK_FREQUENCY : integer range 1 to 200 := 100;
- USE_ONEWIRE : integer range 0 to 2 := c_YES;
+ USE_ONEWIRE : integer range 0 to 3 := c_YES;
BROADCAST_SPECIAL_ADDR : std_logic_vector(7 downto 0) := x"FF";
--media interfaces
MII_NUMBER : integer range 0 to c_MAX_MII_PER_HUB := 4;
INT_REPLY_PACKET_NUM_IN : in std_logic_vector (INT_NUMBER*c_NUM_WIDTH downto 0) := (others => '0');
INT_REPLY_READ_OUT : out std_logic_vector (INT_NUMBER downto 0);
ONEWIRE : inout std_logic;
+ I2C_SCL : inout std_logic;
+ I2C_SDA : inout std_logic;
ONEWIRE_MONITOR_IN : in std_logic := '0';
ONEWIRE_MONITOR_OUT : out std_logic;
COMMON_STAT_REGS : in std_logic_vector (std_COMSTATREG*32-1 downto 0) := (others => '0'); --Status of common STAT regs
);
end generate;
+ gen_i2c : if USE_ONEWIRE = c_I2C generate
+ ONEWIRE_MONITOR_OUT <= '0';
+ ONEWIRE <= '0';
+ i2c_interface : trb_net_i2cwire
+ generic map(
+ USE_TEMPERATURE_READOUT => c_YES,
+ CLK_PERIOD => 10
+ )
+ port map(
+ CLK => CLK,
+ RESET => reset_i,
+ READOUT_ENABLE_IN => '1',
+ --connection to I2C interface
+ SCL_INOUT => I2C_SCL,
+ SDA_INOUT => I2C_SDA,
+ --connection to id ram, according to memory map in TrbNetRegIO
+ DATA_OUT => ONEWIRE_DATA,
+ ADDR_OUT => ONEWIRE_ADDR,
+ WRITE_OUT => ONEWIRE_WRITE,
+ TEMP_OUT => TEMP_OUT,
+ ID_OUT => UNIQUE_ID_OUT,
+ STAT => open
+ );
+ end generate;
+
+
-------------------------------------------------
-- Include variable Endpoint ID
-------------------------------------------------
COMMON_STAT_REGS : out std_logic_vector (std_COMSTATREG*32-1 downto 0); --Status of common STAT regs
COMMON_CTRL_REGS : out std_logic_vector (std_COMCTRLREG*32-1 downto 0); --Status of common STAT regs
ONEWIRE : inout std_logic;
+ ONEWIRE_MONITOR_OUT : out std_logic;
MY_ADDRESS_OUT : out std_logic_vector(15 downto 0);
UNIQUE_ID_OUT : out std_logic_vector (63 downto 0);
EXTERNAL_SEND_RESET : in std_logic := '0';
signal reset_i_mux_io : std_logic;
signal hub_make_network_reset : std_logic := '0';
-signal hub_got_network_reset : std_logic;
+signal hub_got_network_reset : std_logic;\r
+signal timer_i : TIMERS;
signal timer_ticks : std_logic_vector(1 downto 0);
signal hub_ctrl_debug : std_logic_vector(31 downto 0);
signal buf_HUB_STAT_GEN : std_logic_vector(31 downto 0);
REGIO_UNKNOWN_ADDR_IN => hubbus_tx.unknown,
REGIO_TIMEOUT_OUT => hubbus_rx.timeout,
- TIMER_TICKS_OUT(0) => TIMER.tick_us,
- TIMER_TICKS_OUT(1) => TIMER.tick_ms,
+ TIMER_TICKS_OUT(0) => timer_i.tick_us,
+ TIMER_TICKS_OUT(1) => timer_i.tick_ms,
ONEWIRE => ONEWIRE,
ONEWIRE_MONITOR_IN => '0',
- ONEWIRE_MONITOR_OUT=> open,
+ ONEWIRE_MONITOR_OUT=> ONEWIRE_MONITOR_OUT,
MY_ADDRESS_OUT => my_address,
UNIQUE_ID_OUT => UNIQUE_ID_OUT,
COMMON_CTRL_REGS => common_ctrl,
hub_ctrl_debug(2 downto 0) <= not io_error_in;
hub_ctrl_debug(31 downto 3) <= (others => '0');
HUB_STAT_GEN <= buf_HUB_STAT_GEN;
- timer_ticks <= TIMER.tick_ms & TIMER.tick_us;
+ timer_ticks <= timer_i.tick_ms & timer_i.tick_us;\r
+ TIMER <= timer_i;
---------------------------------------------------------------------
-- I/O Buffers