| 1 |
2 |
zero_gravi |
-- #################################################################################################
|
| 2 |
|
|
-- # << NEORV32 - Processor Top Entity >> #
|
| 3 |
|
|
-- # ********************************************************************************************* #
|
| 4 |
18 |
zero_gravi |
-- # This is the top entity of the NEORV32 PROCESSOR. Instantiate this unit in your own project #
|
| 5 |
2 |
zero_gravi |
-- # and define all the configuration generics according to your needs. Alternatively, you can use #
|
| 6 |
18 |
zero_gravi |
-- # one of the alternative top entities provided in the "rtl/top_templates" folder. #
|
| 7 |
|
|
-- # #
|
| 8 |
|
|
-- # Check the processor's documentary for more information: docs/NEORV32.pdf #
|
| 9 |
2 |
zero_gravi |
-- # ********************************************************************************************* #
|
| 10 |
|
|
-- # BSD 3-Clause License #
|
| 11 |
|
|
-- # #
|
| 12 |
|
|
-- # Copyright (c) 2020, Stephan Nolting. All rights reserved. #
|
| 13 |
|
|
-- # #
|
| 14 |
|
|
-- # Redistribution and use in source and binary forms, with or without modification, are #
|
| 15 |
|
|
-- # permitted provided that the following conditions are met: #
|
| 16 |
|
|
-- # #
|
| 17 |
|
|
-- # 1. Redistributions of source code must retain the above copyright notice, this list of #
|
| 18 |
|
|
-- # conditions and the following disclaimer. #
|
| 19 |
|
|
-- # #
|
| 20 |
|
|
-- # 2. Redistributions in binary form must reproduce the above copyright notice, this list of #
|
| 21 |
|
|
-- # conditions and the following disclaimer in the documentation and/or other materials #
|
| 22 |
|
|
-- # provided with the distribution. #
|
| 23 |
|
|
-- # #
|
| 24 |
|
|
-- # 3. Neither the name of the copyright holder nor the names of its contributors may be used to #
|
| 25 |
|
|
-- # endorse or promote products derived from this software without specific prior written #
|
| 26 |
|
|
-- # permission. #
|
| 27 |
|
|
-- # #
|
| 28 |
|
|
-- # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS #
|
| 29 |
|
|
-- # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF #
|
| 30 |
|
|
-- # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE #
|
| 31 |
|
|
-- # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, #
|
| 32 |
|
|
-- # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE #
|
| 33 |
|
|
-- # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED #
|
| 34 |
|
|
-- # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING #
|
| 35 |
|
|
-- # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED #
|
| 36 |
|
|
-- # OF THE POSSIBILITY OF SUCH DAMAGE. #
|
| 37 |
|
|
-- # ********************************************************************************************* #
|
| 38 |
|
|
-- # The NEORV32 Processor - https://github.com/stnolting/neorv32 (c) Stephan Nolting #
|
| 39 |
|
|
-- #################################################################################################
|
| 40 |
|
|
|
| 41 |
|
|
library ieee;
|
| 42 |
|
|
use ieee.std_logic_1164.all;
|
| 43 |
|
|
use ieee.numeric_std.all;
|
| 44 |
|
|
|
| 45 |
|
|
library neorv32;
|
| 46 |
|
|
use neorv32.neorv32_package.all;
|
| 47 |
|
|
|
| 48 |
|
|
entity neorv32_top is
|
| 49 |
|
|
generic (
|
| 50 |
|
|
-- General --
|
| 51 |
12 |
zero_gravi |
CLOCK_FREQUENCY : natural := 0; -- clock frequency of clk_i in Hz
|
| 52 |
8 |
zero_gravi |
BOOTLOADER_USE : boolean := true; -- implement processor-internal bootloader?
|
| 53 |
12 |
zero_gravi |
USER_CODE : std_ulogic_vector(31 downto 0) := x"00000000"; -- custom user code
|
| 54 |
2 |
zero_gravi |
-- RISC-V CPU Extensions --
|
| 55 |
11 |
zero_gravi |
CPU_EXTENSION_RISCV_C : boolean := false; -- implement compressed extension?
|
| 56 |
8 |
zero_gravi |
CPU_EXTENSION_RISCV_E : boolean := false; -- implement embedded RF extension?
|
| 57 |
11 |
zero_gravi |
CPU_EXTENSION_RISCV_M : boolean := false; -- implement muld/div extension?
|
| 58 |
15 |
zero_gravi |
CPU_EXTENSION_RISCV_U : boolean := false; -- implement user mode extension?
|
| 59 |
8 |
zero_gravi |
CPU_EXTENSION_RISCV_Zicsr : boolean := true; -- implement CSR system?
|
| 60 |
|
|
CPU_EXTENSION_RISCV_Zifencei : boolean := true; -- implement instruction stream sync.?
|
| 61 |
19 |
zero_gravi |
-- Extension Options --
|
| 62 |
|
|
CSR_COUNTERS_USE : boolean := true; -- implement RISC-V perf. counters ([m]instret[h], [m]cycle[h], time[h])?
|
| 63 |
|
|
FAST_MUL_EN : boolean := false; -- use DSPs for M extension's multiplier
|
| 64 |
15 |
zero_gravi |
-- Physical Memory Protection (PMP) --
|
| 65 |
|
|
PMP_USE : boolean := false; -- implement PMP?
|
| 66 |
16 |
zero_gravi |
PMP_NUM_REGIONS : natural := 4; -- number of regions (max 8)
|
| 67 |
|
|
PMP_GRANULARITY : natural := 14; -- minimal region granularity (1=8B, 2=16B, 3=32B, ...) default is 64k
|
| 68 |
2 |
zero_gravi |
-- Memory configuration: Instruction memory --
|
| 69 |
8 |
zero_gravi |
MEM_ISPACE_BASE : std_ulogic_vector(31 downto 0) := x"00000000"; -- base address of instruction memory space
|
| 70 |
|
|
MEM_ISPACE_SIZE : natural := 16*1024; -- total size of instruction memory space in byte
|
| 71 |
|
|
MEM_INT_IMEM_USE : boolean := true; -- implement processor-internal instruction memory
|
| 72 |
|
|
MEM_INT_IMEM_SIZE : natural := 16*1024; -- size of processor-internal instruction memory in bytes
|
| 73 |
|
|
MEM_INT_IMEM_ROM : boolean := false; -- implement processor-internal instruction memory as ROM
|
| 74 |
2 |
zero_gravi |
-- Memory configuration: Data memory --
|
| 75 |
8 |
zero_gravi |
MEM_DSPACE_BASE : std_ulogic_vector(31 downto 0) := x"80000000"; -- base address of data memory space
|
| 76 |
|
|
MEM_DSPACE_SIZE : natural := 8*1024; -- total size of data memory space in byte
|
| 77 |
|
|
MEM_INT_DMEM_USE : boolean := true; -- implement processor-internal data memory
|
| 78 |
|
|
MEM_INT_DMEM_SIZE : natural := 8*1024; -- size of processor-internal data memory in bytes
|
| 79 |
2 |
zero_gravi |
-- Memory configuration: External memory interface --
|
| 80 |
8 |
zero_gravi |
MEM_EXT_USE : boolean := false; -- implement external memory bus interface?
|
| 81 |
|
|
MEM_EXT_REG_STAGES : natural := 2; -- number of interface register stages (0,1,2)
|
| 82 |
|
|
MEM_EXT_TIMEOUT : natural := 15; -- cycles after which a valid bus access will timeout
|
| 83 |
2 |
zero_gravi |
-- Processor peripherals --
|
| 84 |
8 |
zero_gravi |
IO_GPIO_USE : boolean := true; -- implement general purpose input/output port unit (GPIO)?
|
| 85 |
|
|
IO_MTIME_USE : boolean := true; -- implement machine system timer (MTIME)?
|
| 86 |
|
|
IO_UART_USE : boolean := true; -- implement universal asynchronous receiver/transmitter (UART)?
|
| 87 |
|
|
IO_SPI_USE : boolean := true; -- implement serial peripheral interface (SPI)?
|
| 88 |
|
|
IO_TWI_USE : boolean := true; -- implement two-wire interface (TWI)?
|
| 89 |
|
|
IO_PWM_USE : boolean := true; -- implement pulse-width modulation unit (PWM)?
|
| 90 |
|
|
IO_WDT_USE : boolean := true; -- implement watch dog timer (WDT)?
|
| 91 |
|
|
IO_TRNG_USE : boolean := false; -- implement true random number generator (TRNG)?
|
| 92 |
|
|
IO_DEVNULL_USE : boolean := true -- implement dummy device (DEVNULL)?
|
| 93 |
2 |
zero_gravi |
);
|
| 94 |
|
|
port (
|
| 95 |
|
|
-- Global control --
|
| 96 |
|
|
clk_i : in std_ulogic := '0'; -- global clock, rising edge
|
| 97 |
|
|
rstn_i : in std_ulogic := '0'; -- global reset, low-active, async
|
| 98 |
|
|
-- Wishbone bus interface (available if MEM_EXT_USE = true) --
|
| 99 |
|
|
wb_adr_o : out std_ulogic_vector(31 downto 0); -- address
|
| 100 |
|
|
wb_dat_i : in std_ulogic_vector(31 downto 0) := (others => '0'); -- read data
|
| 101 |
|
|
wb_dat_o : out std_ulogic_vector(31 downto 0); -- write data
|
| 102 |
|
|
wb_we_o : out std_ulogic; -- read/write
|
| 103 |
|
|
wb_sel_o : out std_ulogic_vector(03 downto 0); -- byte enable
|
| 104 |
|
|
wb_stb_o : out std_ulogic; -- strobe
|
| 105 |
|
|
wb_cyc_o : out std_ulogic; -- valid cycle
|
| 106 |
|
|
wb_ack_i : in std_ulogic := '0'; -- transfer acknowledge
|
| 107 |
|
|
wb_err_i : in std_ulogic := '0'; -- transfer error
|
| 108 |
12 |
zero_gravi |
-- Advanced memory control signals (available if MEM_EXT_USE = true) --
|
| 109 |
|
|
fence_o : out std_ulogic; -- indicates an executed FENCE operation
|
| 110 |
|
|
fencei_o : out std_ulogic; -- indicates an executed FENCEI operation
|
| 111 |
2 |
zero_gravi |
-- GPIO (available if IO_GPIO_USE = true) --
|
| 112 |
22 |
zero_gravi |
gpio_o : out std_ulogic_vector(31 downto 0); -- parallel output
|
| 113 |
|
|
gpio_i : in std_ulogic_vector(31 downto 0) := (others => '0'); -- parallel input
|
| 114 |
2 |
zero_gravi |
-- UART (available if IO_UART_USE = true) --
|
| 115 |
|
|
uart_txd_o : out std_ulogic; -- UART send data
|
| 116 |
|
|
uart_rxd_i : in std_ulogic := '0'; -- UART receive data
|
| 117 |
|
|
-- SPI (available if IO_SPI_USE = true) --
|
| 118 |
6 |
zero_gravi |
spi_sck_o : out std_ulogic; -- SPI serial clock
|
| 119 |
|
|
spi_sdo_o : out std_ulogic; -- controller data out, peripheral data in
|
| 120 |
14 |
zero_gravi |
spi_sdi_i : in std_ulogic := '0'; -- controller data in, peripheral data out
|
| 121 |
2 |
zero_gravi |
spi_csn_o : out std_ulogic_vector(07 downto 0); -- SPI CS
|
| 122 |
|
|
-- TWI (available if IO_TWI_USE = true) --
|
| 123 |
|
|
twi_sda_io : inout std_logic := 'H'; -- twi serial data line
|
| 124 |
|
|
twi_scl_io : inout std_logic := 'H'; -- twi serial clock line
|
| 125 |
|
|
-- PWM (available if IO_PWM_USE = true) --
|
| 126 |
14 |
zero_gravi |
pwm_o : out std_ulogic_vector(03 downto 0); -- pwm channels
|
| 127 |
|
|
-- Interrupts --
|
| 128 |
|
|
msw_irq_i : in std_ulogic := '0'; -- machine software interrupt
|
| 129 |
|
|
mext_irq_i : in std_ulogic := '0' -- machine external interrupt
|
| 130 |
2 |
zero_gravi |
);
|
| 131 |
|
|
end neorv32_top;
|
| 132 |
|
|
|
| 133 |
|
|
architecture neorv32_top_rtl of neorv32_top is
|
| 134 |
|
|
|
| 135 |
12 |
zero_gravi |
-- CPU boot address --
|
| 136 |
|
|
constant boot_addr_c : std_ulogic_vector(31 downto 0) := cond_sel_stdulogicvector_f(BOOTLOADER_USE, boot_base_c, MEM_ISPACE_BASE);
|
| 137 |
|
|
|
| 138 |
2 |
zero_gravi |
-- reset generator --
|
| 139 |
|
|
signal rstn_i_sync0 : std_ulogic;
|
| 140 |
|
|
signal rstn_i_sync1 : std_ulogic;
|
| 141 |
|
|
signal rstn_i_sync2 : std_ulogic;
|
| 142 |
|
|
signal rstn_gen : std_ulogic_vector(3 downto 0);
|
| 143 |
|
|
signal ext_rstn : std_ulogic;
|
| 144 |
|
|
signal sys_rstn : std_ulogic;
|
| 145 |
|
|
signal wdt_rstn : std_ulogic;
|
| 146 |
|
|
|
| 147 |
|
|
-- clock generator --
|
| 148 |
|
|
signal clk_div : std_ulogic_vector(11 downto 0);
|
| 149 |
|
|
signal clk_div_ff : std_ulogic_vector(11 downto 0);
|
| 150 |
|
|
signal clk_gen : std_ulogic_vector(07 downto 0);
|
| 151 |
|
|
signal wdt_cg_en : std_ulogic;
|
| 152 |
|
|
signal uart_cg_en : std_ulogic;
|
| 153 |
|
|
signal spi_cg_en : std_ulogic;
|
| 154 |
|
|
signal twi_cg_en : std_ulogic;
|
| 155 |
|
|
signal pwm_cg_en : std_ulogic;
|
| 156 |
|
|
|
| 157 |
12 |
zero_gravi |
-- bus interface --
|
| 158 |
|
|
type bus_interface_t is record
|
| 159 |
11 |
zero_gravi |
addr : std_ulogic_vector(data_width_c-1 downto 0); -- bus access address
|
| 160 |
|
|
rdata : std_ulogic_vector(data_width_c-1 downto 0); -- bus read data
|
| 161 |
|
|
wdata : std_ulogic_vector(data_width_c-1 downto 0); -- bus write data
|
| 162 |
|
|
ben : std_ulogic_vector(03 downto 0); -- byte enable
|
| 163 |
|
|
we : std_ulogic; -- write enable
|
| 164 |
|
|
re : std_ulogic; -- read enable
|
| 165 |
|
|
cancel : std_ulogic; -- cancel current transfer
|
| 166 |
|
|
ack : std_ulogic; -- bus transfer acknowledge
|
| 167 |
|
|
err : std_ulogic; -- bus transfer error
|
| 168 |
12 |
zero_gravi |
fence : std_ulogic; -- fence(i) instruction executed
|
| 169 |
11 |
zero_gravi |
end record;
|
| 170 |
12 |
zero_gravi |
signal cpu_i, cpu_d, p_bus : bus_interface_t;
|
| 171 |
2 |
zero_gravi |
|
| 172 |
|
|
-- io space access --
|
| 173 |
|
|
signal io_acc : std_ulogic;
|
| 174 |
|
|
signal io_rden : std_ulogic;
|
| 175 |
|
|
signal io_wren : std_ulogic;
|
| 176 |
|
|
|
| 177 |
|
|
-- read-back busses -
|
| 178 |
|
|
signal imem_rdata : std_ulogic_vector(data_width_c-1 downto 0);
|
| 179 |
|
|
signal imem_ack : std_ulogic;
|
| 180 |
|
|
signal dmem_rdata : std_ulogic_vector(data_width_c-1 downto 0);
|
| 181 |
|
|
signal dmem_ack : std_ulogic;
|
| 182 |
|
|
signal bootrom_rdata : std_ulogic_vector(data_width_c-1 downto 0);
|
| 183 |
|
|
signal bootrom_ack : std_ulogic;
|
| 184 |
|
|
signal wishbone_rdata : std_ulogic_vector(data_width_c-1 downto 0);
|
| 185 |
|
|
signal wishbone_ack : std_ulogic;
|
| 186 |
|
|
signal wishbone_err : std_ulogic;
|
| 187 |
|
|
signal gpio_rdata : std_ulogic_vector(data_width_c-1 downto 0);
|
| 188 |
|
|
signal gpio_ack : std_ulogic;
|
| 189 |
|
|
signal mtime_rdata : std_ulogic_vector(data_width_c-1 downto 0);
|
| 190 |
|
|
signal mtime_ack : std_ulogic;
|
| 191 |
|
|
signal uart_rdata : std_ulogic_vector(data_width_c-1 downto 0);
|
| 192 |
|
|
signal uart_ack : std_ulogic;
|
| 193 |
|
|
signal spi_rdata : std_ulogic_vector(data_width_c-1 downto 0);
|
| 194 |
|
|
signal spi_ack : std_ulogic;
|
| 195 |
|
|
signal twi_rdata : std_ulogic_vector(data_width_c-1 downto 0);
|
| 196 |
|
|
signal twi_ack : std_ulogic;
|
| 197 |
|
|
signal pwm_rdata : std_ulogic_vector(data_width_c-1 downto 0);
|
| 198 |
|
|
signal pwm_ack : std_ulogic;
|
| 199 |
|
|
signal wdt_rdata : std_ulogic_vector(data_width_c-1 downto 0);
|
| 200 |
|
|
signal wdt_ack : std_ulogic;
|
| 201 |
|
|
signal trng_rdata : std_ulogic_vector(data_width_c-1 downto 0);
|
| 202 |
|
|
signal trng_ack : std_ulogic;
|
| 203 |
3 |
zero_gravi |
signal devnull_rdata : std_ulogic_vector(data_width_c-1 downto 0);
|
| 204 |
|
|
signal devnull_ack : std_ulogic;
|
| 205 |
12 |
zero_gravi |
signal sysinfo_rdata : std_ulogic_vector(data_width_c-1 downto 0);
|
| 206 |
|
|
signal sysinfo_ack : std_ulogic;
|
| 207 |
2 |
zero_gravi |
|
| 208 |
|
|
-- IRQs --
|
| 209 |
|
|
signal mtime_irq : std_ulogic;
|
| 210 |
14 |
zero_gravi |
signal fast_irq : std_ulogic_vector(3 downto 0);
|
| 211 |
2 |
zero_gravi |
signal gpio_irq : std_ulogic;
|
| 212 |
|
|
signal wdt_irq : std_ulogic;
|
| 213 |
|
|
signal uart_irq : std_ulogic;
|
| 214 |
|
|
signal spi_irq : std_ulogic;
|
| 215 |
|
|
signal twi_irq : std_ulogic;
|
| 216 |
|
|
|
| 217 |
11 |
zero_gravi |
-- misc --
|
| 218 |
|
|
signal mtime_time : std_ulogic_vector(63 downto 0); -- current system time from MTIME
|
| 219 |
|
|
|
| 220 |
2 |
zero_gravi |
begin
|
| 221 |
|
|
|
| 222 |
|
|
-- Sanity Checks --------------------------------------------------------------------------
|
| 223 |
|
|
-- -------------------------------------------------------------------------------------------
|
| 224 |
|
|
sanity_check: process(clk_i)
|
| 225 |
|
|
begin
|
| 226 |
|
|
if rising_edge(clk_i) then
|
| 227 |
|
|
-- internal bootloader memory --
|
| 228 |
|
|
if (BOOTLOADER_USE = true) and (boot_size_c > boot_max_size_c) then
|
| 229 |
18 |
zero_gravi |
assert false report "NEORV32 PROCESSOR CONFIG ERROR! Boot ROM size out of range." severity error;
|
| 230 |
2 |
zero_gravi |
end if;
|
| 231 |
22 |
zero_gravi |
if (BOOTLOADER_USE = true) and (MEM_INT_IMEM_ROM = true) then
|
| 232 |
|
|
assert false report "NEORV32 PROCESSOR CONFIG WARNING! IMEM is configured as read-only. Bootloader will not be able to load new executables." severity warning;
|
| 233 |
|
|
end if;
|
| 234 |
2 |
zero_gravi |
|
| 235 |
|
|
-- memory system - data/instruction fetch --
|
| 236 |
|
|
if (MEM_EXT_USE = false) then
|
| 237 |
|
|
if (MEM_INT_DMEM_USE = false) then
|
| 238 |
18 |
zero_gravi |
assert false report "NEORV32 PROCESSOR CONFIG ERROR! Core cannot fetch data without external memory interface and internal data memory." severity error;
|
| 239 |
2 |
zero_gravi |
end if;
|
| 240 |
|
|
if (MEM_INT_IMEM_USE = false) and (BOOTLOADER_USE = false) then
|
| 241 |
18 |
zero_gravi |
assert false report "NEORV32 PROCESSOR CONFIG ERROR! Core cannot fetch instructions without external memory interface, internal data memory and bootloader." severity error;
|
| 242 |
2 |
zero_gravi |
end if;
|
| 243 |
|
|
end if;
|
| 244 |
|
|
|
| 245 |
12 |
zero_gravi |
-- memory system --
|
| 246 |
18 |
zero_gravi |
if (MEM_ISPACE_BASE(1 downto 0) /= "00") then
|
| 247 |
|
|
assert false report "NEORV32 PROCESSOR CONFIG ERROR! Instruction memory space base address must be 4-byte-aligned." severity error;
|
| 248 |
|
|
end if;
|
| 249 |
|
|
if (MEM_DSPACE_BASE(1 downto 0) /= "00") then
|
| 250 |
|
|
assert false report "NEORV32 PROCESSOR CONFIG ERROR! Data memory space base address must be 4-byte-aligned." severity error;
|
| 251 |
|
|
end if;
|
| 252 |
2 |
zero_gravi |
if (MEM_INT_IMEM_USE = true) and (MEM_INT_IMEM_SIZE > MEM_ISPACE_SIZE) then
|
| 253 |
18 |
zero_gravi |
assert false report "NEORV32 PROCESSOR CONFIG ERROR! Internal instruction memory (IMEM) cannot be greater than total instruction address space." severity error;
|
| 254 |
2 |
zero_gravi |
end if;
|
| 255 |
|
|
if (MEM_INT_DMEM_USE = true) and (MEM_INT_DMEM_SIZE > MEM_DSPACE_SIZE) then
|
| 256 |
18 |
zero_gravi |
assert false report "NEORV32 PROCESSOR CONFIG ERROR! Internal data memory (DMEM) cannot be greater than total data address space." severity error;
|
| 257 |
2 |
zero_gravi |
end if;
|
| 258 |
12 |
zero_gravi |
if (MEM_EXT_TIMEOUT < 1) then
|
| 259 |
18 |
zero_gravi |
assert false report "NEORV32 PROCESSOR CONFIG ERROR! Invalid bus timeout. Processor-internal components have 1 cycle delay." severity error;
|
| 260 |
2 |
zero_gravi |
end if;
|
| 261 |
|
|
|
| 262 |
|
|
-- clock --
|
| 263 |
|
|
if (CLOCK_FREQUENCY = 0) then
|
| 264 |
18 |
zero_gravi |
assert false report "NEORV32 PROCESSOR CONFIG ERROR! Core clock frequency (CLOCK_FREQUENCY) not specified." severity error;
|
| 265 |
2 |
zero_gravi |
end if;
|
| 266 |
|
|
|
| 267 |
|
|
-- memory layout notifier --
|
| 268 |
|
|
if (MEM_ISPACE_BASE /= x"00000000") then
|
| 269 |
18 |
zero_gravi |
assert false report "NEORV32 PROCESSOR CONFIG WARNING! Non-default base address for instruction address space. Make sure this is sync with the software framwork." severity warning;
|
| 270 |
2 |
zero_gravi |
end if;
|
| 271 |
|
|
if (MEM_DSPACE_BASE /= x"80000000") then
|
| 272 |
18 |
zero_gravi |
assert false report "NEORV32 PROCESSOR CONFIG WARNING! Non-default base address for data address space. Make sure this is sync with the software framwork." severity warning;
|
| 273 |
2 |
zero_gravi |
end if;
|
| 274 |
|
|
end if;
|
| 275 |
|
|
end process sanity_check;
|
| 276 |
|
|
|
| 277 |
|
|
|
| 278 |
|
|
-- Reset Generator ------------------------------------------------------------------------
|
| 279 |
|
|
-- -------------------------------------------------------------------------------------------
|
| 280 |
|
|
reset_generator_sync: process(clk_i)
|
| 281 |
|
|
begin
|
| 282 |
|
|
-- make sure the external reset is free of metastability and has a minimal duration of 1 clock cycle
|
| 283 |
|
|
if rising_edge(clk_i) then
|
| 284 |
|
|
rstn_i_sync0 <= rstn_i;
|
| 285 |
|
|
rstn_i_sync1 <= rstn_i_sync0;
|
| 286 |
|
|
rstn_i_sync2 <= rstn_i_sync1;
|
| 287 |
|
|
end if;
|
| 288 |
|
|
end process reset_generator_sync;
|
| 289 |
|
|
|
| 290 |
|
|
-- keep internal reset active for at least 4 clock cycles
|
| 291 |
|
|
reset_generator: process(rstn_i_sync1, rstn_i_sync2, clk_i)
|
| 292 |
|
|
begin
|
| 293 |
|
|
if ((rstn_i_sync1 or rstn_i_sync2) = '0') then -- signal stable somehow?
|
| 294 |
|
|
rstn_gen <= (others => '0');
|
| 295 |
|
|
elsif rising_edge(clk_i) then
|
| 296 |
|
|
rstn_gen <= rstn_gen(rstn_gen'left-1 downto 0) & '1';
|
| 297 |
|
|
end if;
|
| 298 |
|
|
end process reset_generator;
|
| 299 |
|
|
|
| 300 |
|
|
ext_rstn <= rstn_gen(rstn_gen'left); -- the beautified external reset signal
|
| 301 |
|
|
sys_rstn <= ext_rstn and wdt_rstn; -- system reset - can also be triggered by watchdog
|
| 302 |
|
|
|
| 303 |
|
|
|
| 304 |
|
|
-- Clock Generator ------------------------------------------------------------------------
|
| 305 |
|
|
-- -------------------------------------------------------------------------------------------
|
| 306 |
|
|
clock_generator: process(sys_rstn, clk_i)
|
| 307 |
|
|
begin
|
| 308 |
|
|
if (sys_rstn = '0') then
|
| 309 |
|
|
clk_div <= (others => '0');
|
| 310 |
|
|
clk_div_ff <= (others => '0');
|
| 311 |
|
|
elsif rising_edge(clk_i) then
|
| 312 |
|
|
-- anybody wanting some fresh clocks? --
|
| 313 |
|
|
if ((wdt_cg_en or uart_cg_en or spi_cg_en or twi_cg_en or pwm_cg_en) = '1') then
|
| 314 |
|
|
clk_div <= std_ulogic_vector(unsigned(clk_div) + 1);
|
| 315 |
|
|
clk_div_ff <= clk_div;
|
| 316 |
|
|
end if;
|
| 317 |
|
|
end if;
|
| 318 |
|
|
end process clock_generator;
|
| 319 |
|
|
|
| 320 |
|
|
-- clock enable select: rising edge detectors --
|
| 321 |
|
|
clk_gen(clk_div2_c) <= clk_div(0) and (not clk_div_ff(0)); -- CLK/2
|
| 322 |
|
|
clk_gen(clk_div4_c) <= clk_div(1) and (not clk_div_ff(1)); -- CLK/4
|
| 323 |
|
|
clk_gen(clk_div8_c) <= clk_div(2) and (not clk_div_ff(2)); -- CLK/8
|
| 324 |
|
|
clk_gen(clk_div64_c) <= clk_div(5) and (not clk_div_ff(5)); -- CLK/64
|
| 325 |
|
|
clk_gen(clk_div128_c) <= clk_div(6) and (not clk_div_ff(6)); -- CLK/128
|
| 326 |
|
|
clk_gen(clk_div1024_c) <= clk_div(9) and (not clk_div_ff(9)); -- CLK/1024
|
| 327 |
|
|
clk_gen(clk_div2048_c) <= clk_div(10) and (not clk_div_ff(10)); -- CLK/2048
|
| 328 |
|
|
clk_gen(clk_div4096_c) <= clk_div(11) and (not clk_div_ff(11)); -- CLK/4096
|
| 329 |
|
|
|
| 330 |
|
|
|
| 331 |
|
|
-- CPU ------------------------------------------------------------------------------------
|
| 332 |
|
|
-- -------------------------------------------------------------------------------------------
|
| 333 |
|
|
neorv32_cpu_inst: neorv32_cpu
|
| 334 |
|
|
generic map (
|
| 335 |
|
|
-- General --
|
| 336 |
19 |
zero_gravi |
HW_THREAD_ID => (others => '0'), -- hardware thread id
|
| 337 |
|
|
CPU_BOOT_ADDR => boot_addr_c, -- cpu boot address
|
| 338 |
2 |
zero_gravi |
-- RISC-V CPU Extensions --
|
| 339 |
8 |
zero_gravi |
CPU_EXTENSION_RISCV_C => CPU_EXTENSION_RISCV_C, -- implement compressed extension?
|
| 340 |
|
|
CPU_EXTENSION_RISCV_E => CPU_EXTENSION_RISCV_E, -- implement embedded RF extension?
|
| 341 |
|
|
CPU_EXTENSION_RISCV_M => CPU_EXTENSION_RISCV_M, -- implement muld/div extension?
|
| 342 |
15 |
zero_gravi |
CPU_EXTENSION_RISCV_U => CPU_EXTENSION_RISCV_U, -- implement user mode extension?
|
| 343 |
8 |
zero_gravi |
CPU_EXTENSION_RISCV_Zicsr => CPU_EXTENSION_RISCV_Zicsr, -- implement CSR system?
|
| 344 |
|
|
CPU_EXTENSION_RISCV_Zifencei => CPU_EXTENSION_RISCV_Zifencei, -- implement instruction stream sync.?
|
| 345 |
19 |
zero_gravi |
-- Extension Options --
|
| 346 |
|
|
CSR_COUNTERS_USE => CSR_COUNTERS_USE, -- implement RISC-V perf. counters ([m]instret[h], [m]cycle[h], time[h])?
|
| 347 |
|
|
FAST_MUL_EN => FAST_MUL_EN, -- use DSPs for M extension's multiplier
|
| 348 |
15 |
zero_gravi |
-- Physical Memory Protection (PMP) --
|
| 349 |
|
|
PMP_USE => PMP_USE, -- implement PMP?
|
| 350 |
16 |
zero_gravi |
PMP_NUM_REGIONS => PMP_NUM_REGIONS, -- number of regions (max 8)
|
| 351 |
|
|
PMP_GRANULARITY => PMP_GRANULARITY, -- minimal region granularity (1=8B, 2=16B, 3=32B, ...) default is 64k
|
| 352 |
14 |
zero_gravi |
-- Bus Interface --
|
| 353 |
|
|
BUS_TIMEOUT => MEM_EXT_TIMEOUT -- cycles after which a valid bus access will timeout
|
| 354 |
2 |
zero_gravi |
)
|
| 355 |
|
|
port map (
|
| 356 |
|
|
-- global control --
|
| 357 |
12 |
zero_gravi |
clk_i => clk_i, -- global clock, rising edge
|
| 358 |
|
|
rstn_i => sys_rstn, -- global reset, low-active, async
|
| 359 |
|
|
-- instruction bus interface --
|
| 360 |
|
|
i_bus_addr_o => cpu_i.addr, -- bus access address
|
| 361 |
|
|
i_bus_rdata_i => cpu_i.rdata, -- bus read data
|
| 362 |
|
|
i_bus_wdata_o => cpu_i.wdata, -- bus write data
|
| 363 |
|
|
i_bus_ben_o => cpu_i.ben, -- byte enable
|
| 364 |
|
|
i_bus_we_o => cpu_i.we, -- write enable
|
| 365 |
|
|
i_bus_re_o => cpu_i.re, -- read enable
|
| 366 |
|
|
i_bus_cancel_o => cpu_i.cancel, -- cancel current bus transaction
|
| 367 |
|
|
i_bus_ack_i => cpu_i.ack, -- bus transfer acknowledge
|
| 368 |
|
|
i_bus_err_i => cpu_i.err, -- bus transfer error
|
| 369 |
|
|
i_bus_fence_o => cpu_i.fence, -- executed FENCEI operation
|
| 370 |
|
|
-- data bus interface --
|
| 371 |
|
|
d_bus_addr_o => cpu_d.addr, -- bus access address
|
| 372 |
|
|
d_bus_rdata_i => cpu_d.rdata, -- bus read data
|
| 373 |
|
|
d_bus_wdata_o => cpu_d.wdata, -- bus write data
|
| 374 |
|
|
d_bus_ben_o => cpu_d.ben, -- byte enable
|
| 375 |
|
|
d_bus_we_o => cpu_d.we, -- write enable
|
| 376 |
|
|
d_bus_re_o => cpu_d.re, -- read enable
|
| 377 |
|
|
d_bus_cancel_o => cpu_d.cancel, -- cancel current bus transaction
|
| 378 |
|
|
d_bus_ack_i => cpu_d.ack, -- bus transfer acknowledge
|
| 379 |
|
|
d_bus_err_i => cpu_d.err, -- bus transfer error
|
| 380 |
|
|
d_bus_fence_o => cpu_d.fence, -- executed FENCE operation
|
| 381 |
11 |
zero_gravi |
-- system time input from MTIME --
|
| 382 |
12 |
zero_gravi |
time_i => mtime_time, -- current system time
|
| 383 |
14 |
zero_gravi |
-- interrupts (risc-v compliant) --
|
| 384 |
|
|
msw_irq_i => msw_irq_i, -- machine software interrupt
|
| 385 |
|
|
mext_irq_i => mext_irq_i, -- machine external interrupt request
|
| 386 |
|
|
mtime_irq_i => mtime_irq, -- machine timer interrupt
|
| 387 |
|
|
-- fast interrupts (custom) --
|
| 388 |
|
|
firq_i => fast_irq
|
| 389 |
2 |
zero_gravi |
);
|
| 390 |
|
|
|
| 391 |
14 |
zero_gravi |
-- advanced memory control --
|
| 392 |
|
|
fence_o <= cpu_d.fence; -- indicates an executed FENCE operation
|
| 393 |
|
|
fencei_o <= cpu_i.fence; -- indicates an executed FENCEI operation
|
| 394 |
2 |
zero_gravi |
|
| 395 |
14 |
zero_gravi |
-- fast interrupts --
|
| 396 |
|
|
fast_irq(0) <= wdt_irq; -- highest priority
|
| 397 |
|
|
fast_irq(1) <= gpio_irq;
|
| 398 |
|
|
fast_irq(2) <= uart_irq;
|
| 399 |
|
|
fast_irq(3) <= spi_irq or twi_irq; -- lowest priority, can be triggered by SPI or TWI
|
| 400 |
|
|
|
| 401 |
|
|
|
| 402 |
12 |
zero_gravi |
-- CPU Crossbar Switch --------------------------------------------------------------------
|
| 403 |
|
|
-- -------------------------------------------------------------------------------------------
|
| 404 |
|
|
neorv32_busswitch_inst: neorv32_busswitch
|
| 405 |
|
|
generic map (
|
| 406 |
|
|
PORT_CA_READ_ONLY => false, -- set if controller port A is read-only
|
| 407 |
|
|
PORT_CB_READ_ONLY => true -- set if controller port B is read-only
|
| 408 |
|
|
)
|
| 409 |
|
|
port map (
|
| 410 |
|
|
-- global control --
|
| 411 |
|
|
clk_i => clk_i, -- global clock, rising edge
|
| 412 |
|
|
rstn_i => sys_rstn, -- global reset, low-active, async
|
| 413 |
|
|
-- controller interface a --
|
| 414 |
|
|
ca_bus_addr_i => cpu_d.addr, -- bus access address
|
| 415 |
|
|
ca_bus_rdata_o => cpu_d.rdata, -- bus read data
|
| 416 |
|
|
ca_bus_wdata_i => cpu_d.wdata, -- bus write data
|
| 417 |
|
|
ca_bus_ben_i => cpu_d.ben, -- byte enable
|
| 418 |
|
|
ca_bus_we_i => cpu_d.we, -- write enable
|
| 419 |
|
|
ca_bus_re_i => cpu_d.re, -- read enable
|
| 420 |
|
|
ca_bus_cancel_i => cpu_d.cancel, -- cancel current bus transaction
|
| 421 |
|
|
ca_bus_ack_o => cpu_d.ack, -- bus transfer acknowledge
|
| 422 |
|
|
ca_bus_err_o => cpu_d.err, -- bus transfer error
|
| 423 |
|
|
-- controller interface b --
|
| 424 |
|
|
cb_bus_addr_i => cpu_i.addr, -- bus access address
|
| 425 |
|
|
cb_bus_rdata_o => cpu_i.rdata, -- bus read data
|
| 426 |
|
|
cb_bus_wdata_i => cpu_i.wdata, -- bus write data
|
| 427 |
|
|
cb_bus_ben_i => cpu_i.ben, -- byte enable
|
| 428 |
|
|
cb_bus_we_i => cpu_i.we, -- write enable
|
| 429 |
|
|
cb_bus_re_i => cpu_i.re, -- read enable
|
| 430 |
|
|
cb_bus_cancel_i => cpu_i.cancel, -- cancel current bus transaction
|
| 431 |
|
|
cb_bus_ack_o => cpu_i.ack, -- bus transfer acknowledge
|
| 432 |
|
|
cb_bus_err_o => cpu_i.err, -- bus transfer error
|
| 433 |
|
|
-- peripheral bus --
|
| 434 |
|
|
p_bus_addr_o => p_bus.addr, -- bus access address
|
| 435 |
|
|
p_bus_rdata_i => p_bus.rdata, -- bus read data
|
| 436 |
|
|
p_bus_wdata_o => p_bus.wdata, -- bus write data
|
| 437 |
|
|
p_bus_ben_o => p_bus.ben, -- byte enable
|
| 438 |
|
|
p_bus_we_o => p_bus.we, -- write enable
|
| 439 |
|
|
p_bus_re_o => p_bus.re, -- read enable
|
| 440 |
|
|
p_bus_cancel_o => p_bus.cancel, -- cancel current bus transaction
|
| 441 |
|
|
p_bus_ack_i => p_bus.ack, -- bus transfer acknowledge
|
| 442 |
|
|
p_bus_err_i => p_bus.err -- bus transfer error
|
| 443 |
|
|
);
|
| 444 |
2 |
zero_gravi |
|
| 445 |
14 |
zero_gravi |
-- processor bus: CPU data input --
|
| 446 |
12 |
zero_gravi |
p_bus.rdata <= (imem_rdata or dmem_rdata or bootrom_rdata) or wishbone_rdata or (gpio_rdata or mtime_rdata or uart_rdata or
|
| 447 |
14 |
zero_gravi |
spi_rdata or twi_rdata or pwm_rdata or wdt_rdata or trng_rdata or devnull_rdata or sysinfo_rdata);
|
| 448 |
2 |
zero_gravi |
|
| 449 |
14 |
zero_gravi |
-- processor bus: CPU data ACK input --
|
| 450 |
12 |
zero_gravi |
p_bus.ack <= (imem_ack or dmem_ack or bootrom_ack) or wishbone_ack or (gpio_ack or mtime_ack or uart_ack or
|
| 451 |
14 |
zero_gravi |
spi_ack or twi_ack or pwm_ack or wdt_ack or trng_ack or devnull_ack or sysinfo_ack);
|
| 452 |
12 |
zero_gravi |
|
| 453 |
14 |
zero_gravi |
-- processor bus: CPU data bus error input --
|
| 454 |
12 |
zero_gravi |
p_bus.err <= wishbone_err;
|
| 455 |
|
|
|
| 456 |
|
|
|
| 457 |
2 |
zero_gravi |
-- Processor-Internal Instruction Memory (IMEM) -------------------------------------------
|
| 458 |
|
|
-- -------------------------------------------------------------------------------------------
|
| 459 |
|
|
neorv32_int_imem_inst_true:
|
| 460 |
|
|
if (MEM_INT_IMEM_USE = true) generate
|
| 461 |
|
|
neorv32_int_imem_inst: neorv32_imem
|
| 462 |
|
|
generic map (
|
| 463 |
|
|
IMEM_BASE => MEM_ISPACE_BASE, -- memory base address
|
| 464 |
|
|
IMEM_SIZE => MEM_INT_IMEM_SIZE, -- processor-internal instruction memory size in bytes
|
| 465 |
|
|
IMEM_AS_ROM => MEM_INT_IMEM_ROM, -- implement IMEM as read-only memory?
|
| 466 |
|
|
BOOTLOADER_USE => BOOTLOADER_USE -- implement and use bootloader?
|
| 467 |
|
|
)
|
| 468 |
|
|
port map (
|
| 469 |
12 |
zero_gravi |
clk_i => clk_i, -- global clock line
|
| 470 |
|
|
rden_i => p_bus.re, -- read enable
|
| 471 |
|
|
wren_i => p_bus.we, -- write enable
|
| 472 |
|
|
ben_i => p_bus.ben, -- byte write enable
|
| 473 |
|
|
upen_i => '1', -- update enable
|
| 474 |
|
|
addr_i => p_bus.addr, -- address
|
| 475 |
|
|
data_i => p_bus.wdata, -- data in
|
| 476 |
|
|
data_o => imem_rdata, -- data out
|
| 477 |
|
|
ack_o => imem_ack -- transfer acknowledge
|
| 478 |
2 |
zero_gravi |
);
|
| 479 |
|
|
end generate;
|
| 480 |
|
|
|
| 481 |
|
|
neorv32_int_imem_inst_false:
|
| 482 |
|
|
if (MEM_INT_IMEM_USE = false) generate
|
| 483 |
|
|
imem_rdata <= (others => '0');
|
| 484 |
|
|
imem_ack <= '0';
|
| 485 |
|
|
end generate;
|
| 486 |
|
|
|
| 487 |
|
|
|
| 488 |
|
|
-- Processor-Internal Data Memory (DMEM) --------------------------------------------------
|
| 489 |
|
|
-- -------------------------------------------------------------------------------------------
|
| 490 |
|
|
neorv32_int_dmem_inst_true:
|
| 491 |
|
|
if (MEM_INT_DMEM_USE = true) generate
|
| 492 |
|
|
neorv32_int_dmem_inst: neorv32_dmem
|
| 493 |
|
|
generic map (
|
| 494 |
|
|
DMEM_BASE => MEM_DSPACE_BASE, -- memory base address
|
| 495 |
|
|
DMEM_SIZE => MEM_INT_DMEM_SIZE -- processor-internal data memory size in bytes
|
| 496 |
|
|
)
|
| 497 |
|
|
port map (
|
| 498 |
12 |
zero_gravi |
clk_i => clk_i, -- global clock line
|
| 499 |
|
|
rden_i => p_bus.re, -- read enable
|
| 500 |
|
|
wren_i => p_bus.we, -- write enable
|
| 501 |
|
|
ben_i => p_bus.ben, -- byte write enable
|
| 502 |
|
|
addr_i => p_bus.addr, -- address
|
| 503 |
|
|
data_i => p_bus.wdata, -- data in
|
| 504 |
|
|
data_o => dmem_rdata, -- data out
|
| 505 |
|
|
ack_o => dmem_ack -- transfer acknowledge
|
| 506 |
2 |
zero_gravi |
);
|
| 507 |
|
|
end generate;
|
| 508 |
|
|
|
| 509 |
|
|
neorv32_int_dmem_inst_false:
|
| 510 |
|
|
if (MEM_INT_DMEM_USE = false) generate
|
| 511 |
|
|
dmem_rdata <= (others => '0');
|
| 512 |
|
|
dmem_ack <= '0';
|
| 513 |
|
|
end generate;
|
| 514 |
|
|
|
| 515 |
|
|
|
| 516 |
|
|
-- Processor-Internal Bootloader ROM (BOOTROM) --------------------------------------------
|
| 517 |
|
|
-- -------------------------------------------------------------------------------------------
|
| 518 |
|
|
neorv32_boot_rom_inst_true:
|
| 519 |
|
|
if (BOOTLOADER_USE = true) generate
|
| 520 |
|
|
neorv32_boot_rom_inst: neorv32_boot_rom
|
| 521 |
|
|
port map (
|
| 522 |
|
|
clk_i => clk_i, -- global clock line
|
| 523 |
12 |
zero_gravi |
rden_i => p_bus.re, -- read enable
|
| 524 |
|
|
addr_i => p_bus.addr, -- address
|
| 525 |
2 |
zero_gravi |
data_o => bootrom_rdata, -- data out
|
| 526 |
|
|
ack_o => bootrom_ack -- transfer acknowledge
|
| 527 |
|
|
);
|
| 528 |
|
|
end generate;
|
| 529 |
|
|
|
| 530 |
|
|
neorv32_boot_rom_inst_false:
|
| 531 |
|
|
if (BOOTLOADER_USE = false) generate
|
| 532 |
|
|
bootrom_rdata <= (others => '0');
|
| 533 |
|
|
bootrom_ack <= '0';
|
| 534 |
|
|
end generate;
|
| 535 |
|
|
|
| 536 |
|
|
|
| 537 |
|
|
-- External Wishbone Gateway (WISHBONE) ---------------------------------------------------
|
| 538 |
|
|
-- -------------------------------------------------------------------------------------------
|
| 539 |
|
|
neorv32_wishbone_inst_true:
|
| 540 |
|
|
if (MEM_EXT_USE = true) generate
|
| 541 |
|
|
neorv32_wishbone_inst: neorv32_wishbone
|
| 542 |
|
|
generic map (
|
| 543 |
|
|
INTERFACE_REG_STAGES => MEM_EXT_REG_STAGES, -- number of interface register stages (0,1,2)
|
| 544 |
|
|
-- Memory configuration: Instruction memory --
|
| 545 |
12 |
zero_gravi |
MEM_ISPACE_BASE => MEM_ISPACE_BASE, -- base address of instruction memory space
|
| 546 |
|
|
MEM_ISPACE_SIZE => MEM_ISPACE_SIZE, -- total size of instruction memory space in byte
|
| 547 |
|
|
MEM_INT_IMEM_USE => MEM_INT_IMEM_USE, -- implement processor-internal instruction memory
|
| 548 |
|
|
MEM_INT_IMEM_SIZE => MEM_INT_IMEM_SIZE, -- size of processor-internal instruction memory in bytes
|
| 549 |
2 |
zero_gravi |
-- Memory configuration: Data memory --
|
| 550 |
12 |
zero_gravi |
MEM_DSPACE_BASE => MEM_DSPACE_BASE, -- base address of data memory space
|
| 551 |
|
|
MEM_DSPACE_SIZE => MEM_DSPACE_SIZE, -- total size of data memory space in byte
|
| 552 |
|
|
MEM_INT_DMEM_USE => MEM_INT_DMEM_USE, -- implement processor-internal data memory
|
| 553 |
|
|
MEM_INT_DMEM_SIZE => MEM_INT_DMEM_SIZE -- size of processor-internal data memory in bytes
|
| 554 |
2 |
zero_gravi |
)
|
| 555 |
|
|
port map (
|
| 556 |
|
|
-- global control --
|
| 557 |
|
|
clk_i => clk_i, -- global clock line
|
| 558 |
|
|
rstn_i => sys_rstn, -- global reset line, low-active
|
| 559 |
|
|
-- host access --
|
| 560 |
12 |
zero_gravi |
addr_i => p_bus.addr, -- address
|
| 561 |
|
|
rden_i => p_bus.re, -- read enable
|
| 562 |
|
|
wren_i => p_bus.we, -- write enable
|
| 563 |
|
|
ben_i => p_bus.ben, -- byte write enable
|
| 564 |
|
|
data_i => p_bus.wdata, -- data in
|
| 565 |
2 |
zero_gravi |
data_o => wishbone_rdata, -- data out
|
| 566 |
12 |
zero_gravi |
cancel_i => p_bus.cancel, -- cancel current transaction
|
| 567 |
2 |
zero_gravi |
ack_o => wishbone_ack, -- transfer acknowledge
|
| 568 |
|
|
err_o => wishbone_err, -- transfer error
|
| 569 |
|
|
-- wishbone interface --
|
| 570 |
|
|
wb_adr_o => wb_adr_o, -- address
|
| 571 |
|
|
wb_dat_i => wb_dat_i, -- read data
|
| 572 |
|
|
wb_dat_o => wb_dat_o, -- write data
|
| 573 |
|
|
wb_we_o => wb_we_o, -- read/write
|
| 574 |
|
|
wb_sel_o => wb_sel_o, -- byte enable
|
| 575 |
|
|
wb_stb_o => wb_stb_o, -- strobe
|
| 576 |
|
|
wb_cyc_o => wb_cyc_o, -- valid cycle
|
| 577 |
|
|
wb_ack_i => wb_ack_i, -- transfer acknowledge
|
| 578 |
|
|
wb_err_i => wb_err_i -- transfer error
|
| 579 |
|
|
);
|
| 580 |
|
|
end generate;
|
| 581 |
|
|
|
| 582 |
|
|
neorv32_wishbone_inst_false:
|
| 583 |
|
|
if (MEM_EXT_USE = false) generate
|
| 584 |
|
|
wishbone_rdata <= (others => '0');
|
| 585 |
|
|
wishbone_ack <= '0';
|
| 586 |
|
|
wishbone_err <= '0';
|
| 587 |
|
|
--
|
| 588 |
|
|
wb_adr_o <= (others => '0');
|
| 589 |
|
|
wb_dat_o <= (others => '0');
|
| 590 |
|
|
wb_we_o <= '0';
|
| 591 |
|
|
wb_sel_o <= (others => '0');
|
| 592 |
|
|
wb_stb_o <= '0';
|
| 593 |
|
|
wb_cyc_o <= '0';
|
| 594 |
|
|
end generate;
|
| 595 |
|
|
|
| 596 |
|
|
|
| 597 |
|
|
-- IO Access? -----------------------------------------------------------------------------
|
| 598 |
|
|
-- -------------------------------------------------------------------------------------------
|
| 599 |
12 |
zero_gravi |
io_acc <= '1' when (p_bus.addr(data_width_c-1 downto index_size_f(io_size_c)) = io_base_c(data_width_c-1 downto index_size_f(io_size_c))) else '0';
|
| 600 |
|
|
io_rden <= io_acc and p_bus.re;
|
| 601 |
22 |
zero_gravi |
-- the peripheral/IO devices in the IO area can only be written in word mode (reduces HW complexity)
|
| 602 |
|
|
io_wren <= io_acc and p_bus.we and p_bus.ben(3) and p_bus.ben(2) and p_bus.ben(1) and p_bus.ben(0);
|
| 603 |
2 |
zero_gravi |
|
| 604 |
|
|
|
| 605 |
|
|
-- General Purpose Input/Output Port (GPIO) -----------------------------------------------
|
| 606 |
|
|
-- -------------------------------------------------------------------------------------------
|
| 607 |
|
|
neorv32_gpio_inst_true:
|
| 608 |
|
|
if (IO_GPIO_USE = true) generate
|
| 609 |
|
|
neorv32_gpio_inst: neorv32_gpio
|
| 610 |
|
|
port map (
|
| 611 |
|
|
-- host access --
|
| 612 |
12 |
zero_gravi |
clk_i => clk_i, -- global clock line
|
| 613 |
|
|
addr_i => p_bus.addr, -- address
|
| 614 |
|
|
rden_i => io_rden, -- read enable
|
| 615 |
|
|
wren_i => io_wren, -- write enable
|
| 616 |
|
|
data_i => p_bus.wdata, -- data in
|
| 617 |
|
|
data_o => gpio_rdata, -- data out
|
| 618 |
|
|
ack_o => gpio_ack, -- transfer acknowledge
|
| 619 |
2 |
zero_gravi |
-- parallel io --
|
| 620 |
|
|
gpio_o => gpio_o,
|
| 621 |
|
|
gpio_i => gpio_i,
|
| 622 |
|
|
-- interrupt --
|
| 623 |
12 |
zero_gravi |
irq_o => gpio_irq -- pin-change interrupt
|
| 624 |
2 |
zero_gravi |
);
|
| 625 |
|
|
end generate;
|
| 626 |
|
|
|
| 627 |
|
|
neorv32_gpio_inst_false:
|
| 628 |
|
|
if (IO_GPIO_USE = false) generate
|
| 629 |
|
|
gpio_rdata <= (others => '0');
|
| 630 |
|
|
gpio_ack <= '0';
|
| 631 |
|
|
gpio_o <= (others => '0');
|
| 632 |
|
|
gpio_irq <= '0';
|
| 633 |
|
|
end generate;
|
| 634 |
|
|
|
| 635 |
|
|
|
| 636 |
|
|
-- Watch Dog Timer (WDT) ------------------------------------------------------------------
|
| 637 |
|
|
-- -------------------------------------------------------------------------------------------
|
| 638 |
|
|
neorv32_wdt_inst_true:
|
| 639 |
|
|
if (IO_WDT_USE = true) generate
|
| 640 |
|
|
neorv32_wdt_inst: neorv32_wdt
|
| 641 |
|
|
port map (
|
| 642 |
|
|
-- host access --
|
| 643 |
12 |
zero_gravi |
clk_i => clk_i, -- global clock line
|
| 644 |
|
|
rstn_i => ext_rstn, -- global reset line, low-active
|
| 645 |
|
|
rden_i => io_rden, -- read enable
|
| 646 |
|
|
wren_i => io_wren, -- write enable
|
| 647 |
|
|
addr_i => p_bus.addr, -- address
|
| 648 |
|
|
data_i => p_bus.wdata, -- data in
|
| 649 |
|
|
data_o => wdt_rdata, -- data out
|
| 650 |
|
|
ack_o => wdt_ack, -- transfer acknowledge
|
| 651 |
2 |
zero_gravi |
-- clock generator --
|
| 652 |
12 |
zero_gravi |
clkgen_en_o => wdt_cg_en, -- enable clock generator
|
| 653 |
2 |
zero_gravi |
clkgen_i => clk_gen,
|
| 654 |
|
|
-- timeout event --
|
| 655 |
12 |
zero_gravi |
irq_o => wdt_irq, -- timeout IRQ
|
| 656 |
|
|
rstn_o => wdt_rstn -- timeout reset, low_active, use it as async!
|
| 657 |
2 |
zero_gravi |
);
|
| 658 |
|
|
end generate;
|
| 659 |
|
|
|
| 660 |
|
|
neorv32_wdt_inst_false:
|
| 661 |
|
|
if (IO_WDT_USE = false) generate
|
| 662 |
|
|
wdt_rdata <= (others => '0');
|
| 663 |
|
|
wdt_ack <= '0';
|
| 664 |
|
|
wdt_irq <= '0';
|
| 665 |
|
|
wdt_rstn <= '1';
|
| 666 |
|
|
wdt_cg_en <= '0';
|
| 667 |
|
|
end generate;
|
| 668 |
|
|
|
| 669 |
|
|
|
| 670 |
|
|
-- Machine System Timer (MTIME) -----------------------------------------------------------
|
| 671 |
|
|
-- -------------------------------------------------------------------------------------------
|
| 672 |
|
|
neorv32_mtime_inst_true:
|
| 673 |
|
|
if (IO_MTIME_USE = true) generate
|
| 674 |
|
|
neorv32_mtime_inst: neorv32_mtime
|
| 675 |
|
|
port map (
|
| 676 |
|
|
-- host access --
|
| 677 |
12 |
zero_gravi |
clk_i => clk_i, -- global clock line
|
| 678 |
|
|
rstn_i => sys_rstn, -- global reset, low-active, async
|
| 679 |
|
|
addr_i => p_bus.addr, -- address
|
| 680 |
|
|
rden_i => io_rden, -- read enable
|
| 681 |
|
|
wren_i => io_wren, -- write enable
|
| 682 |
|
|
data_i => p_bus.wdata, -- data in
|
| 683 |
|
|
data_o => mtime_rdata, -- data out
|
| 684 |
|
|
ack_o => mtime_ack, -- transfer acknowledge
|
| 685 |
11 |
zero_gravi |
-- time output for CPU --
|
| 686 |
12 |
zero_gravi |
time_o => mtime_time, -- current system time
|
| 687 |
2 |
zero_gravi |
-- interrupt --
|
| 688 |
12 |
zero_gravi |
irq_o => mtime_irq -- interrupt request
|
| 689 |
2 |
zero_gravi |
);
|
| 690 |
|
|
end generate;
|
| 691 |
|
|
|
| 692 |
|
|
neorv32_mtime_inst_false:
|
| 693 |
|
|
if (IO_MTIME_USE = false) generate
|
| 694 |
|
|
mtime_rdata <= (others => '0');
|
| 695 |
11 |
zero_gravi |
mtime_time <= (others => '0');
|
| 696 |
2 |
zero_gravi |
mtime_ack <= '0';
|
| 697 |
|
|
mtime_irq <= '0';
|
| 698 |
|
|
end generate;
|
| 699 |
|
|
|
| 700 |
|
|
|
| 701 |
|
|
-- Universal Asynchronous Receiver/Transmitter (UART) -------------------------------------
|
| 702 |
|
|
-- -------------------------------------------------------------------------------------------
|
| 703 |
|
|
neorv32_uart_inst_true:
|
| 704 |
|
|
if (IO_UART_USE = true) generate
|
| 705 |
|
|
neorv32_uart_inst: neorv32_uart
|
| 706 |
|
|
port map (
|
| 707 |
|
|
-- host access --
|
| 708 |
12 |
zero_gravi |
clk_i => clk_i, -- global clock line
|
| 709 |
|
|
addr_i => p_bus.addr, -- address
|
| 710 |
|
|
rden_i => io_rden, -- read enable
|
| 711 |
|
|
wren_i => io_wren, -- write enable
|
| 712 |
|
|
data_i => p_bus.wdata, -- data in
|
| 713 |
|
|
data_o => uart_rdata, -- data out
|
| 714 |
|
|
ack_o => uart_ack, -- transfer acknowledge
|
| 715 |
2 |
zero_gravi |
-- clock generator --
|
| 716 |
12 |
zero_gravi |
clkgen_en_o => uart_cg_en, -- enable clock generator
|
| 717 |
2 |
zero_gravi |
clkgen_i => clk_gen,
|
| 718 |
|
|
-- com lines --
|
| 719 |
|
|
uart_txd_o => uart_txd_o,
|
| 720 |
|
|
uart_rxd_i => uart_rxd_i,
|
| 721 |
|
|
-- interrupts --
|
| 722 |
12 |
zero_gravi |
uart_irq_o => uart_irq -- uart rx/tx interrupt
|
| 723 |
2 |
zero_gravi |
);
|
| 724 |
|
|
end generate;
|
| 725 |
|
|
|
| 726 |
|
|
neorv32_uart_inst_false:
|
| 727 |
|
|
if (IO_UART_USE = false) generate
|
| 728 |
|
|
uart_rdata <= (others => '0');
|
| 729 |
|
|
uart_ack <= '0';
|
| 730 |
|
|
uart_txd_o <= '0';
|
| 731 |
|
|
uart_cg_en <= '0';
|
| 732 |
|
|
uart_irq <= '0';
|
| 733 |
|
|
end generate;
|
| 734 |
|
|
|
| 735 |
|
|
|
| 736 |
|
|
-- Serial Peripheral Interface (SPI) ------------------------------------------------------
|
| 737 |
|
|
-- -------------------------------------------------------------------------------------------
|
| 738 |
|
|
neorv32_spi_inst_true:
|
| 739 |
|
|
if (IO_SPI_USE = true) generate
|
| 740 |
|
|
neorv32_spi_inst: neorv32_spi
|
| 741 |
|
|
port map (
|
| 742 |
|
|
-- host access --
|
| 743 |
12 |
zero_gravi |
clk_i => clk_i, -- global clock line
|
| 744 |
|
|
addr_i => p_bus.addr, -- address
|
| 745 |
|
|
rden_i => io_rden, -- read enable
|
| 746 |
|
|
wren_i => io_wren, -- write enable
|
| 747 |
|
|
data_i => p_bus.wdata, -- data in
|
| 748 |
|
|
data_o => spi_rdata, -- data out
|
| 749 |
|
|
ack_o => spi_ack, -- transfer acknowledge
|
| 750 |
2 |
zero_gravi |
-- clock generator --
|
| 751 |
12 |
zero_gravi |
clkgen_en_o => spi_cg_en, -- enable clock generator
|
| 752 |
2 |
zero_gravi |
clkgen_i => clk_gen,
|
| 753 |
|
|
-- com lines --
|
| 754 |
12 |
zero_gravi |
spi_sck_o => spi_sck_o, -- SPI serial clock
|
| 755 |
|
|
spi_sdo_o => spi_sdo_o, -- controller data out, peripheral data in
|
| 756 |
|
|
spi_sdi_i => spi_sdi_i, -- controller data in, peripheral data out
|
| 757 |
|
|
spi_csn_o => spi_csn_o, -- SPI CS
|
| 758 |
2 |
zero_gravi |
-- interrupt --
|
| 759 |
12 |
zero_gravi |
spi_irq_o => spi_irq -- transmission done interrupt
|
| 760 |
2 |
zero_gravi |
);
|
| 761 |
|
|
end generate;
|
| 762 |
|
|
|
| 763 |
|
|
neorv32_spi_inst_false:
|
| 764 |
|
|
if (IO_SPI_USE = false) generate
|
| 765 |
|
|
spi_rdata <= (others => '0');
|
| 766 |
|
|
spi_ack <= '0';
|
| 767 |
6 |
zero_gravi |
spi_sck_o <= '0';
|
| 768 |
|
|
spi_sdo_o <= '0';
|
| 769 |
2 |
zero_gravi |
spi_csn_o <= (others => '1'); -- CSn lines are low-active
|
| 770 |
|
|
spi_cg_en <= '0';
|
| 771 |
|
|
spi_irq <= '0';
|
| 772 |
|
|
end generate;
|
| 773 |
|
|
|
| 774 |
|
|
|
| 775 |
|
|
-- Two-Wire Interface (TWI) ---------------------------------------------------------------
|
| 776 |
|
|
-- -------------------------------------------------------------------------------------------
|
| 777 |
|
|
neorv32_twi_inst_true:
|
| 778 |
|
|
if (IO_TWI_USE = true) generate
|
| 779 |
|
|
neorv32_twi_inst: neorv32_twi
|
| 780 |
|
|
port map (
|
| 781 |
|
|
-- host access --
|
| 782 |
12 |
zero_gravi |
clk_i => clk_i, -- global clock line
|
| 783 |
|
|
addr_i => p_bus.addr, -- address
|
| 784 |
|
|
rden_i => io_rden, -- read enable
|
| 785 |
|
|
wren_i => io_wren, -- write enable
|
| 786 |
|
|
data_i => p_bus.wdata, -- data in
|
| 787 |
|
|
data_o => twi_rdata, -- data out
|
| 788 |
|
|
ack_o => twi_ack, -- transfer acknowledge
|
| 789 |
2 |
zero_gravi |
-- clock generator --
|
| 790 |
12 |
zero_gravi |
clkgen_en_o => twi_cg_en, -- enable clock generator
|
| 791 |
2 |
zero_gravi |
clkgen_i => clk_gen,
|
| 792 |
|
|
-- com lines --
|
| 793 |
12 |
zero_gravi |
twi_sda_io => twi_sda_io, -- serial data line
|
| 794 |
|
|
twi_scl_io => twi_scl_io, -- serial clock line
|
| 795 |
2 |
zero_gravi |
-- interrupt --
|
| 796 |
12 |
zero_gravi |
twi_irq_o => twi_irq -- transfer done IRQ
|
| 797 |
2 |
zero_gravi |
);
|
| 798 |
|
|
end generate;
|
| 799 |
|
|
|
| 800 |
|
|
neorv32_twi_inst_false:
|
| 801 |
|
|
if (IO_TWI_USE = false) generate
|
| 802 |
|
|
twi_rdata <= (others => '0');
|
| 803 |
|
|
twi_ack <= '0';
|
| 804 |
|
|
-- twi_sda_io <= 'H';
|
| 805 |
|
|
-- twi_scl_io <= 'H';
|
| 806 |
|
|
twi_cg_en <= '0';
|
| 807 |
|
|
twi_irq <= '0';
|
| 808 |
|
|
end generate;
|
| 809 |
|
|
|
| 810 |
|
|
|
| 811 |
|
|
-- Pulse-Width Modulation Controller (PWM) ------------------------------------------------
|
| 812 |
|
|
-- -------------------------------------------------------------------------------------------
|
| 813 |
|
|
neorv32_pwm_inst_true:
|
| 814 |
|
|
if (IO_PWM_USE = true) generate
|
| 815 |
|
|
neorv32_pwm_inst: neorv32_pwm
|
| 816 |
|
|
port map (
|
| 817 |
|
|
-- host access --
|
| 818 |
12 |
zero_gravi |
clk_i => clk_i, -- global clock line
|
| 819 |
|
|
addr_i => p_bus.addr, -- address
|
| 820 |
|
|
rden_i => io_rden, -- read enable
|
| 821 |
|
|
wren_i => io_wren, -- write enable
|
| 822 |
|
|
data_i => p_bus.wdata, -- data in
|
| 823 |
|
|
data_o => pwm_rdata, -- data out
|
| 824 |
|
|
ack_o => pwm_ack, -- transfer acknowledge
|
| 825 |
2 |
zero_gravi |
-- clock generator --
|
| 826 |
12 |
zero_gravi |
clkgen_en_o => pwm_cg_en, -- enable clock generator
|
| 827 |
2 |
zero_gravi |
clkgen_i => clk_gen,
|
| 828 |
|
|
-- pwm output channels --
|
| 829 |
|
|
pwm_o => pwm_o
|
| 830 |
|
|
);
|
| 831 |
|
|
end generate;
|
| 832 |
|
|
|
| 833 |
|
|
neorv32_pwm_inst_false:
|
| 834 |
|
|
if (IO_PWM_USE = false) generate
|
| 835 |
|
|
pwm_rdata <= (others => '0');
|
| 836 |
|
|
pwm_ack <= '0';
|
| 837 |
|
|
pwm_cg_en <= '0';
|
| 838 |
|
|
pwm_o <= (others => '0');
|
| 839 |
|
|
end generate;
|
| 840 |
|
|
|
| 841 |
|
|
|
| 842 |
|
|
-- True Random Number Generator (TRNG) ----------------------------------------------------
|
| 843 |
|
|
-- -------------------------------------------------------------------------------------------
|
| 844 |
|
|
neorv32_trng_inst_true:
|
| 845 |
|
|
if (IO_TRNG_USE = true) generate
|
| 846 |
|
|
neorv32_trng_inst: neorv32_trng
|
| 847 |
|
|
port map (
|
| 848 |
|
|
-- host access --
|
| 849 |
12 |
zero_gravi |
clk_i => clk_i, -- global clock line
|
| 850 |
|
|
addr_i => p_bus.addr, -- address
|
| 851 |
|
|
rden_i => io_rden, -- read enable
|
| 852 |
|
|
wren_i => io_wren, -- write enable
|
| 853 |
|
|
data_i => p_bus.wdata, -- data in
|
| 854 |
|
|
data_o => trng_rdata, -- data out
|
| 855 |
|
|
ack_o => trng_ack -- transfer acknowledge
|
| 856 |
2 |
zero_gravi |
);
|
| 857 |
|
|
end generate;
|
| 858 |
|
|
|
| 859 |
|
|
neorv32_trng_inst_false:
|
| 860 |
|
|
if (IO_TRNG_USE = false) generate
|
| 861 |
|
|
trng_rdata <= (others => '0');
|
| 862 |
|
|
trng_ack <= '0';
|
| 863 |
|
|
end generate;
|
| 864 |
|
|
|
| 865 |
|
|
|
| 866 |
3 |
zero_gravi |
-- Dummy Device (DEVNULL) -----------------------------------------------------------------
|
| 867 |
|
|
-- -------------------------------------------------------------------------------------------
|
| 868 |
|
|
neorv32_devnull_inst_true:
|
| 869 |
|
|
if (IO_DEVNULL_USE = true) generate
|
| 870 |
|
|
neorv32_devnull_inst: neorv32_devnull
|
| 871 |
|
|
port map (
|
| 872 |
|
|
-- host access --
|
| 873 |
|
|
clk_i => clk_i, -- global clock line
|
| 874 |
12 |
zero_gravi |
addr_i => p_bus.addr, -- address
|
| 875 |
3 |
zero_gravi |
rden_i => io_rden, -- read enable
|
| 876 |
|
|
wren_i => io_wren, -- write enable
|
| 877 |
12 |
zero_gravi |
data_i => p_bus.wdata, -- data in
|
| 878 |
3 |
zero_gravi |
data_o => devnull_rdata, -- data out
|
| 879 |
|
|
ack_o => devnull_ack -- transfer acknowledge
|
| 880 |
|
|
);
|
| 881 |
|
|
end generate;
|
| 882 |
12 |
zero_gravi |
|
| 883 |
3 |
zero_gravi |
neorv32_devnull_inst_false:
|
| 884 |
|
|
if (IO_DEVNULL_USE = false) generate
|
| 885 |
|
|
devnull_rdata <= (others => '0');
|
| 886 |
|
|
devnull_ack <= '0';
|
| 887 |
|
|
end generate;
|
| 888 |
|
|
|
| 889 |
|
|
|
| 890 |
12 |
zero_gravi |
-- System Configuration Information Memory (SYSINFO) --------------------------------------
|
| 891 |
|
|
-- -------------------------------------------------------------------------------------------
|
| 892 |
|
|
neorv32_sysinfo_inst: neorv32_sysinfo
|
| 893 |
|
|
generic map (
|
| 894 |
|
|
-- General --
|
| 895 |
|
|
CLOCK_FREQUENCY => CLOCK_FREQUENCY, -- clock frequency of clk_i in Hz
|
| 896 |
|
|
BOOTLOADER_USE => BOOTLOADER_USE, -- implement processor-internal bootloader?
|
| 897 |
|
|
USER_CODE => USER_CODE, -- custom user code
|
| 898 |
|
|
-- Memory configuration: Instruction memory --
|
| 899 |
|
|
MEM_ISPACE_BASE => MEM_ISPACE_BASE, -- base address of instruction memory space
|
| 900 |
|
|
MEM_ISPACE_SIZE => MEM_ISPACE_SIZE, -- total size of instruction memory space in byte
|
| 901 |
|
|
MEM_INT_IMEM_USE => MEM_INT_IMEM_USE, -- implement processor-internal instruction memory
|
| 902 |
|
|
MEM_INT_IMEM_SIZE => MEM_INT_IMEM_SIZE, -- size of processor-internal instruction memory in bytes
|
| 903 |
|
|
MEM_INT_IMEM_ROM => MEM_INT_IMEM_ROM, -- implement processor-internal instruction memory as ROM
|
| 904 |
|
|
-- Memory configuration: Data memory --
|
| 905 |
|
|
MEM_DSPACE_BASE => MEM_DSPACE_BASE, -- base address of data memory space
|
| 906 |
|
|
MEM_DSPACE_SIZE => MEM_DSPACE_SIZE, -- total size of data memory space in byte
|
| 907 |
|
|
MEM_INT_DMEM_USE => MEM_INT_DMEM_USE, -- implement processor-internal data memory
|
| 908 |
|
|
MEM_INT_DMEM_SIZE => MEM_INT_DMEM_SIZE, -- size of processor-internal data memory in bytes
|
| 909 |
|
|
-- Memory configuration: External memory interface --
|
| 910 |
|
|
MEM_EXT_USE => MEM_EXT_USE, -- implement external memory bus interface?
|
| 911 |
|
|
-- Processor peripherals --
|
| 912 |
|
|
IO_GPIO_USE => IO_GPIO_USE, -- implement general purpose input/output port unit (GPIO)?
|
| 913 |
|
|
IO_MTIME_USE => IO_MTIME_USE, -- implement machine system timer (MTIME)?
|
| 914 |
|
|
IO_UART_USE => IO_UART_USE, -- implement universal asynchronous receiver/transmitter (UART)?
|
| 915 |
|
|
IO_SPI_USE => IO_SPI_USE, -- implement serial peripheral interface (SPI)?
|
| 916 |
|
|
IO_TWI_USE => IO_TWI_USE, -- implement two-wire interface (TWI)?
|
| 917 |
|
|
IO_PWM_USE => IO_PWM_USE, -- implement pulse-width modulation unit (PWM)?
|
| 918 |
|
|
IO_WDT_USE => IO_WDT_USE, -- implement watch dog timer (WDT)?
|
| 919 |
|
|
IO_TRNG_USE => IO_TRNG_USE, -- implement true random number generator (TRNG)?
|
| 920 |
|
|
IO_DEVNULL_USE => IO_DEVNULL_USE -- implement dummy device (DEVNULL)?
|
| 921 |
|
|
)
|
| 922 |
|
|
port map (
|
| 923 |
|
|
-- host access --
|
| 924 |
|
|
clk_i => clk_i, -- global clock line
|
| 925 |
|
|
addr_i => p_bus.addr, -- address
|
| 926 |
|
|
rden_i => io_rden, -- read enable
|
| 927 |
|
|
data_o => sysinfo_rdata, -- data out
|
| 928 |
|
|
ack_o => sysinfo_ack -- transfer acknowledge
|
| 929 |
|
|
);
|
| 930 |
|
|
|
| 931 |
|
|
|
| 932 |
2 |
zero_gravi |
end neorv32_top_rtl;
|