The UET-RVMCU project is funded under LFX Mentorship Program Spring 2024. This project aims to enhance the capabilities of the existing UETRV_Pcore RISC-V core, transforming it into a versatile and feature-rich open-source microcontroller. The core (UETRV_Pcore) is RV32IMA Linux-compatible and Privilege Architecture 1.10 compliant. Our vision is to provide a comprehensive RISC-V MCU solution accessible to the open-source community.
UETRV-PCore with a few modifications has been used as the Processor Core.
- RV32IMA Compatibility: Ensuring the core supports the RV32I base integer instruction set with the M (multiply), A (atomic), and I (integer) extensions.
- Pipeline converted from 5-stages to 3-stages
- Only M-mode supported
- MMU and Virtual Memory removed
- Block Memory integrated
GPIO peripherals will facilitate easy interfacing with external devices.
Features:
- GPIO port A, B and C, each having 8 pins.
- Configurable level interrupts
- GP-Special, 16 LEDs and 16 switches, of NexysA-7 board interfaced, with configurable interrupts.
Memory has been updated to four memory banks to support byte addressable accesses.
The Bitmanip extension offers advanced bitwise manipulation instructions, enhancing performance for tasks requiring intensive bit-level operations.
Features:
- Zba
- Zbb
- Zbc
- Zbs
Incorporating the Floating Point extension will enable hardware-accelerated floating-point computations, essential for applications requiring high precision and performance.
Goals:
- Integrate the Floating Point extension into the core.
- Optimize floating-point operations for performance.
- Ensure compliance with the RISC-V standard.
Enhancing the microcontroller's capabilities through debug and trace functionalities improves development and debugging processes.
Goals:
- Integrate comprehensive debug functionalities.
- Implement trace capabilities to track and analyze core execution.
This guide provides step-by-step instructions for running the UETRVMCU core on an FPGA and simulating it using Verilator. The Makefile simplifies building, simulating, and programming the FPGA.
-
Hardware
- Supported FPGA board:
NexysA7orNexys4.
- Supported FPGA board:
-
Software
-
Directory Structure Our project directory is organized as follows: /bench └── pcore_tb.sv /rtl ├── core/ ├── defines/ ├── interconnect/ ├── memory/ ├── peripherals/ /fpga └── project/ /sdk └── build_imem.sh └── interfaces └── src mem.tcl run.tcl
Run the following command to remove previous build files:
make cleanTo generate the instruction memory:
make build_imemSpecify the target FPGA board (NexysA7 or Nexys4) and run:
make bitstream BOARD=NexysA7Once the bitstream is generated, ensure the FPGA is connected to your computer and run
make update_bitYou can do all the above steps in a single command by running
make fpga BOARD=NexysA7To compile the Verilog source files for simulation:
make verilateSimulate the core with specific parameters. For example:
make sim-verilate-uartThis generates an output log (uart_logdata.log) and optional waveform files (* .vcd) if enabled. Waveforms (* .vcd) can be enabled by setting vcd=1:
make sim-verilate-uart vcd=1| Command | Description |
|---|---|
make clean |
Cleans the project directory by removing all generated files. |
make build_imem |
Generates the instruction memory required for the core. |
make bitstream BOARD=<BoardName> |
Builds the FPGA project for the specified board (e.g., NexysA7, Nexys4). |
make update_bit |
Updates the memory on the FPGA using Vivado batch mode. |
make verilate |
Builds the Verilator model of the UETRVMCU core for simulation. |
make sim-verilate-uart |
Simulates the core with Verilator and logs UART output in uart_logdata.log. |
make clean-all |
Removes all Verilator-related files, logs, and waveform files from the directory. |
If you see an error like: Error: Please specify a valid BOARD (Nexys4 or NexysA7). Ensure you specify the BOARD variable when running the Makefile. For example:
make fpga BOARD=NexysA7Ensure the following dependencies are installed and correctly configured:
-
Hardware
- Supported FPGA board:
NexysA7orNexys4.
- Supported FPGA board:
-
Software
We welcome contributions from the open-source community! To contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Submit a pull request with a detailed description of your changes.
Ensure that Vivado and Verilator paths are correctly set in your environment variables. The build_imem.sh script and .tcl scripts should be adapted as per project-specific requirements.
This project is licensed under the Apache License 2.0. See the LICENSE file for more details.
For questions, suggestions, or feedback, please reach out to us via GitHub Issues, or for further assistance, contact the author: Umer Shahid (@umershahidengr)



