summaryrefslogtreecommitdiff
path: root/chiselFrontend/src/main/scala/chisel3/Aggregate.scala
diff options
context:
space:
mode:
authorJack Koenig2019-11-05 13:41:47 -0800
committerGitHub2019-11-05 13:41:47 -0800
commit92d88ffbe1663b4aa917c6c8b66a4fd697282410 (patch)
tree246e46176067204475afc2cb781816fe7969283a /chiselFrontend/src/main/scala/chisel3/Aggregate.scala
parent19e651faccf2c922888fb0eae69981399120774f (diff)
Support literals cast to aggregates as async reset reg init values (#1225)
Accomplished by changing the code gen for casting literals to aggregates. Rather than connecting the literal to a wire that is then bit selected from, just bit select from the literal which saves the creation of an intermediate wire and matches FIRRTL's semantics for legal async reset initial values.
Diffstat (limited to 'chiselFrontend/src/main/scala/chisel3/Aggregate.scala')
-rw-r--r--chiselFrontend/src/main/scala/chisel3/Aggregate.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/Aggregate.scala b/chiselFrontend/src/main/scala/chisel3/Aggregate.scala
index ba9afd5b..eaa56c36 100644
--- a/chiselFrontend/src/main/scala/chisel3/Aggregate.scala
+++ b/chiselFrontend/src/main/scala/chisel3/Aggregate.scala
@@ -65,7 +65,7 @@ sealed abstract class Aggregate extends Data {
private[chisel3] override def connectFromBits(that: Bits)(implicit sourceInfo: SourceInfo,
compileOptions: CompileOptions): Unit = {
var i = 0
- val bits = WireDefault(UInt(this.width), that) // handles width padding
+ val bits = if (that.isLit) that else WireDefault(UInt(this.width), that) // handles width padding
for (x <- flatten) {
val fieldWidth = x.getWidth
if (fieldWidth > 0) {