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