Open jackkoenig opened 16 hours ago
As written, the circuit is illegal because it is saying that the register should be connected to two different ports. I don't think that duplicating to resolve this is correct.
There's a path that could fix this with the following changes:
InferResets
would need to be broken out into a pass that runs after DedupModules
.FIRRTL version 4.0.0
; CHECK-LABEL: module test(
circuit top :
module child :
input clock : Clock
input in : UInt<8>
output out : UInt<8>
reg r : UInt<8>, clock
connect r, in
connect out, r
module parent_1 :
input clock : Clock
input reset : AsyncReset
input in : UInt<8>
output out : UInt<8>
intrinsic(<circt.fullreset>, reset)
inst c of child
connect c.clock, clock
connect c.in, in
connect out, c.out
module parent_2 :
input clock : Clock
input reset : AsyncReset
input in : UInt<8>
output out : UInt<8>
intrinsic(<circt.fullreset>, reset)
inst c of child
connect c.clock, clock
connect c.in, in
connect out, c.out
public module top :
input clock : Clock
input reset1 : AsyncReset
input reset2 : AsyncReset
input in : UInt<8>
output out : UInt<8>
inst p1 of parent_1
connect p1.clock, clock
connect p1.reset, reset1
connect p1.in, in
inst p2 of parent_2
connect p2.clock, clock
connect p2.reset, reset2
connect p2.in, in
connect out, and(p1.out, p2.out)
This is related to https://github.com/llvm/circt/issues/4886 in that this is sort of a special case. Fixing #4886 would fix this issue so long as infer-resets is followed by dedup (as it currently is)
Consider the following:
We have 2 full reset domains, but they are identical (same port name and type). This currently errors with:
But this doesn't need to error, it could notice that the change required by each domain is the same.