Tracing, Analysis and Simulation For Embedded Systems: Rickard Olsson @rickard - Olsson Reza Javaheri @reza - Javaheri
Tracing, Analysis and Simulation For Embedded Systems: Rickard Olsson @rickard - Olsson Reza Javaheri @reza - Javaheri
Github: https://github.com/devR2/
Overview
Hypothetical Problem Erlang Simulation & Analysis Related work Applications, Pains & Remedies
Hypothetical Problem
Safe System
Faulty FSM
Corrected FSM
Erlang
Erlang
Functional Distributed Fault Tolerant
Simulation
Simulation
Having a simulator early on in an embedded project increases the chance of success :)
Simulation
Creating a simulator is time consuming Change in the product causes change in the simulator Simulator should be easy to change and maintain
Simulation Workflow
View workflow at: http://prezi. com/lvc_zevtm25b/erlang-embedded-simulationworkflow
Simulating Sensors
Record messages sent from sensor Replay messages from a session E.g. GPS sensors
Simulating Time
Using timestamps gathered while recording Relative intervals Performance of system can be simulated to some extent
Composing FSM
for every trace case channel(trace): input : inputStack += trace output : transition := merge inputs in inputStack if output does not exist as a state: create a new state x else state x := state with same output add transition from current state to state x end end
Composing FSM
Analysing FSM
Drawing visual fsm Statistics of fsm usage, how many times were a transition performed or how long did the application stay in a state
Related Work
Inferring FSM
QSM* (Query-driven State Machine) User Inquiries Interactive Grammar Interface** X-Machines and XFSM Probing the system (create test) Extract accepting sequences from captured log messages
* THE QSM ALGORITHM AND ITS APPLICATION TO SOFTWARE BEHAVIOR MODEL INDUCTION (Pierre Dupont) ** Reverse Engineering State Machines by Interactive Grammar Inference Neil Walkinshaw, Kirill Bogdanov, Mike Holcombe, Sarah Salahuddin
Inferring FSM
Abstraction Functions Leader election algorithm
Semi-Formal Development of a Fault-Tolerant Leader Election Protocol in Erlang Thomas Arts, Koen Claessen, and Hans Svensson IT University in Go teborg, Box 8718, 402 75 Go teborg, Sweden
Inferring FSM
P-PSM Probabilistic method Using clustering to distinguish states Using frequency filter and extract the most frequent transitions
Inferring Protocol State Machine from Network Traces: A Probabilistic Approach Yipeng Wang, Zhibin Zhang, Danfeng(Daphne) Yao, Buyun Qu, Li Guo Institute of Computing Technology, CAS Virginia Tech, USA
Applications
Applications Verification of systems Legacy Systems Quickly creating functional simulators Other area than embedded, e.g. http simulator