提交 e435c306 编写于 作者: Z ZhangZifei

Bru: add BRUOpType to package.scala

上级 b2990a65
......@@ -5,24 +5,38 @@ import chisel3.util._
package object backend {
// jal csr mov
// jal csr move(x2f) mou
object BRUOpType {
// 1. jal
def jal = "b011000".U
def jalr = "b011010".U
// def cjalr= "b111010".U // pc + 2 instead of 4
// 2. csr
def jmp = "b000".U
def wrt = "b001".U
def set = "b010".U
def clr = "b011".U
def wrti = "b101".U
def seti = "b110".U
def clri = "b111".U
// todo: 3. mov
// def pcPlus2(func: UInt) = func(5)//[important]
// [2bit:Type]: 00:csr 01:move(x2f) mou(fence.i,etc) jump
// 0. csr
def jmp = "b00_000".U
def wrt = "b00_001".U
def set = "b00_010".U
def clr = "b00_011".U
def wrti = "b00_101".U
def seti = "b00_110".U
def clri = "b00_111".U
// 1. move(x2f)
// FIXME: temp decode, should be fixed when use it
def fmv_w_x = "b01_000".U
def fmv_d_x = "b01_001".U
// 2. mou
def fence = "b01_000".U
def fencei = "b01_001".U
def sfence_vma = "b01_010".U
// 3. jal
def jal = "b11_000".U
def jalr = "b11_010".U
def call = "b11_011".U
def ret = "b11_100".U
def isCSR(func: UInt) = func(4,3)===0.U
def isFMV(func: UInt) = func(4,3)===1.U
def isMOU(func: UInt) = func(4,3)===2.U // TODO: change its name
def isJUMP(func: UInt) = func(4,3)===3.U
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册