SlideShare une entreprise Scribd logo
1  sur  23
Télécharger pour lire hors ligne
:

                   CITED BY 8
2010   1   8
•   Event-driven State-machines Programming (ESP)

                   •                /

               •

               •   C               (SPIN)

               •                    :VMMC

                   •   C(15600) →ESP(about 300) ????


2010   1   8
Contents
               •   Introduction
               •   Motivation
                   •   Case Study:VMMC Firmware
                   •   Implementing Firmware in C
               •   Goals and Approach
               •   Event-driven State-machine programming(ESP) language
                   •   Types, Expressions, and Statements
                   •   Channels/Processes
                                                                          /
                   •   Memory Management
                   •   External Interface
                   •   Case Study:VMMC Firmware
               •   Developing and Testing Using a Verifier
                   •   Spin Model Checking Verifier
                   •   Translating ESP into SPIN Specifications
                   •   Case Study:VMMC Firmware
               •   Generating Efficient Firmware
                   •   ESP Compiler
                   •   Case Study:VMMC Firmware
               •   Related Work
               •   Conclusions
2010   1   8
Motivation


                            Programmable
                            Device




                     firmware
                        (concurrency)

                     user-level threads
                      or
                     event-driven state-machines
2010   1   8
Case Study:VMMC
  The VMMC architecture delivers high-performance on Gigabit
  networks by using sophisticated network cards(Myrinet).




  Event-driven state-machine in C



2010   1   8
Firmware for VMMC in C
                      Problems:
                         very hard to read
                           fragmented across several handlers.
                         be saved explicitly in global variables
                           the stack is shared to pass between handlers
                           (e.g. pAddr, sendData)
                           to used by state machines to communicate
                           with each other (e.g. reqSM2).
                         explicit memory management
                           be responsible for freeing
                         functions are an inappropriate abstraction
                         mechanism for programming with state
                         machines
                         Union data type to encode by “switch”
                         hard to optimize
2010   1   8
C v.s. ESP




2010   1   8
Goal and Approach

               •   Ease of development

               •   Permit extensive testing

               •   Low performance penalty

       simple device-specific functionality    to verify different properties of
       like accessing device registers        the system




2010   1   8
ESP


               •   based on the CSP [13] language/a Cstyle syntax

               •   supports Event-driven State-machines Programming

               •   processes

                   •   a sequential flow of control in a concurrent program

               •   channels

                   •   processes communicate with each other by sending
                       messages on channels


2010   1   8
Types, Expressions, and Statements
               • basic type(int, bool), record, union, array/mutable, immutable


                   •   no global variables

                   •   initialized at declaration time(with a $ prefix)




               •   common imperative constructs

                   •   if-then-else/while

                   •   no recursive
2010   1   8
Channels
               •   synchronous

                   •   sender(out) and receiver(in) are blocking operations

                   •   The alt construct allows a process to wait on the in/out
                       readiness of multiple channels




               •   the use of pattern matching to support dispatch(like ML)

               •   passed by value

2010   1   8
Pattern Matching by Channel
               Declaration:




               Usage:




2010   1   8
Process
               •   processes implement state machines




2010   1   8
Memory Management

               •   provides a novel explicit management scheme to allow
                   efficient but bug free memory management

                   •   memory safety a local property of each process

                   •   When objects are sent over channels, deep copies of the
                       objects are delivered to the receiving process

                   •   each process is responsible for managing its own objects.

               •   provides a reference counting interface to manage memory

               •   link(increment)/unlink(decrement) for ref. counter


2010   1   8
External Interface
           •   provides a single external interface for both SPIN and C
               code

           •   the channel mechanism to support external interfaces

               •   ESP processes often block on external events like arrival
                   of user request or network packets

               •   external code can also use the same dispatch mechanism
                   built into channels through pattern-matching

               •   it promotes modularity




2010   1   8
Case Study:VMMC Firmware




2010   1   8
ESP to SPIN Spec.

               •   right after type checking

                   •   pointer/the size of the state space

                   •   bugs in compile-stage

               •   straight forward translation with a few exceptions

                   •   lack of pointer(by using objectId)




                   •   dynamic allocation(array is treated as its max)


2010   1   8
Case Study:VMMC Firmware
               •   Retransmission Protocol: 10                   2

               •
               •

               •
                   •   State-space explosion prevented us from checking for
                       systemwide properties like absence of deadlocks

                   •   We are currently working on extracting more abstract
                       models so that the state-space search is more tractable
2010   1   8
ESP Compiler
       Processes

           •   generating one big C function

               •   each process = an automaton

                   •   zero-overhead context switching

                   •   code size growing exponentially

               •   generating the code for processes separately

                   •   does not have to save stack

                   •   low-overhead(save/restore program counter)

           •   idle loop/stack-based scheduling policy(shown @next)

           •   some of the traditional optimization
2010   1   8
ESP Compiler
       Processes




2010   1   8
ESP Compiler
       Channels


           •   a set of queue

               •   alt                 queue

           •   bit-mask per process

           •
          one bit for every channel the process may block on
       Messages on Channels

           •   requirement of deep copies(semantics)

           •   increment reference count of the objects(implementation)


2010   1   8
Microbenchmarks Perf.




2010   1   8
Related Work

               •   Concurrency Theory

                   •   CSP, Squeak

               •   Concurrent Languages

                   •   CML, Java, OCCAM

               •   Code Generation+Verification

                   •   Esterel, Teapot, Promela++

               •   Software Testing

                   •   Verisoft, Meta-level Compilation
                                                          concurrent task
2010   1   8

Contenu connexe

En vedette

En vedette (8)

2014 jspenポスター
2014 jspenポスター2014 jspenポスター
2014 jspenポスター
 
Documento n° 3 de apoyo
Documento n° 3 de apoyoDocumento n° 3 de apoyo
Documento n° 3 de apoyo
 
Penjernihan air saring2
Penjernihan air saring2Penjernihan air saring2
Penjernihan air saring2
 
積穗月報98年12月份
積穗月報98年12月份積穗月報98年12月份
積穗月報98年12月份
 
Web 2.0
Web 2.0Web 2.0
Web 2.0
 
Geead 2011 07 20: Deus: Atributos da Divindade
Geead 2011 07 20: Deus: Atributos da DivindadeGeead 2011 07 20: Deus: Atributos da Divindade
Geead 2011 07 20: Deus: Atributos da Divindade
 
Listado de inscriptos alumnos turno tarde
Listado de inscriptos alumnos turno tardeListado de inscriptos alumnos turno tarde
Listado de inscriptos alumnos turno tarde
 
Pantai baron yogyakarta
Pantai baron yogyakartaPantai baron yogyakarta
Pantai baron yogyakarta
 

Similaire à Esp 100107093030-phpapp02

Dynamo 100107092845-phpapp02
Dynamo 100107092845-phpapp02Dynamo 100107092845-phpapp02
Dynamo 100107092845-phpapp02
Takefumi MIYOSHI
 
Lahav Savir - Massively Scaleable Mobile Gateways
Lahav Savir - Massively Scaleable Mobile GatewaysLahav Savir - Massively Scaleable Mobile Gateways
Lahav Savir - Massively Scaleable Mobile Gateways
Lahav Savir
 
Extent3 exante broker_for_algorithmic_trading_2012
Extent3 exante broker_for_algorithmic_trading_2012Extent3 exante broker_for_algorithmic_trading_2012
Extent3 exante broker_for_algorithmic_trading_2012
extentconf Tsoy
 

Similaire à Esp 100107093030-phpapp02 (20)

Dynamo 100107092845-phpapp02
Dynamo 100107092845-phpapp02Dynamo 100107092845-phpapp02
Dynamo 100107092845-phpapp02
 
ECI OpenFlow 2.0 the Future of SDN
ECI OpenFlow 2.0 the Future of SDN ECI OpenFlow 2.0 the Future of SDN
ECI OpenFlow 2.0 the Future of SDN
 
Mike Bartley - Innovations for Testing Parallel Software - EuroSTAR 2012
Mike Bartley - Innovations for Testing Parallel Software - EuroSTAR 2012Mike Bartley - Innovations for Testing Parallel Software - EuroSTAR 2012
Mike Bartley - Innovations for Testing Parallel Software - EuroSTAR 2012
 
Latest (storage IO) patterns for cloud-native applications
Latest (storage IO) patterns for cloud-native applications Latest (storage IO) patterns for cloud-native applications
Latest (storage IO) patterns for cloud-native applications
 
CrySys guest-lecture: Virtual machine introspection on modern hardware
CrySys guest-lecture: Virtual machine introspection on modern hardwareCrySys guest-lecture: Virtual machine introspection on modern hardware
CrySys guest-lecture: Virtual machine introspection on modern hardware
 
Bridging the Semantic Gap in Virtualized Environment
Bridging the Semantic Gap in Virtualized EnvironmentBridging the Semantic Gap in Virtualized Environment
Bridging the Semantic Gap in Virtualized Environment
 
Erlang/Elixir and OTP
Erlang/Elixir and OTPErlang/Elixir and OTP
Erlang/Elixir and OTP
 
17-virtualization.pptx
17-virtualization.pptx17-virtualization.pptx
17-virtualization.pptx
 
Ecoz presentation
Ecoz presentationEcoz presentation
Ecoz presentation
 
Tos tutorial
Tos tutorialTos tutorial
Tos tutorial
 
Fault tolerance
Fault toleranceFault tolerance
Fault tolerance
 
An Operating System for Multicore and Clouds: Mechanisms and Implementation
An Operating System for Multicore and Clouds: Mechanisms and ImplementationAn Operating System for Multicore and Clouds: Mechanisms and Implementation
An Operating System for Multicore and Clouds: Mechanisms and Implementation
 
Symbian os
Symbian osSymbian os
Symbian os
 
2012 06-15-jazoon12-sub138-eranea-large-apps-migration
2012 06-15-jazoon12-sub138-eranea-large-apps-migration2012 06-15-jazoon12-sub138-eranea-large-apps-migration
2012 06-15-jazoon12-sub138-eranea-large-apps-migration
 
Lahav Savir - Massively Scaleable Mobile Gateways
Lahav Savir - Massively Scaleable Mobile GatewaysLahav Savir - Massively Scaleable Mobile Gateways
Lahav Savir - Massively Scaleable Mobile Gateways
 
Jython for embedded software validation
Jython for embedded software validationJython for embedded software validation
Jython for embedded software validation
 
Extent3 exante broker_for_algorithmic_trading_2012
Extent3 exante broker_for_algorithmic_trading_2012Extent3 exante broker_for_algorithmic_trading_2012
Extent3 exante broker_for_algorithmic_trading_2012
 
Migrate to Microservices Judiciously!
Migrate to Microservices Judiciously!Migrate to Microservices Judiciously!
Migrate to Microservices Judiciously!
 
Asia 14-garcia-illera-dude-wtf-in-my-can
Asia 14-garcia-illera-dude-wtf-in-my-canAsia 14-garcia-illera-dude-wtf-in-my-can
Asia 14-garcia-illera-dude-wtf-in-my-can
 
Applying microservices principles to front end
Applying microservices principles to front endApplying microservices principles to front end
Applying microservices principles to front end
 

Plus de Takefumi MIYOSHI

Plus de Takefumi MIYOSHI (20)

ACRi_webinar_20220118_miyo
ACRi_webinar_20220118_miyoACRi_webinar_20220118_miyo
ACRi_webinar_20220118_miyo
 
DAS_202109
DAS_202109DAS_202109
DAS_202109
 
ACRiルーム1年間の活動と 新たな取り組み
ACRiルーム1年間の活動と 新たな取り組みACRiルーム1年間の活動と 新たな取り組み
ACRiルーム1年間の活動と 新たな取り組み
 
RISC-V introduction for SIG SDR in CQ 2019.07.29
RISC-V introduction for SIG SDR in CQ 2019.07.29RISC-V introduction for SIG SDR in CQ 2019.07.29
RISC-V introduction for SIG SDR in CQ 2019.07.29
 
Misc for edge_devices_with_fpga
Misc for edge_devices_with_fpgaMisc for edge_devices_with_fpga
Misc for edge_devices_with_fpga
 
Cq off 20190718
Cq off 20190718Cq off 20190718
Cq off 20190718
 
Synthesijer - HLS frineds 20190511
Synthesijer - HLS frineds 20190511Synthesijer - HLS frineds 20190511
Synthesijer - HLS frineds 20190511
 
Reconf 201901
Reconf 201901Reconf 201901
Reconf 201901
 
Hls friends 201803.key
Hls friends 201803.keyHls friends 201803.key
Hls friends 201803.key
 
Abstracts of FPGA2017 papers (Temporary Version)
Abstracts of FPGA2017 papers (Temporary Version)Abstracts of FPGA2017 papers (Temporary Version)
Abstracts of FPGA2017 papers (Temporary Version)
 
Hls friends 20161122.key
Hls friends 20161122.keyHls friends 20161122.key
Hls friends 20161122.key
 
Slide
SlideSlide
Slide
 
Synthesijer and Synthesijer.Scala in HLS-friends 201512
Synthesijer and Synthesijer.Scala in HLS-friends 201512Synthesijer and Synthesijer.Scala in HLS-friends 201512
Synthesijer and Synthesijer.Scala in HLS-friends 201512
 
Das 2015
Das 2015Das 2015
Das 2015
 
Microblaze loader
Microblaze loaderMicroblaze loader
Microblaze loader
 
Reconf 201506
Reconf 201506Reconf 201506
Reconf 201506
 
Synthesijer jjug 201504_01
Synthesijer jjug 201504_01Synthesijer jjug 201504_01
Synthesijer jjug 201504_01
 
Synthesijer zynq qs_20150316
Synthesijer zynq qs_20150316Synthesijer zynq qs_20150316
Synthesijer zynq qs_20150316
 
Synthesijer fpgax 20150201
Synthesijer fpgax 20150201Synthesijer fpgax 20150201
Synthesijer fpgax 20150201
 
Synthesijer hls 20150116
Synthesijer hls 20150116Synthesijer hls 20150116
Synthesijer hls 20150116
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Esp 100107093030-phpapp02

  • 1. : CITED BY 8 2010 1 8
  • 2. Event-driven State-machines Programming (ESP) • / • • C (SPIN) • :VMMC • C(15600) →ESP(about 300) ???? 2010 1 8
  • 3. Contents • Introduction • Motivation • Case Study:VMMC Firmware • Implementing Firmware in C • Goals and Approach • Event-driven State-machine programming(ESP) language • Types, Expressions, and Statements • Channels/Processes / • Memory Management • External Interface • Case Study:VMMC Firmware • Developing and Testing Using a Verifier • Spin Model Checking Verifier • Translating ESP into SPIN Specifications • Case Study:VMMC Firmware • Generating Efficient Firmware • ESP Compiler • Case Study:VMMC Firmware • Related Work • Conclusions 2010 1 8
  • 4. Motivation Programmable Device firmware (concurrency) user-level threads or event-driven state-machines 2010 1 8
  • 5. Case Study:VMMC The VMMC architecture delivers high-performance on Gigabit networks by using sophisticated network cards(Myrinet). Event-driven state-machine in C 2010 1 8
  • 6. Firmware for VMMC in C Problems: very hard to read fragmented across several handlers. be saved explicitly in global variables the stack is shared to pass between handlers (e.g. pAddr, sendData) to used by state machines to communicate with each other (e.g. reqSM2). explicit memory management be responsible for freeing functions are an inappropriate abstraction mechanism for programming with state machines Union data type to encode by “switch” hard to optimize 2010 1 8
  • 8. Goal and Approach • Ease of development • Permit extensive testing • Low performance penalty simple device-specific functionality to verify different properties of like accessing device registers the system 2010 1 8
  • 9. ESP • based on the CSP [13] language/a Cstyle syntax • supports Event-driven State-machines Programming • processes • a sequential flow of control in a concurrent program • channels • processes communicate with each other by sending messages on channels 2010 1 8
  • 10. Types, Expressions, and Statements • basic type(int, bool), record, union, array/mutable, immutable • no global variables • initialized at declaration time(with a $ prefix) • common imperative constructs • if-then-else/while • no recursive 2010 1 8
  • 11. Channels • synchronous • sender(out) and receiver(in) are blocking operations • The alt construct allows a process to wait on the in/out readiness of multiple channels • the use of pattern matching to support dispatch(like ML) • passed by value 2010 1 8
  • 12. Pattern Matching by Channel Declaration: Usage: 2010 1 8
  • 13. Process • processes implement state machines 2010 1 8
  • 14. Memory Management • provides a novel explicit management scheme to allow efficient but bug free memory management • memory safety a local property of each process • When objects are sent over channels, deep copies of the objects are delivered to the receiving process • each process is responsible for managing its own objects. • provides a reference counting interface to manage memory • link(increment)/unlink(decrement) for ref. counter 2010 1 8
  • 15. External Interface • provides a single external interface for both SPIN and C code • the channel mechanism to support external interfaces • ESP processes often block on external events like arrival of user request or network packets • external code can also use the same dispatch mechanism built into channels through pattern-matching • it promotes modularity 2010 1 8
  • 17. ESP to SPIN Spec. • right after type checking • pointer/the size of the state space • bugs in compile-stage • straight forward translation with a few exceptions • lack of pointer(by using objectId) • dynamic allocation(array is treated as its max) 2010 1 8
  • 18. Case Study:VMMC Firmware • Retransmission Protocol: 10 2 • • • • State-space explosion prevented us from checking for systemwide properties like absence of deadlocks • We are currently working on extracting more abstract models so that the state-space search is more tractable 2010 1 8
  • 19. ESP Compiler Processes • generating one big C function • each process = an automaton • zero-overhead context switching • code size growing exponentially • generating the code for processes separately • does not have to save stack • low-overhead(save/restore program counter) • idle loop/stack-based scheduling policy(shown @next) • some of the traditional optimization 2010 1 8
  • 20. ESP Compiler Processes 2010 1 8
  • 21. ESP Compiler Channels • a set of queue • alt queue • bit-mask per process • one bit for every channel the process may block on Messages on Channels • requirement of deep copies(semantics) • increment reference count of the objects(implementation) 2010 1 8
  • 23. Related Work • Concurrency Theory • CSP, Squeak • Concurrent Languages • CML, Java, OCCAM • Code Generation+Verification • Esterel, Teapot, Promela++ • Software Testing • Verisoft, Meta-level Compilation concurrent task 2010 1 8