2016-11-28 01:16:37 +01:00
|
|
|
// See LICENSE.Berkeley for license details.
|
2014-09-13 03:06:41 +02:00
|
|
|
|
2012-02-26 02:09:26 +01:00
|
|
|
package rocket
|
2012-10-08 05:15:54 +02:00
|
|
|
package constants
|
2011-10-26 08:02:47 +02:00
|
|
|
|
|
|
|
import Chisel._
|
2011-12-09 09:42:43 +01:00
|
|
|
import scala.math._
|
2011-10-26 08:02:47 +02:00
|
|
|
|
2012-10-08 05:15:54 +02:00
|
|
|
trait ScalarOpConstants {
|
2016-08-09 23:39:06 +02:00
|
|
|
val MT_SZ = 3
|
|
|
|
val MT_X = BitPat("b???")
|
|
|
|
val MT_B = UInt("b000")
|
|
|
|
val MT_H = UInt("b001")
|
|
|
|
val MT_W = UInt("b010")
|
|
|
|
val MT_D = UInt("b011")
|
|
|
|
val MT_BU = UInt("b100")
|
|
|
|
val MT_HU = UInt("b101")
|
|
|
|
val MT_WU = UInt("b110")
|
|
|
|
def mtSize(mt: UInt) = mt(MT_SZ-2, 0)
|
|
|
|
def mtSigned(mt: UInt) = !mt(MT_SZ-1)
|
|
|
|
|
2012-11-25 13:24:25 +01:00
|
|
|
val SZ_BR = 3
|
2015-07-28 11:48:49 +02:00
|
|
|
val BR_X = BitPat("b???")
|
|
|
|
val BR_EQ = UInt(0, 3)
|
|
|
|
val BR_NE = UInt(1, 3)
|
|
|
|
val BR_J = UInt(2, 3)
|
|
|
|
val BR_N = UInt(3, 3)
|
|
|
|
val BR_LT = UInt(4, 3)
|
|
|
|
val BR_GE = UInt(5, 3)
|
|
|
|
val BR_LTU = UInt(6, 3)
|
|
|
|
val BR_GEU = UInt(7, 3)
|
|
|
|
|
|
|
|
val A1_X = BitPat("b??")
|
2013-12-10 00:06:13 +01:00
|
|
|
val A1_ZERO = UInt(0, 2)
|
|
|
|
val A1_RS1 = UInt(1, 2)
|
2014-02-11 04:04:42 +01:00
|
|
|
val A1_PC = UInt(2, 2)
|
2013-09-12 12:44:38 +02:00
|
|
|
|
2015-07-28 11:48:49 +02:00
|
|
|
val IMM_X = BitPat("b???")
|
2014-01-14 06:43:56 +01:00
|
|
|
val IMM_S = UInt(0, 3)
|
|
|
|
val IMM_SB = UInt(1, 3)
|
|
|
|
val IMM_U = UInt(2, 3)
|
|
|
|
val IMM_UJ = UInt(3, 3)
|
|
|
|
val IMM_I = UInt(4, 3)
|
|
|
|
val IMM_Z = UInt(5, 3)
|
2013-09-12 12:44:38 +02:00
|
|
|
|
2015-07-28 11:48:49 +02:00
|
|
|
val A2_X = BitPat("b??")
|
2013-12-10 00:06:13 +01:00
|
|
|
val A2_ZERO = UInt(0, 2)
|
2016-07-30 01:36:07 +02:00
|
|
|
val A2_SIZE = UInt(1, 2)
|
2013-12-10 00:06:13 +01:00
|
|
|
val A2_RS2 = UInt(2, 2)
|
|
|
|
val A2_IMM = UInt(3, 2)
|
2011-10-26 08:02:47 +02:00
|
|
|
|
2015-07-28 11:48:49 +02:00
|
|
|
val X = BitPat("b?")
|
|
|
|
val N = BitPat("b0")
|
|
|
|
val Y = BitPat("b1")
|
2011-10-26 08:02:47 +02:00
|
|
|
|
2012-11-18 02:24:08 +01:00
|
|
|
val SZ_DW = 1
|
2012-05-02 05:16:36 +02:00
|
|
|
val DW_X = X
|
2016-08-16 02:34:56 +02:00
|
|
|
val DW_32 = Bool(false)
|
|
|
|
val DW_64 = Bool(true)
|
|
|
|
val DW_XPR = DW_64
|
2012-10-08 05:15:54 +02:00
|
|
|
}
|