Line 1... |
Line 1... |
-- #################################################################################################
|
-- #################################################################################################
|
-- # << NEORV32 - Bus Keeper (BUSKEEPER) >> #
|
-- # << NEORV32 - Bus Keeper (BUSKEEPER) >> #
|
-- # ********************************************************************************************* #
|
-- # ********************************************************************************************* #
|
-- # This unit monitors the processor-internal bus. If the accesses INTERNAL (IMEM if enabled, #
|
-- # This unit monitors the processor-internal bus. If the accessed INTERNAL (IMEM if enabled, #
|
-- # DMEM if enabled, BOOTROM + IO region) module does not respond within the defined number of #
|
-- # DMEM if enabled, BOOTROM + IO region) module does not respond within the defined number of #
|
-- # cycles (VHDL package: max_proc_int_response_time_c) it asserts the error signal to inform the #
|
-- # cycles (VHDL package: max_proc_int_response_time_c) the BUS KEEPER asserts the error signal #
|
-- # CPU / bus driver. This timeout does not track accesses via the processor-external bus #
|
-- # to inform the CPU / bus driver. #
|
-- # interface! #
|
-- # #
|
|
-- # WARNING: The bus keeper timeout does not track accesses via the processor-external bus #
|
|
-- # interface! If the timeout-function of the Wishbone interface is not used, the CPU #
|
|
-- # might be permanently stalled by an an unacknowledged transfer! If the external bus #
|
|
-- # interface is disabled, ALL accesses by the CPU are internal. #
|
-- # ********************************************************************************************* #
|
-- # ********************************************************************************************* #
|
-- # BSD 3-Clause License #
|
-- # BSD 3-Clause License #
|
-- # #
|
-- # #
|
-- # Copyright (c) 2021, Stephan Nolting. All rights reserved. #
|
-- # Copyright (c) 2021, Stephan Nolting. All rights reserved. #
|
-- # #
|
-- # #
|
Line 45... |
Line 49... |
library neorv32;
|
library neorv32;
|
use neorv32.neorv32_package.all;
|
use neorv32.neorv32_package.all;
|
|
|
entity neorv32_bus_keeper is
|
entity neorv32_bus_keeper is
|
generic (
|
generic (
|
|
-- External memory interface --
|
|
MEM_EXT_EN : boolean := false; -- implement external memory bus interface?
|
-- Internal instruction memory --
|
-- Internal instruction memory --
|
MEM_INT_IMEM_EN : boolean := true; -- implement processor-internal instruction memory
|
MEM_INT_IMEM_EN : boolean := true; -- implement processor-internal instruction memory
|
MEM_INT_IMEM_SIZE : natural := 8*1024; -- size of processor-internal instruction memory in bytes
|
MEM_INT_IMEM_SIZE : natural := 8*1024; -- size of processor-internal instruction memory in bytes
|
-- Internal data memory --
|
-- Internal data memory --
|
MEM_INT_DMEM_EN : boolean := true; -- implement processor-internal data memory
|
MEM_INT_DMEM_EN : boolean := true; -- implement processor-internal data memory
|
Line 115... |
Line 121... |
elsif rising_edge(clk_i) then
|
elsif rising_edge(clk_i) then
|
|
|
-- pending access? --
|
-- pending access? --
|
control.bus_err <= '0';
|
control.bus_err <= '0';
|
if (control.pending = '0') then -- idle
|
if (control.pending = '0') then -- idle
|
if ((rden_i or wren_i) = '1') and (access_check.valid = '1') then
|
if ((rden_i or wren_i) = '1') and ((access_check.valid = '1') or (MEM_EXT_EN = false)) then -- valid INTERNAL access
|
control.pending <= '1';
|
control.pending <= '1';
|
end if;
|
end if;
|
else -- pending
|
else -- pending
|
if (ack_i = '1') or (err_i = '1') then -- termination by bus system
|
if (ack_i = '1') or (err_i = '1') then -- termination by bus system
|
control.pending <= '0';
|
control.pending <= '0';
|