OpenCores
URL https://opencores.org/ocsvn/neorv32/neorv32/trunk

Subversion Repositories neorv32

[/] [neorv32/] [trunk/] [rtl/] [system_integration/] [neorv32_SystemTop_AvalonMM.vhd] - Blame information for rev 67

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 64 zero_gravi
-- #################################################################################################
2
-- # << NEORV32 - Processor Top Entity with AvalonMM Compatible Master Interface >>                #
3
-- # ********************************************************************************************* #
4
-- # (c) "AvalonMM", "NIOS-2", "Qsys", "MegaWizard"  and "Platform Designer"                       # 
5
-- # are trademarks of Intel                                                                       #
6
-- # ********************************************************************************************* #
7
-- # BSD 3-Clause License                                                                          #
8
-- #                                                                                               #
9
-- # Copyright (c) 2021, Stephan Nolting. All rights reserved.                                     #
10
-- #                                                                                               #
11
-- # Redistribution and use in source and binary forms, with or without modification, are          #
12
-- # permitted provided that the following conditions are met:                                     #
13
-- #                                                                                               #
14
-- # 1. Redistributions of source code must retain the above copyright notice, this list of        #
15
-- #    conditions and the following disclaimer.                                                   #
16
-- #                                                                                               #
17
-- # 2. Redistributions in binary form must reproduce the above copyright notice, this list of     #
18
-- #    conditions and the following disclaimer in the documentation and/or other materials        #
19
-- #    provided with the distribution.                                                            #
20
-- #                                                                                               #
21
-- # 3. Neither the name of the copyright holder nor the names of its contributors may be used to  #
22
-- #    endorse or promote products derived from this software without specific prior written      #
23
-- #    permission.                                                                                #
24
-- #                                                                                               #
25
-- # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS   #
26
-- # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF               #
27
-- # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE    #
28
-- # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,     #
29
-- # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE #
30
-- # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED    #
31
-- # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING     #
32
-- # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED  #
33
-- # OF THE POSSIBILITY OF SUCH DAMAGE.                                                            #
34
-- # ********************************************************************************************* #
35
-- # The NEORV32 Processor - https://github.com/stnolting/neorv32              (c) Stephan Nolting #
36
-- #################################################################################################
37
 
38
library ieee;
39
use ieee.std_logic_1164.all;
40
use ieee.numeric_std.all;
41
 
42
library neorv32;
43
use neorv32.neorv32_package.all;
44
 
45
entity neorv32_top_avalonmm is
46
  generic (
47
    -- General --
48
    CLOCK_FREQUENCY              : natural;           -- clock frequency of clk_i in Hz
49
    HW_THREAD_ID                 : natural := 0;      -- hardware thread id (32-bit)
50
    INT_BOOTLOADER_EN            : boolean := false;  -- boot configuration: true = boot explicit bootloader; false = boot from int/ext (I)MEM
51
 
52
    -- On-Chip Debugger (OCD) --
53
    ON_CHIP_DEBUGGER_EN          : boolean := false;  -- implement on-chip debugger
54
 
55
    -- RISC-V CPU Extensions --
56
    CPU_EXTENSION_RISCV_A        : boolean := false;  -- implement atomic extension?
57 66 zero_gravi
    CPU_EXTENSION_RISCV_B        : boolean := false;  -- implement bit-manipulation extension?
58 64 zero_gravi
    CPU_EXTENSION_RISCV_C        : boolean := false;  -- implement compressed extension?
59
    CPU_EXTENSION_RISCV_E        : boolean := false;  -- implement embedded RF extension?
60
    CPU_EXTENSION_RISCV_M        : boolean := false;  -- implement mul/div extension?
61
    CPU_EXTENSION_RISCV_U        : boolean := false;  -- implement user mode extension?
62
    CPU_EXTENSION_RISCV_Zfinx    : boolean := false;  -- implement 32-bit floating-point extension (using INT regs!)
63
    CPU_EXTENSION_RISCV_Zicsr    : boolean := true;   -- implement CSR system?
64 66 zero_gravi
    CPU_EXTENSION_RISCV_Zicntr   : boolean := true;   -- implement base counters?
65
    CPU_EXTENSION_RISCV_Zihpm    : boolean := false;  -- implement hardware performance monitors?
66 64 zero_gravi
    CPU_EXTENSION_RISCV_Zifencei : boolean := false;  -- implement instruction stream sync.?
67
    CPU_EXTENSION_RISCV_Zmmul    : boolean := false;  -- implement multiply-only M sub-extension?
68
 
69
    -- Extension Options --
70
    FAST_MUL_EN                  : boolean := false;  -- use DSPs for M extension's multiplier
71
    FAST_SHIFT_EN                : boolean := false;  -- use barrel shifter for shift operations
72
    CPU_CNT_WIDTH                : natural := 64;     -- total width of CPU cycle and instret counters (0..64)
73
    CPU_IPB_ENTRIES              : natural := 2;      -- entries is instruction prefetch buffer, has to be a power of 2
74
 
75
    -- Physical Memory Protection (PMP) --
76
    PMP_NUM_REGIONS              : natural := 0;      -- number of regions (0..64)
77
    PMP_MIN_GRANULARITY          : natural := 64*1024; -- minimal region granularity in bytes, has to be a power of 2, min 8 bytes
78
 
79
    -- Hardware Performance Monitors (HPM) --
80
    HPM_NUM_CNTS                 : natural := 0;      -- number of implemented HPM counters (0..29)
81
    HPM_CNT_WIDTH                : natural := 40;     -- total size of HPM counters (0..64)
82
 
83
    -- Internal Instruction memory (IMEM) --
84
    MEM_INT_IMEM_EN              : boolean := false;  -- implement processor-internal instruction memory
85
    MEM_INT_IMEM_SIZE            : natural := 16*1024; -- size of processor-internal instruction memory in bytes
86
 
87
    -- Internal Data memory (DMEM) --
88
    MEM_INT_DMEM_EN              : boolean := false;  -- implement processor-internal data memory
89
    MEM_INT_DMEM_SIZE            : natural := 8*1024; -- size of processor-internal data memory in bytes
90
 
91
    -- Internal Cache memory (iCACHE) --
92
    ICACHE_EN                    : boolean := false;  -- implement instruction cache
93
    ICACHE_NUM_BLOCKS            : natural := 4;      -- i-cache: number of blocks (min 1), has to be a power of 2
94
    ICACHE_BLOCK_SIZE            : natural := 64;     -- i-cache: block size in bytes (min 4), has to be a power of 2
95
    ICACHE_ASSOCIATIVITY         : natural := 1;      -- i-cache: associativity / number of sets (1=direct_mapped), has to be a power of 2
96
 
97
    -- Stream link interface (SLINK) --
98
    SLINK_NUM_TX                 : natural := 0;      -- number of TX links (0..8)
99
    SLINK_NUM_RX                 : natural := 0;      -- number of TX links (0..8)
100
    SLINK_TX_FIFO                : natural := 1;      -- TX fifo depth, has to be a power of two
101
    SLINK_RX_FIFO                : natural := 1;      -- RX fifo depth, has to be a power of two
102
 
103
    -- External Interrupts Controller (XIRQ) --
104
    XIRQ_NUM_CH                  : natural := 0;      -- number of external IRQ channels (0..32)
105
    XIRQ_TRIGGER_TYPE            : std_ulogic_vector(31 downto 0) := x"ffffffff"; -- trigger type: 0=level, 1=edge
106
    XIRQ_TRIGGER_POLARITY        : std_ulogic_vector(31 downto 0) := x"ffffffff"; -- trigger polarity: 0=low-level/falling-edge, 1=high-level/rising-edge
107
 
108
    -- Processor peripherals --
109
    IO_GPIO_EN                   : boolean := false;  -- implement general purpose input/output port unit (GPIO)?
110
    IO_MTIME_EN                  : boolean := false;  -- implement machine system timer (MTIME)?
111
    IO_UART0_EN                  : boolean := false;  -- implement primary universal asynchronous receiver/transmitter (UART0)?
112 65 zero_gravi
    IO_UART0_RX_FIFO             : natural := 1;      -- RX fifo depth, has to be a power of two, min 1
113
    IO_UART0_TX_FIFO             : natural := 1;      -- TX fifo depth, has to be a power of two, min 1
114 64 zero_gravi
    IO_UART1_EN                  : boolean := false;  -- implement secondary universal asynchronous receiver/transmitter (UART1)?
115 65 zero_gravi
    IO_UART1_RX_FIFO             : natural := 1;      -- RX fifo depth, has to be a power of two, min 1
116
    IO_UART1_TX_FIFO             : natural := 1;      -- TX fifo depth, has to be a power of two, min 1
117 64 zero_gravi
    IO_SPI_EN                    : boolean := false;  -- implement serial peripheral interface (SPI)?
118
    IO_TWI_EN                    : boolean := false;  -- implement two-wire interface (TWI)?
119
    IO_PWM_NUM_CH                : natural := 0;      -- number of PWM channels to implement (0..60); 0 = disabled
120
    IO_WDT_EN                    : boolean := false;  -- implement watch dog timer (WDT)?
121
    IO_TRNG_EN                   : boolean := false;  -- implement true random number generator (TRNG)?
122
    IO_CFS_EN                    : boolean := false;  -- implement custom functions subsystem (CFS)?
123
    IO_CFS_CONFIG                : std_ulogic_vector(31 downto 0) := x"00000000"; -- custom CFS configuration generic
124
    IO_CFS_IN_SIZE               : positive := 32;    -- size of CFS input conduit in bits
125
    IO_CFS_OUT_SIZE              : positive := 32;    -- size of CFS output conduit in bits
126
    IO_NEOLED_EN                 : boolean := false;  -- implement NeoPixel-compatible smart LED interface (NEOLED)?
127 67 zero_gravi
    IO_NEOLED_TX_FIFO            : natural := 1;      -- NEOLED TX FIFO depth, 1..32k, has to be a power of two
128
    IO_GPTMR_EN                  : boolean := false   -- implement general purpose timer (GPTMR)?
129 64 zero_gravi
  );
130
  port (
131
    -- Global control --
132
    clk_i          : in  std_ulogic; -- global clock, rising edge
133
    rstn_i         : in  std_ulogic; -- global reset, low-active, async
134
 
135
    -- JTAG on-chip debugger interface (available if ON_CHIP_DEBUGGER_EN = true) --
136
    jtag_trst_i    : in  std_ulogic := 'U'; -- low-active TAP reset (optional)
137
    jtag_tck_i     : in  std_ulogic := 'U'; -- serial clock
138
    jtag_tdi_i     : in  std_ulogic := 'U'; -- serial data input
139
    jtag_tdo_o     : out std_ulogic;        -- serial data output
140
    jtag_tms_i     : in  std_ulogic := 'U'; -- mode select
141
 
142
    -- AvalonMM interface
143
    read_o         : out std_logic;
144
    write_o        : out std_logic;
145
    waitrequest_i  : in std_logic := '0';
146
    byteenable_o   : out std_logic_vector(3 downto 0);
147
    address_o      : out std_logic_vector(31 downto 0);
148
    writedata_o    : out std_logic_vector(31 downto 0);
149
    readdata_i     : in std_logic_vector(31 downto 0) := (others => '0');
150
 
151
    -- Advanced memory control signals (available if MEM_EXT_EN = true) --
152
    fence_o        : out std_ulogic; -- indicates an executed FENCE operation
153
    fencei_o       : out std_ulogic; -- indicates an executed FENCEI operation
154
 
155
    -- TX stream interfaces (available if SLINK_NUM_TX > 0) --
156
    slink_tx_dat_o : out sdata_8x32_t; -- output data
157
    slink_tx_val_o : out std_ulogic_vector(7 downto 0); -- valid output
158
    slink_tx_rdy_i : in  std_ulogic_vector(7 downto 0) := (others => 'L'); -- ready to send
159
 
160
    -- RX stream interfaces (available if SLINK_NUM_RX > 0) --
161
    slink_rx_dat_i : in  sdata_8x32_t := (others => (others => 'U')); -- input data
162
    slink_rx_val_i : in  std_ulogic_vector(7 downto 0) := (others => 'L'); -- valid input
163
    slink_rx_rdy_o : out std_ulogic_vector(7 downto 0); -- ready to receive
164
 
165
    -- GPIO (available if IO_GPIO_EN = true) --
166
    gpio_o         : out std_ulogic_vector(63 downto 0); -- parallel output
167
    gpio_i         : in  std_ulogic_vector(63 downto 0) := (others => 'U'); -- parallel input
168
 
169
    -- primary UART0 (available if IO_UART0_EN = true) --
170
    uart0_txd_o    : out std_ulogic; -- UART0 send data
171
    uart0_rxd_i    : in  std_ulogic := 'U'; -- UART0 receive data
172
    uart0_rts_o    : out std_ulogic; -- hw flow control: UART0.RX ready to receive ("RTR"), low-active, optional
173
    uart0_cts_i    : in  std_ulogic := 'L'; -- hw flow control: UART0.TX allowed to transmit, low-active, optional
174
 
175
    -- secondary UART1 (available if IO_UART1_EN = true) --
176
    uart1_txd_o    : out std_ulogic; -- UART1 send data
177
    uart1_rxd_i    : in  std_ulogic := 'U'; -- UART1 receive data
178
    uart1_rts_o    : out std_ulogic; -- hw flow control: UART1.RX ready to receive ("RTR"), low-active, optional
179
    uart1_cts_i    : in  std_ulogic := 'L'; -- hw flow control: UART1.TX allowed to transmit, low-active, optional
180
 
181
    -- SPI (available if IO_SPI_EN = true) --
182
    spi_sck_o      : out std_ulogic; -- SPI serial clock
183
    spi_sdo_o      : out std_ulogic; -- controller data out, peripheral data in
184
    spi_sdi_i      : in  std_ulogic := 'U'; -- controller data in, peripheral data out
185
    spi_csn_o      : out std_ulogic_vector(07 downto 0); -- chip-select
186
 
187
    -- TWI (available if IO_TWI_EN = true) --
188
    twi_sda_io     : inout std_logic := 'U'; -- twi serial data line
189
    twi_scl_io     : inout std_logic := 'U'; -- twi serial clock line
190
 
191
    -- PWM (available if IO_PWM_NUM_CH > 0) --
192
    pwm_o          : out std_ulogic_vector(IO_PWM_NUM_CH-1 downto 0); -- pwm channels
193
 
194
    -- Custom Functions Subsystem IO (available if IO_CFS_EN = true) --
195
    cfs_in_i       : in  std_ulogic_vector(IO_CFS_IN_SIZE-1  downto 0) := (others => 'U'); -- custom CFS inputs conduit
196
    cfs_out_o      : out std_ulogic_vector(IO_CFS_OUT_SIZE-1 downto 0); -- custom CFS outputs conduit
197
 
198
    -- NeoPixel-compatible smart LED interface (available if IO_NEOLED_EN = true) --
199
    neoled_o       : out std_ulogic; -- async serial data line
200
 
201
    -- System time --
202
    mtime_i        : in  std_ulogic_vector(63 downto 0) := (others => 'U'); -- current system time from ext. MTIME (if IO_MTIME_EN = false)
203
    mtime_o        : out std_ulogic_vector(63 downto 0); -- current system time from int. MTIME (if IO_MTIME_EN = true)
204
 
205
    -- External platform interrupts (available if XIRQ_NUM_CH > 0) --
206
    xirq_i         : in  std_ulogic_vector(XIRQ_NUM_CH-1 downto 0) := (others => 'L'); -- IRQ channels
207
 
208
    -- CPU interrupts --
209
    mtime_irq_i    : in  std_ulogic := 'L'; -- machine timer interrupt, available if IO_MTIME_EN = false
210
    msw_irq_i      : in  std_ulogic := 'L'; -- machine software interrupt
211
    mext_irq_i     : in  std_ulogic := 'L'  -- machine external interrupt
212
  );
213
end neorv32_top_avalonmm;
214
 
215
architecture neorv32_top_avalonmm_rtl of neorv32_top_avalonmm is
216
 
217 65 zero_gravi
  -- Wishbone bus interface (available if MEM_EXT_EN = true) --
218
  signal wb_tag_o  : std_ulogic_vector(02 downto 0); -- request tag
219
  signal wb_adr_o  : std_ulogic_vector(31 downto 0); -- address
220
  signal wb_dat_i  : std_ulogic_vector(31 downto 0) := (others => 'U'); -- read data
221
  signal wb_dat_o  : std_ulogic_vector(31 downto 0); -- write data
222
  signal wb_we_o   : std_ulogic; -- read/write
223
  signal wb_sel_o  : std_ulogic_vector(03 downto 0); -- byte enable
224
  signal wb_stb_o  : std_ulogic; -- strobe
225
  signal wb_cyc_o  : std_ulogic; -- valid cycle
226
  signal wb_lock_o : std_ulogic; -- exclusive access request
227
  signal wb_ack_i  : std_ulogic := 'L'; -- transfer acknowledge
228
  signal wb_err_i  : std_ulogic := 'L'; -- transfer error
229 64 zero_gravi
 
230
begin
231
 
232
  neorv32_top_map : neorv32_top
233
  generic map (
234
    -- General --
235
    CLOCK_FREQUENCY => CLOCK_FREQUENCY,
236
    HW_THREAD_ID => HW_THREAD_ID,
237
    INT_BOOTLOADER_EN => INT_BOOTLOADER_EN,
238
 
239
    -- On-Chip Debugger (OCD) --
240
    ON_CHIP_DEBUGGER_EN => ON_CHIP_DEBUGGER_EN,
241
 
242
    -- RISC-V CPU Extensions --
243
    CPU_EXTENSION_RISCV_A => CPU_EXTENSION_RISCV_A,
244 66 zero_gravi
    CPU_EXTENSION_RISCV_B => CPU_EXTENSION_RISCV_B,
245 64 zero_gravi
    CPU_EXTENSION_RISCV_C => CPU_EXTENSION_RISCV_C,
246
    CPU_EXTENSION_RISCV_E => CPU_EXTENSION_RISCV_E,
247
    CPU_EXTENSION_RISCV_M => CPU_EXTENSION_RISCV_M,
248
    CPU_EXTENSION_RISCV_U => CPU_EXTENSION_RISCV_U,
249
    CPU_EXTENSION_RISCV_Zfinx => CPU_EXTENSION_RISCV_Zfinx,
250
    CPU_EXTENSION_RISCV_Zicsr => CPU_EXTENSION_RISCV_Zicsr,
251 66 zero_gravi
    CPU_EXTENSION_RISCV_Zicntr => CPU_EXTENSION_RISCV_Zicntr,
252
    CPU_EXTENSION_RISCV_Zihpm => CPU_EXTENSION_RISCV_Zihpm,
253 64 zero_gravi
    CPU_EXTENSION_RISCV_Zifencei => CPU_EXTENSION_RISCV_Zifencei,
254
    CPU_EXTENSION_RISCV_Zmmul => CPU_EXTENSION_RISCV_Zmmul,
255
 
256
    -- Extension Options --
257
    FAST_MUL_EN => FAST_MUL_EN,
258
    FAST_SHIFT_EN => FAST_SHIFT_EN,
259
    CPU_CNT_WIDTH => CPU_CNT_WIDTH,
260
    CPU_IPB_ENTRIES => CPU_IPB_ENTRIES,
261
 
262
    -- Physical Memory Protection (PMP) --
263
    PMP_NUM_REGIONS => PMP_NUM_REGIONS,
264
    PMP_MIN_GRANULARITY => PMP_MIN_GRANULARITY,
265
 
266
    -- Hardware Performance Monitors (HPM) --
267
    HPM_NUM_CNTS => HPM_NUM_CNTS,
268
    HPM_CNT_WIDTH => HPM_CNT_WIDTH,
269
 
270
    -- Internal Instruction memory (IMEM) --
271
    MEM_INT_IMEM_EN => MEM_INT_IMEM_EN,
272
    MEM_INT_IMEM_SIZE => MEM_INT_IMEM_SIZE,
273
 
274
    -- Internal Data memory (DMEM) --
275
    MEM_INT_DMEM_EN => MEM_INT_IMEM_EN,
276
    MEM_INT_DMEM_SIZE => MEM_INT_DMEM_SIZE,
277
 
278
    -- Internal Cache memory (iCACHE) --
279
    ICACHE_EN => ICACHE_EN,
280
    ICACHE_NUM_BLOCKS => ICACHE_NUM_BLOCKS,
281
    ICACHE_BLOCK_SIZE => ICACHE_BLOCK_SIZE,
282
    ICACHE_ASSOCIATIVITY => ICACHE_ASSOCIATIVITY,
283
 
284
    -- External memory interface (WISHBONE) --
285
    MEM_EXT_EN => true,
286
    MEM_EXT_TIMEOUT => 0,
287
    MEM_EXT_PIPE_MODE => false,
288
    MEM_EXT_BIG_ENDIAN => false,
289
    MEM_EXT_ASYNC_RX => false,
290
 
291
    -- Stream link interface (SLINK) --
292
    SLINK_NUM_TX => SLINK_NUM_TX,
293
    SLINK_NUM_RX => SLINK_NUM_RX,
294
    SLINK_TX_FIFO => SLINK_TX_FIFO,
295
    SLINK_RX_FIFO => SLINK_RX_FIFO,
296
 
297
    -- External Interrupts Controller (XIRQ) --
298
    XIRQ_NUM_CH => XIRQ_NUM_CH,
299
    XIRQ_TRIGGER_TYPE => XIRQ_TRIGGER_TYPE,
300
    XIRQ_TRIGGER_POLARITY => XIRQ_TRIGGER_POLARITY,
301
 
302
    -- Processor peripherals --
303
    IO_GPIO_EN => IO_GPIO_EN,
304
    IO_MTIME_EN => IO_MTIME_EN,
305
    IO_UART0_EN => IO_UART0_EN,
306 65 zero_gravi
    IO_UART0_RX_FIFO => IO_UART0_RX_FIFO,
307
    IO_UART0_TX_FIFO => IO_UART0_TX_FIFO,
308 64 zero_gravi
    IO_UART1_EN => IO_UART1_EN,
309 65 zero_gravi
    IO_UART1_RX_FIFO => IO_UART1_RX_FIFO,
310
    IO_UART1_TX_FIFO => IO_UART1_TX_FIFO,
311 64 zero_gravi
    IO_SPI_EN => IO_SPI_EN,
312
    IO_TWI_EN => IO_TWI_EN,
313
    IO_PWM_NUM_CH => IO_PWM_NUM_CH,
314
    IO_WDT_EN => IO_WDT_EN,
315
    IO_TRNG_EN => IO_TRNG_EN,
316
    IO_CFS_EN => IO_CFS_EN,
317
    IO_CFS_CONFIG => IO_CFS_CONFIG,
318
    IO_CFS_IN_SIZE => IO_CFS_IN_SIZE,
319
    IO_CFS_OUT_SIZE => IO_CFS_OUT_SIZE,
320
    IO_NEOLED_EN => IO_NEOLED_EN,
321 67 zero_gravi
    IO_NEOLED_TX_FIFO => IO_NEOLED_TX_FIFO,
322
    IO_GPTMR_EN => IO_GPTMR_EN
323
    )
324 64 zero_gravi
  port map (
325
    -- Global control --
326
    clk_i => clk_i,
327
    rstn_i => rstn_i,
328
 
329
    -- JTAG on-chip debugger interface (available if ON_CHIP_DEBUGGER_EN = true) --
330
    jtag_trst_i => jtag_trst_i,
331
    jtag_tck_i => jtag_tck_i,
332
    jtag_tdi_i => jtag_tdi_i,
333
    jtag_tdo_o => jtag_tdo_o,
334
    jtag_tms_i => jtag_tms_i,
335
 
336
    -- Wishbone bus interface (available if MEM_EXT_EN = true) --
337
    wb_tag_o => wb_tag_o,
338
    wb_adr_o => wb_adr_o,
339
    wb_dat_i => wb_dat_i,
340
    wb_dat_o => wb_dat_o,
341
    wb_we_o => wb_we_o,
342
    wb_sel_o => wb_sel_o,
343
    wb_stb_o => wb_stb_o,
344
    wb_cyc_o => wb_cyc_o,
345
    wb_lock_o => wb_lock_o,
346
    wb_ack_i => wb_ack_i,
347
    wb_err_i => wb_err_i,
348
 
349
    -- Advanced memory control signals (available if MEM_EXT_EN = true) --
350
    fence_o => fence_o,
351
    fencei_o => fencei_o,
352
 
353
    -- TX stream interfaces (available if SLINK_NUM_TX > 0) --
354
    slink_tx_dat_o => slink_tx_dat_o,
355
    slink_tx_val_o => slink_tx_val_o,
356
    slink_tx_rdy_i => slink_tx_rdy_i,
357
 
358
    -- RX stream interfaces (available if SLINK_NUM_RX > 0) --
359
    slink_rx_dat_i => slink_rx_dat_i,
360
    slink_rx_val_i => slink_rx_val_i,
361
    slink_rx_rdy_o => slink_rx_rdy_o,
362
 
363
    -- GPIO (available if IO_GPIO_EN = true) --
364
    gpio_o => gpio_o,
365
    gpio_i => gpio_i,
366
 
367
    -- primary UART0 (available if IO_UART0_EN = true) --
368
    uart0_txd_o => uart0_txd_o,
369
    uart0_rxd_i => uart0_rxd_i,
370
    uart0_rts_o => uart0_rts_o,
371
    uart0_cts_i => uart0_cts_i,
372
 
373
    -- secondary UART1 (available if IO_UART1_EN = true) --
374
    uart1_txd_o => uart1_txd_o,
375
    uart1_rxd_i => uart1_rxd_i,
376
    uart1_rts_o => uart1_rts_o,
377
    uart1_cts_i => uart1_cts_i,
378
 
379
    -- SPI (available if IO_SPI_EN = true) --
380
    spi_sck_o => spi_sck_o,
381
    spi_sdo_o => spi_sdo_o,
382
    spi_sdi_i => spi_sdi_i,
383
    spi_csn_o => spi_csn_o,
384
 
385
    -- TWI (available if IO_TWI_EN = true) --
386
    twi_sda_io => twi_sda_io,
387
    twi_scl_io => twi_scl_io,
388
 
389
    -- PWM (available if IO_PWM_NUM_CH > 0) --
390
    pwm_o => pwm_o,
391
 
392
    -- Custom Functions Subsystem IO (available if IO_CFS_EN = true) --
393
    cfs_in_i => cfs_in_i,
394
    cfs_out_o => cfs_out_o,
395
 
396
    -- NeoPixel-compatible smart LED interface (available if IO_NEOLED_EN = true) --
397
    neoled_o => neoled_o,
398
 
399
    -- System time --
400
    mtime_i => mtime_i,
401
    mtime_o => mtime_o,
402
 
403
    -- External platform interrupts (available if XIRQ_NUM_CH > 0) --
404
    xirq_i => xirq_i,
405
 
406
    -- CPU interrupts --
407
    mtime_irq_i => mtime_irq_i,
408
    msw_irq_i => msw_irq_i,
409 65 zero_gravi
    mext_irq_i => mext_irq_i
410
  );
411 64 zero_gravi
 
412 65 zero_gravi
  -- Wishbone to AvalonMM bridge
413 64 zero_gravi
  read_o <= '1' when (wb_stb_o = '1' and wb_we_o = '0') else '0';
414
  write_o <= '1' when (wb_stb_o = '1' and wb_we_o = '1') else '0';
415
  address_o <= std_logic_vector(wb_adr_o);
416
  writedata_o <= std_logic_vector(wb_dat_o);
417
  byteenable_o <= std_logic_vector(wb_sel_o);
418
 
419
  wb_dat_i <= std_ulogic_vector(readdata_i);
420
  wb_ack_i <= not(waitrequest_i);
421
  wb_err_i <= '0';
422
 
423
end neorv32_top_avalonmm_rtl;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.