Commit 4b361036 authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

axi_gpio_expander: bugfix to allow using a subset of bank0

parent 9af7902f
......@@ -139,8 +139,10 @@ architecture behav of axi_gpio_expander is
variable tmp : std_logic_vector(g_num-1 downto 0);
begin
tmp := orig;
if (bank = 0) then
tmp(31 downto 0) := rdata;
if (bank = 0 and g_num >= c_GPIOPS_BANK0) then
tmp(c_GPIOPS_BANK0-1 downto 0) := rdata;
elsif (bank = 0 and g_num < c_GPIOPS_BANK0) then
tmp := rdata(g_num-1 downto 0);
else
tmp(g_num-1 downto c_GPIOPS_BANK0) := rdata(g_num-c_GPIOPS_BANK0-1 downto 0);
end if;
......
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