Erlang Embedded Simulation Final Chalmers Presentation

Comments (0)

Transcript of Erlang Embedded Simulation Final Chalmers Presentation

Erlang Embedded Simulation Rickard Olsson & Reza Javaheri What is Erlang Embedded? Erlang running on a small computerNOT an AVR with 2kb of ram and 8mhzErlang needs an OS IntroductionWhat is Erlang?WorkflowDemo videoMeasurementsConclusionFuture WorkQuestions What is erlang? Messages The world is concurrentThings in the world don't share dataThings communicate with messagesThings fail-Joe Armstrong Processes communicate by value, sending messagesProcesses has idsEach process has a mailboxThis is like email Processes Erlang Virtual Machine does scheduling and memory management are handled by the VMCan easily spawn 100.000 processesErlang is a functional language DoesSimulatorexist? YES DoesPeripheralAPIexist? NO Choose peripheral to simulate Set OS environmental variable "EMBEDDED_ENV" to "sim". Peripheralgeneratesdata? Create API which can be used later for driver YES NO NO Integrate simulator with driver API(only one line of code) YES Hardware Chooseenvironment Simulator No change needed Write reply messages to API Manually write log messagesorRecord message from hardware Choose Supervisors:Hans Svensson (Chalmers)Robert Virding (Inventor of Erlang) Overview Thesis Testing code on hardware is inconvientNeed access to the hardwareNo workflow for simulators available Library for creating and verifying simulatorsSimulators for simple devices like serial ports, push buttons, LEDs, GPS navigation devicesDevelopment workflowPerform analysis to verify improvement and correctnes of using simulators Acknowledgements You can shorten development time and improve quality by using simulators. The Problem Result Erlang Solutions for letting us to work on our thesis in their office in Stockholm.Our supervisors Hans Svensson & Robert Virding and others at Erlang Solutions Approach It is possible to create simulators for Erlang EmbeddedCorrectness of simulators can be verifed and the simulators we created are correctTime can be saved & quality improved Complex simulators Handle pids Stdio Create the most generic fsm of logsCan be used for verification of systemFor simulationOr statisticial analysis of FSM, which states and transisiton are used Replace call to open_portto *_stub during runtime Create FSM of logs Create a stdio interface for interoperability with other languages, like C or Java Runtime Replacement Create simulators which base replies on log messages for e.g. synchronous communication. Replies based on probability. Make recorder handle unregistered pids in messages Yes, According to our experienceLogic reasoning Improvement? Correctness Result Correctness can be verified by using the recorder toolOur simulators were verified and deemed correct Correctness of simulators can be verified and the simulators we created are correctTime can be saved & quality improved Write code for the target platform Deploy the code and observe the results Repeat the above steps until the desired results are achived.