Low-latency I/O RISC-V CPU core in FPGA fabric - Atharva Kashalkar#
Introduction#
Implementation of PRU subsystem on BeagleV-Fire’s FPGA fabric, resulting in a real-time microcontroller system working alongside the main CPU, providing low-latency access to I/O .
Summary links#
Contributor: Atharva Kashalkar
Mentors: Jason Kridner, Cyril Jean
Code Repository: TBD
Status#
This project is currently just a proposal.
Proposal#
About#
Resume: Find my resume here
OpenBeagle: Roger18 (Atharva Kashalkar)
Github: RapidRoger18 (Atharva Kashalkar)
School: Veermata Jijabai Technological Institute (VJTI)
Country: India
Primary language: English Hindi
Typical work hours: 9 AM-11 PM Indian Standard Time
Previous GSoC participation: First Time Applicant
Project#
Project name: Low-latency I/O RISC-V CPU core in FPGA fabric.
Description#
To provide the capability of a Programmable Real-time Unit Industrial Control SubSystem (PRU-ICSS), which is present on several BeagleBone boards, I propose to deploy an existing RISC-V 32IM core with a customized Instruction Set Architecture on FPGA Fabric present on BeagleV-Fire. The goal of this deployment is to provide high bandwidth between the CPU and I/O, resulting in a on-board microcontroller.
Goals and Objectives#
The ultimate aim of this project is to have a functional Risc-V soft core on the BeagleV-Fire FPGA fabric, which will be functionally equivalent to a PRU subsystem on the BeagleBone Black. Together with ultra-low latency I/O operations, this core will be able to execute Risc-V instructions acting as a microcontroller. BeagleV-Fire will feature a functional PRU-comparable subsystem on its FPGA fabric by the project’s conclusion.
The programmable nature of the PRU, along with its access to pins, events, and all SoC resources, provides flexibility in implementing fast real-time responses, specialized data handling operations, custom peripheral interfaces, and in offloading tasks from the other processor cores of the system-on-chip (SoC). This is a basic block diagram for PRU design:
Based on the block diagram above we can divide the project into two stages. Stage 1 will include deciding the most suitable pre-existing core based on its performance concerning its size, complexity, accessibility, etc. Customizing the core to meet project requirements and integrating it with BeagleV-Fire gateware, followed by extensive Verification of the modifications using preset verification techniques. This stage will conclude with having a stable communication protocol between the PRU and main CPU. This will ensure that the PRU’s instruction memory can be written by main CPU and have an interrupt signal to control the PRU.
At Stage 1 Evaluation, a functional Risc-V PRU with CPU access support will be prepared for deployment.
The primary aim for Stage 2 will be establishing the necessary I/O functions, and stable communication between the PRU and these I/O. I/O and other peripherals can be mapped to particular special addresses to which the PRU can write, which will enable the user to configure the I/O devices to any parameters using a PRU C Library, which will try to abstract I/O usage for the user. Changes to be made to build scripts to add an option of including a PRU design to the gateware when flashing the Board. Updating Device Tree Overlay to enable PRU whenever necessary. Having a test program for users to get familiar with the use of PRU.
After Stage 2, BeagleV-Fire will host a fully functional PRU system that can be controlled by invoking a specific function within the main CPU.
Software#
Verilog HDL.
Verilator.
Libero SoC suite.
Microchip Softconsole
ModelSim ME.
Linux.
OpenBeagle CI.
Hardware#
Ability to program BeagleV-Fire using serial port and set up JTAG for effective debugging.
Timeline#
Timeline summary#
Date |
Activity |
---|---|
April |
Understand detailed use cases of existing cores and shortlist them based on requirements |
May 1 |
Start bonding - Discussing implementation methods with Mentors |
May 15 |
College Examinations |
June 1 |
Start coding and introductory video |
June 3 |
|
June 10 |
|
June 17 |
|
June 24 |
|
July 1 |
|
July 8 |
Submit midterm evaluations |
July 15 |
|
July 22 |
|
July 29 |
|
August 5 |
|
August 12 |
|
August 19 |
Submit final project video, submit final work to GSoC site, and complete final mentor evaluation |
Timeline detailed#
Community Bonding Period (May 1st - May 15th)#
Get to know mentors and discuss project implementation.
read documentation, and get up to speed to begin working on the projects
shortlisting pre-existing cores based on initial assessment, by reading available documentation.
Coding begins (May 27th)#
Milestone #1, Introductory YouTube video (June 3rd)#
Make an introductory video
Selecting the best-suited core by comparing their functionality, size, availability of extensions, etc.
Setting up remote access on BeagleV-Fire and completing the LED-blink tutorial given in the documentation.
Milestone #2, Modifiying RV core (June 10th)#
Modification of the selected core to meet project requirements, like memory configurations, interrupt control, etc.
Removing unnecessary extensions to reduce size and complexity, without changing its efficiency.
Milestone #3, Verification of core (June 17th)#
Performing Verification of PRU core using pre-determined verification methods by using Verilator or any other Verification software.
This is to make sure the PRU functions as required after modifications.
Milestone #4, Remote-proc setup (June 24th)#
Integration of PRU core with BeagleV-Fire gateware. This is to ensure PRU deployment through BeagleV-Fire gateware.
Set up Remote-proc Interfacing between PRU and main CPU. This will ensure CPU access to PRU’s instruction memory.
Milestone #5, Setup Device Tree (July 1st)#
Coninuing to work on Remote-proc framework.
Ensuring stable PRU workflow.
Setting up Device Tree Overlay to include PRU when necessary.
Submit midterm evaluations (July 8th)#
Complete pending Stage 1 tasks, if any.
Important
July 12 - 18:00 UTC: Midterm evaluation deadline (standard coding period)
Milestone #6, Mapping I/O (July 15th)#
Implementing required I/O functionalities.
Mapping I/O to registers to enable interaction with CPU.
Milestone #7, Verification of mapped I/O (July 22nd)#
Verification of these I/O operations using simulation and generating common use cases.
Deploying these modules on BeagleV-Fire FPGA and testing their latency and real-time application.
Milestone #8, Add customizability (July 29th)#
Adding customizability to CPU. This is to allow user to make small changes to CPU to observe the changes in output.
This will allow user to learn internal working of a RISC processor.
Milestone #9, Setup Scripts (Aug 5th)#
Setting up gateware scripts wherever changes are needed. This will grant users easier access to CPU.
Editing TCL scripts wherever necessary.
Milestone #10, Documentation and Tutorial(Aug 12th)#
Documenting the project and ways to access PRU on docs.beagleboard.org.
Having an LED Blink tutorial for users to familiarize themselves with the PRU.
Final YouTube video (Aug 19th)#
Submit final project video, submit final work to GSoC site, and complete final mentor evaluation
Final Submission (Aug 24th)#
Important
August 19 - 26 - 18:00 UTC: Final week: GSoC contributors submit their final work product and their final mentor evaluation (standard coding period)
August 26 - September 2 - 18:00 UTC: Mentors submit final GSoC contributor evaluations (standard coding period)
Initial results (September 3)#
Important
September 3 - November 4: GSoC contributors with extended timelines continue coding
November 4 - 18:00 UTC: Final date for all GSoC contributors to submit their final work product and final evaluation
November 11 - 18:00 UTC: Final date for mentors to submit evaluations for GSoC contributor projects with an extended deadline
Experience#
This project will require prior knowledge of Risc-V ISA, FPGA programming, Assembly, and Verilog.
Approach#
Contingency#
- If I get stuck on my project and my mentor isn’t around, I will use the following resources:-
Moreover, the BeagleBoard community is very helpful in resolving doubts, I will use OpenBeagle forums to clarify any doubts left after referring to the above resources.
Benefit#
- This project will not only improve the use cases of BeagleV-Fire but also provide a very fast real-time subsystem that can be used as a microcontroller. It will provide the following functionalities: -
Reduce memory and I/O resource consumption on the main CPU by performing basic computations in PRU itself thus providing more resources to perform complex tasks.
Provide a real-time interface for fast, deterministic operations.
Reprogammability of FPGA will allow to deployment of PRU only when necessary, thus providing additional logical elements when PRU is not being used.
The configurable nature of FPGA will allow multiple levels of customizations and configurations on PRU, enabling the user to efficiently meet their requirements in the lowest possible resources.
The success of this project will result in an all-in-one SoC meeting all the requirements of BeagleBoard.org community.
Misc#
PR request for cross-compilation task #182