@@ -136,22 +136,26 @@ firrtl.circuit "DoubleExportOfDomain" {
136136
137137// -----
138138
139- // Domain exported multiple times, this time with one input and one output. Which do we choose?
139+ // Domain exported multiple times, this time with two outputs.
140140
141141firrtl.circuit " DoubleExportOfDomain" {
142- firrtl.domain @ClockDomain
142+ firrtl.domain @ClockDomain
143+
144+ firrtl.extmodule @Generator (out D : !firrtl.domain of @ClockDomain )
143145
144146 firrtl.module @DoubleExportOfDomain (
145- // expected-note @below {{candidate association "DI "}}
146- out %DI : !firrtl.domain of @ClockDomain ,
147- // expected-note @below {{candidate association "DO "}}
148- out %DO : !firrtl.domain of @ClockDomain ,
149- in %i : !firrtl.uint <1 > domains [%DO ],
147+ // expected-note @below {{candidate association "D1 "}}
148+ out %D1 : !firrtl.domain of @ClockDomain ,
149+ // expected-note @below {{candidate association "D2 "}}
150+ out %D2 : !firrtl.domain of @ClockDomain ,
151+ in %i : !firrtl.uint <1 > domains [%D1 ],
150152 // expected-error @below {{ambiguous "ClockDomain" association for port "o"}}
151153 out %o : !firrtl.uint <1 > domains []
152154 ) {
155+ %gen_D = firrtl.instance gen @Generator (out D : !firrtl.domain of @ClockDomain )
153156 // DI and DO are aliases
154- firrtl.domain.define %DO , %DI
157+ firrtl.domain.define %D1 , %gen_D
158+ firrtl.domain.define %D2 , %gen_D
155159
156160 // o is on same domain as i
157161 firrtl.matchingconnect %o , %i : !firrtl.uint <1 >
@@ -161,6 +165,7 @@ firrtl.circuit "DoubleExportOfDomain" {
161165// -----
162166
163167// InstanceChoice: Each module has different domains inferred.
168+ // TODO: this just relies on the op-verifier for instance choice ops.
164169
165170firrtl.circuit " ConflictingInstanceChoiceDomains" {
166171 firrtl.domain @ClockDomain
@@ -176,11 +181,13 @@ firrtl.circuit "ConflictingInstanceChoiceDomains" {
176181 }
177182
178183 // Bar's "out" port takes on the domains of "in2".
184+ // expected-note @below {{original module declared here}}
179185 firrtl.module @Bar (in %in1: !firrtl.uint <1 >, in %in2: !firrtl.uint <1 >, out %out: !firrtl.uint <1 >) {
180186 firrtl.connect %out , %in2 : !firrtl.uint <1 >
181187 }
182188
183189 firrtl.module @ConflictingInstanceChoiceDomains (in %in1: !firrtl.uint <1 >, in %in2: !firrtl.uint <1 >) {
190+ // expected-error @below {{'firrtl.instance_choice' op domain info for "out" must be [2 : ui32], but got [0 : ui32]}}
184191 %inst_in1 , %inst_in2 , %inst_out = firrtl.instance_choice inst @Foo alternatives @Option { @X -> @Foo , @Y -> @Bar } (in in1 : !firrtl.uint <1 >, in in2 : !firrtl.uint <1 >, out out : !firrtl.uint <1 >)
185192 firrtl.connect %inst_in1 , %in1 : !firrtl.uint <1 >, !firrtl.uint <1 >
186193 firrtl.connect %inst_in2 , %in2 : !firrtl.uint <1 >, !firrtl.uint <1 >
0 commit comments