File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
test/scala/chiselTests/aop Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -373,6 +373,7 @@ object Select {
373
373
*/
374
374
def attachedTo (module : BaseModule )(signal : Data ): Set [Data ] = {
375
375
check(module)
376
+ <<<<<<< HEAD
376
377
module._component.get
377
378
.asInstanceOf [DefModule ]
378
379
.commands
@@ -381,6 +382,16 @@ object Select {
381
382
}
382
383
.flatMap { seq => seq.map(_.id.asInstanceOf [Data ]) }
383
384
.toSet
385
+ =======
386
+ collect(
387
+ module._component.get
388
+ .asInstanceOf [DefModule ]
389
+ .block
390
+ .getCommands()
391
+ ) {
392
+ case Attach (_, seq) if seq.contains(Node (signal)) => seq
393
+ }.flatMap { seq => seq.map(_.id.asInstanceOf [Data ]) }.toSet
394
+ >>>>>>> 1aa41cdb7 (Fix Select .attachedTo (# 4458 ))
384
395
}
385
396
386
397
/** Selects all connections to a signal or its parent signal(s) (if the signal is an element of an aggregate signal)
Original file line number Diff line number Diff line change @@ -130,6 +130,20 @@ class SelectSpec extends ChiselFlatSpec {
130
130
)
131
131
}
132
132
133
+ " Test" should " pass if selecting attach" in {
134
+ import chisel3 .experimental .{attach , Analog }
135
+ class AttachTest extends RawModule {
136
+ val a, b, c = IO (Analog (8 .W ))
137
+ attach(a, b, c)
138
+ }
139
+ val dut = ChiselGeneratorAnnotation (() => new AttachTest )
140
+ .elaborate(1 )
141
+ .asInstanceOf [DesignAnnotation [AttachTest ]]
142
+ .design
143
+ Select .attachedTo(dut)(dut.a) should be(Set (dut.a, dut.b, dut.c))
144
+
145
+ }
146
+
133
147
" Test" should " pass if selecting ops by kind" in {
134
148
execute(
135
149
() => new SelectTester (Seq (0 , 1 , 2 )),
You can’t perform that action at this time.
0 commit comments