use work.config.all;
entity trb3sc_tools is
+ generic (
+ HEADER_PAGE_ADDR : std_logic_vector(15 downto 0) := x"7000"
+ );
port(
CLK : in std_logic;
RESET : in std_logic;
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);
+signal control_reg_i : std_logic_vector(15 downto 0);
begin
PORT_ADDRESSES => (0 => x"0000", 1 => x"0400", 2 => x"0480", 3 => x"0500", 4 => x"0600",
5 => x"0180", 6 => x"0f00", 7 => x"0f80", 8 => x"0580", others => x"0000"),
PORT_ADDR_MASK => (0 => 9, 1 => 5, 2 => 5, 3 => 2, 4 => 2,
- 5 => 4, 6 => 7, 7 => 7, 8 => 0, others => 0),
+ 5 => 4, 6 => 7, 7 => 7, 8 => 1, others => 0),
PORT_MASK_ENABLE => 1
)
port map(
BUS_TX => busflash_tx,
DO_REBOOT_IN => REBOOT_IN,
+ REBOOT_ON_RESET => control_reg_i(15),
PROGRAMN => PROGRAMN,
SPI_CS_OUT => flash_cs_i,
-- Load Settings from Flash
---------------------------------------------------------------------------
THE_FLASH_REGS : entity work.load_settings
+ generic map(
+ HEADER_PAGE_ADDR => HEADER_PAGE_ADDR
+ )
port map(
CLK => CLK,
RST => RESET,
busctrl_tx.unknown <= '0';
if busctrl_rx.read = '1' then
- busctrl_tx.data(additional_reg_i'left downto 0) <= additional_reg_i;
+ if busctrl_rx.addr(0) = '0' then
+ busctrl_tx.data(additional_reg_i'left downto 0) <= additional_reg_i;
+ else
+ busctrl_tx.data(control_reg_i'left downto 0) <= control_reg_i;
+ end if;
busctrl_tx.ack <= '1';
elsif busctrl_rx.write = '1' then
- additional_reg_i <= busctrl_rx.data(additional_reg_i'left downto 0);
+ if busctrl_rx.addr(0) = '0' then
+ additional_reg_i <= busctrl_rx.data(additional_reg_i'left downto 0);
+ else
+ control_reg_i <= busctrl_rx.data(control_reg_i'left downto 0);
+ end if;
busctrl_tx.ack <= '1';
end if;
end process;