Personal tools

Difference between revisions of "Real-time Linux on RISC-V"

From iis-projects

Jump to: navigation, search
(Created page with "<!-- Real-time Linux on RISC-V --> Category:Digital Category:Computer Architecture Category:SW/HW Predictability and Security Category:HW/SW Safety and Security...")
 
 
(9 intermediate revisions by the same user not shown)
Line 11: Line 11:
 
[[Category:Balasr]]
 
[[Category:Balasr]]
 
[[Category:Aottaviano]]
 
[[Category:Aottaviano]]
[[Category:Available]]
+
[[Category:In Progress]]
  
 
= Overview =
 
= Overview =
  
== Status: Available ==
+
== Status: In Progress ==
  
* Type: Semester Thesis/Master Thesis
+
* Type: Semester Thesis or Master Thesis
 
* Professor: Prof. Dr. L. Benini
 
* Professor: Prof. Dr. L. Benini
 
* Supervisors:
 
* Supervisors:
Line 24: Line 24:
  
 
= Introduction =
 
= Introduction =
 +
[[File:Preempt-rt-logo.png|thumb|350px|]]
  
Real-time systems are systems that need to guarantee certain time constraints such as for example responding within a certain time frame. This means that computations not only need to be logically correct but also the physical instant of the result computation has to meet a particular timing constraint.
+
Linux[1] is a monolithic, modular, Unix-like, open-source general-purpose kernel running on servers, workstations, mobile devices and embedded systems.
  
Regular general-purpose operating systems such as Linux are often not designed to ensure that real-time constraints are respected.
+
Currently, mainline Linux is not suitable for real-time workloads which require a deterministic and predictable behavior. Many design decision rather focus on throughput. There have been various approaches trying to address problem such as RTLinux[4], Xenomai[5] and PREEMPT_RT [2][11]. This work will focus on PREEMPT_RT.
  
To address that problem several so called real-time operating systems have been developed in the last decades and used in several fields where the design of safety-critical systems matters (automotive and aerospace above all). Among these, Zephyr OS [1] is a promising scalable real-time operating system with small memory footprint designed for resource-constrained systems following modern security practices. It supports a lot of architectures such as ARM (Cortex series), MIPS, SPARC, AMD64, and RISC-V. The development model is very similar to the linux kernel: The kernel sources, drivers and any bootstrapping code are part of the same project giving a nice out-of-the-box experience.
+
PREEMPT_RT is a set of patches for Linux to turn into a kernel that is more suitable for real-time applications. These changes try to ''minimize the amount of kernel code that is non-preemptible'' which translates directly into a more reactive system. The core algorithms and data structures that are changed are the timer, interrupt handlers, RCU, mutexes and spinlocks[3][6].
  
ControlPULP is an open-source HW/SW platform based on PULP [2], a parallel embedded MCU implementing the RISC-V ISA. ControlPULP has been developed to serve as an integrated power controller for HPC processors [3]. In this scenario, a timely response from multiple MIMO interfaces is required to be able to track and set the operating point of the controlled system in a workload-aware manner.
+
As a development platform we will use Cheshire[7], an open-source SoC from our group that features a 64-bit RISC-V core and various peripherals such as UART, SPI, I2C, VGA and more.
 
 
Currently, we already support FreeRTOS [6] in ControlPULP as real-time operating system
 
  
 
= Project =
 
= Project =
  
The goal of this project is to port Zephyr OS to ControlPULP:
+
The goal of this project is to port PREEMPT_RT Linux to run on 64-bit RISC-V Linux, evaluate performance compare to baseline Linux and propose modifications. As development environment you will run Cheshire on a FPGA.
 
 
* a
 
* b
 
* c
 
  
 +
* Port PREEMPT_RT Linux to Cheshire
 +
* Evaluate Performance compare to other configuration such as baseline Linux, Sel4 and Hypervisor configurations (Bao[8], Sel4 VMM[9]). You can start from e.g. just running cyclitest[10].
 +
* Propose modifications to Hardware and Software. This will depend on the scope of the thesis (SA or MA). For example, support for the Core-Local Interrupt Controller[12] could be added.
  
 
== Character ==
 
== Character ==
  
* 15% Literature / architecture review
+
* 10% Literature / architecture review
* 65% Software layer
+
* 60% C programming
 +
* 10% RTL design
 
* 20% Evaluation
 
* 20% Evaluation
  
 
== Prerequisites ==
 
== Prerequisites ==
* Experience with digital design in SystemVerilog as taught in VLSI I
+
 
* Basic knowledge of operating systems
+
* Good knowledge of operating systems
* Knowledge of C programming language and UNIX tooling as from previous bachelor/master courses
+
* Good knowledge of C programming language and UNIX tooling as from previous bachelor/master courses
 +
* SystemVerilog knowledge is helpful as taught in VLSI I
  
 
= References =
 
= References =
  
 
[1] https://www.kernel.org/
 
[1] https://www.kernel.org/
 +
 +
[2] https://wiki.linuxfoundation.org/realtime/start
 +
 +
[3] https://lwn.net/Articles/146861/
 +
 +
[4] https://www.yodaiken.com/papers/rtlmanifesto.pdf
 +
 +
[5] https://source.denx.de/Xenomai/xenomai/-/wikis/home
 +
 +
[6] https://wiki.linuxfoundation.org/realtime/documentation/technical_details/start
 +
 +
[7] https://github.com/pulp-platform/cheshire
 +
 +
[8] https://github.com/bao-project/bao-hypervisor
 +
 +
[9] https://sel4.systems/
 +
 +
[10] https://wiki.linuxfoundation.org/realtime/documentation/howto/tools/cyclictest/start
 +
 +
[11] https://dl.acm.org/doi/pdf/10.1145/3297714
 +
 +
[12] https://github.com/pulp-platform/clic

Latest revision as of 15:29, 19 February 2024


Overview

Status: In Progress

Introduction

Preempt-rt-logo.png

Linux[1] is a monolithic, modular, Unix-like, open-source general-purpose kernel running on servers, workstations, mobile devices and embedded systems.

Currently, mainline Linux is not suitable for real-time workloads which require a deterministic and predictable behavior. Many design decision rather focus on throughput. There have been various approaches trying to address problem such as RTLinux[4], Xenomai[5] and PREEMPT_RT [2][11]. This work will focus on PREEMPT_RT.

PREEMPT_RT is a set of patches for Linux to turn into a kernel that is more suitable for real-time applications. These changes try to minimize the amount of kernel code that is non-preemptible which translates directly into a more reactive system. The core algorithms and data structures that are changed are the timer, interrupt handlers, RCU, mutexes and spinlocks[3][6].

As a development platform we will use Cheshire[7], an open-source SoC from our group that features a 64-bit RISC-V core and various peripherals such as UART, SPI, I2C, VGA and more.

Project

The goal of this project is to port PREEMPT_RT Linux to run on 64-bit RISC-V Linux, evaluate performance compare to baseline Linux and propose modifications. As development environment you will run Cheshire on a FPGA.

  • Port PREEMPT_RT Linux to Cheshire
  • Evaluate Performance compare to other configuration such as baseline Linux, Sel4 and Hypervisor configurations (Bao[8], Sel4 VMM[9]). You can start from e.g. just running cyclitest[10].
  • Propose modifications to Hardware and Software. This will depend on the scope of the thesis (SA or MA). For example, support for the Core-Local Interrupt Controller[12] could be added.

Character

  • 10% Literature / architecture review
  • 60% C programming
  • 10% RTL design
  • 20% Evaluation

Prerequisites

  • Good knowledge of operating systems
  • Good knowledge of C programming language and UNIX tooling as from previous bachelor/master courses
  • SystemVerilog knowledge is helpful as taught in VLSI I

References

[1] https://www.kernel.org/

[2] https://wiki.linuxfoundation.org/realtime/start

[3] https://lwn.net/Articles/146861/

[4] https://www.yodaiken.com/papers/rtlmanifesto.pdf

[5] https://source.denx.de/Xenomai/xenomai/-/wikis/home

[6] https://wiki.linuxfoundation.org/realtime/documentation/technical_details/start

[7] https://github.com/pulp-platform/cheshire

[8] https://github.com/bao-project/bao-hypervisor

[9] https://sel4.systems/

[10] https://wiki.linuxfoundation.org/realtime/documentation/howto/tools/cyclictest/start

[11] https://dl.acm.org/doi/pdf/10.1145/3297714

[12] https://github.com/pulp-platform/clic