Sv.wire and hw.wire

Hi! I’m a bit confused about these two WireOps. I’ve checked the descriptions and the test files, but I’m not seeing the reason there are two of these.
My questions would be:

  1. What are the differences between both?
  2. Why do we need to separate them.
    It would be nice if anyone could explain this to me;)

The operation definition provides a little bit of a clue:

In summary, sv.wire has semantics tied to the SV spec, and must be driven with ops like sv.assign.

Whereas hw.wire works well with MLIR’s graph of SSA values, and is make compiler analysis more straightforward. It can be emitted as a wire when possible, and can also enable observing/forcing the SSA edge if required.

The introduction of hw.wire has some more explanation of why it was added in addition to sv.wire: [HW] Add hw.wire operation by fabianschuiki · Pull Request #4822 · llvm/circt · GitHub

Thanks a lot! I’ll look them through;)