Commit 159e5a99 authored by Theodor-Adrian Stana's avatar Theodor-Adrian Stana

wb_i2c_bridge: Make FSM watchdog setup more generic

This is done by adding a generic to the entity, which is connected directly to
the gc_fsm_watchdog component instantiated within the wb_i2c_bridge. The user
should calculate the appropriate watchdog timeout value and set it via this
generic.

The instantiation template in the wishbone_pkg is also updated.
Signed-off-by: Theodor-Adrian Stana's avatarTheodor Stana <t.stana@cern.ch>
parent 41ba89b8
......@@ -59,6 +59,12 @@ use ieee.numeric_std.all;
use work.gencores_pkg.all;
entity wb_i2c_bridge is
generic
(
-- FSM watchdog timeout, see Appendix A in the component documentation for
-- an example of setting this generic
g_fsm_wdt : positive
);
port
(
-- Clock, reset
......@@ -391,20 +397,10 @@ begin
--============================================================================
-- FSM watchdog timer
--============================================================================
-- * in the case of writemregs command, a maximum of 35 bytes can be written
-- - 1 I2C address byte
-- - 2 register (Wishbone) address bytes
-- - 8*4 Wishbone register values
-- * we will therefore set the watchdog max. value to allow for 36 bytes to
-- be sent, considering a maximum clk_i frequency of 20 MHz (period = 50 ns)
-- and an SCL frequency of 100 kHz
-- * 100 us / 50 ns = 2000 clock cycles to send one byte
-- * 2000 * 36 bytes = 72000 clock cycles to send 36 bytes
-- * g_wdt_max = 72000
cmp_watchdog : gc_fsm_watchdog
generic map
(
g_wdt_max => 72000
g_wdt_max => g_fsm_wdt
)
port map
(
......
......@@ -903,6 +903,12 @@ package wishbone_pkg is
-- I2C to Wishbone bridge, following protocol defined with ELMA
-----------------------------------------------------------------------------
component wb_i2c_bridge is
generic
(
-- FSM watchdog timeout, see Appendix A in the component documentation for
-- an example of setting this generic
g_fsm_wdt : positive
);
port
(
-- Clock, reset
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment