Line 1... |
Line 1... |
-- #################################################################################################
|
-- #################################################################################################
|
-- # << NEORV32 - External Bus Interface (WISHBONE) >> #
|
-- # << NEORV32 - External Bus Interface (WISHBONE) >> #
|
-- # ********************************************************************************************* #
|
-- # ********************************************************************************************* #
|
-- # The interface provides registers for all outgoing signals. If the host cancels a running #
|
-- # The interface provides registers for all outgoing and for all incoming signals. If the host #
|
-- # transfer, the Wishbone arbiter still waits some time for the bus system to ACK the transfer #
|
-- # cancels an activetransfer, the Wishbone arbiter still waits some time for the bus system to #
|
-- # before the arbiter forces termination. #
|
-- # ACK/ERR the transfer before the arbiter forces termination. #
|
-- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
|
-- # #
|
-- # Even when all processor-internal memories and IO devices are disabled, the EXTERNAL address #
|
-- # Even when all processor-internal memories and IO devices are disabled, the EXTERNAL address #
|
-- # space ENDS at address 0xffff0000 (begin of internal BOOTROM address space). #
|
-- # space ENDS at address 0xffff0000 (begin of internal BOOTROM address space). #
|
-- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
|
-- # #
|
-- # All bus accesses from the CPU, which do not target the internal IO region / the internal #
|
-- # All bus accesses from the CPU, which do not target the internal IO region / the internal #
|
-- # bootlloader / the internal instruction or data memories (if implemented), are delegated via #
|
-- # bootlloader / the internal instruction or data memories (if implemented), are delegated via #
|
-- # this Wishbone gateway to the external bus interface. Accessed peripherals can have a response #
|
-- # this Wishbone gateway to the external bus interface. Accessed peripherals can have a response #
|
-- # latency of up to neorv32_package.vhd:bus_timeout_c - 2 cycles. #
|
-- # latency of up to BUS_TIMEOUT - 2 cycles. #
|
-- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
|
-- # #
|
-- # This interface supports classic/standard Wishbone transactions (WB_PIPELINED_MODE = false) #
|
-- # This interface supports classic/standard Wishbone transactions (WB_PIPELINED_MODE = false) #
|
-- # and also pipelined transactions (WB_PIPELINED_MODE = true). #
|
-- # and also pipelined transactions (WB_PIPELINED_MODE = true). #
|
-- # ********************************************************************************************* #
|
-- # ********************************************************************************************* #
|
-- # BSD 3-Clause License #
|
-- # BSD 3-Clause License #
|
-- # #
|
-- # #
|
Line 60... |
Line 60... |
-- Internal instruction memory --
|
-- Internal instruction memory --
|
MEM_INT_IMEM_USE : boolean := true; -- implement processor-internal instruction memory
|
MEM_INT_IMEM_USE : 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_USE : boolean := true; -- implement processor-internal data memory
|
MEM_INT_DMEM_USE : boolean := true; -- implement processor-internal data memory
|
MEM_INT_DMEM_SIZE : natural := 4*1024 -- size of processor-internal data memory in bytes
|
MEM_INT_DMEM_SIZE : natural := 4*1024; -- size of processor-internal data memory in bytes
|
|
-- Bus Timeout --
|
|
BUS_TIMEOUT : natural := 63 -- cycles after an UNACKNOWLEDGED bus access triggers a bus fault exception
|
);
|
);
|
port (
|
port (
|
-- global control --
|
-- global control --
|
clk_i : in std_ulogic; -- global clock line
|
clk_i : in std_ulogic; -- global clock line
|
rstn_i : in std_ulogic; -- global reset line, low-active
|
rstn_i : in std_ulogic; -- global reset line, low-active
|
Line 97... |
Line 99... |
end neorv32_wishbone;
|
end neorv32_wishbone;
|
|
|
architecture neorv32_wishbone_rtl of neorv32_wishbone is
|
architecture neorv32_wishbone_rtl of neorv32_wishbone is
|
|
|
-- constants --
|
-- constants --
|
constant xbus_timeout_c : natural := bus_timeout_c/4;
|
constant xbus_timeout_c : natural := BUS_TIMEOUT/4;
|
|
|
-- access control --
|
-- access control --
|
signal int_imem_acc : std_ulogic;
|
signal int_imem_acc : std_ulogic;
|
signal int_dmem_acc : std_ulogic;
|
signal int_dmem_acc : std_ulogic;
|
signal int_boot_acc : std_ulogic;
|
signal int_boot_acc : std_ulogic;
|
Line 132... |
Line 134... |
begin
|
begin
|
|
|
-- Sanity Checks --------------------------------------------------------------------------
|
-- Sanity Checks --------------------------------------------------------------------------
|
-- -------------------------------------------------------------------------------------------
|
-- -------------------------------------------------------------------------------------------
|
-- max bus timeout latency lower than recommended --
|
-- max bus timeout latency lower than recommended --
|
assert not (bus_timeout_c <= 32) report "NEORV32 PROCESSOR CONFIG ERROR: Bus timeout (neorv32_package.vhd:bus_timeout_c) should be >32 when using external bus interface." severity error;
|
assert not (BUS_TIMEOUT <= 32) report "NEORV32 PROCESSOR CONFIG WARNING: Bus timeout should be >32 when using external bus interface." severity warning;
|
-- external memory iterface protocol + max timeout latency notifier (warning) --
|
-- external memory iterface protocol + max timeout latency notifier (warning) --
|
assert not (wb_pipe_mode_c = false) report "NEORV32 PROCESSOR CONFIG NOTE: Implementing external memory interface using STANDARD Wishbone protocol with max latency = " & integer'image(bus_timeout_c) & " cycles." severity note;
|
assert not (wb_pipe_mode_c = false) report "NEORV32 PROCESSOR CONFIG NOTE: Implementing external memory interface using STANDARD Wishbone protocol." severity note;
|
assert not (wb_pipe_mode_c = true) report "NEORV32 PROCESSOR CONFIG WARNING! Implementing external memory interface using PIEPLINED Wishbone protocol with max latency = " & integer'image(bus_timeout_c) & " cycles." severity warning;
|
assert not (wb_pipe_mode_c = true) report "NEORV32 PROCESSOR CONFIG NOTE! Implementing external memory interface using PIEPLINED Wishbone protocol." severity note;
|
-- endianness --
|
-- endianness --
|
assert not (xbus_big_endian_c = false) report "NEORV32 PROCESSOR CONFIG NOTE: Using LITTLE-ENDIAN byte order for external memory interface." severity note;
|
assert not (xbus_big_endian_c = false) report "NEORV32 PROCESSOR CONFIG NOTE: Using LITTLE-ENDIAN byte order for external memory interface." severity note;
|
assert not (xbus_big_endian_c = true) report "NEORV32 PROCESSOR CONFIG NOTE: Using BIG-ENDIAN byte order for external memory interface." severity note;
|
assert not (xbus_big_endian_c = true) report "NEORV32 PROCESSOR CONFIG NOTE: Using BIG-ENDIAN byte order for external memory interface." severity note;
|
|
|
|
|