Master's Thesis

Evaluation of Real Time Operating System in RISC-V

Rui Silva Ferreira — 2024

Key information

Authors:

Rui Silva Ferreira (Rui Silva Ferreira)

Supervisors:

Rui António Policarpo Duarte; Paulo Ferreira Godinho Flores (Paulo Ferreira Godinho Flores)

Published in

June 26, 2024

Abstract

A arquitetura do conjunto de instruções RISC-V surgiu como uma alternativa devido à sua natureza aberta, simplicidade e modularidade. As implementações de sistemas em circuitos incorporados (SoC) baseados em processadores RISC-V podem utilizar aceleradores de hardware para melhorar o seu desempenho, transferindo tarefas computacionais pesadas do processador. A utilização de um sistema operativo em tempo real é essencial para satisfazer os requisitos temporais e gerir eficientemente múltiplas tarefas. Nesta tese, a SoC SweRVolf foi adaptada para se conectar a um acelerador de hardware. Foram propostos três cenários para gerir o acelerador usando mecanismos do RTOS Zephyr para que o processador RISC-V execute diferentes tarefas enquanto o acelerador está a trabalhar. No primeiro cenário, uma única thread acede ao acelerador, sendo bloqueada por um semáforo enquanto este está a funcionar. No segundo cenário várias threads competem pelo acesso ao acelerador e os semáforos controlam as tentativas de acesso. O terceiro cenário usa uma thread responsável por gerir o acesso ao acelerador. As threads computacionais enviam pedidos à thread gestora para utilizar o acelerador. Para avaliar estes cenários, duas aplicações foram desenvolvidas e executadas na placa Nexys A7, a multiplicação de um conjunto de matrizes e uma rede neural para prever os dígitos do conjunto de dados MNIST. Os tempos de execução dos diferentes cenários mostram que a utilização de uma thread de gestão é mais rápida do que as múltiplas threads competindo pelo acesso ao acelerador e permite um maior controlo sobre a thread que utiliza o acelerador. The RISC-V instruction set architecture has emerged as in the community due to its open and royalty-free nature, simplicity, and modularity. System-on-Chip (SoC) implementations based on RISC-V processors can be extended with hardware accelerators to improve the performance of embedded systems by offloading heavy computational tasks from the processor. Using a Real-Time Operating System (RTOS) is essential in meeting the timing requirements and efficiently managing multiple tasks. In this thesis, the SweRVolf SoC was extended to connect to a hardware accelerator. Three scenarios were proposed for managing the hardware accelerator using Zephyr RTOS mechanisms that enable the RISC-V processor to execute different tasks, while the accelerator works in parallel. In the first scenario, a single thread accesses to the accelerator and a semaphore is used to block the thread while it’s working. The second scenario has several threads competing to access the accelerator and semaphores control access attempts. The third scenario uses a thread responsible for managing the accelerator's access. Computational threads send requests to the manager thread to use the accelerator. To evaluate these scenarios, two use case applications were developed and executed on the FPGA board Nexys A7, a set of matrices multiplications and a neural network to predict the digits of the MNIST dataset. The execution times of the different scenarios show that using a manager thread is more time-efficient than the multiple threads competing for access to the accelerator, while providing a larger control over what thread uses the accelerator.

Publication details

Authors in the community:

Supervisors of this institution:

RENATES TID

203843886

Degree Name

Mestrado em Engenharia Eletrotécnica e de Computadores

Fields of Science and Technology (FOS)

electrical-engineering-electronic-engineering-information-engineering - Electrical engineering, electronic engineering, information engineering

Keywords

  • RISC-V
  • Real-time Operating System
  • Hardware Accelerator
  • SweRVolf SoC
  • Zephyr
  • Sistema Operativo de Tempo Real
  • Acelerador de Hardware

Publication language (ISO code)

eng - English

Rights type:

Embargo lifted

Date available:

May 27, 2025

Institution name

Instituto Superior Técnico