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 64

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