SMB-354 fix for problem with address decoding in som_ctrl block

This commit is contained in:
Christos Spirotis 2021-06-02 15:35:09 +01:00
commit c0f49acd7a

View file

@ -66,6 +66,7 @@ architecture rtl of som_ctrl_1 is
constant CSR_IP_ID : std_logic_vector(31 downto 0) := x"0000FF0F";
constant CSR_IP_VER : std_logic_vector(31 downto 0) := x"00000101";
signal ctrl_write, ctrl_read : std_logic;
signal swim_write, swim_read, swim_read_d : std_logic;
signal avs_read_d : std_logic;
signal mon_pt_pin_rewire : std_logic;
@ -146,6 +147,9 @@ begin
swim_write <= '1' when avs_write = '1' and avs_address(5) = '1' else '0';
swim_read <= '1' when avs_read = '1' and avs_address(5) = '1' else '0';
ctrl_write <= '1' when avs_write = '1' and avs_address(5) = '0' else '0';
ctrl_read <= '1' when avs_read = '1' and avs_address(5) = '0' else '0';
avs_addr <= avs_address(3 downto 0);
pCTRL_STATUS : process(reset_n, clk)
@ -175,7 +179,7 @@ begin
som_led <= (others => '0');
elsif(clk = '1' and clk'event) then
-- CTRL registers
if(avs_write = '1') then
if(ctrl_write = '1') then
case avs_addr is
when CSR_HOST_PWR_ADDR =>
host_pwr_en <= avs_writedata(0);
@ -203,7 +207,7 @@ begin
end if;
-- Read Ctrl & Status registers
if(avs_read = '1') then
if(ctrl_read = '1') then
case avs_addr is
when CSR_IP_ID_ADDR =>
avs_readdata_i <= CSR_IP_ID;