0% found this document useful (0 votes)
363 views

Tracing, Analysis and Simulation For Embedded Systems: Rickard Olsson @rickard - Olsson Reza Javaheri @reza - Javaheri

This document discusses tracing, analysis and simulation for embedded systems using Erlang. It provides an overview of using recorded traces from a safe system to infer a finite state machine (FSM) model and simulate the system. The document describes creating simple state simulators and simulating sensors by replaying recorded messages. It also discusses related work on inferring FSM models from traces and networks using techniques like querying, interactive grammar inference, and probabilistic methods.

Uploaded by

Rickard Olsson
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
363 views

Tracing, Analysis and Simulation For Embedded Systems: Rickard Olsson @rickard - Olsson Reza Javaheri @reza - Javaheri

This document discusses tracing, analysis and simulation for embedded systems using Erlang. It provides an overview of using recorded traces from a safe system to infer a finite state machine (FSM) model and simulate the system. The document describes creating simple state simulators and simulating sensors by replaying recorded messages. It also discusses related work on inferring FSM models from traces and networks using techniques like querying, interactive grammar inference, and probabilistic methods.

Uploaded by

Rickard Olsson
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

Tracing, Analysis and Simulation for Embedded Systems

Rickard Olsson @rickard_olsson [email protected]

Reza Javaheri @reza_javaheri [email protected]

Github: https://github.com/devR2/

Tweet your questions


@erlangsim

Overview
Hypothetical Problem Erlang Simulation & Analysis Related work Applications, Pains & Remedies

Hypothetical Problem

Software for a Safe

Safe System

Connect Recorder to the Safe System

Recorded Trace file


{trace, {process, safe}, {type, receive}, {msg, {123}}} {trace, {process, safe}, {type, send}, {msg, lock}, {to, door}} {trace, {process, safe}, {type, receive}, {msg, {123}}}

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

Our view on simulators


Let's talk about how our journey changed our view on simulators Simulating functional aspects, not resources or performance

Simple State Simulator


Provide an interface to access simulator Hard code requests and replies E.g. A button

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

Using Traces to Create FSM


Using traces to infer generic FSM Quick and generic solution, powerful but hard to implement

Using Traces to Create FSM

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

Each output = 1 state


Every output is treated as a unique state. Otherwise state explosion might happen. State explosion can be avoided by user inquiries or abstraction functions.

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

What are you trying to say?

Applications
Applications Verification of systems Legacy Systems Quickly creating functional simulators Other area than embedded, e.g. http simulator

Pain and Remedies


Pain Defining and capturing channels Mapping effects(output) to the right input Remedies Messaging patterns

You might also like