All Projects → ess-dmsc → lewis

ess-dmsc / lewis

Licence: GPL-3.0 License
Let's write intricate simulators!

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to lewis

Firesim
FireSim: Easy-to-use, Scalable, FPGA-accelerated Cycle-accurate Hardware Simulation in the Cloud
Stars: ✭ 415 (+2341.18%)
Mutual labels:  hardware, simulation
fphdl
VHDL-2008 Support Library
Stars: ✭ 36 (+111.76%)
Mutual labels:  hardware, simulation
docker
Scripts to build and use docker images including GHDL
Stars: ✭ 27 (+58.82%)
Mutual labels:  hardware, simulation
MinimumViableSynth
A virtual analog synthesizer with lots of knobs and buttons.
Stars: ✭ 22 (+29.41%)
Mutual labels:  hardware
super-sixteen
Code and schematics for the Super Sixteen Eurorack sequencer
Stars: ✭ 90 (+429.41%)
Mutual labels:  hardware
streamdeck
Golang API for the Corsair / Elgato StreamDeck
Stars: ✭ 46 (+170.59%)
Mutual labels:  hardware
simplu3D
A library to generate buildings from local urban regulations.
Stars: ✭ 18 (+5.88%)
Mutual labels:  simulation
amodeus
Autonomous Mobility-on-Demand Extremely Useful Simulation
Stars: ✭ 44 (+158.82%)
Mutual labels:  simulation
multiphysics
Interactive Multiphysics Simulation for Everyone
Stars: ✭ 41 (+141.18%)
Mutual labels:  simulation
dsensor
📈 Digital universal particle concentration sensor ⏲️
Stars: ✭ 13 (-23.53%)
Mutual labels:  hardware
elasty
A research-oriented elastic body simulator
Stars: ✭ 173 (+917.65%)
Mutual labels:  simulation
sbml-test-suite
The SBML Test Suite is a conformance testing system. It allows developers and users to test the degree and correctness of the SBML support provided in a software package.
Stars: ✭ 21 (+23.53%)
Mutual labels:  simulation
rpl-attacks
RPL attacks framework for simulating WSN with a malicious mote based on Contiki
Stars: ✭ 56 (+229.41%)
Mutual labels:  simulation
asyn
EPICS module for driver and device support
Stars: ✭ 19 (+11.76%)
Mutual labels:  epics
SmartTrafficIntersection
Another AI toy project, of a traffic intersection controlled by a Reinforcement Learning AI agent to optimize traffic flow in an intersection of vehicles or pedestrians
Stars: ✭ 30 (+76.47%)
Mutual labels:  simulation
SimNDT
Ultrasonic NDT Simulator with engine core based on the Elastodynamic Finite Integration Technique (EFIT)
Stars: ✭ 34 (+100%)
Mutual labels:  simulation
RAWSim-O
A simulation framework for Robotic Mobile Fulfillment Systems
Stars: ✭ 82 (+382.35%)
Mutual labels:  simulation
openfluid
OpenFLUID framework and applications
Stars: ✭ 19 (+11.76%)
Mutual labels:  simulation
pinout
An open source Python package that generates hardware pinout diagrams as SVG images.
Stars: ✭ 298 (+1652.94%)
Mutual labels:  hardware
euler-fluid-cpp
Euler fluid simulated with CPP and SFML
Stars: ✭ 50 (+194.12%)
Mutual labels:  simulation

Codacy Coverage Status Documentation

Lewis

Lewis - Let's write intricate simulators.

Lewis is a Python framework for simulating hardware devices. It is compatible with Python 3.6 or higher.

Lewis can be installed via pip or ran from source. See relevant usage sections at ReadTheDocs for more details.

Resources: GitHub -- ReadTheDocs -- PyPI

Lewis was previously named "Plankton" but, due to a package with the same name on PyPI, we decided to rename the project.

Lewis is licensed under GPL v3 or later.

Purpose and Use Cases

Lewis is being developed in the context of instrument control at the ESS, but it is general enough to be used in many other contexts that require detailed, stateful software simulations of hardware devices.

We consider a detailed device simulation to be one that can communicate using the same protocol as the real device, and that can very closely approximate real device behaviour in terms of what is seen through this protocol. This includes gradual processes, side-effects and error conditions.

The purpose of Lewis is to provide a common framework to facilitate the development of such simulators. The framework provides a common set of tools, including communication protocol services, which helps minimize code replication and allows the developer of a simulated device to focus on capturing device behaviour.

Potential use cases for detailed device simulators include:

  • Replacing the physical device when developing and testing software that interfaces with the device
  • Testing failure conditions without risking damage to the physical device
  • Automated system and unit tests of software that communicates with the device
  • Perform "dry runs" against test scripts that are to be run on the real device

Using a simulation for the above has the added benefit that, unlike most real devices, a simulation may be sped up / fast-forwarded past any lengthy delays or processes that occur in the device.

Features

Brief Terminology

Devices and Interfaces are two independent concepts in Lewis. The Device is model for the device behaviour and internal memory. A Device can be represented using a StateMachine, but it does not have to be. A Device does not include anything specific to the communication protocol with the Device. An Interface provides bindings from a protocol Adapter to a Device. Common Adapters, , such as TCP stream, Modbus and EPICS, are provided by Lewis. The Device and Interface are instantiated as part of a Simulation that provides a cycle "heart beat" and manages other environmental aspects and services.

https://github.com/ess-dmsc/lewis/raw/master/docs/resources/diagrams/SimulationCycles.png

What Can You Do With Lewis?

  • Create new Devices to closely imitate the internal behaviour and memory of something
  • Optionally make a Device work as a StateMachine via StateMachineDevice to give rich behaviours
  • Create one or more Interfaces over your Device to expose it as an EPICS IOC, a TCP listener, or on any other bespoke protocol you like
  • Access and control the Device while it is running via a control server
  • Access and control the Simulation while it is running via a control server
  • Control server can be accessed via command-line utility, Python bindings, or JSON RPC.

Additional Documentation

Documentation can be found at ReadTheDocs.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].