From c411a3e77f17b0eebcf572acc60345b1af57b5f3 Mon Sep 17 00:00:00 2001 From: "Wesley W. Terpstra" Date: Thu, 1 Sep 2016 11:12:59 -0700 Subject: [PATCH] tilelink2: simpler sizes requirement for users to understand --- uncore/src/main/scala/tilelink2/Parameters.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/uncore/src/main/scala/tilelink2/Parameters.scala b/uncore/src/main/scala/tilelink2/Parameters.scala index 7482a32c..26e799ec 100644 --- a/uncore/src/main/scala/tilelink2/Parameters.scala +++ b/uncore/src/main/scala/tilelink2/Parameters.scala @@ -47,7 +47,7 @@ case class TransferSizes(min: Int, max: Int) def this(x: Int) = this(x, x) require (min <= max) - require (min != 0 || max == 0) + require (min >= 0 && max >= 0) require (max == 0 || isPow2(max)) require (min == 0 || isPow2(min)) require (max <= TransferSizes.maxAllowed) @@ -175,6 +175,8 @@ case class TLManagerPortParameters(managers: Seq[TLManagerParameters], beatBytes // Synthesizable lookup methods def find(address: UInt) = Vec(managers.map(_.address.map(_.contains(address)).reduce(_ || _))) def findById(id: UInt) = Vec(managers.map(_.sinkId.contains(id))) + + // !!! need a cheaper version of find, where we assume a valid address match exists // Does this Port manage this ID/address? def contains(address: UInt) = find(address).reduce(_ || _)