Skip to content

[FIRRTL] InferDomains: Partially annotated wires not updated #10109

@rwy7

Description

@rwy7
FIRRTL version 6.0.0
circuit Foo :
  domain ClockDomain :

  domain PowerDomain :

  public module Foo :
    input A : Domain of ClockDomain
    input p : UInt<1>
    wire w : UInt<1> domains [A]
    connect w, p

gives:

===- Running InferDomains ---------------------------------------------------===
infer: Foo
  processing:
    process port A : ClockDomain
      set A : ClockDomain := A : ClockDomain
    process port p
      set domains(p) := [?1, ?2]
    process %w = firrtl.wire domains[%A] : !firrtl.uint<1> domains[!firrtl.domain<@ClockDomain()>]
      set domains(w) := [A : ClockDomain, ?3]
    process firrtl.matchingconnect %w, %p : !firrtl.uint<1>
      unify domains(w) = domains(p)
      unify [A : ClockDomain, ?3] = [?1, ?2]
      unify A : ClockDomain = ?1
      unify ?3 = ?2
  domain exports:
    A : ClockDomain exported as A : ClockDomain
  applying updates:
    new-input PowerDomain : PowerDomain
      unify ?2 = PowerDomain : PowerDomain
  port summary:
    A : ClockDomain
    PowerDomain : PowerDomain
    p domains [A : ClockDomain, PowerDomain : PowerDomain]
===--------------------------------------------------------------------------===
// -----// IR Dump After InferDomains (firrtl-infer-domains) //----- //
firrtl.circuit "Foo" {
  firrtl.domain @ClockDomain
  firrtl.domain @PowerDomain
  firrtl.module @Foo(in %A: !firrtl.domain<@ClockDomain()>, in %PowerDomain: !firrtl.domain<@PowerDomain()>, in %p: !firrtl.uint<1> domains [%A, %PowerDomain]) attributes {convention = #firrtl<convention scalarized>} {
    %w = firrtl.wire domains[%A] : !firrtl.uint<1> domains[!firrtl.domain<@ClockDomain()>]
    firrtl.matchingconnect %w, %p : !firrtl.uint<1>
  }
}

The wire was not updated, it should be associated with both %A and %PowerDomain.

Metadata

Metadata

Assignees

Labels

FIRRTLInvolving the `firrtl` dialect

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions