signal parse_feedback : std_logic_vector(31 downto 0) := (others=>'0');
-signal registers_to_read : std_logic_vector(31 downto 0);
-signal pages_to_read : std_logic_vector(31 downto 0);
+signal registers_to_read : std_logic_vector(15 downto 0);
+signal pages_to_read : std_logic_vector(15 downto 0);
signal current_sc_addr : std_logic_vector(15 downto 0);
signal current_sc_value : std_logic_vector(31 downto 0);
signal sc_ack_timeout : integer range 0 to 31;
-signal sc_write_errors : std_logic_vector(31 downto 0) := (others =>'0');
+signal sc_write_errors : std_logic_vector(15 downto 0) := (others =>'0');
parse_state <= WAIT4RAM;
when STORE_NO_REGISTERS =>
- registers_to_read <= pop_page_data_word;
+ registers_to_read <= pop_page_data_word(15 downto 0);
parse_state <= GET_NO_PAGES;
when GET_NO_PAGES =>
parse_state <= WAIT4RAM;
when STORE_NO_PAGES =>
- pages_to_read <= pop_page_data_word;
+ pages_to_read <= pop_page_data_word(15 downto 0);
parse_state <= READ_NEXT_PAGE;
if( BUS_RX.read = '1') then -- got a read command
BUS_TX.ack <= '1';
- BUS_TX.data(15 downto 0) <= (others => '0');
+ BUS_TX.data(31 downto 0) <= (others => '0');
case BUS_RX.addr(7 downto 0) is
when ADDR_TAKE_SPI =>
BUS_TX.data(0) <= take_spi;
when ADDR_FEEDBACK =>
BUS_TX.data <= parse_feedback;
when ADDR_SC_WRITE_ERRORS =>
- BUS_TX.data <= sc_write_errors;
+ BUS_TX.data(15 downto 0) <= sc_write_errors;
-- DEFAULT --
when others =>
BUS_TX.ack <= '0';
signal debug_rx, debug_tx : std_logic;
signal debug_status : std_logic_vector(31 downto 0);
signal additional_reg_i : std_logic_vector(31 downto 0) := x"00000000";
-signal control_reg_i : std_logic_vector(15 downto 0);
-signal dtrout : std_logic_vector(7 downto 0) := x"00"; --temperature in ECP5
+signal control_reg_i : std_logic_vector(15 downto 0) := x"0000";
+ alias CONF_spi_disable : std_logic is control_reg_i(14);
+ alias CONF_reboot_on_reset : std_logic is control_reg_i(15);
+signal dtrout : std_logic_vector(7 downto 0) := x"00"; --temperature in ECP5
+signal sed_reload_i : std_logic := '0';
attribute syn_black_box: boolean ;
component dtr
BUS_RX => busflash_rx,
BUS_TX => busflash_tx,
- DO_REBOOT_IN => REBOOT_IN,
- REBOOT_ON_RESET => control_reg_i(15),
+ DO_REBOOT_IN => REBOOT_IN or sed_reload_i,
+ REBOOT_ON_RESET => CONF_reboot_on_reset,
PROGRAMN => PROGRAMN,
PREPARE_FOR_RELOAD => PREPARE_FOR_RELOAD,
);
BUS_MASTER_ACTIVE <= flashset_active or debug_active;
- FLASH_CS <= flash_cs_i when flashset_active = '0' else flash_cs_s;
- FLASH_CLK <= flash_clk_i when flashset_active = '0' else flash_clk_s;
- FLASH_OUT <= flash_out_i when flashset_active = '0' else flash_out_s;
+ -- FLASH_CS <= 'Z' when CONF_spi_disable = '1' else flash_cs_i when flashset_active = '0' else flash_cs_s;
+ -- FLASH_CLK <= 'Z' when CONF_spi_disable = '1' else flash_clk_i when flashset_active = '0' else flash_clk_s;
+ -- FLASH_OUT <= 'Z' when CONF_spi_disable = '1' else flash_out_i when flashset_active = '0' else flash_out_s;
+
+ FLASH_CS <= flash_cs_s when flashset_active = '1' else flash_cs_i;-- when CONF_spi_disable = '0' else 'Z';
+ FLASH_CLK <= flash_clk_s when flashset_active = '1' else flash_clk_i when CONF_spi_disable = '0' else 'Z';
+ FLASH_OUT <= flash_out_s when flashset_active = '1' else flash_out_i; -- when CONF_spi_disable = '0' else 'Z';
+
bus_flash_tx_in <= BUS_MASTER_IN;
bus_debug_tx_in <= BUS_MASTER_IN;
---------------------------------------------------------------------------
-- SED Detection
---------------------------------------------------------------------------
-gen_sed : if FPGA_TYPE = 3 generate
+-- gen_sed : if FPGA_TYPE = 3 generate
THE_SED : entity work.sedcheck
port map(
CLK => CLK,
ERROR_OUT => SED_ERROR_OUT,
+ RELOAD_OUT => sed_reload_i,
BUS_RX => bussed_rx,
BUS_TX => bussed_tx,
DEBUG => open
);
-else generate
- bussed_tx.unknown <= bussed_rx.write or bussed_rx.read;
- bussed_tx.ack <= '0'; bussed_tx.nack <= '0';
- bussed_tx.data <= (others => '0');
- SED_ERROR_OUT <= '0';
-end generate;
+-- else generate
+-- bussed_tx.unknown <= bussed_rx.write or bussed_rx.read;
+-- bussed_tx.ack <= '0'; bussed_tx.nack <= '0';
+-- bussed_tx.data <= (others => '0');
+-- SED_ERROR_OUT <= '0';
+-- end generate;
---------------------------------------------------------------------------