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 65

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
    CPU_EXTENSION_RISCV_C        : boolean := false;  -- implement compressed extension?
58
    CPU_EXTENSION_RISCV_E        : boolean := false;  -- implement embedded RF extension?
59
    CPU_EXTENSION_RISCV_M        : boolean := false;  -- implement mul/div extension?
60
    CPU_EXTENSION_RISCV_U        : boolean := false;  -- implement user mode extension?
61
    CPU_EXTENSION_RISCV_Zbb      : boolean := false;  -- implement basic bit-manipulation sub-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
    CPU_EXTENSION_RISCV_Zifencei : boolean := false;  -- implement instruction stream sync.?
65
    CPU_EXTENSION_RISCV_Zmmul    : boolean := false;  -- implement multiply-only M sub-extension?
66
 
67
    -- Extension Options --
68
    FAST_MUL_EN                  : boolean := false;  -- use DSPs for M extension's multiplier
69
    FAST_SHIFT_EN                : boolean := false;  -- use barrel shifter for shift operations
70
    CPU_CNT_WIDTH                : natural := 64;     -- total width of CPU cycle and instret counters (0..64)
71
    CPU_IPB_ENTRIES              : natural := 2;      -- entries is instruction prefetch buffer, has to be a power of 2
72
 
73
    -- Physical Memory Protection (PMP) --
74
    PMP_NUM_REGIONS              : natural := 0;      -- number of regions (0..64)
75
    PMP_MIN_GRANULARITY          : natural := 64*1024; -- minimal region granularity in bytes, has to be a power of 2, min 8 bytes
76
 
77
    -- Hardware Performance Monitors (HPM) --
78
    HPM_NUM_CNTS                 : natural := 0;      -- number of implemented HPM counters (0..29)
79
    HPM_CNT_WIDTH                : natural := 40;     -- total size of HPM counters (0..64)
80
 
81
    -- Internal Instruction memory (IMEM) --
82
    MEM_INT_IMEM_EN              : boolean := false;  -- implement processor-internal instruction memory
83
    MEM_INT_IMEM_SIZE            : natural := 16*1024; -- size of processor-internal instruction memory in bytes
84
 
85
    -- Internal Data memory (DMEM) --
86
    MEM_INT_DMEM_EN              : boolean := false;  -- implement processor-internal data memory
87
    MEM_INT_DMEM_SIZE            : natural := 8*1024; -- size of processor-internal data memory in bytes
88
 
89
    -- Internal Cache memory (iCACHE) --
90
    ICACHE_EN                    : boolean := false;  -- implement instruction cache
91
    ICACHE_NUM_BLOCKS            : natural := 4;      -- i-cache: number of blocks (min 1), has to be a power of 2
92
    ICACHE_BLOCK_SIZE            : natural := 64;     -- i-cache: block size in bytes (min 4), has to be a power of 2
93
    ICACHE_ASSOCIATIVITY         : natural := 1;      -- i-cache: associativity / number of sets (1=direct_mapped), has to be a power of 2
94
 
95
    -- Stream link interface (SLINK) --
96
    SLINK_NUM_TX                 : natural := 0;      -- number of TX links (0..8)
97
    SLINK_NUM_RX                 : natural := 0;      -- number of TX links (0..8)
98
    SLINK_TX_FIFO                : natural := 1;      -- TX fifo depth, has to be a power of two
99
    SLINK_RX_FIFO                : natural := 1;      -- RX fifo depth, has to be a power of two
100
 
101
    -- External Interrupts Controller (XIRQ) --
102
    XIRQ_NUM_CH                  : natural := 0;      -- number of external IRQ channels (0..32)
103
    XIRQ_TRIGGER_TYPE            : std_ulogic_vector(31 downto 0) := x"ffffffff"; -- trigger type: 0=level, 1=edge
104
    XIRQ_TRIGGER_POLARITY        : std_ulogic_vector(31 downto 0) := x"ffffffff"; -- trigger polarity: 0=low-level/falling-edge, 1=high-level/rising-edge
105
 
106
    -- Processor peripherals --
107
    IO_GPIO_EN                   : boolean := false;  -- implement general purpose input/output port unit (GPIO)?
108
    IO_MTIME_EN                  : boolean := false;  -- implement machine system timer (MTIME)?
109
    IO_UART0_EN                  : boolean := false;  -- implement primary universal asynchronous receiver/transmitter (UART0)?
110 65 zero_gravi
    IO_UART0_RX_FIFO             : natural := 1;      -- RX fifo depth, has to be a power of two, min 1
111
    IO_UART0_TX_FIFO             : natural := 1;      -- TX fifo depth, has to be a power of two, min 1
112 64 zero_gravi
    IO_UART1_EN                  : boolean := false;  -- implement secondary universal asynchronous receiver/transmitter (UART1)?
113 65 zero_gravi
    IO_UART1_RX_FIFO             : natural := 1;      -- RX fifo depth, has to be a power of two, min 1
114
    IO_UART1_TX_FIFO             : natural := 1;      -- TX fifo depth, has to be a power of two, min 1
115 64 zero_gravi
    IO_SPI_EN                    : boolean := false;  -- implement serial peripheral interface (SPI)?
116
    IO_TWI_EN                    : boolean := false;  -- implement two-wire interface (TWI)?
117
    IO_PWM_NUM_CH                : natural := 0;      -- number of PWM channels to implement (0..60); 0 = disabled
118
    IO_WDT_EN                    : boolean := false;  -- implement watch dog timer (WDT)?
119
    IO_TRNG_EN                   : boolean := false;  -- implement true random number generator (TRNG)?
120
    IO_CFS_EN                    : boolean := false;  -- implement custom functions subsystem (CFS)?
121
    IO_CFS_CONFIG                : std_ulogic_vector(31 downto 0) := x"00000000"; -- custom CFS configuration generic
122
    IO_CFS_IN_SIZE               : positive := 32;    -- size of CFS input conduit in bits
123
    IO_CFS_OUT_SIZE              : positive := 32;    -- size of CFS output conduit in bits
124
    IO_NEOLED_EN                 : boolean := false;  -- implement NeoPixel-compatible smart LED interface (NEOLED)?
125
    IO_NEOLED_TX_FIFO            : natural := 1       -- NEOLED TX FIFO depth, 1..32k, has to be a power of two
126
  );
127
  port (
128
    -- Global control --
129
    clk_i          : in  std_ulogic; -- global clock, rising edge
130
    rstn_i         : in  std_ulogic; -- global reset, low-active, async
131
 
132
    -- JTAG on-chip debugger interface (available if ON_CHIP_DEBUGGER_EN = true) --
133
    jtag_trst_i    : in  std_ulogic := 'U'; -- low-active TAP reset (optional)
134
    jtag_tck_i     : in  std_ulogic := 'U'; -- serial clock
135
    jtag_tdi_i     : in  std_ulogic := 'U'; -- serial data input
136
    jtag_tdo_o     : out std_ulogic;        -- serial data output
137
    jtag_tms_i     : in  std_ulogic := 'U'; -- mode select
138
 
139
    -- AvalonMM interface
140
    read_o         : out std_logic;
141
    write_o        : out std_logic;
142
    waitrequest_i  : in std_logic := '0';
143
    byteenable_o   : out std_logic_vector(3 downto 0);
144
    address_o      : out std_logic_vector(31 downto 0);
145
    writedata_o    : out std_logic_vector(31 downto 0);
146
    readdata_i     : in std_logic_vector(31 downto 0) := (others => '0');
147
 
148
    -- Advanced memory control signals (available if MEM_EXT_EN = true) --
149
    fence_o        : out std_ulogic; -- indicates an executed FENCE operation
150
    fencei_o       : out std_ulogic; -- indicates an executed FENCEI operation
151
 
152
    -- TX stream interfaces (available if SLINK_NUM_TX > 0) --
153
    slink_tx_dat_o : out sdata_8x32_t; -- output data
154
    slink_tx_val_o : out std_ulogic_vector(7 downto 0); -- valid output
155
    slink_tx_rdy_i : in  std_ulogic_vector(7 downto 0) := (others => 'L'); -- ready to send
156
 
157
    -- RX stream interfaces (available if SLINK_NUM_RX > 0) --
158
    slink_rx_dat_i : in  sdata_8x32_t := (others => (others => 'U')); -- input data
159
    slink_rx_val_i : in  std_ulogic_vector(7 downto 0) := (others => 'L'); -- valid input
160
    slink_rx_rdy_o : out std_ulogic_vector(7 downto 0); -- ready to receive
161
 
162
    -- GPIO (available if IO_GPIO_EN = true) --
163
    gpio_o         : out std_ulogic_vector(63 downto 0); -- parallel output
164
    gpio_i         : in  std_ulogic_vector(63 downto 0) := (others => 'U'); -- parallel input
165
 
166
    -- primary UART0 (available if IO_UART0_EN = true) --
167
    uart0_txd_o    : out std_ulogic; -- UART0 send data
168
    uart0_rxd_i    : in  std_ulogic := 'U'; -- UART0 receive data
169
    uart0_rts_o    : out std_ulogic; -- hw flow control: UART0.RX ready to receive ("RTR"), low-active, optional
170
    uart0_cts_i    : in  std_ulogic := 'L'; -- hw flow control: UART0.TX allowed to transmit, low-active, optional
171
 
172
    -- secondary UART1 (available if IO_UART1_EN = true) --
173
    uart1_txd_o    : out std_ulogic; -- UART1 send data
174
    uart1_rxd_i    : in  std_ulogic := 'U'; -- UART1 receive data
175
    uart1_rts_o    : out std_ulogic; -- hw flow control: UART1.RX ready to receive ("RTR"), low-active, optional
176
    uart1_cts_i    : in  std_ulogic := 'L'; -- hw flow control: UART1.TX allowed to transmit, low-active, optional
177
 
178
    -- SPI (available if IO_SPI_EN = true) --
179
    spi_sck_o      : out std_ulogic; -- SPI serial clock
180
    spi_sdo_o      : out std_ulogic; -- controller data out, peripheral data in
181
    spi_sdi_i      : in  std_ulogic := 'U'; -- controller data in, peripheral data out
182
    spi_csn_o      : out std_ulogic_vector(07 downto 0); -- chip-select
183
 
184
    -- TWI (available if IO_TWI_EN = true) --
185
    twi_sda_io     : inout std_logic := 'U'; -- twi serial data line
186
    twi_scl_io     : inout std_logic := 'U'; -- twi serial clock line
187
 
188
    -- PWM (available if IO_PWM_NUM_CH > 0) --
189
    pwm_o          : out std_ulogic_vector(IO_PWM_NUM_CH-1 downto 0); -- pwm channels
190
 
191
    -- Custom Functions Subsystem IO (available if IO_CFS_EN = true) --
192
    cfs_in_i       : in  std_ulogic_vector(IO_CFS_IN_SIZE-1  downto 0) := (others => 'U'); -- custom CFS inputs conduit
193
    cfs_out_o      : out std_ulogic_vector(IO_CFS_OUT_SIZE-1 downto 0); -- custom CFS outputs conduit
194
 
195
    -- NeoPixel-compatible smart LED interface (available if IO_NEOLED_EN = true) --
196
    neoled_o       : out std_ulogic; -- async serial data line
197
 
198
    -- System time --
199
    mtime_i        : in  std_ulogic_vector(63 downto 0) := (others => 'U'); -- current system time from ext. MTIME (if IO_MTIME_EN = false)
200
    mtime_o        : out std_ulogic_vector(63 downto 0); -- current system time from int. MTIME (if IO_MTIME_EN = true)
201
 
202
    -- External platform interrupts (available if XIRQ_NUM_CH > 0) --
203
    xirq_i         : in  std_ulogic_vector(XIRQ_NUM_CH-1 downto 0) := (others => 'L'); -- IRQ channels
204
 
205
    -- CPU interrupts --
206
    mtime_irq_i    : in  std_ulogic := 'L'; -- machine timer interrupt, available if IO_MTIME_EN = false
207
    msw_irq_i      : in  std_ulogic := 'L'; -- machine software interrupt
208
    mext_irq_i     : in  std_ulogic := 'L'  -- machine external interrupt
209
  );
210
end neorv32_top_avalonmm;
211
 
212
architecture neorv32_top_avalonmm_rtl of neorv32_top_avalonmm is
213
 
214 65 zero_gravi
  -- Wishbone bus interface (available if MEM_EXT_EN = true) --
215
  signal wb_tag_o  : std_ulogic_vector(02 downto 0); -- request tag
216
  signal wb_adr_o  : std_ulogic_vector(31 downto 0); -- address
217
  signal wb_dat_i  : std_ulogic_vector(31 downto 0) := (others => 'U'); -- read data
218
  signal wb_dat_o  : std_ulogic_vector(31 downto 0); -- write data
219
  signal wb_we_o   : std_ulogic; -- read/write
220
  signal wb_sel_o  : std_ulogic_vector(03 downto 0); -- byte enable
221
  signal wb_stb_o  : std_ulogic; -- strobe
222
  signal wb_cyc_o  : std_ulogic; -- valid cycle
223
  signal wb_lock_o : std_ulogic; -- exclusive access request
224
  signal wb_ack_i  : std_ulogic := 'L'; -- transfer acknowledge
225
  signal wb_err_i  : std_ulogic := 'L'; -- transfer error
226 64 zero_gravi
 
227
begin
228
 
229
  neorv32_top_map : neorv32_top
230
  generic map (
231
    -- General --
232
    CLOCK_FREQUENCY => CLOCK_FREQUENCY,
233
    HW_THREAD_ID => HW_THREAD_ID,
234
    INT_BOOTLOADER_EN => INT_BOOTLOADER_EN,
235
 
236
    -- On-Chip Debugger (OCD) --
237
    ON_CHIP_DEBUGGER_EN => ON_CHIP_DEBUGGER_EN,
238
 
239
    -- RISC-V CPU Extensions --
240
    CPU_EXTENSION_RISCV_A => CPU_EXTENSION_RISCV_A,
241
    CPU_EXTENSION_RISCV_C => CPU_EXTENSION_RISCV_C,
242
    CPU_EXTENSION_RISCV_E => CPU_EXTENSION_RISCV_E,
243
    CPU_EXTENSION_RISCV_M => CPU_EXTENSION_RISCV_M,
244
    CPU_EXTENSION_RISCV_U => CPU_EXTENSION_RISCV_U,
245
    CPU_EXTENSION_RISCV_Zbb => CPU_EXTENSION_RISCV_Zbb,
246
    CPU_EXTENSION_RISCV_Zfinx => CPU_EXTENSION_RISCV_Zfinx,
247
    CPU_EXTENSION_RISCV_Zicsr => CPU_EXTENSION_RISCV_Zicsr,
248
    CPU_EXTENSION_RISCV_Zifencei => CPU_EXTENSION_RISCV_Zifencei,
249
    CPU_EXTENSION_RISCV_Zmmul => CPU_EXTENSION_RISCV_Zmmul,
250
 
251
    -- Extension Options --
252
    FAST_MUL_EN => FAST_MUL_EN,
253
    FAST_SHIFT_EN => FAST_SHIFT_EN,
254
    CPU_CNT_WIDTH => CPU_CNT_WIDTH,
255
    CPU_IPB_ENTRIES => CPU_IPB_ENTRIES,
256
 
257
    -- Physical Memory Protection (PMP) --
258
    PMP_NUM_REGIONS => PMP_NUM_REGIONS,
259
    PMP_MIN_GRANULARITY => PMP_MIN_GRANULARITY,
260
 
261
    -- Hardware Performance Monitors (HPM) --
262
    HPM_NUM_CNTS => HPM_NUM_CNTS,
263
    HPM_CNT_WIDTH => HPM_CNT_WIDTH,
264
 
265
    -- Internal Instruction memory (IMEM) --
266
    MEM_INT_IMEM_EN => MEM_INT_IMEM_EN,
267
    MEM_INT_IMEM_SIZE => MEM_INT_IMEM_SIZE,
268
 
269
    -- Internal Data memory (DMEM) --
270
    MEM_INT_DMEM_EN => MEM_INT_IMEM_EN,
271
    MEM_INT_DMEM_SIZE => MEM_INT_DMEM_SIZE,
272
 
273
    -- Internal Cache memory (iCACHE) --
274
    ICACHE_EN => ICACHE_EN,
275
    ICACHE_NUM_BLOCKS => ICACHE_NUM_BLOCKS,
276
    ICACHE_BLOCK_SIZE => ICACHE_BLOCK_SIZE,
277
    ICACHE_ASSOCIATIVITY => ICACHE_ASSOCIATIVITY,
278
 
279
    -- External memory interface (WISHBONE) --
280
    MEM_EXT_EN => true,
281
    MEM_EXT_TIMEOUT => 0,
282
    MEM_EXT_PIPE_MODE => false,
283
    MEM_EXT_BIG_ENDIAN => false,
284
    MEM_EXT_ASYNC_RX => false,
285
 
286
    -- Stream link interface (SLINK) --
287
    SLINK_NUM_TX => SLINK_NUM_TX,
288
    SLINK_NUM_RX => SLINK_NUM_RX,
289
    SLINK_TX_FIFO => SLINK_TX_FIFO,
290
    SLINK_RX_FIFO => SLINK_RX_FIFO,
291
 
292
    -- External Interrupts Controller (XIRQ) --
293
    XIRQ_NUM_CH => XIRQ_NUM_CH,
294
    XIRQ_TRIGGER_TYPE => XIRQ_TRIGGER_TYPE,
295
    XIRQ_TRIGGER_POLARITY => XIRQ_TRIGGER_POLARITY,
296
 
297
    -- Processor peripherals --
298
    IO_GPIO_EN => IO_GPIO_EN,
299
    IO_MTIME_EN => IO_MTIME_EN,
300
    IO_UART0_EN => IO_UART0_EN,
301 65 zero_gravi
    IO_UART0_RX_FIFO => IO_UART0_RX_FIFO,
302
    IO_UART0_TX_FIFO => IO_UART0_TX_FIFO,
303 64 zero_gravi
    IO_UART1_EN => IO_UART1_EN,
304 65 zero_gravi
    IO_UART1_RX_FIFO => IO_UART1_RX_FIFO,
305
    IO_UART1_TX_FIFO => IO_UART1_TX_FIFO,
306 64 zero_gravi
    IO_SPI_EN => IO_SPI_EN,
307
    IO_TWI_EN => IO_TWI_EN,
308
    IO_PWM_NUM_CH => IO_PWM_NUM_CH,
309
    IO_WDT_EN => IO_WDT_EN,
310
    IO_TRNG_EN => IO_TRNG_EN,
311
    IO_CFS_EN => IO_CFS_EN,
312
    IO_CFS_CONFIG => IO_CFS_CONFIG,
313
    IO_CFS_IN_SIZE => IO_CFS_IN_SIZE,
314
    IO_CFS_OUT_SIZE => IO_CFS_OUT_SIZE,
315
    IO_NEOLED_EN => IO_NEOLED_EN,
316
    IO_NEOLED_TX_FIFO => IO_NEOLED_TX_FIFO)
317
  port map (
318
    -- Global control --
319
    clk_i => clk_i,
320
    rstn_i => rstn_i,
321
 
322
    -- JTAG on-chip debugger interface (available if ON_CHIP_DEBUGGER_EN = true) --
323
    jtag_trst_i => jtag_trst_i,
324
    jtag_tck_i => jtag_tck_i,
325
    jtag_tdi_i => jtag_tdi_i,
326
    jtag_tdo_o => jtag_tdo_o,
327
    jtag_tms_i => jtag_tms_i,
328
 
329
    -- Wishbone bus interface (available if MEM_EXT_EN = true) --
330
    wb_tag_o => wb_tag_o,
331
    wb_adr_o => wb_adr_o,
332
    wb_dat_i => wb_dat_i,
333
    wb_dat_o => wb_dat_o,
334
    wb_we_o => wb_we_o,
335
    wb_sel_o => wb_sel_o,
336
    wb_stb_o => wb_stb_o,
337
    wb_cyc_o => wb_cyc_o,
338
    wb_lock_o => wb_lock_o,
339
    wb_ack_i => wb_ack_i,
340
    wb_err_i => wb_err_i,
341
 
342
    -- Advanced memory control signals (available if MEM_EXT_EN = true) --
343
    fence_o => fence_o,
344
    fencei_o => fencei_o,
345
 
346
    -- TX stream interfaces (available if SLINK_NUM_TX > 0) --
347
    slink_tx_dat_o => slink_tx_dat_o,
348
    slink_tx_val_o => slink_tx_val_o,
349
    slink_tx_rdy_i => slink_tx_rdy_i,
350
 
351
    -- RX stream interfaces (available if SLINK_NUM_RX > 0) --
352
    slink_rx_dat_i => slink_rx_dat_i,
353
    slink_rx_val_i => slink_rx_val_i,
354
    slink_rx_rdy_o => slink_rx_rdy_o,
355
 
356
    -- GPIO (available if IO_GPIO_EN = true) --
357
    gpio_o => gpio_o,
358
    gpio_i => gpio_i,
359
 
360
    -- primary UART0 (available if IO_UART0_EN = true) --
361
    uart0_txd_o => uart0_txd_o,
362
    uart0_rxd_i => uart0_rxd_i,
363
    uart0_rts_o => uart0_rts_o,
364
    uart0_cts_i => uart0_cts_i,
365
 
366
    -- secondary UART1 (available if IO_UART1_EN = true) --
367
    uart1_txd_o => uart1_txd_o,
368
    uart1_rxd_i => uart1_rxd_i,
369
    uart1_rts_o => uart1_rts_o,
370
    uart1_cts_i => uart1_cts_i,
371
 
372
    -- SPI (available if IO_SPI_EN = true) --
373
    spi_sck_o => spi_sck_o,
374
    spi_sdo_o => spi_sdo_o,
375
    spi_sdi_i => spi_sdi_i,
376
    spi_csn_o => spi_csn_o,
377
 
378
    -- TWI (available if IO_TWI_EN = true) --
379
    twi_sda_io => twi_sda_io,
380
    twi_scl_io => twi_scl_io,
381
 
382
    -- PWM (available if IO_PWM_NUM_CH > 0) --
383
    pwm_o => pwm_o,
384
 
385
    -- Custom Functions Subsystem IO (available if IO_CFS_EN = true) --
386
    cfs_in_i => cfs_in_i,
387
    cfs_out_o => cfs_out_o,
388
 
389
    -- NeoPixel-compatible smart LED interface (available if IO_NEOLED_EN = true) --
390
    neoled_o => neoled_o,
391
 
392
    -- System time --
393
    mtime_i => mtime_i,
394
    mtime_o => mtime_o,
395
 
396
    -- External platform interrupts (available if XIRQ_NUM_CH > 0) --
397
    xirq_i => xirq_i,
398
 
399
    -- CPU interrupts --
400
    mtime_irq_i => mtime_irq_i,
401
    msw_irq_i => msw_irq_i,
402 65 zero_gravi
    mext_irq_i => mext_irq_i
403
  );
404 64 zero_gravi
 
405 65 zero_gravi
  -- Wishbone to AvalonMM bridge
406 64 zero_gravi
  read_o <= '1' when (wb_stb_o = '1' and wb_we_o = '0') else '0';
407
  write_o <= '1' when (wb_stb_o = '1' and wb_we_o = '1') else '0';
408
  address_o <= std_logic_vector(wb_adr_o);
409
  writedata_o <= std_logic_vector(wb_dat_o);
410
  byteenable_o <= std_logic_vector(wb_sel_o);
411
 
412
  wb_dat_i <= std_ulogic_vector(readdata_i);
413
  wb_ack_i <= not(waitrequest_i);
414
  wb_err_i <= '0';
415
 
416
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.