Commit 610ec86a authored by Lucas Russo's avatar Lucas Russo

modules/dbe_wishbone/*: add heartbeat into (x)wb_perih module

Now we can select which LEDs output
we want to have a ORed heartbeat between
the GPIO modules and the heartbeat module.
parent d85f086f
......@@ -14,6 +14,12 @@ use work.trigger_pkg.all;
package dbe_wishbone_pkg is
--------------------------------------------------------------------
-- Types
--------------------------------------------------------------------
subtype t_boolean is boolean;
type t_boolean_array is array (natural range <>) of t_boolean;
--------------------------------------------------------------------
-- Components
--------------------------------------------------------------------
......@@ -1355,6 +1361,7 @@ package dbe_wishbone_pkg is
g_address_granularity : t_wishbone_address_granularity := WORD;
g_cntr_period : integer := 100000; -- 100MHz clock, ms granularity
g_num_leds : natural := 8;
g_with_led_heartbeat : t_boolean_array ; -- must match g_num_leds width
g_num_buttons : natural := 8
);
port(
......@@ -1398,6 +1405,7 @@ package dbe_wishbone_pkg is
g_address_granularity : t_wishbone_address_granularity := WORD;
g_cntr_period : integer := 100000; -- 100MHz clock, ms granularity
g_num_leds : natural := 8;
g_with_led_heartbeat : t_boolean_array ; -- must match g_num_leds width
g_num_buttons : natural := 8
);
port(
......@@ -1494,7 +1502,8 @@ package dbe_wishbone_pkg is
g_fifo_fc_size : natural := 64;
g_sim_readback : boolean := false;
g_ddr_interface_type : string := "AXIS";
g_max_burst_size : natural := 4
g_max_burst_size : natural := 4;
g_inst_id : natural := 1
);
port
(
......
......@@ -14,6 +14,7 @@ generic(
g_address_granularity : t_wishbone_address_granularity := WORD;
g_cntr_period : integer := 100000; -- 100MHz clock, ms granularity
g_num_leds : natural := 8;
g_with_led_heartbeat : t_boolean_array ; -- must match g_num_leds width
g_num_buttons : natural := 8
);
port(
......@@ -79,6 +80,9 @@ architecture rtl of wb_dbe_periph is
signal cbar_master_in : t_wishbone_master_in_array(c_slaves-1 downto 0);
signal cbar_master_out : t_wishbone_master_out_array(c_slaves-1 downto 0);
signal led_gpio_out_int : std_logic_vector(g_num_leds-1 downto 0) := (others => '0');
signal led_heartbeat_out_int : std_logic_vector(g_num_leds-1 downto 0) := (others => '0');
begin
cmp_interconnect : xwb_sdb_crossbar
......@@ -149,11 +153,35 @@ begin
--gpio_b : inout std_logic_vector(g_num_pins-1 downto 0);
gpio_out_o => led_out_o,
gpio_out_o => led_gpio_out_int,
gpio_in_i => led_in_i,
gpio_oen_o => led_oen_o
);
gen_leds_heartbeat : for i in g_num_leds-1 downto 0 generate
gen_with_heartbeat : if g_with_led_heartbeat(i) generate
-- Heartbeat module controls the Blue LED
cmp_blue_led : heartbeat
port map
(
clk_i => clk_sys_i,
rst_n_i => rst_n_i,
heartbeat_o => led_heartbeat_out_int(i)
);
end generate;
gen_without_heartbeat : if not g_with_led_heartbeat(i) generate
led_heartbeat_out_int(i) <= '0';
end generate;
end generate;
gen_leds_outputs : for i in g_num_leds-1 downto 0 generate
led_out_o(i) <= led_gpio_out_int(i) or led_heartbeat_out_int(i);
end generate;
-- Slave 2 is the Button driver
cmp_buttons : xwb_gpio_port
generic map(
......
......@@ -14,6 +14,7 @@ generic(
g_address_granularity : t_wishbone_address_granularity := WORD;
g_cntr_period : integer := 100000; -- 100MHz clock, ms granularity
g_num_leds : natural := 8;
g_with_led_heartbeat : t_boolean_array ; -- must match g_num_leds width
g_num_buttons : natural := 8
);
port(
......@@ -52,6 +53,7 @@ begin
g_address_granularity => g_address_granularity,
g_cntr_period => g_cntr_period,
g_num_leds => g_num_leds,
g_with_led_heartbeat => g_with_led_heartbeat,
g_num_buttons => g_num_buttons
)
port map(
......
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