Skip to content

SurajSonawane2415/RISC-V-Arch-Support-Embox-RTOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 

Repository files navigation

Project Overview

This project aims to enhance the RISC-V architecture support in the Embox RTOS by integrating key components such as:

  • Core Local Interruptor (CLINT)
  • Platform-Level Interrupt Controller (PLIC)
  • Floating-Point Unit (FPU)
  • Physical Memory Protection (PMP)
  • Memory Management Unit(MMU)

These additions will enable Embox to efficiently handle hardware interrupts, perform floating-point operations, enforce memory protection, and manage virtual memory. The integration of CLINT and PLIC will improve real-time interrupt handling, FPU support will enhance computational performance, PMP will bolster security by preventing unauthorized memory access, and MMU support will provide efficient memory management and address translation.

Key Features

  • CLINT and PLIC Integration: Improves real-time handling of interrupts and timer management.
  • FPU Support: Enhances computational capabilities for floating-point operations.
  • PMP Support: Provides memory protection and access control to improve system security and stability.
  • MMU Support: Enables efficient virtual memory management and address translation, enhancing memory isolation and system stability.

Merged Pull Requests

Summary

Project Objectives

Output

  • Testing results with QEMU: Screenshot from 2024-07-19 20-50-51

Project Description

1. Physical Memory Protection (PMP)

To enhance secure processing and manage faults, Physical Memory Protection (PMP) limits the physical memory addresses accessible by software running on a hart. PMP provides per-hart machine-mode control registers to specify access privileges (read, write, execute) for each memory region. This feature helps prevent unauthorized access and interference from third-party code, as well as detect stack overflows, thus improving system safety and security.

Screenshot 2024-07-31 at 20-28-32 Antmicro · Adding Physical Memory Protection to the VeeR EL2 RISC-V Core

2. Core Local Interruptor (CLINT)

The Core Local Interruptor (CLINT) manages software and timer interrupts within the RISC-V architecture. The implementation of CLINT in Embox RTOS involves configuring software and timer interrupts, setting timer values, enabling interrupts, and managing interrupt claims and completions. This integration enhances Embox's real-time application capabilities in embedded systems.

CLINT Integration

3. Platform-Level Interrupt Controller (PLIC)

Support for the Platform-Level Interrupt Controller (PLIC) has been added for the RISC-V architecture [link]. This project aims to integrate PLIC support specifically for the SiFive U54-MC board in Embox [Issue link].

The PLIC manages interrupts for the SiFive U54-MC Core Complex according to RISC-V standards. It supports up to 511 external interrupt sources with 7 priority levels. The implementation involves configuring interrupt sources, setting priorities, enabling interrupts, and handling claims and completions. This addition enhances real-time capabilities in embedded systems.

PLIC Memory Map

The PLIC memory map for the SiFive U54-MC Core Complex includes:

  • Source Priority Registers: From 0x0C00 0004 to 0x0C00 0804, holding interrupt source priority levels.
  • Pending Array: Starting at 0x0C00 1000, containing information about pending interrupts.
  • M-mode Enables: Starting from 0x0C00 2000, managing M-mode interrupt enables for each hart.
  • S-mode Enables: Similar to M-mode, controlling S-mode interrupt enables for each hart.
  • Priority Thresholds: Set using registers starting from 0x0C20 0000.
  • Claim/Complete Registers: Located at 0x0C20 0004, used for the interrupt claim process.

4. Floating-Point Unit (FPU)

The Floating-Point Unit (FPU) provides functional units for performing mathematical operations, comparisons, and other tasks on floating-point values. It ensures efficient execution of floating-point instructions and enhances the handling of complex arithmetic operations, which is critical for real-time applications in embedded systems.

Contributors

Mentors

  • Aleksey Zhmulin
  • Anton Bondrarev

Resources

About

Improve RISC-V architecture support in Embox RTOS

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published