From f908ad514e1c103c7bde57adcff1af62ba0497f4 Mon Sep 17 00:00:00 2001 From: Jan Michel Date: Tue, 28 Jun 2022 16:43:29 +0200 Subject: [PATCH] add option to reboot-on-reset to reload handler --- special/fpga_reboot.vhd | 5 +++-- special/spi_flash_and_fpga_reload_record.vhd | 8 +++++--- trb_net_components.vhd | 1 + 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/special/fpga_reboot.vhd b/special/fpga_reboot.vhd index 9be0432..a1e22ec 100644 --- a/special/fpga_reboot.vhd +++ b/special/fpga_reboot.vhd @@ -8,6 +8,7 @@ entity fpga_reboot is CLK : in std_logic; RESET : in std_logic; DO_REBOOT : in std_logic; + REBOOT_ON_RESET : in std_logic := '0'; PROGRAMN : out std_logic := '1' ); end entity; @@ -24,7 +25,7 @@ PROC_REBOOT : process begin wait until rising_edge(CLK); if RESET = '1' then - delayed_restart_fpga <= '0'; + delayed_restart_fpga <= REBOOT_ON_RESET; restart_fpga_counter <= x"000"; else delayed_restart_fpga <= '0'; @@ -41,4 +42,4 @@ PROC_REBOOT : process PROGRAMN <= not delayed_restart_fpga; -end architecture; \ No newline at end of file +end architecture; diff --git a/special/spi_flash_and_fpga_reload_record.vhd b/special/spi_flash_and_fpga_reload_record.vhd index 7243d4b..6cc586a 100644 --- a/special/spi_flash_and_fpga_reload_record.vhd +++ b/special/spi_flash_and_fpga_reload_record.vhd @@ -16,8 +16,9 @@ entity spi_flash_and_fpga_reload_record is BUS_TX : out CTRLBUS_TX; BUS_RX : in CTRLBUS_RX; - DO_REBOOT_IN : in std_logic; - PROGRAMN : out std_logic; + DO_REBOOT_IN : in std_logic; + REBOOT_ON_RESET : in std_logic := '0'; + PROGRAMN : out std_logic; SPI_CS_OUT : out std_logic; SPI_SCK_OUT : out std_logic; @@ -155,11 +156,12 @@ THE_SPI_MEMORY: spi_databus_memory --------------------------------------------------------------------------- -- Reboot FPGA --------------------------------------------------------------------------- -THE_FPGA_REBOOT : fpga_reboot +THE_FPGA_REBOOT : entity work.fpga_reboot port map( CLK => CLK_IN, RESET => RESET_IN, DO_REBOOT => DO_REBOOT_IN, + REBOOT_ON_RESET => REBOOT_ON_RESET, PROGRAMN => PROGRAMN ); diff --git a/trb_net_components.vhd b/trb_net_components.vhd index 3729cef..3fe4ecf 100644 --- a/trb_net_components.vhd +++ b/trb_net_components.vhd @@ -1348,6 +1348,7 @@ end component; CLK : in std_logic; RESET : in std_logic; DO_REBOOT : in std_logic; + REBOOT_ON_RESET : in std_logic := '0'; PROGRAMN : out std_logic ); end component; -- 2.43.0