Open leonardt opened 3 years ago
Yes, that suspicion is correct. I will revisit uniquification/caching/coreir context. In the meantime, if this is blocking you can we reset the CoreIR context manually in between?
Yea, it's not blocking, just noted it so we have it documented. It came up as I was writing a fault test that calls compile and run twice, which seemed like something that might be okay to do as a new user, so ideally we can fix this to make onboarding easier.
This example
produces two files Adder4.v and Adder16.v, but they both contain the same contents (i.e. the Adder(4) definition of the Adder module is being reused in the second file).
I suspect the problem is that we're not uniquifying names across invocations of m.compile, and this means that coreir is using the old definition for the
Adder
circuit when we lookup the module by name.