From ba6dd160a3bab923f3f1d6ccafafadf08a8d578f Mon Sep 17 00:00:00 2001 From: Henry Cook Date: Thu, 21 Dec 2017 11:42:12 -0800 Subject: [PATCH] diplomacy: allow access to sram Device info --- src/main/scala/diplomacy/SRAM.scala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/scala/diplomacy/SRAM.scala b/src/main/scala/diplomacy/SRAM.scala index 8add66d4..d0b700f8 100644 --- a/src/main/scala/diplomacy/SRAM.scala +++ b/src/main/scala/diplomacy/SRAM.scala @@ -10,9 +10,11 @@ abstract class DiplomaticSRAM( beatBytes: Int, devName: Option[String])(implicit p: Parameters) extends LazyModule { - protected val resources = devName - .map(new SimpleDevice(_, Seq("sifive,sram0")).reg("mem")) - .getOrElse(new MemoryDevice().reg) + val device = devName + .map(new SimpleDevice(_, Seq("sifive,sram0"))) + .getOrElse(new MemoryDevice()) + + val resources = device.reg("mem") def bigBits(x: BigInt, tail: List[Boolean] = Nil): List[Boolean] = if (x == 0) tail.reverse else bigBits(x >> 1, ((x & 1) == 1) :: tail)