94 lines
5.1 KiB
Coq
94 lines
5.1 KiB
Coq
|
|
||
|
// #################################################################################################
|
||
|
// # << NEORV32 - Minimal setup without a bootloader >> #
|
||
|
// # ********************************************************************************************* #
|
||
|
// # BSD 3-Clause License #
|
||
|
// # #
|
||
|
// # Copyright (c) 2023, Stephan Nolting. All rights reserved. #
|
||
|
// # #
|
||
|
// # Redistribution and use in source and binary forms, with or without modification, are #
|
||
|
// # permitted provided that the following conditions are met: #
|
||
|
// # #
|
||
|
// # 1. Redistributions of source code must retain the above copyright notice, this list of #
|
||
|
// # conditions and the following disclaimer. #
|
||
|
// # #
|
||
|
// # 2. Redistributions in binary form must reproduce the above copyright notice, this list of #
|
||
|
// # conditions and the following disclaimer in the documentation and/or other materials #
|
||
|
// # provided with the distribution. #
|
||
|
// # #
|
||
|
// # 3. Neither the name of the copyright holder nor the names of its contributors may be used to #
|
||
|
// # endorse or promote products derived from this software without specific prior written #
|
||
|
// # permission. #
|
||
|
// # #
|
||
|
// # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS #
|
||
|
// # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF #
|
||
|
// # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE #
|
||
|
// # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, #
|
||
|
// # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE #
|
||
|
// # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED #
|
||
|
// # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING #
|
||
|
// # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED #
|
||
|
// # OF THE POSSIBILITY OF SUCH DAMAGE. #
|
||
|
// # ********************************************************************************************* #
|
||
|
// # The NEORV32 Processor - https://github.com/stnolting/neorv32 (c) Stephan Nolting #
|
||
|
// #################################################################################################
|
||
|
// no timescale needed
|
||
|
|
||
|
module neorv32_ProcessorTop_Minimal(
|
||
|
input wire clk_i,
|
||
|
input wire rstn_i,
|
||
|
output wire [IO_PWM_NUM_CH - 1:0] pwm_o
|
||
|
);
|
||
|
|
||
|
// General --
|
||
|
parameter [31:0] CLOCK_FREQUENCY=0;
|
||
|
parameter MEM_INT_IMEM_EN=true;
|
||
|
parameter [31:0] MEM_INT_IMEM_SIZE=8 * 1024;
|
||
|
parameter MEM_INT_DMEM_EN=true;
|
||
|
parameter [31:0] MEM_INT_DMEM_SIZE=64 * 1024;
|
||
|
parameter [31:0] IO_PWM_NUM_CH=3;
|
||
|
// number of PWM channels to implement (0..12); 0 = disabled
|
||
|
// Global control --
|
||
|
// PWM (available if IO_PWM_NUM_CH > 0) --
|
||
|
|
||
|
|
||
|
|
||
|
// internal IO connection --
|
||
|
wire [11:0] con_pwm_o;
|
||
|
|
||
|
// The core of the problem ----------------------------------------------------------------
|
||
|
// -------------------------------------------------------------------------------------------
|
||
|
neorv32_top #(
|
||
|
// General --
|
||
|
.CLOCK_FREQUENCY(CLOCK_FREQUENCY),
|
||
|
// clock frequency of clk_i in Hz
|
||
|
.INT_BOOTLOADER_EN(false),
|
||
|
// boot configuration: true = boot explicit bootloader; false = boot from int/ext (I)MEM
|
||
|
// Internal Instruction memory --
|
||
|
.MEM_INT_IMEM_EN(MEM_INT_IMEM_EN),
|
||
|
// implement processor-internal instruction memory
|
||
|
.MEM_INT_IMEM_SIZE(MEM_INT_IMEM_SIZE),
|
||
|
// size of processor-internal instruction memory in bytes
|
||
|
// Internal Data memory --
|
||
|
.MEM_INT_DMEM_EN(MEM_INT_DMEM_EN),
|
||
|
// implement processor-internal data memory
|
||
|
.MEM_INT_DMEM_SIZE(MEM_INT_DMEM_SIZE),
|
||
|
// size of processor-internal data memory in bytes
|
||
|
// Processor peripherals --
|
||
|
.IO_MTIME_EN(true),
|
||
|
// implement machine system timer (MTIME)?
|
||
|
.IO_PWM_NUM_CH(IO_PWM_NUM_CH))
|
||
|
neorv32_inst(
|
||
|
// Global control --
|
||
|
.clk_i(clk_i),
|
||
|
// global clock, rising edge
|
||
|
.rstn_i(rstn_i),
|
||
|
// global reset, low-active, async
|
||
|
// PWM (available if IO_PWM_NUM_CH > 0) --
|
||
|
.pwm_o(con_pwm_o));
|
||
|
|
||
|
// PWM --
|
||
|
assign pwm_o = con_pwm_o[IO_PWM_NUM_CH - 1:0];
|
||
|
|
||
|
endmodule
|