From dc9ae19936d14d1739dc291232eac10e96b68a3a Mon Sep 17 00:00:00 2001 From: Jim Lawson Date: Tue, 23 Aug 2016 10:54:19 -0700 Subject: [PATCH] Work-around for current Scala compiler "structural type loses implicits". Running rocket-chip through the chisel3 gsdt branch which supports stricter connection checks and uses implicit definitions to deal with "old" direction overrides, exposed a possible bug in the Scala compiler. [error] .../src/main/scala/uncore/devices/Prci.scala:27: value asOutput is not a member of uncore.devices.PRCIInterrupts{val mtip: chisel3.core.Bool; val msip: chisel3.core.Bool} [error] possible cause: maybe a semicolon is missing before `value asOutput'? [error] }.asOutput [error] ^ [error] one error found [error] (uncore/compile:compileIncremental) Compilation failed This change isn't strictly required for current chisel3 code, but is being submitted in anticipation of an eventual merge of the gsdt branch prior to a compiler fix. --- src/main/scala/uncore/devices/Prci.scala | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/scala/uncore/devices/Prci.scala b/src/main/scala/uncore/devices/Prci.scala index f296b84a..24232fd8 100644 --- a/src/main/scala/uncore/devices/Prci.scala +++ b/src/main/scala/uncore/devices/Prci.scala @@ -22,10 +22,13 @@ class PRCIInterrupts extends Bundle { class PRCITileIO(implicit p: Parameters) extends Bundle { val reset = Bool(OUTPUT) val id = UInt(OUTPUT, log2Up(p(NTiles))) - val interrupts = new PRCIInterrupts { - val mtip = Bool() - val msip = Bool() - }.asOutput + val interrupts = { + val result = new PRCIInterrupts { + val mtip = Bool() + val msip = Bool() + } + result.asOutput + } override def cloneType: this.type = new PRCITileIO().asInstanceOf[this.type] }