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 {
|
2012-11-25 13:24:25 +01:00
|
|
|
val SZ_BR = 3
|
2012-10-10 06:35:03 +02:00
|
|
|
val BR_X = Bits("b???", 3)
|
2012-11-05 01:40:14 +01:00
|
|
|
val BR_EQ = Bits(0, 3)
|
|
|
|
val BR_NE = Bits(1, 3)
|
|
|
|
val BR_J = Bits(2, 3)
|
|
|
|
val BR_N = Bits(3, 3)
|
|
|
|
val BR_LT = Bits(4, 3)
|
|
|
|
val BR_GE = Bits(5, 3)
|
|
|
|
val BR_LTU = Bits(6, 3)
|
|
|
|
val BR_GEU = Bits(7, 3)
|
2012-10-10 06:35:03 +02:00
|
|
|
|
|
|
|
val PC_EX4 = UFix(0, 2)
|
|
|
|
val PC_EX = UFix(1, 2)
|
|
|
|
val PC_WB = UFix(2, 2)
|
|
|
|
val PC_PCR = UFix(3, 2)
|
2011-10-26 08:02:47 +02:00
|
|
|
|
2012-05-02 05:16:36 +02:00
|
|
|
val A2_X = Bits("b???", 3)
|
2012-02-08 15:47:26 +01:00
|
|
|
val A2_BTYPE = UFix(0, 3);
|
|
|
|
val A2_LTYPE = UFix(1, 3);
|
|
|
|
val A2_ITYPE = UFix(2, 3);
|
|
|
|
val A2_ZERO = UFix(4, 3);
|
|
|
|
val A2_JTYPE = UFix(5, 3);
|
|
|
|
val A2_RTYPE = UFix(6, 3);
|
2011-10-26 08:02:47 +02:00
|
|
|
|
2012-05-02 05:16:36 +02:00
|
|
|
val X = Bits("b?", 1)
|
2012-08-22 22:38:07 +02:00
|
|
|
val N = Bits(0, 1);
|
|
|
|
val Y = Bits(1, 1);
|
2011-10-26 08:02:47 +02:00
|
|
|
|
2012-05-02 05:16:36 +02:00
|
|
|
val WA_X = X
|
|
|
|
val WA_RD = N
|
|
|
|
val WA_RA = Y
|
2011-10-26 08:02:47 +02:00
|
|
|
|
2012-05-02 05:16:36 +02:00
|
|
|
val WB_X = Bits("b???", 3)
|
2011-10-26 08:02:47 +02:00
|
|
|
val WB_PC = UFix(0, 3);
|
2012-01-02 06:28:38 +01:00
|
|
|
val WB_ALU = UFix(2, 3);
|
|
|
|
val WB_TSC = UFix(4, 3);
|
|
|
|
val WB_IRT = UFix(5, 3);
|
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
|
|
|
|
val DW_32 = N
|
|
|
|
val DW_64 = Y
|
|
|
|
val DW_XPR = Y
|
2011-10-26 08:02:47 +02:00
|
|
|
|
|
|
|
val RA = UFix(1, 5);
|
2012-10-08 05:15:54 +02:00
|
|
|
}
|
2011-10-26 08:02:47 +02:00
|
|
|
|
2012-10-08 05:15:54 +02:00
|
|
|
trait InterruptConstants {
|
2012-03-24 21:03:31 +01:00
|
|
|
val CAUSE_INTERRUPT = 32
|
2012-10-08 05:15:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
trait VectorOpConstants {
|
2012-05-02 05:16:36 +02:00
|
|
|
val VEC_X = Bits("b??", 2).toUFix
|
2012-03-14 05:10:03 +01:00
|
|
|
val VEC_FN_N = UFix(0, 2)
|
|
|
|
val VEC_VL = UFix(1, 2)
|
|
|
|
val VEC_CFG = UFix(2, 2)
|
|
|
|
val VEC_CFGVL = UFix(3, 2)
|
2012-02-09 06:43:45 +01:00
|
|
|
|
|
|
|
val VCMD_I = UFix(0, 3)
|
|
|
|
val VCMD_F = UFix(1, 3)
|
|
|
|
val VCMD_TX = UFix(2, 3)
|
|
|
|
val VCMD_TF = UFix(3, 3)
|
|
|
|
val VCMD_MX = UFix(4, 3)
|
|
|
|
val VCMD_MF = UFix(5, 3)
|
2012-03-04 00:09:42 +01:00
|
|
|
val VCMD_A = UFix(6, 3)
|
2012-02-09 06:43:45 +01:00
|
|
|
val VCMD_X = UFix(0, 3)
|
|
|
|
|
2012-02-09 10:28:16 +01:00
|
|
|
val VIMM_VLEN = UFix(0, 1)
|
|
|
|
val VIMM_ALU = UFix(1, 1)
|
|
|
|
val VIMM_X = UFix(0, 1)
|
2012-02-26 07:05:30 +01:00
|
|
|
|
2012-03-04 00:09:42 +01:00
|
|
|
val VIMM2_RS2 = UFix(0, 1)
|
|
|
|
val VIMM2_ALU = UFix(1, 1)
|
|
|
|
val VIMM2_X = UFix(0, 1)
|
2012-10-08 05:15:54 +02:00
|
|
|
}
|