complete flexbus_register component (nearly)

This commit is contained in:
Markus Fröschle
2016-07-29 13:27:25 +00:00
parent 7084975767
commit 3b0d2a7f89
6 changed files with 892 additions and 852 deletions

View File

@@ -25,7 +25,7 @@ entity flexbus_register is
fb_wr_n : in std_logic;
fb_oe_n : in std_logic;
fb_size : in std_logic_vector(1 downto 0);
register_ta : out std_logic
);
end entity flexbus_register;
@@ -71,10 +71,45 @@ begin
fbcs_match <= '1' when not(fb_cs_n(match_fbcs)) = '1' else '0';
address_match <= f_addr_cmp_mask(fb_addr, match_address, num_ignore);
p_register_access : process(all)
begin
if rising_edge(clk) then
end if;
end process p_register_access;
cs <= '1' when fbcs_match and address_match else '0';
p_copy_data_in : process (all)
begin
reg_value <= reg_value;
if cs and not fb_wr_n then
if reg_width > 24 and fb_b(0) = '1' then -- HH byte
reg_value(reg_width - 1 downto 24) <= fb_ad_in(work.firebee_utils_pkg.min(31, reg_width - 1) downto 24);
end if;
if reg_width > 16 and fb_b(1) = '1' then -- HL byte
reg_value(work.firebee_utils_pkg.min(23, reg_width - 1) downto 16) <= fb_ad_in(work.firebee_utils_pkg.min(23, reg_width - 1) downto 16);
end if;
if reg_width > 8 and fb_b(2) = '1' then -- LH byte
reg_value(work.firebee_utils_pkg.min(15, reg_width - 1) downto 8) <= fb_ad_in(work.firebee_utils_pkg.min(15, reg_width - 1) downto 8);
end if;
if reg_width > 0 and fb_b(3) = '1' then -- LL byte
reg_value(work.firebee_utils_pkg.min(7, reg_width - 1) downto 0) <= fb_ad_in(work.firebee_utils_pkg.min(7, reg_width - 1) downto 0);
end if;
end if;
end process p_copy_data_in;
p_copy_data_out : process (all)
begin
fb_ad_out <= (others => 'Z');
if cs and not fb_oe_n then
if reg_width > 24 and fb_b(0) = '1' then -- HH byte
fb_ad_out(work.firebee_utils_pkg.min(31, reg_width - 1) downto 24) <= reg_value(work.firebee_utils_pkg.min(31, reg_width - 1) downto 24);
end if;
if reg_width > 16 and fb_b(1) = '1' then -- HL byte
fb_ad_out(work.firebee_utils_pkg.min(23, reg_width - 1) downto 16) <= reg_value(work.firebee_utils_pkg.min(23, reg_width - 1) downto 16);
end if;
if reg_width > 8 and fb_b(2) = '1' then -- LH byte
fb_ad_out(work.firebee_utils_pkg.min(15, reg_width - 1) downto 8) <= reg_value(work.firebee_utils_pkg.min(15, reg_width - 1) downto 8);
end if;
if reg_width > 0 and fb_b(3) = '1' then -- LL byte
fb_ad_out(work.firebee_utils_pkg.min(7, reg_width - 1) downto 0) <= reg_value(work.firebee_utils_pkg.min(7, reg_width - 1) downto 0);
end if;
end if;
end process p_copy_data_out;
register_ta <= cs;
end architecture rtl;