driving and virtualizing control systems: the open source approach used in whiterabbit (heptech...

31
Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez Academia-Industry Matching event on Technology of Controls for Accelerators and Detectors November 2013

Upload: igalia

Post on 15-Jan-2015

101 views

Category:

Technology


0 download

DESCRIPTION

Javier Muñoz Mellid and Samuel Iglesias Gonsalvez. This talk will describe the collaboration between CERN and Igalia around the White Rabbit project, the value of the Open Source approach and how it crystallizes in upstream contributions (software and hardware). Along this talk we will describe in detail how White Rabbit and Open Source projects are able to raise the quality of the software used, accelerating innovation and gaining addi- tional contributors. In the technical arena, we will describe the development of Linux drivers and virtual hardware (QEMU/KVM) for the FMC/TDC board designed in CERN. This approach was showcased in LinuxCon 2012, one of the most relevant conferences in the industry. We will comment about the importance of promoting this kind of technology in industry events. The talk will finish with a live demo showing how virtual hardware (hardware mimick- ing real hardware designed by CERN for WhiteRabbit) is used to develop, test and debug control drivers using a generic software stack.

TRANSCRIPT

Page 1: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

Driving and virtualizing control systems: the OpenSource approach used in WhiteRabbit

Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Academia-Industry Matching event on Technology of Controls for Accelerators and DetectorsNovember 2013

Page 2: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

Agenda

Knowing IgaliaThe value of the Open Source approachOpen Source approach in WhiteRabbitA walk on technical details and demo

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 3: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

What is Igalia?

Open Source Company40 engineers and hackers working around the globeHacking upstream in different technologies andcommunities

kernel (Linux)virtualization (QEMU/KVM)browsers/multimedia (WebKit, Blink, GStreamer...)compilers (V8, JavaScriptCore...)UI (GTK+,...)documents (Evince, LibreOffice...)distros (Debian, Tizen...)automotive/IVI

13 years old now!www.igalia.com

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 4: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

Partnering

Linux Foundationwww.linuxfoundation.org/news-media/announcements/2011/04/igalia-joins-linux-foundationW3Cwww.igalia.com/nc/igalia-247/news/item/igalia-joins-the-world-wide-web-consortiumTizen Associationwww.igalia.com/nc/igalia-247/news/item/igalia-joins-the-tizen-association-partner-program/...

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 5: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

What services and solutions provides Igalia?

We are experts in Open Source Software solutionsWe help companies and institutions to achieve opendevelopments aligned with their culture and businessmodelsWe collaborate with customers through concrete andwell-defined projectsUsual customer’s needs ranges from expert technicaldevelopment, support and training to strengthen in-houseteams or requiring a technical link between project andopen communities

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 6: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

Can your project take advantage of an openapproach?

To take serious advantage of Open Source approach youshould avoid using open and free software only(consuming). You should take in consideration producingit as WhiteRabbit community is doing!It requires understanding the ’upstreaming concept’ inOpen Source projectsWe will see the upstream concept quickly in order toillustrate it with the WhiteRabbit experience

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 7: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

What is upstreaming?

Upstreaming refers to the practice of contributing sourcecode that has been developed independently or in-houseback to an open source project.Having code accepted upstream provides several benefitsto the open source project, the companies submitting codeto upstream projects, and the open source ecosystem ingeneral.

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 8: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

Advantages of Upstream Alignment

Accelerate InnovationMinimize R&D CostsGain Additional ContributorsIncrease Code QualityEnable Faster Integration and TestingInfluence the project’s directionProvide stability to the open source project

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 9: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

CERN and Igalia collaboration (I)

Started in 2012Collaboration between CERN’s BE-CO-HT section andIgalia’s Kernel/Virtualization teamWorked around FMC/TDC board in the WhiteRabbitcontextIgalia was in charge of Linux kernel driver development,testing and quality for this boardIn this project we started to develop virtual hardware foran open virtualizator/emulator (QEMU/KVM)We introduced part of our collaboration with CERN basedon automatic testing, continuous integration and qualityfor Linux drivers using virtual hardware in LinuxCon 2012In this conference, LinuxCon, Igalia promotioned some ofthe technologies used in CERN and the WhiteRabbitproject as part of this collaboration

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 10: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

CERN and Igalia collaboration (II)

In summary, this collaboration related with control aspectsraised value in the following aspects:

Speeding up Linux driver development for one customboard designed in CERNDeveloped virtual hardware for automatic testing,continuous integration and safe testsSupported the collaboration’s upstream process with codein different communities (Linux, QEMU, Open HardwareRepository and KiCAD mainly)We introduced this collaboration and experience inLinuxCon 2012. A very relevant conference in the industryRelated to this collaboration, some of our customers founduseful the open virtual hardware approach to reducedevelopment times, working in parallel with hardwaredesigners, redesigning firmware’s interface or runningagressive testing

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 11: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

Technical details and demo

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 12: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

Our work in kernel

Industry Pack busTEWS TPCI-200.GE IP-OCTAL-232.

FMC bus (WhiteRabbit project)FMC TDC board

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 13: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

Industry Pack drivers

Open Source drivers developed at CERN.Mainstream Linux kernel support added in 2012.

In Staging in May 2012.Moved to mainstream in November 2012.

Three drivers:ipack bus driverTEWS TPCI-200 carrier boardGE IP-OCTAL: 8 channel serial port device

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 14: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

Industry Pack boards

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 15: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

FMC TDC driver

Hosted in OHWR.http://www.ohwr.org/projects/fmc-tdc-sw

Tested on a SPEC board.It uses ZIO framework to bring an I/O device touser-space.It uses the FMC bus driver to register the mezzanine in thesystem.

FMC bus is supported in mainline kernel as of June 2013.

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 16: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

FMC TDC board

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 17: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

Our work in virtualization

Virtualized models

Industry Pack: Added to QEMU in 2012.TEWS TPCI-200GE IP-OCTAL-232

FMC TDCSPEC board (only needed bits)FMC TDC board

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 18: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

FMC TDC board virtualization

When developing the driver, we saw some problems:No enough devices for all developersFW is not mature enoughWhich is the source of the error?

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 19: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

FMC TDC board virtualization

So we created a virtual model of the deviceVirtualized just some specific bits of SPECSame memory addresses and registers than the real FWWe can test error conditions to improve driver’s robustness

Could it be possible to test the driver automatically?

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 20: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

FMC TDC board: Error conditions

It was needed to test error conditions on the driver

Generic stuffThe virtual board in being detected by the driver as agenuine deviceNormal mode: no error injection

DMA errorsSet up different input pulse configurations

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 21: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

How we did that

QEMU (http://wiki.qemu.org)Open source machine emulator and virtualizerAllow us to play with different setupsIf has nice features: snapshot, shared folders, no screen, etc

Buildbot (http://trac.buildbot.net/)Continuous integration system designed to automate thebuild/test cyclePython. Web interface to check the logs

Our own testing suiteBased on Sam’s experience working with PTS in the pastNeeded more flexibility: different setups for the same testDeveloped in Python, as PTS

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 22: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

The result (I)

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 23: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

The result (II)

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 24: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

The result (III)

http://tdc-buildbot.igalia.com

Username: buildbotPassword: qemulinux

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 25: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

The result (IV)

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 26: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

The result (V)

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 27: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

Results

We could test different conditions:Choose memory size, virtual machine image, network, etcDifferent kernel versionsAs is uses continuous integration -> Detect which commitadded the error

Based on Open Source technologiesCan be modified to validate complex systems before theyare done

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 28: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

Links (I)

CERN/Igalia collaborationwww.igalia.com/kernelblogs.igalia.com/jmunhoz/blog/2012/12/14/follow-the-white-rabbit-working-with-cern.html

Industry Pack driversblogs.igalia.com/siglesias/2012/11/23/fmc-tdc-driver

FMC TDC driverFMC projects SPEC, FMC TDC and FMC TDC softwareblogs.igalia.com/siglesias/2012/11/23/fmc-tdc-driver/

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 29: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

Links (II)

CI, testing suites and virtual hardware (QEMU)blogs.igalia.com/berto/2012/10/03/industrypack-qemu-and-linuxcon/blogs.igalia.com/berto/2012/11/28/qemu-and-open-hardware-spec-and-fmc-tdc/events.linuxfoundation.org/.../pdf/lceu2012_garcia.pdfblogs.igalia.com/magomez/2012/11/28/continuous-integration-and-testing-driver-development-and-virtual-hardware-the-fmc-tdc-experience/

Fixing bugs upstream in KiCADblogs.igalia.com/jaragunde/2013/01/21/introducing-kicad-because-open-hardware-needs-open-tools/blogs.igalia.com/jaragunde/2013/01/30/kicad-bug-squashing-round-1/blogs.igalia.com/jaragunde/2013/02/14/kicad-bug-squashing-round-2/

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 30: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

Questions & Answers

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez

Page 31: Driving and virtualizing control systems: the Open Source approach used in WhiteRabbit (HEPTech Academia 2013)

Thank you!

Driving and virtualizing control systems: the Open Sourceapproach used in WhiteRabbit Javier Muñoz Mellid & Samuel Iglesias Gonsalvez