Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add vfcvt fu #83

Merged
merged 22 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,11 @@ emu: $(SOFTFLOAT) $(EMU)
clean:
rm -rf build

bsp:
mill -i mill.bsp.BSP/install

idea:
mill -i mill.scalalib.GenIdea/idea

test:
mill YunSuan.test.test
39 changes: 39 additions & 0 deletions src/main/scala/yunsuan/encoding/Opcode/VfCvtOpcode.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package yunsuan.encoding.Opcode

import chisel3._

object VfCvtOpcode {
def width = 8
// 000_000 -> 000_101 single
// 001_000 -> 001_110 widen
// 010_000 -> 010_111 norrow
// 100_000 1/sqrt7(x)
// 100_001 1/x7
// f/i(input) ## f/i(output) ## intr's func1
def vfcvt_xufv = "b10_000000".U(8.W)
def vfcvt_xfv = "b10_000001".U(8.W)
def vfcvt_fxuv = "b01_000010".U(8.W)
def vfcvt_fxv = "b01_000011".U(8.W)
def vfcvt_rtz_xufv = "b10_000110".U(8.W)
def vfcvt_rtz_xfv = "b10_000111".U(8.W)

def vfrsqrt7 = "b11_100000".U(8.W)
def vfrec7 = "b11_100001".U(8.W)

def vfwcvt_xufv = "b10_001000".U(8.W)
def vfwcvt_xfv = "b10_001001".U(8.W)
def vfwcvt_fxuv = "b01_001010".U(8.W)
def vfwcvt_fxv = "b01_001011".U(8.W)
def vfwcvt_ffv = "b11_001100".U(8.W)
def vfwcvt_rtz_xufv = "b10_001110".U(8.W)
def vfwcvt_rtz_xfv = "b10_001111".U(8.W)

def vfnvct_xufw = "b10_010000".U(8.W)
def vfnvct_xfw = "b10_010001".U(8.W)
def vfnvct_fxuw = "b01_010010".U(8.W)
def vfnvct_fxw = "b01_010011".U(8.W)
def vfnvct_ffw = "b11_010100".U(8.W)
def vfnvct_rod_ffw = "b11_010101".U(8.W)
def vfnvct_rtz_xufw = "b10_010110".U(8.W)
def vfnvct_rtz_xfw = "b10_010111".U(8.W)
}
32 changes: 32 additions & 0 deletions src/main/scala/yunsuan/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,38 @@ package object yunsuan {
def vfsqrt = "b1".U(1.W)
}

object VfcvtType {
def width = 8
// f/i(input) ## f/i(output) ## intr's func1
def vfcvt_xufv = "b10_000000".U(8.W)
def vfcvt_xfv = "b10_000001".U(8.W)
def vfcvt_fxuv = "b01_000010".U(8.W)
def vfcvt_fxv = "b01_000011".U(8.W)
def vfcvt_rtz_xufv = "b10_000110".U(8.W)
def vfcvt_rtz_xfv = "b10_000111".U(8.W)

def vfrsqrt7 = "b11_100000".U(8.W)
def vfrec7 = "b11_100001".U(8.W)

def vfwcvt_xufv = "b10_001000".U(8.W)
def vfwcvt_xfv = "b10_001001".U(8.W)
def vfwcvt_fxuv = "b01_001010".U(8.W)
def vfwcvt_fxv = "b01_001011".U(8.W)
def vfwcvt_ffv = "b11_001100".U(8.W)
def vfwcvt_rtz_xufv = "b10_001110".U(8.W)
def vfwcvt_rtz_xfv = "b10_001111".U(8.W)

def vfnvct_xufw = "b10_010000".U(8.W)
def vfnvct_xfw = "b10_010001".U(8.W)
def vfnvct_fxuw = "b01_010010".U(8.W)
def vfnvct_fxw = "b01_010011".U(8.W)
def vfnvct_ffw = "b11_010100".U(8.W)
def vfnvct_rod_ffw = "b11_010101".U(8.W)
def vfnvct_rtz_xufw = "b10_010110".U(8.W)
def vfnvct_rtz_xfw = "b10_010111".U(8.W)
}


object VectorElementFormat {
def width = 2
def b = "b00".U(width.W)
Expand Down
Loading
Loading