1
0
Fork 0

diplomacy: allow access to sram Device info

This commit is contained in:
Henry Cook 2017-12-21 11:42:12 -08:00
parent d9c5ec4f7b
commit ba6dd160a3
1 changed files with 5 additions and 3 deletions

View File

@ -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)