From 972ca06729152b0d90116afebe1046f3cda00a24 Mon Sep 17 00:00:00 2001 From: "Wesley W. Terpstra" Date: Thu, 22 Sep 2016 17:51:33 -0700 Subject: [PATCH] RegField: remove RegField.bytes; it was dangerous The implementation unconditionally drove the register. This made it incompatible with drivers from the device itself. Besides, writing only parts of a register at a time is ultra-shady. --- src/main/scala/uncore/tilelink2/RegField.scala | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/main/scala/uncore/tilelink2/RegField.scala b/src/main/scala/uncore/tilelink2/RegField.scala index 2b372208..365649dc 100644 --- a/src/main/scala/uncore/tilelink2/RegField.scala +++ b/src/main/scala/uncore/tilelink2/RegField.scala @@ -106,21 +106,6 @@ object RegField Bool(true) })) - // Split a large register into a sequence of byte fields - // The bytes can be individually written, as they are one byte per field - def bytes(x: UInt): Seq[RegField] = { - require (x.getWidth % 8 == 0) - val bytes = Seq.tabulate(x.getWidth/8) { i => x(8*(i+1)-1, 8*i) } - val wires = bytes.map { b => Wire(init = b) } - x := Cat(wires.reverse) - Seq.tabulate(x.getWidth/8) { i => - RegField(8, bytes(i), RegWriteFn { (valid, data) => - when (valid) { wires(i) := data } - Bool(true) - }) - } - } - // Divide a long sequence of RegFields into a maximum sized registers // Your input RegFields may not cross a beatBytes boundary! def split(fields: Seq[RegField], base: Int, beatBytes: Int = 4): Seq[RegField.Map] = {