Commit dbf0b46b authored by Tomasz Wlostowski's avatar Tomasz Wlostowski

xvme64x_core: support for static address DIP switch

parent 6abee52c
......@@ -66,21 +66,21 @@ architecture rtl of vme_funct_match is
signal s_function : std_logic_vector(ader_i'range);
signal s_ader_am_valid : std_logic_vector(ader_i'range);
begin
------------------------------------------------------------------------------
-- Address and AM comparators
------------------------------------------------------------------------------
gen_match_loop : for i in ader_i'range generate
-- True in case of match
s_function(i) <=
'1' when (((addr_i(t_ADEM_M) and g_DECODER(i).adem(t_ADEM_M))
------------------------------------------------------------------------------
-- Address and AM comparators
------------------------------------------------------------------------------
gen_match_loop : for i in ader_i'range generate
-- True in case of match
s_function(i) <=
'1' when (((addr_i(t_ADEM_M) and g_DECODER(i).adem(t_ADEM_M))
= ader_i(i)(t_ADEM_M))
and ((am_i = ader_i(i)(t_ADER_AM))
or not g_DECODE_AM))
else '0';
-- True if the AM is enabled by AMCAP
s_ader_am_valid(i) <=
g_DECODER(i).amcap(to_integer(unsigned(am_i)));
end generate;
-- True if the AM is enabled by AMCAP
s_ader_am_valid(i) <=
g_DECODER(i).amcap(to_integer(unsigned(am_i)));
end generate;
------------------------------------------------------------------------------
-- Function priority encoder
......
......@@ -107,6 +107,9 @@ entity xvme64x_core is
g_BEG_SN : std_logic_vector(23 downto 0) := x"000000";
g_END_SN : std_logic_vector(23 downto 0) := x"000000";
g_USE_BASE_ADDR_SWITCH : boolean := FALSE;
g_BASE_ADDR_BITS : integer := 6;
-- Function decoder parameters.
g_DECODER : t_vme64x_decoder_arr := c_vme64x_decoders_default);
port (
......@@ -134,6 +137,9 @@ entity xvme64x_core is
-- pulse to the IRQ Generator.
irq_ack_o : out std_logic;
-- Base address switch(es)
base_addr_switch_i : in std_logic_vector(g_BASE_ADDR_BITS-1 downto 0) := (others => '0');
-- User CSR
-- The following signals are used when g_USER_CSR_EXT = true
-- otherwise they are connected to the internal user CSR.
......@@ -181,7 +187,7 @@ architecture rtl of xvme64x_core is
-- Compute the ADER for each function if CR/CSR is not used. For example:
-- ADEM=FF000000, GA=05 => ADER=05000000
-- ADEM=FFE00000, GA=05 => ADER=00A00000
function compute_static_ader (ga : std_logic_vector(4 downto 0)) return t_ader_array is
function compute_static_ader (ga : std_logic_vector) return t_ader_array is
variable a : t_ader_array(0 to c_last_ader) := (others => x"0000_0000");
begin
for i in a'range loop
......@@ -396,7 +402,7 @@ begin
port map (
clk_i => clk_i,
rst_n_i => s_reset_n,
addr_i => s_addr_decoder_i,
addr_o => s_addr_decoder_o,
decode_start_i => s_decode_start,
......@@ -519,7 +525,10 @@ begin
s_module_enable <= '1';
s_module_reset <= '0';
s_bar <= s_ga;
s_ader <= compute_static_ader(s_ga);
s_ader <= compute_static_ader(s_ga) when not g_USE_BASE_ADDR_SWITCH
else compute_static_ader(base_addr_switch_i);
end generate;
user_csr_addr_o <= s_user_csr_addr;
......
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