Line 17... |
Line 17... |
-- # * data buffer #
|
-- # * data buffer #
|
-- # * control and status register #
|
-- # * control and status register #
|
-- # ********************************************************************************************* #
|
-- # ********************************************************************************************* #
|
-- # BSD 3-Clause License #
|
-- # BSD 3-Clause License #
|
-- # #
|
-- # #
|
-- # Copyright (c) 2021, Stephan Nolting. All rights reserved. #
|
-- # Copyright (c) 2022, Stephan Nolting. All rights reserved. #
|
-- # #
|
-- # #
|
-- # Redistribution and use in source and binary forms, with or without modification, are #
|
-- # Redistribution and use in source and binary forms, with or without modification, are #
|
-- # permitted provided that the following conditions are met: #
|
-- # permitted provided that the following conditions are met: #
|
-- # #
|
-- # #
|
-- # 1. Redistributions of source code must retain the above copyright notice, this list of #
|
-- # 1. Redistributions of source code must retain the above copyright notice, this list of #
|
Line 70... |
Line 70... |
dmi_resp_valid_o : out std_ulogic; -- response valid when set
|
dmi_resp_valid_o : out std_ulogic; -- response valid when set
|
dmi_resp_ready_i : in std_ulogic; -- ready to receive respond
|
dmi_resp_ready_i : in std_ulogic; -- ready to receive respond
|
dmi_resp_data_o : out std_ulogic_vector(31 downto 0);
|
dmi_resp_data_o : out std_ulogic_vector(31 downto 0);
|
dmi_resp_err_o : out std_ulogic; -- 0=ok, 1=error
|
dmi_resp_err_o : out std_ulogic; -- 0=ok, 1=error
|
-- CPU bus access --
|
-- CPU bus access --
|
|
cpu_debug_i : in std_ulogic; -- CPU is in debug mode
|
cpu_addr_i : in std_ulogic_vector(31 downto 0); -- address
|
cpu_addr_i : in std_ulogic_vector(31 downto 0); -- address
|
cpu_rden_i : in std_ulogic; -- read enable
|
cpu_rden_i : in std_ulogic; -- read enable
|
cpu_wren_i : in std_ulogic; -- write enable
|
cpu_wren_i : in std_ulogic; -- write enable
|
cpu_data_i : in std_ulogic_vector(31 downto 0); -- data in
|
cpu_data_i : in std_ulogic_vector(31 downto 0); -- data in
|
cpu_data_o : out std_ulogic_vector(31 downto 0); -- data out
|
cpu_data_o : out std_ulogic_vector(31 downto 0); -- data out
|
Line 666... |
Line 667... |
|
|
-- Access Control ------------------------------------------------------------------------
|
-- Access Control ------------------------------------------------------------------------
|
-- -------------------------------------------------------------------------------------------
|
-- -------------------------------------------------------------------------------------------
|
acc_en <= '1' when (cpu_addr_i(hi_abb_c downto lo_abb_c) = dm_base_c(hi_abb_c downto lo_abb_c)) else '0';
|
acc_en <= '1' when (cpu_addr_i(hi_abb_c downto lo_abb_c) = dm_base_c(hi_abb_c downto lo_abb_c)) else '0';
|
maddr <= cpu_addr_i(lo_abb_c-1 downto lo_abb_c-2); -- (sub-)module select address
|
maddr <= cpu_addr_i(lo_abb_c-1 downto lo_abb_c-2); -- (sub-)module select address
|
rden <= acc_en and cpu_rden_i;
|
rden <= acc_en and cpu_debug_i and cpu_rden_i; -- allow access only when in debug mode
|
wren <= acc_en and cpu_wren_i;
|
wren <= acc_en and cpu_debug_i and cpu_wren_i; -- allow access only when in debug mode
|
|
|
|
|
-- Write Access ---------------------------------------------------------------------------
|
-- Write Access ---------------------------------------------------------------------------
|
-- -------------------------------------------------------------------------------------------
|
-- -------------------------------------------------------------------------------------------
|
write_access: process(clk_i)
|
write_access: process(clk_i)
|