Skip to content

wip: proof-of-concept for "robosim" #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

wip: proof-of-concept for "robosim" #5

wants to merge 4 commits into from

Conversation

sethp
Copy link
Contributor

@sethp sethp commented Dec 18, 2022

A "discrete event simulator" model of our circuit(s) so we can ask questions like "which invariants are we violating?" and maybe even "what did we decide to do about the SPI clock? why?"

A "discrete event simulator" model of our circuit(s) so we can ask
questions like "which invariants are we violating?" and maybe even
"what did we decide to do about the SPI clock? why?"
Attempting to connect an inverter that will delay changing its output
by 6ns to my 80MHz clock, but Rust does not believe what I'm doing is
safe. Maybe it even isn't?
In order to achieve the goal of 2c94850 without too much wrangling, we
restrict things that are inputs into a node to only produce a single
future scheduled event so we can avoid needing to possibly call
downstream consumers more than once in the future.

Alternatives include:
* Possibly restricting consumers to being Fn (vs FnMut), and passing
  around lots of references with *hand wave* the correct lifetimes
* Instead of taking consumers, take a FnMut that creates the consumers,
  (which can then all be FnOnces again), calling as many times as
  necessary. Also, it'd probably have to return a copy of itself for
  "rewiring", too

But probably the most fruitful:
* Stop holding Rust like it was Haskell, and make `struct Node {...}`
  that holds the (mutable) state of a node in the graph. (why is it
  always graphs?)

Additionally, and more reason to do the above, the simulator engine now
has to recognize the mapping between the schedule (in its entirety) and
which nodes are updated at which point for saving into the history. This
is probably fine (if not ideal) for a ~5 component graph, but unworkable
for a general simulator.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant