package.scala 492 Bytes
Newer Older
1
package chisel.axiutils
Jens Korinth's avatar
Jens Korinth committed
2
package object axi4lite {
Jens Korinth's avatar
Jens Korinth committed
3
  /** Tuple-type for bit ranges. */
4
5
6
7
8
9
10
11
  sealed case class BitRange(to: Int, from: Int) {
    require (to >= from && from >= 0, "BitRange: invalid range (%d, %d)".format(to, from))
    def overlapsWith(other: BitRange): Boolean = (from <= other.from && to >= other.from) ||
                                                 (from >  other.from && from <= other.to)
  }
  /** Names for bit ranges. **/
  type BitfieldMap = Map[String, BitRange]
}