package.scala 488 Bytes
Newer Older
Jens Korinth's avatar
Jens Korinth committed
1
2
package chisel.axi

Jens Korinth's avatar
Jens Korinth committed
3
package object axi4lite {
Jens Korinth's avatar
Jens Korinth committed
4
  /** Tuple-type for bit ranges. */
5
6
7
8
9
10
11
12
  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]
}