chipsalliance / chipsalliance/chisel

Chisel 3.5.1 incorrectly warns on some Bundle traits

Open
#2,403 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Scala
Stars
4.8k
Forks
658
Avg merge
18h 59m
Merged PRs (30d)
14

Description

**Type of issue**: bug report

**Impact**: no functional change

**Development Phase**: request | proposal

**Other information**

**If the current behavior is a bug, please provide the steps to reproduce the problem:**

It seems to happen on Bundle traits that only have virtual methods, eg.
```scala
trait Foo extends Bundle {
val foo: UInt
}

class Bar extends Foo {
val foo = UInt(8.W)
val bar = UInt(8.W)
}

class Example extends Module {
val in = IO(Input(new Bar))
val out = IO(Output(new Bar))
out := in
}
```

This seems to be due to the changes that make it possible to generate `_elementsImpl` since we know process non-concrete Bundles. That being said, this only seems to affect abstract Bundles that only have virtual methods so I don't think it affects the correctness of capturing the elements since those virtual methods will need to be implemented later.

**What is the current behavior?**

Chisel 3.5.1 warns on `trait Foo`: https://scastie.scala-lang.org/0J6M9n2URSCvzfAEnkZPcw

**What is the expected behavior?**

Chisel 3.5.0 does not: https://scastie.scala-lang.org/l1P8OyIMQ9aX3Ge22WGSEA

**Please tell us about your environment:**

Chisel v3.5.1

**What is the use case for changing the behavior?**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.