1 BROOKHAVEN SCIENCE ASSOCIATES Funded under DOE contract : DE-AC02-98CH10886 EPICS/RTEMS/MVME5500 FOR REAL-TIME CONTROLS AT NSLS ICALEPCS2005, Geneva,

Slides:



Advertisements
Similar presentations
Nios Multi Processor Ethernet Embedded Platform Final Presentation
Advertisements

Chapter 2 Operating System Overview Operating Systems: Internals and Design Principles, 6/E William Stallings.
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 3: Input/output and co-processors dr.ir. A.C. Verschueren.
CMPT 300: Operating Systems I Dr. Mohamed Hefeeda
Chapter 13 Embedded Systems
© ABB Group Jun-15 Evaluation of Real-Time Operating Systems for Xilinx MicroBlaze CPU Anders Rönnholm.
Operating Systems High Level View Chapter 1,2. Who is the User? End Users Application Programmers System Programmers Administrators.
UNIX Chapter 01 Overview of Operating Systems Mr. Mohammad A. Smirat.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
1 Soft Timers: Efficient Microsecond Software Timer Support For Network Processing Mohit Aron and Peter Druschel Rice University Presented By Jonathan.
Chapter 13 Embedded Systems
Chapter 1 and 2 Computer System and Operating System Overview
Figure 1.1 Interaction between applications and the operating system.
1 Chapter 13 Embedded Systems Embedded Systems Characteristics of Embedded Operating Systems.
Using FPGAs with Embedded Processors for Complete Hardware and Software Systems Jonah Weber May 2, 2006.
Building an Application Server for Home Network based on Android Platform Yi-hsien Liao Supervised by : Dr. Chao-huang Wei Department of Electrical Engineering.
Performance Evaluation of Real-Time Operating Systems
0 Deterministic Replay for Real- time Software Systems Alice Lee Safety, Reliability & Quality Assurance Office JSC, NASA Yann-Hang.
Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in.
Introduction to USB Development. USB Development Introduction Technical Overview USB in Embedded Systems Recent Developments Extensions to USB USB as.
1 Computer System Overview Chapter 1. 2 n An Operating System makes the computing power available to users by controlling the hardware n Let us review.
RTEMS overview W. Eric Norum Introduction RTEMS is a tool designed specifically for real-time embedded systems The RTEMS product is an executive.
Upgrade to Real Time Linux Target: A MATLAB-Based Graphical Control Environment Thesis Defense by Hai Xu CLEMSON U N I V E R S I T Y Department of Electrical.
Dec 8-10, 2004EPICS Collaboration Meeting – Tokai, Japan MicroIOC: A Simple Robust Platform for Integrating Devices Mark Pleško
OPERATING SYSTEMS Goals of the course Definitions of operating systems Operating system goals What is not an operating system Computer architecture O/S.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Ethernet Based Embedded IOC for FEL Control Systems J. Yan, D. Sexton, Al Grippo, W. Moore, and K. Jordan ICALEPCS 2007 October 19, 2007 Knoxville Convention.
MACCE and Real-Time Schedulers Steve Roberts EEL 6897.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Interrupts, Buses Chapter 6.2.5, Introduction to Interrupts Interrupts are a mechanism by which other modules (e.g. I/O) may interrupt normal.
Multiprogramming. Readings r Silberschatz, Galvin, Gagne, “Operating System Concepts”, 8 th edition: Chapter 3.1, 3.2.
I/O Computer Organization II 1 Interconnecting Components Need interconnections between – CPU, memory, I/O controllers Bus: shared communication channel.
Scheduling Lecture 6. What is Scheduling? An O/S often has many pending tasks. –Threads, async callbacks, device input. The order may matter. –Policy,
SNS Integrated Control System Timing Clients at SNS DH Thompson Epics Spring 2003.
Chapter 2 Processes and Threads Introduction 2.2 Processes A Process is the execution of a Program More specifically… – A process is a program.
Debugging parallel programs. Breakpoint debugging Probably the most widely familiar method of debugging programs is breakpoint debugging. In this method,
1 Soft Timers: Efficient Microsecond Software Timer Support For Network Processing Mohit Aron and Peter Druschel Rice University Presented By Oindrila.
Fast Fault Finder A Machine Protection Component.
CPS 4150 Computer Organization Fall 2006 Ching-Song Don Wei.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
Operating Systems 1 K. Salah Module 1.2: Fundamental Concepts Interrupts System Calls.
Sep. 17, 2002BESIII Review Meeting BESIII DAQ System BESIII Review Meeting IHEP · Beijing · China Sep , 2002.
CIS250 OPERATING SYSTEMS Chapter One Introduction.
Processes & Threads Introduction to Operating Systems: Module 5.
BROOKHAVEN SCIENCE ASSOCIATES U.S. Department of Energy Office of Basic Energy Sciences Funded under contract: DE-AC02-98CH10886 EPICS/RTEMS at NSLS S.
ICALEPCS 2007 The Evolution of the Elettra Control System The evolution of the Elettra Control Sytem C. Scafuri, L. Pivetta.
1 Process Description and Control Chapter 3. 2 Process A program in execution An instance of a program running on a computer The entity that can be assigned.
EPICS and LabVIEW Tony Vento, National Instruments
Introduction Contain two or more CPU share common memory and peripherals. Provide greater system throughput. Multiple processor executing simultaneous.
Control System Overview J. Frederick Bartlett Fermilab June 1,1999.
The BaBar Online Detector Control System Upgrade Matthias Wittgen, SLAC.
Embedded Real-Time Systems Introduction to embedded software development Lecturer Department University.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Soft Timers : Efficient Microsecond Software Timer Support for Network Processing - Mohit Aron & Peter Druschel CS533 Winter 2007.
Multiprogramming. Readings r Chapter 2.1 of the textbook.
Introduction to Operating Systems Concepts
Process concept.
Session 3 Memory Management
OPERATING SYSTEMS CS3502 Fall 2017
Operating Systems (CS 340 D)
Chapter 3: Windows7 Part 2.
Chapter 3: Windows7 Part 2.
BIC 10503: COMPUTER ARCHITECTURE
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
EPICS: Experimental Physics and Industrial Control System
Operating System Overview
Chapter 13: I/O Systems.
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

1 BROOKHAVEN SCIENCE ASSOCIATES Funded under DOE contract : DE-AC02-98CH10886 EPICS/RTEMS/MVME5500 FOR REAL-TIME CONTROLS AT NSLS ICALEPCS2005, Geneva, Switzerland October 10-14, 2005 S. Kate Feng, D. Peter Siddons, NSLS, BNL, USA Till Straumann, SSRL, SLAC, USA Mark Heron, and Steve Singleton, DLS,UK

2 BROOKHAVEN SCIENCE ASSOCIATES National Synchrotron Light Source Overview Introduction: Why EPICS/RTEMS/MVME5500 ? Performance of Network and IRQ Latency Image Processing for Practical Applications Other VME devices used in the beamlines RTEMS/MVME5500 debugging Advantage and Disadvantage of EPICS/RTEMS Conclusion Acknowledgements

3 BROOKHAVEN SCIENCE ASSOCIATES National Synchrotron Light Source Introduction There are over two thousands users of NSLS at BNL yearly. At several NSLS beamlines, EPICS as core control software and RTEMS as real-time Operating System (O.S.), both of them open source, were adapted to produce low-cost and robust VME control systems. Recently, Nobel Prize winning research was performed at one of NSLS beamlines, which utilize the EPICS/RTEMS/MVME2307 control systems.

4 BROOKHAVEN SCIENCE ASSOCIATES National Synchrotron Light Source Why EPICS/RTEMS/MVME5500 ? EPICS3.14.x provides Operating System Interface layer, which supports RTEMS. The performance of RTEMS is comparable to that of VxWorks as a real time O.S. We had successful experience with RTEMS/MVME2307. The board was discontinued as of Sept., We decided to write a RTEMS BSP for the cost-effective MVME5500. Its system controller GT64260 is similar to GT64360, which offers off-the- shell embedded solutions such as VPF1 on the VME/VXS platform, for fast I/O on the custom hardware. Thus, some of the BSP software would become sharable for the planned embedded solutions. The 1GHZ processor speed and high network throughputs of the MVME5500 offer users the advantage to integrate a PMC card to the RTEMS IOCs for image processing, producing compact, low-cost and optimal real time control systems.

5 BROOKHAVEN SCIENCE ASSOCIATES National Synchrotron Light Source MVME5500 Block Diagram by Motorola

6 BROOKHAVEN SCIENCE ASSOCIATES National Synchrotron Light Source Performance Measurement : Network EPICS provides “ catime ” client software for users to measure its client/server network performance (e.g. channel access), which was used to compare the network performance at NSLS under the same subnet between RTEMS and vxWorks on the EPICS3.14.6/MVME5500 IOCs. The client platform is a PC equipped with an Intel Xeon 3.2 GHz processor and 1MB L3 cache running RedHat9.0 Linux installed with the Kernel. The result listed is for scalars, not for arrays or images.

7 BROOKHAVEN SCIENCE ASSOCIATES National Synchrotron Light Source Table 1: catime performance of the 10/100 MHz port between MV5500/EPICS/RTEMS4.6.x and MV5500/EPICS/vxWorks5.5. Units are “Mega bits per second (Mbps)” and “Items per second (It/s)” O.S.RTEMSvxWorksRTEMSvxWorks # of channels 1,000 10,000 search 5.8 Mbps 27.1 Mbps 18.2 Mbps pend 413.6K It/s470.3K It/s445.2K It/s447.6K It/s async put 15.4 Mbps 13.0 Mbps 30.4 Mbps 22.0 Mbps async get 19.1 Mbps 15.0 Mbps 51.4 Mbps 32.5 Mbps Sync get 1.4 Mbps 0.8 Mbps 0.4 Mbps 0.3 Mbps

8 BROOKHAVEN SCIENCE ASSOCIATES National Synchrotron Light Source Table 2: catime performance of the 1GHz port between MV5500/EPICS/RTEMS4.6.x and MV5500/EPICS/vxWorks5.5. Units are “Mega bits per second (Mbps)” and “Items per second (It/s)” O.S.RTEMSvxWorksRTEMSvxWorks # of channels 1,000 10,000 search 5.7 Mbps 4.8 Mbps 24.6 Mbps 21.1 Mbps pend 453.1K It/s450.0K It/s453.5K It/s450.9K It/s async put 15.6 Mbps 31.3 Mbps 30.7 Mbps async get 19.5 Mbps 18.3 Mbps 54.0 Mbps 43.8 Mbps Sync get 1.1 Mbps 0.7 Mbps 0.4 Mbps 0.3 Mbps

9 BROOKHAVEN SCIENCE ASSOCIATES National Synchrotron Light Source Summary of Network Performance The tables showed similar performance between RTEMS and vxWorks for 1K channels. For the test of 10K channels, RTEMS had a slightly higher performance on both network ports. The 1GHz port did not show much higher performance than the 100MHz one. It might be due to the advantage that the 100MHz Ethernet unit and SDRAM controller are integrated on the GT64260 system controller of the MVME5500, clocking the Direct Memory Access operations via the CPU local bus at 133MHz. The 1GHz Ethernet controller is implemented on the 66 MHz PCI local bus, which was interfaced to the SDRAM via the GT64260 system controller.

10 BROOKHAVEN SCIENCE ASSOCIATES National Synchrotron Light Source Summary of Network Performance More tests need to be done to verify if a faster PC running Linux 2.6.x Kernel will improve the performance of the 1GHz network port. One could further enhance the performance of 1GHz port on RTEMS by adding O.S. support for checksum offloading and TCP segmentation offload.

11 BROOKHAVEN SCIENCE ASSOCIATES National Synchrotron Light Source IRQ Latency measurement An important consideration of a real-time system is the time it takes for the system to react to an external event (e.g. interrupt) under the worst case. Interrupt latency is the time it takes from a device asserting an interrupt line until the system dispatching the corresponding Interrupt Service Routine. Context switch delay is the time it takes to schedule a task. It involves the scheduler determining which task to run, saving the current task context and restoring the new one.

12 BROOKHAVEN SCIENCE ASSOCIATES National Synchrotron Light Source Benchmark Software for Latency Measurement The benchmark software consists of an initialization routine, an interrupt handler and a simple measurement procedure. It was loaded dynamically and executed after IOC initialization. For both RTEMS and vxWorks, 2,000,000 timer interrupts were generated at a rate of 4k Hz and the maximal and average latencies were recorded under both idle and loaded conditions. The loaded system consisted of ‘catime’ client constantly accessing the process variables of the IOC from a Linux workstation, while letting a low priority thread print characters to the serial console.

13 BROOKHAVEN SCIENCE ASSOCIATES National Synchrotron Light Source Table 3: Measurement results of Interrupt latency and Context Switching on EPICS/MVME5500 MVME5500 Interrupt latency (usec) Maximum (Average) Context Switching(usec) Maximum (Average) Idle System RTEMS5.04 (3.45)6.80 (0.96) VxWorks6.10 (1.58)9.65 (0.91) Loaded System RTEMS8.17 (3.74)17.48 (1.69) VxWorks13.90 (1.68)20.80 (1.90)

14 BROOKHAVEN SCIENCE ASSOCIATES National Synchrotron Light Source Latency Performance : Summary of Table 3 The idle systems exhibit comparable figures. Under the loaded systems, RTEMS is showed to be slightly more deterministic and steadier than vxWorks. In the RTEMS users mailing lists, there were interesting discussions from the industry, which indicated that RTEMS/MVME5500 responded faster than vxWorks/MVME5500 in a heavily loaded application.

15 BROOKHAVEN SCIENCE ASSOCIATES National Synchrotron Light Source Image Processing for Practical Applications At the beamline, images need to be handled more frequently as the experiments and their detectors become more sophisticated. Imaging x-ray detectors and visible light images all need to be integrated into the EPICS system, and it is becoming important that the latencies in the data acquisition be minimized. Target performance : thirty frames per second of data acquisition rate with tight coupling between the signal source and the EPICS IOC. Why RTEMS ? The image software for vxWorks is proprietary, expensive and incompatible with our RTEMS IOCs.

16 BROOKHAVEN SCIENCE ASSOCIATES National Synchrotron Light Source Image Processing for EPICS/RTEMS Applications RTEMS BSP EPICS core + Database(PV)+ device support RTEMS VME/PMC drivers & libraries Linux W.S. GUI PMC2343 firewire controller PMC341 ADC MVME5500 1GHz 100MHz Linux W.S. for development Firewire camera 1 Firewire camera 2 Firewire camera 3 400/200/100 Mbps

17 BROOKHAVEN SCIENCE ASSOCIATES National Synchrotron Light Source Image Processing for EPICS/RTEMS Applications Applications: beam profile measurement for automated beamline tuning, and automated sample alignment. As of today, the drivers were tested to control the camera for power on/off and for the readout of the camera format information. The image acquisition and performance measurement is not implemented yet.

18 BROOKHAVEN SCIENCE ASSOCIATES National Synchrotron Light Source Other VME Devices Used in the Beamlines PMC341(14-bit,16 channel): 8usec simultanenous sampling ADCs for the purpose of reading out the four signals from an X-Y Beam Position Monitor as well as for more general applications (e.g. temperature reading). Other devices ported from EPICS/vxworks to EPICS/RTEMS:OMS58 motor controllers, AVME9440 bit I/Os, VSC8/16 scalers, and IK320 encoders.

19 BROOKHAVEN SCIENCE ASSOCIATES National Synchrotron Light Source The CARROT for using EPICS/RTEMS The EPICS 3.14.x OSI facilitates the porting of the existing vxWorks drivers to RTEMS. To share the EPICS database and attractively designed Graphical User Interface (GUI) software, which is Motif Editor and Display Manage (MEDM) based, and other client software such as StripTool for the beamline applications. The learning curve for the MEDM based GUI software is as easy as it could be. The unified GUI further cuts the learning curve for users who run experiments among different facilities which supply the same GUI.

20 BROOKHAVEN SCIENCE ASSOCIATES National Synchrotron Light Source RTEMS/MVME5500 DEBUGGING What to do if the system crashed ? The MVME5500 BSP would dump the register contents and print stack traces (Fig. 1) information if the system crashed. Tracing back the stacks against the disassembled dump of the code allows one to debug the software simulating the real-time debugging. Next PC or Address of fault = 1F3AE2C, Saved MSR = B032 Stack Trace: IP: 0x01F3AE2C, LR: 0x01F3AE04  0x01F3AB98  0x01F3A114  0x00007C90  0x0000C7D0  0x00006E94  0x C  0x  x C  0x0011FE90  0x0011FD9C unrecoverable exception!!! task 0A suspended Fig. 1 An example of stack trace printed by the exception handler

21 BROOKHAVEN SCIENCE ASSOCIATES National Synchrotron Light Source An easier way of DEBUGGING There is a source-level symbolic debugger built for the RTEMS/MVME5500, which was derived from the GNU Debugger(GDB) by adding enhancements such as supporting a RTEMS/CEXP (e.g. dynamic loader ) target. On the target, the debugging agent must be linked into the IOC system and started as a daemon. The GDB from a host computer will find the source code lines corresponding to the PC addresses on the stack and provide other debugging capabilities such as setting/resetting breakpoints, displaying/modifying data structures and so on.

22 BROOKHAVEN SCIENCE ASSOCIATES National Synchrotron Light Source Advantage of EPICS/RTEMS Both EPICS and RTEMS have professional level user mailing lists for open technical discussion based on a large group of users internationally. There are no license hassles for the EPICS and RTEMS software. They both provide lifetime access to anyone even if the provider drops support on a particular platform because access is available to the source code level.

23 BROOKHAVEN SCIENCE ASSOCIATES National Synchrotron Light Source Disadvantage of RTEMS As an open source O.S., RTEMS is not as widely used as other ones such as Linux, which is not designed for real-time applications. However, the strength of RTEMS is that it guarantees a higher performance for a worst case in a specified system load, while the performance of Linux is less predictable and much slower under the same hardware platform.

24 BROOKHAVEN SCIENCE ASSOCIATES National Synchrotron Light Source Conclusion Open source promotes open discussion and open collaboration, enhancing technical effectiveness, which contribute to our success to a robust, competent, and inexpensive system for real-time controls. The EPICS 3.14 OSI facilitates RTEMS software development, and the EPICS/RTEMS OSI layer is efficient, reliable and sufficient.

25 BROOKHAVEN SCIENCE ASSOCIATES National Synchrotron Light Source Conclusion -cont. The RTEMS O.S. is comparable to the leading commercial real-time O.S. such as vxWorks. It is flexible, reliable and suitable for even high- end real-time applications. The performance of RTEMS is thriving upwards as more people adopt it and contribute to it. As of today, RTEMS has a reasonable variety of BSPs. To further expand its horizon, more men/women power is needed to popularize RTEMS.

26 BROOKHAVEN SCIENCE ASSOCIATES National Synchrotron Light Source Acknowledgements Many thanks to my colleagues Zhijian Yin and Ivan So of NSLS and EPICS community for the smooth O.S. transition of the IOCs at NSLS beamlines from EPICS/vxWorks to EPICS/RTEMS. This work performed under the Department of Energy contract DE-AC02-98CH10886.