xref: /XiangShan/src/main/scala/xiangshan/backend/decode/isa/predecode/predecode.scala (revision 66314a3840e5ebe6cc81ca4725bde95942f67489)
1package xiangshan.backend.decode.isa.predecode
2
3import chisel3.util._
4import xiangshan.frontend.BrType
5
6object PreDecode {
7  def C_JAL     = BitPat("b?01_?_??_???_??_???_01")  //c.jal & c.j  //C_ADDIW?
8  def C_JALR    = BitPat("b100_?_??_???_00_000_10")
9  def C_BRANCH  = BitPat("b11?_?_??_???_??_???_01")
10  def JAL       = BitPat("b???_?????_1101111")
11  def JALR      = BitPat("b000_?????_1100111")
12  def BRANCH    = BitPat("b???_?????_1100011")
13
14
15  val brTable = Array(
16    C_JAL     -> List(BrType.jal),
17    C_JALR    -> List(BrType.jalr),
18    C_BRANCH  -> List(BrType.branch),
19    JAL       -> List(BrType.jal),
20    JALR      -> List(BrType.jalr),
21    BRANCH    -> List(BrType.branch)
22  )
23}
24