RTLinux in an FPGA Alejandro Lucero

Slides:



Advertisements
Similar presentations
1 SECURE-PARTIAL RECONFIGURATION OF FPGAs MSc.Fisnik KRAJA Computer Engineering Department, Faculty Of Information Technology, Polytechnic University of.
Advertisements

Altera FLEX 10K technology in Real Time Application.
A reconfigurable system featuring dynamically extensible embedded microprocessor, FPGA, and customizable I/O Borgatti, M. Lertora, F. Foret, B. Cali, L.
Khaled A. Al-Utaibi  Computers are Every Where  What is Computer Engineering?  Design Levels  Computer Engineering Fields  What.
Chapter 13 Embedded Systems
© ABB Group Jun-15 Evaluation of Real-Time Operating Systems for Xilinx MicroBlaze CPU Anders Rönnholm.
MPI in uClinux on Microblaze Neelima Balakrishnan Khang Tran 05/01/2006.
Contiki A Lightweight and Flexible Operating System for Tiny Networked Sensors Presented by: Jeremy Schiff.
A Study of the Speedups and Competitiveness of FPGA Soft Processor Cores using Dynamic Hardware/Software Partitioning Roman Lysecky, Frank Vahid* Department.
Embedded Real-time Systems The Linux kernel. The Operating System Kernel Resident in memory, privileged mode System calls offer general purpose services.
Configurable System-on-Chip: Xilinx EDK
The Xilinx EDK Toolset: Xilinx Platform Studio (XPS) Building a base system platform.
Figure 1.1 Interaction between applications and the operating system.
1 Chapter 14 Embedded Processing Cores. 2 Overview RISC: Reduced Instruction Set Computer RISC-based processor: PowerPC, ARM and MIPS The embedded processor.
Implementation of DSP Algorithm on SoC. Mid-Semester Presentation Student : Einat Tevel Supervisor : Isaschar Walter Accompaning engineer : Emilia Burlak.
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
Out-of-Order OpenRISC 2 semesters project Semester A: Implementation of OpenRISC on XUPV5 board Final A Presentation By: Vova Menis-Lurie Sonia Gershkovich.
RSC Williams MAPLD 2005/BOF-S1 A Linux-based Software Environment for the Reconfigurable Scalable Computing Project John A. Williams 1
Out-of-Order OpenRISC 2 semesters project Semester A: Implementation of OpenRISC on XUPV5 board Midterm Presentation By: Vova Menis-Lurie Sonia Gershkovich.
1 3-General Purpose Processors: Altera Nios II 2 Altera Nios II processor A 32-bit soft core processor from Altera Comes in three cores: Fast, Standard,
Microprocessor-based systems Curse 7 Memory hierarchies.
Eric Keller, Evan Green Princeton University PRESTO /22/08 Virtualizing the Data Plane Through Source Code Merging.
Xenomai’s Porting on processor NIOS II Professor : P. Kadionik Authors : Bassi Vincent Louati Azza Mirault Raphael Polette Simon.
집적회로 Spring 2007 Prof. Sang Sik AHN Signal Processing LAB.
LAB1 Summary Zhaofeng SJTU.SOME. Embedded Software Tools CPU Logic Design Tools I/O FPGA Memory Logic Design Tools FPGA + Memory + IP + High Speed IO.
Somervill RSC 1 125/MAPLD'05 Reconfigurable Processing Module (RPM) Kevin Somervill 1 Dr. Robert Hodson 1
Content Project Goals. Workflow Background. System configuration. Working environment. System simulation. System synthesis. Benchmark. Multicore.
1 of 14 Lab 2: Design-Space Exploration with MPARM.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
Back-end Electronics Upgrade TileCal Meeting 23/10/2009.
Embedded Systems. What is Embedded Systems?  Embedded reflects the facts that they are an integral.
SUBJECT : DIGITAL ELECTRONICS CLASS : SEM 3(B) TOPIC : INTRODUCTION OF VHDL.
Introduction to Operating Systems Concepts
OPERATING SYSTEM CONCEPTS AND PRACTISE
Programmable Logic Devices
Homework Reading Machine Projects Labs
Programmable Hardware: Hardware or Software?
REAL-TIME OPERATING SYSTEMS
Multiprocessor System Distributed System
ECE354 Embedded Systems Introduction C Andras Moritz.
CS 6560: Operating Systems Design
Topics Covered What is Real Time Operating System (RTOS)
Complex Programmable Logic Device (CPLD) Architecture and Its Applications
Introduction to Programmable Logic
Andrew Putnam University of Washington RAMP Retreat January 17, 2008
Operating System Structure
FPGA: Real needs and limits
KERNEL ARCHITECTURE.
Overview of Embedded SoC Systems
Improved schedulability on the ρVEX polymorphic VLIW processor
Threads, SMP, and Microkernels
Page Replacement.
Embedded systems, Lab 1: notes
Simulation of computer system
Outline Module 1 and 2 dealt with processes, scheduling and synchronization Next two modules will deal with memory and storage Processes require data to.
Today’s agenda Hardware architecture and runtime system
The performance requirements for DSP applications continue to grow and the traditional solutions do not adequately address this new challenge Paradigm.
Real-time Linux Evaluation
Lecture 4- Threads, SMP, and Microkernels
HIGH LEVEL SYNTHESIS.
Outline Chapter 2 (cont) OS Design OS structure
Operating System Introduction.
THE ECE 554 XILINX DESIGN PROCESS
System calls….. C-program->POSIX call
THE ECE 554 XILINX DESIGN PROCESS
Mr. M. D. Jamadar Assistant Professor
CSE 542: Operating Systems
In Today’s Class.. General Kernel Responsibilities Kernel Organization
ARM920T Processor This training module provides an introduction to the ARM920T processor embedded in the AT91RM9200 microcontroller.We’ll identify the.
Presentation transcript:

RTLinux in an FPGA Alejandro Lucero

RTLinux in a FPGA 1. OpenRTU Project 2. FPGAs and soft processors 3. uClinux 4. RTLinux in Microblaze

RTLinux in a FPGA 1. OpenRTU Project ● Spanish Industrial Research Project (Nov, 2004 – May, 2006) ● Financed by Spanish Industrial Ministry (PROFIT) ● Consortium: TELVENT: real time company, RTUs ESI: European Software Institute, Product Line CSIC: Scientific Research Institution, FPGA Design OS3: embedded Linux company, RTLinux

RTLinux in a FPGA 1. OpenRTU: Project Goal Building a new generation of RTUs (Remote Terminal Units) using FPGAs and Open Source. ● More Flexibility ● Faster Development ● Better Scalability ● Avoiding Obsolescence Challenge

RTLinux in a FPGA 1. OpenRTU Project: Results ● A prototype built and running uClinux and RTLinux in Microblaze ● HARD Real Time requirements achieved (Initially, 1ms)

RTLinux in a FPGA 2. FPGAs and soft processors ● FPGA: Field Programmable Gate Array ● Device containing programmable logic and programmable interconnects. ● Field programmable = it can be programmed after the manufacturing process in the field ● You can program the HW !!!

RTLinux in a FPGA 2. FPGAs: How it can be programmed ● FPGA design using VHDL (VHSIC & HDL) ● An Electronic Automation Tool obtains a netlist from the VHDL code ● Place & Route software fits the netlist to the FPGA ● Validation through timing analysis, simulation and verification tools ● A bitstream is generated to program the logic gate array

RTLinux in a FPGA 2. FPGAs: How it can be programmed ● You can add IP (Intellectual Property) Cores to your design: libraries of predefined complex functions and circuits ● IP Cores: buses, codecs, DSPs, interfaces,... and processors ● Soft processors (FPGA logic): picoblaze (Xilinx), Microblaze (Xilinx), Nios (Altera), LatticeMico32

RTLinux in a FPGA 2. FPGAs: Microblaze soft processor ● Xilinx Microblaze (4.0) 32 bits processor ● Three-stage pipeline ● RISC, Harvard architecture ● Configurable Code and Data Caches ● Hardware Debug Logic ● Non-MMU processor

RTLinux in a FPGA 3. uClinux ● Linux for non MMU processors ● Available ports: DragonBall, Coldfire, QUICC, ARM7DMI, Intel i960, Blackfin, Microblaze, NEC V850 ● Commercial products based on uClinux: IP cameras, wireless routers, VoIP based telephones

RTLinux in a FPGA 3. uClinux: drawbacks ● No protection between tasks, and even worse: a user process can crash the system ● This is the most well-known issue, but it is not the only one ● Using Linux code is not automatic

RTLinux in a FPGA 3. uClinux: non MMU problems ● Processes are created using the vfork system call instead fork ● user stack per process is static in size ● memory management done by the OS is different ● dynamic libraries are not available (at least as standard)

RTLinux in a FPGA 3. uClinux: Microblaze Architecture ● Port done in 2003 by John Williams, from Queensland University in Australia ● uCLinux 2.4 in Microblaze is being used in several commercial products ● Xilinx has recently released the uClinux 2.6 for Microblaze

RTLinux in a FPGA 4. RTLinux ● RTLinux is a hard real time microkernel ● Interrupts are virtualized for Linux ● Linux runs as the task with the lowest priority inside RTLinux: Linux is the idle task for RTLinux

RTLinux in a FPGA Virtualization technology is in fashion

RTLinux in a FPGA RTLinux Virtualization technology

RTLinux in a FPGA 4. RTLinux in Microblaze ● RTLinux DOES NOT need an MMU (but can use it) ● RTLinux needs Linux or uClinux: uClinux port in Microblaze done by John Williams in 2003 ● What HARD real time performance can be achieved with a 75Mhz soft processor running a GPOS?

RTLinux in a FPGA 4. RTLinux in Microblaze: Doing the PORT ● We had some initial doubts about the technology ● These doubts were reinforced when we found a bug in the processor IP core implementation ● This led us to put most of the blame on the technology when latencies were not as expected

RTLinux in a FPGA 4. RTLinux in Microblaze: Doing the PORT ● We decided to divide the work clearly: 1) Interrupts virtualization layer 2) RTLinux microkernel ● In case of problems with the full RTLinux microkernel coexisting with uClinux kernel, we could just make use of the virtualization mechanism for a simple system executing critical code when an event raises an interrupt without uClinux interference

RTLinux in a FPGA 4. RTLinux in Microblaze: Doing the PORT ● Once the Interrupt Virtualization layer was implemented, first tests showed latencies higher than expected ● The measurements were done with the timer interrupt, and Linux could be interfering with the results ● We decided to wait until we knew what latencies we had with the full RTLinux microkernel working ●... But we suspected OPB (On-Chip peripheral Bus) was introducing the delays

RTLinux in a FPGA 4. RTLinux in Microblaze: Doing the PORT ● The second part of the work was done to implement the full RTLinux microkernel: threads creation and destruction, scheduling, timer programming (one shot and periodic) and threads synchronization and communication ● The RTLinux microkernel code is composed of architecture specific part, and by independent architecture which will run without changes

RTLinux in a FPGA 4. RTLinux in Microblaze: Doing the PORT ● Once the full RTLinux microkernel was implemented, tests showed peak latencies higher than expected ● We did some code inspection but in C language level ● Due to our initial doubts about the uncertainty of the technology, we suspected OPB was introducing the delays ● This took us to the longest route to solve the problems, but on the positive side, this was not a complete waste of time.

RTLinux in a FPGA 4. RTLinux in Microblaze: Doing the PORT ● The solution taken was to make use of a special Microblaze configuration avoiding the execution of real time code from DRAM or SRAM ● LMB and Microblaze caches have 1 cycle access ● The idea was to allocate the real time code into these special memories avoiding the peak latencies when the code had to go through the OPB

RTLinux in a FPGA

RTLinux in a FPGA 4. RTLinux in Microblaze: Doing the PORT Drawbacks when using 1 cycle access memories ● LMB Ram Blocks are used by FPGA designers, so we can not take them for free. ● Microblaze cache is write-through, so if the problem is when RAM or SRAM is accessed, we are in the same point

RTLinux in a FPGA 4. RTLinux in Microblaze: Doing the PORT ● The first problem was maximum space available (Spartan3) using LMB was 16Kbytes (just 12Kbytes aligned) ● RTLinux modules: ➔ rtl.o: 8192 bytes (only code) ➔ rtl_time.o 2264 bytes (only code) ➔ rtl_sched.o13692 bytes (only code)

RTLinux in a FPGA 4. RTLinux in Microblaze: Doing the PORT ● RTLinux code distribution was modified, creating a new module where "real" real time code is allocated ● In the old modules we left the code just used during initialization ● the new module rtl_previous_core had a final size of 8K, so it could be allocated in the LMB

RTLinux in a FPGA 4. RTLinux in Microblaze: Doing the PORT ● We did other changes in uClinux related with interrupts code: a new section was created in the elf kernel file for this code, and during the initialization it is copied to LMB ● Once we had all the code related with real time in 1 cycle memory access, we did new tests and... ● Peaks latencies had survived the attack

RTLinux in a FPGA 4. RTLinux in Microblaze: Doing the PORT Technology was absolved. We had the real guilty: The RTLinux Port Implementation was buggy

RTLinux in a FPGA 4. RTLinux in Microblaze: Doing the PORT Some problems hard to find: ● Microblaze has not lock instructions: changes in set_bit, test_bit, clear_bit, test_and_set, test_and_clear, which need to disable interrupts. ● Some cli uClinux operations were not being virtualized ● compilation flags: muls and divs by software introduce high latencies ● buggy gcc 2.95 with 64 bits operations (needed for timers)

RTLinux in a FPGA 4. RTLinux in Microblaze: Results

RTLinux in a FPGA 4. RTLinux in Microblaze: Doing the PORT Conclusions ● we followed the longest route to achieve the hard real time performance ● The usual way would had been to suspect first that the implementation is buggy, but we had some preconceived ideas... ● On the positive side, we have now the best performance we can get using RTLinux and uClinux in Microblaze

RTLinux in a FPGA Thank you Alejandro Lucero