Open lkolbly opened 1 year ago
This is partially done, we have to also consider the case of two external modules connected circularly, e.g.:
instantiate foo as a;
instantiate bar as b;
a.x[t] = b.y[t];
b.x[t] = a.y[t];
which is, of course, legal (as long as one of foo
or bar
breaks the combinatorial cycle), but necessitates that we split the simulation into separate "update" and "clock" steps and call "update" on each module until the system stabilizes.
The user might want to instantiate a module which is defined outside of their code. For example, this can be a high-cost alternative to #9 if the user uses the external module to instantiate memories or something:
If the user does this, they should still be able to simulate it when running in Python, perhaps something like this:
or perhaps by specifying an object that gets passed into the module, for example:
however we end up doing it, we'll need to support combinatorial modules, so being able to set
y[t] = f(t[-1])
doesn't quite cover every case (in fact, this is something that the simulation is lacking at a broader scale too).