NyanCAD / Mosaic

A modern schematic entry and simulation program
https://nyancad.github.io/Mosaic/
Mozilla Public License 2.0
68 stars 5 forks source link

simulator integration #21

Closed pepijndevos closed 2 years ago

pepijndevos commented 3 years ago

Two conflicting requirements: interactive feedback & long-running simulations

Feedback is everything in design. Change something, see the results. For small circuits and in particular for operating point, it's feasible to interactively run a simulation, and update the plots and annotate the operating points in the schematic.

On the other hand, for complex designs simulations can run for hours or days and you don't want to lose your results if you close the tab or something.

You want to be able to automate as much of the simulation and measurement as possible, and as little manual running and analyzing waveform plots. On the other hand analog designers aren't great programmers, so keeping it simple is paramount.

I think Jupyter Lab is a great platform to run both interactive simulations and plots, as well as long running simulations (possibly with the aid of %%capture )

so first point is: we need a simple Python API. This can use the collaboration API to just fetch the schematic from CouchDB and write annotations back to it.

Second more complicated point: how does Jupyter integrate with Mosaic? Do they just run in their own tabs? Do we embed Mosaic as a Jupyter Lab editor? Do we embed Jupyter notebook inside Mosaic?

For context, what I think is the wrong approach is the Mosaic Pluto.jl plugin in which the editor feels cramped, being embedded inside the notebook, and in which there is no good "upgrade path" to running long-running simulations outside of the notebook. This is using a JS API to send the netlist to Julia. I think using a CouchDB API will allow "upgrading" to an offline Python script much easier.

pepijndevos commented 2 years ago

Feels like the current approach works well