Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenXiangShan
XiangShan
提交
17ec87f2
X
XiangShan
项目概览
OpenXiangShan
/
XiangShan
10 个月 前同步成功
通知
1183
Star
3914
Fork
526
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
XiangShan
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
17ec87f2
编写于
5月 22, 2023
作者:
X
Xuan Hu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
decode: rename uopDivType to uopSplitType
上级
b6b11f60
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
71 addition
and
71 deletion
+71
-71
src/main/scala/xiangshan/backend/Bundles.scala
src/main/scala/xiangshan/backend/Bundles.scala
+2
-2
src/main/scala/xiangshan/backend/decode/DecodeUnit.scala
src/main/scala/xiangshan/backend/decode/DecodeUnit.scala
+3
-3
src/main/scala/xiangshan/backend/decode/DecodeUnitComp.scala
src/main/scala/xiangshan/backend/decode/DecodeUnitComp.scala
+57
-57
src/main/scala/xiangshan/backend/decode/VecDecoder.scala
src/main/scala/xiangshan/backend/decode/VecDecoder.scala
+9
-9
未找到文件。
src/main/scala/xiangshan/backend/Bundles.scala
浏览文件 @
17ec87f2
...
...
@@ -81,14 +81,14 @@ object Bundles {
val
isMove
=
Bool
()
val
uopIdx
=
UInt
(
5.
W
)
val
vtype
=
new
VType
val
uop
DivType
=
UopDiv
Type
()
val
uop
SplitType
=
UopSplit
Type
()
val
isVset
=
Bool
()
val
firstUop
=
Bool
()
val
lastUop
=
Bool
()
val
commitType
=
CommitType
()
// Todo: remove it
private
def
allSignals
=
srcType
.
take
(
3
)
++
Seq
(
fuType
,
fuOpType
,
rfWen
,
fpWen
,
vecWen
,
isXSTrap
,
waitForward
,
blockBackward
,
flushPipe
,
uop
Div
Type
,
selImm
)
isXSTrap
,
waitForward
,
blockBackward
,
flushPipe
,
uop
Split
Type
,
selImm
)
def
decode
(
inst
:
UInt
,
table
:
Iterable
[(
BitPat
,
List
[
BitPat
])])
:
DecodedInst
=
{
val
decoder
:
Seq
[
UInt
]
=
ListLookup
(
...
...
src/main/scala/xiangshan/backend/decode/DecodeUnit.scala
浏览文件 @
17ec87f2
...
...
@@ -51,7 +51,7 @@ abstract trait DecodeConstants {
// | | | | | | | | | | | flushPipe
// | | | | | | | | | | | | uopDivType
// | | | | | | | | | | | | | selImm
List
(
SrcType
.
X
,
SrcType
.
X
,
SrcType
.
X
,
FuType
.
X
,
FuOpType
.
X
,
N
,
N
,
N
,
N
,
N
,
N
,
N
,
Uop
Div
Type
.
X
,
SelImm
.
INVALID_INSTR
)
// Use SelImm to indicate invalid instr
List
(
SrcType
.
X
,
SrcType
.
X
,
SrcType
.
X
,
FuType
.
X
,
FuOpType
.
X
,
N
,
N
,
N
,
N
,
N
,
N
,
N
,
Uop
Split
Type
.
X
,
SelImm
.
INVALID_INSTR
)
// Use SelImm to indicate invalid instr
val
decodeArray
:
Array
[(
BitPat
,
XSDecodeBase
)]
final
def
table
:
Array
[(
BitPat
,
List
[
BitPat
])]
=
decodeArray
.
map
(
x
=>
(
x
.
_1
,
x
.
_2
.
generate
()))
...
...
@@ -105,7 +105,7 @@ case class XSDecode(
case
class
FDecode
(
src1
:
BitPat
,
src2
:
BitPat
,
src3
:
BitPat
,
fu
:
Int
,
fuOp
:
BitPat
,
selImm
:
BitPat
=
SelImm
.
X
,
uopSplitType
:
BitPat
=
u
opSplitType
.
X
,
uopSplitType
:
BitPat
=
U
opSplitType
.
X
,
xWen
:
Boolean
=
false
,
fWen
:
Boolean
=
false
,
vWen
:
Boolean
=
false
,
...
...
@@ -746,7 +746,7 @@ class DecodeUnit(implicit p: Parameters) extends XSModule with DecodeUnitConstan
when
(
FuType
.
isVpu
(
decodedInst
.
fuType
))
{
decodedInst
.
vtype
:=
io
.
enq
.
vtype
}
io
.
deq
.
isComplex
:=
Uop
DivType
.
needSplit
(
decodedInst
.
uopDiv
Type
)
io
.
deq
.
isComplex
:=
Uop
SplitType
.
needSplit
(
decodedInst
.
uopSplit
Type
)
decodedInst
.
commitType
:=
0.
U
// Todo: remove it
io
.
deq
.
decodedInst
:=
decodedInst
...
...
src/main/scala/xiangshan/backend/decode/DecodeUnitComp.scala
浏览文件 @
17ec87f2
...
...
@@ -56,6 +56,7 @@ class DecodeUnitCompIO(implicit p: Parameters) extends XSBundle {
}
val
csrCtrl
=
Input
(
new
CustomCSRCtrlIO
)
}
/**
* @author zly
*/
...
...
@@ -100,7 +101,7 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
}
}
//Type of uop Div
val
typeOfDiv
=
decodedInsts_u
.
uop
Div
Type
val
typeOfDiv
=
decodedInsts_u
.
uop
Split
Type
//LMUL
val
lmul
=
MuxLookup
(
simple
.
io
.
enq
.
vtype
.
vlmul
,
1.
U
(
4.
W
),
Array
(
...
...
@@ -115,35 +116,35 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
))
//number of uop
val
numOfUop
=
MuxLookup
(
typeOfDiv
,
1.
U
(
log2Up
(
maxUopSize
+
1
).
W
),
Array
(
Uop
Div
Type
.
VEC_0XV
->
2.
U
,
Uop
Div
Type
.
DIR
->
Mux
(
dest
=/=
0.
U
,
2.
U
,
Uop
Split
Type
.
VEC_0XV
->
2.
U
,
Uop
Split
Type
.
DIR
->
Mux
(
dest
=/=
0.
U
,
2.
U
,
Mux
(
src1
=/=
0.
U
,
1.
U
,
Mux
(
VSETOpType
.
isVsetvl
(
decodedInsts_u
.
fuOpType
),
2.
U
,
1.
U
))),
Uop
Div
Type
.
VEC_VVV
->
lmul
,
Uop
Div
Type
.
VEC_EXT2
->
lmul
,
Uop
Div
Type
.
VEC_EXT4
->
lmul
,
Uop
Div
Type
.
VEC_EXT8
->
lmul
,
Uop
Div
Type
.
VEC_VVM
->
lmul
,
Uop
Div
Type
.
VEC_VXM
->
(
lmul
+&
1.
U
),
Uop
Div
Type
.
VEC_VXV
->
(
lmul
+&
1.
U
),
Uop
Div
Type
.
VEC_VVW
->
Cat
(
lmul
,
0.
U
(
1.
W
)),
// lmul <= 4
Uop
Div
Type
.
VEC_WVW
->
Cat
(
lmul
,
0.
U
(
1.
W
)),
// lmul <= 4
Uop
Div
Type
.
VEC_VXW
->
Cat
(
lmul
,
1.
U
(
1.
W
)),
// lmul <= 4
Uop
Div
Type
.
VEC_WXW
->
Cat
(
lmul
,
1.
U
(
1.
W
)),
// lmul <= 4
Uop
Div
Type
.
VEC_WVV
->
Cat
(
lmul
,
0.
U
(
1.
W
)),
// lmul <= 4
Uop
Div
Type
.
VEC_WXV
->
Cat
(
lmul
,
1.
U
(
1.
W
)),
// lmul <= 4
Uop
Div
Type
.
VEC_SLIDE1UP
->
(
lmul
+&
1.
U
),
Uop
Div
Type
.
VEC_FSLIDE1UP
->
lmul
,
Uop
Div
Type
.
VEC_SLIDE1DOWN
->
Cat
(
lmul
,
0.
U
(
1.
W
)),
Uop
Div
Type
.
VEC_FSLIDE1DOWN
->
(
Cat
(
lmul
,
0.
U
(
1.
W
))
-
1.
U
),
Uop
Div
Type
.
VEC_VRED
->
lmul
,
Uop
Div
Type
.
VEC_SLIDEUP
->
(
numOfUopVslide
+
1.
U
),
Uop
Div
Type
.
VEC_ISLIDEUP
->
numOfUopVslide
,
Uop
Div
Type
.
VEC_SLIDEDOWN
->
(
numOfUopVslide
+
1.
U
),
Uop
Div
Type
.
VEC_ISLIDEDOWN
->
numOfUopVslide
,
Uop
Div
Type
.
VEC_M0X
->
(
lmul
+&
1.
U
),
Uop
Div
Type
.
VEC_MVV
->
(
Cat
(
lmul
,
0.
U
(
1.
W
))
-
1.
U
),
Uop
Div
Type
.
VEC_M0X_VFIRST
->
2.
U
,
Uop
Split
Type
.
VEC_VVV
->
lmul
,
Uop
Split
Type
.
VEC_EXT2
->
lmul
,
Uop
Split
Type
.
VEC_EXT4
->
lmul
,
Uop
Split
Type
.
VEC_EXT8
->
lmul
,
Uop
Split
Type
.
VEC_VVM
->
lmul
,
Uop
Split
Type
.
VEC_VXM
->
(
lmul
+&
1.
U
),
Uop
Split
Type
.
VEC_VXV
->
(
lmul
+&
1.
U
),
Uop
Split
Type
.
VEC_VVW
->
Cat
(
lmul
,
0.
U
(
1.
W
)),
// lmul <= 4
Uop
Split
Type
.
VEC_WVW
->
Cat
(
lmul
,
0.
U
(
1.
W
)),
// lmul <= 4
Uop
Split
Type
.
VEC_VXW
->
Cat
(
lmul
,
1.
U
(
1.
W
)),
// lmul <= 4
Uop
Split
Type
.
VEC_WXW
->
Cat
(
lmul
,
1.
U
(
1.
W
)),
// lmul <= 4
Uop
Split
Type
.
VEC_WVV
->
Cat
(
lmul
,
0.
U
(
1.
W
)),
// lmul <= 4
Uop
Split
Type
.
VEC_WXV
->
Cat
(
lmul
,
1.
U
(
1.
W
)),
// lmul <= 4
Uop
Split
Type
.
VEC_SLIDE1UP
->
(
lmul
+&
1.
U
),
Uop
Split
Type
.
VEC_FSLIDE1UP
->
lmul
,
Uop
Split
Type
.
VEC_SLIDE1DOWN
->
Cat
(
lmul
,
0.
U
(
1.
W
)),
Uop
Split
Type
.
VEC_FSLIDE1DOWN
->
(
Cat
(
lmul
,
0.
U
(
1.
W
))
-
1.
U
),
Uop
Split
Type
.
VEC_VRED
->
lmul
,
Uop
Split
Type
.
VEC_SLIDEUP
->
(
numOfUopVslide
+
1.
U
),
Uop
Split
Type
.
VEC_ISLIDEUP
->
numOfUopVslide
,
Uop
Split
Type
.
VEC_SLIDEDOWN
->
(
numOfUopVslide
+
1.
U
),
Uop
Split
Type
.
VEC_ISLIDEDOWN
->
numOfUopVslide
,
Uop
Split
Type
.
VEC_M0X
->
(
lmul
+&
1.
U
),
Uop
Split
Type
.
VEC_MVV
->
(
Cat
(
lmul
,
0.
U
(
1.
W
))
-
1.
U
),
Uop
Split
Type
.
VEC_M0X_VFIRST
->
2.
U
,
))
//uop div up to maxUopSize
...
...
@@ -158,7 +159,7 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
csBundle
(
numOfUop
-
1.
U
).
lastUop
:=
true
.
B
switch
(
typeOfDiv
)
{
is
(
Uop
Div
Type
.
DIR
)
{
is
(
Uop
Split
Type
.
DIR
)
{
when
(
isVset_u
)
{
when
(
dest
=/=
0.
U
)
{
csBundle
(
0
).
fuType
:=
FuType
.
vsetiwi
.
U
...
...
@@ -201,7 +202,7 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
}
}
}
is
(
Uop
Div
Type
.
VEC_VVV
)
{
is
(
Uop
Split
Type
.
VEC_VVV
)
{
for
(
i
<-
0
until
MAX_VLMUL
)
{
csBundle
(
i
).
lsrc
(
0
)
:=
src1
+
i
.
U
csBundle
(
i
).
lsrc
(
1
)
:=
src2
+
i
.
U
...
...
@@ -210,7 +211,7 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
csBundle
(
i
).
uopIdx
:=
i
.
U
}
}
is
(
Uop
Div
Type
.
VEC_EXT2
)
{
is
(
Uop
Split
Type
.
VEC_EXT2
)
{
for
(
i
<-
0
until
MAX_VLMUL
/
2
)
{
csBundle
(
2
*
i
).
lsrc
(
1
)
:=
src2
+
i
.
U
csBundle
(
2
*
i
).
lsrc
(
2
)
:=
dest
+
(
2
*
i
).
U
...
...
@@ -222,7 +223,7 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
csBundle
(
2
*
i
+
1
).
uopIdx
:=
(
2
*
i
+
1
).
U
}
}
is
(
Uop
Div
Type
.
VEC_EXT4
)
{
is
(
Uop
Split
Type
.
VEC_EXT4
)
{
for
(
i
<-
0
until
MAX_VLMUL
/
4
)
{
csBundle
(
4
*
i
).
lsrc
(
1
)
:=
src2
+
i
.
U
csBundle
(
4
*
i
).
lsrc
(
2
)
:=
dest
+
(
4
*
i
).
U
...
...
@@ -242,7 +243,7 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
csBundle
(
4
*
i
+
3
).
uopIdx
:=
(
4
*
i
+
3
).
U
}
}
is
(
Uop
Div
Type
.
VEC_EXT8
)
{
is
(
Uop
Split
Type
.
VEC_EXT8
)
{
for
(
i
<-
0
until
MAX_VLMUL
)
{
csBundle
(
i
).
lsrc
(
1
)
:=
src2
csBundle
(
i
).
lsrc
(
2
)
:=
dest
+
i
.
U
...
...
@@ -250,7 +251,7 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
csBundle
(
i
).
uopIdx
:=
i
.
U
}
}
is
(
Uop
Div
Type
.
VEC_0XV
)
{
is
(
Uop
Split
Type
.
VEC_0XV
)
{
/*
FMV.D.X
*/
...
...
@@ -282,12 +283,12 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
csBundle
(
1
).
lsrc
(
2
)
:=
dest
csBundle
(
1
).
ldest
:=
dest
csBundle
(
1
).
fuType
:=
FuType
.
vppu
.
U
csBundle
(
1
).
fuOpType
:=
VpermType
.
vfmv_s_f
csBundle
(
1
).
fuOpType
:=
VpermType
.
dummy
csBundle
(
1
).
rfWen
:=
false
.
B
csBundle
(
1
).
fpWen
:=
false
.
B
csBundle
(
1
).
vecWen
:=
true
.
B
}
is
(
Uop
Div
Type
.
VEC_VXV
)
{
is
(
Uop
Split
Type
.
VEC_VXV
)
{
/*
FMV.D.X
*/
...
...
@@ -320,7 +321,7 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
csBundle
(
i
+
1
).
uopIdx
:=
i
.
U
}
}
is
(
Uop
Div
Type
.
VEC_VVW
)
{
is
(
Uop
Split
Type
.
VEC_VVW
)
{
for
(
i
<-
0
until
MAX_VLMUL
/
2
)
{
csBundle
(
2
*
i
).
lsrc
(
0
)
:=
src1
+
i
.
U
csBundle
(
2
*
i
).
lsrc
(
1
)
:=
src2
+
i
.
U
...
...
@@ -334,7 +335,7 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
csBundle
(
2
*
i
+
1
).
uopIdx
:=
(
2
*
i
+
1
).
U
}
}
is
(
Uop
Div
Type
.
VEC_WVW
)
{
is
(
Uop
Split
Type
.
VEC_WVW
)
{
for
(
i
<-
0
until
MAX_VLMUL
/
2
)
{
csBundle
(
2
*
i
).
lsrc
(
0
)
:=
src1
+
i
.
U
csBundle
(
2
*
i
).
lsrc
(
1
)
:=
src2
+
(
2
*
i
).
U
...
...
@@ -348,7 +349,7 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
csBundle
(
2
*
i
+
1
).
uopIdx
:=
(
2
*
i
+
1
).
U
}
}
is
(
Uop
Div
Type
.
VEC_VXW
)
{
is
(
Uop
Split
Type
.
VEC_VXW
)
{
/*
FMV.D.X
*/
...
...
@@ -385,7 +386,7 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
csBundle
(
2
*
i
+
2
).
uopIdx
:=
(
2
*
i
+
1
).
U
}
}
is
(
Uop
Div
Type
.
VEC_WXW
)
{
is
(
Uop
Split
Type
.
VEC_WXW
)
{
/*
FMV.D.X
*/
...
...
@@ -422,7 +423,7 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
csBundle
(
2
*
i
+
2
).
uopIdx
:=
(
2
*
i
+
1
).
U
}
}
is
(
Uop
Div
Type
.
VEC_WVV
)
{
is
(
Uop
Split
Type
.
VEC_WVV
)
{
for
(
i
<-
0
until
MAX_VLMUL
/
2
)
{
csBundle
(
2
*
i
).
lsrc
(
0
)
:=
src1
+
i
.
U
...
...
@@ -437,7 +438,7 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
csBundle
(
2
*
i
+
1
).
uopIdx
:=
(
2
*
i
+
1
).
U
}
}
is
(
Uop
Div
Type
.
VEC_WXV
)
{
is
(
Uop
Split
Type
.
VEC_WXV
)
{
/*
FMV.D.X
*/
...
...
@@ -474,7 +475,7 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
csBundle
(
2
*
i
+
2
).
uopIdx
:=
(
2
*
i
+
1
).
U
}
}
is
(
Uop
Div
Type
.
VEC_VVM
)
{
is
(
Uop
Split
Type
.
VEC_VVM
)
{
csBundle
(
0
).
lsrc
(
2
)
:=
dest
csBundle
(
0
).
ldest
:=
VECTOR_TMP_REG_LMUL
.
U
csBundle
(
0
).
uopIdx
:=
0.
U
...
...
@@ -487,7 +488,7 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
}
csBundle
(
numOfUop
-
1.
U
).
ldest
:=
dest
}
is
(
Uop
Div
Type
.
VEC_VXM
)
{
is
(
Uop
Split
Type
.
VEC_VXM
)
{
/*
FMV.D.X
*/
...
...
@@ -524,7 +525,7 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
}
csBundle
(
numOfUop
-
1.
U
).
ldest
:=
dest
}
is
(
Uop
Div
Type
.
VEC_SLIDE1UP
)
{
is
(
Uop
Split
Type
.
VEC_SLIDE1UP
)
{
/*
FMV.D.X
*/
...
...
@@ -560,7 +561,7 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
csBundle
(
i
+
1
).
uopIdx
:=
i
.
U
}
}
is
(
Uop
Div
Type
.
VEC_FSLIDE1UP
)
{
is
(
Uop
Split
Type
.
VEC_FSLIDE1UP
)
{
//LMUL
csBundle
(
0
).
srcType
(
0
)
:=
SrcType
.
fp
csBundle
(
0
).
lsrc
(
0
)
:=
src1
...
...
@@ -577,7 +578,7 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
csBundle
(
i
).
uopIdx
:=
i
.
U
}
}
is
(
Uop
Div
Type
.
VEC_SLIDE1DOWN
)
{
// lmul+lmul = 16
is
(
Uop
Split
Type
.
VEC_SLIDE1DOWN
)
{
// lmul+lmul = 16
/*
FMV.D.X
*/
...
...
@@ -620,7 +621,7 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
csBundle
(
numOfUop
-
1.
U
).
lsrc
(
0
)
:=
FP_TMP_REG_MV
.
U
csBundle
(
numOfUop
-
1.
U
).
ldest
:=
dest
+
lmul
-
1.
U
}
is
(
Uop
Div
Type
.
VEC_FSLIDE1DOWN
)
{
is
(
Uop
Split
Type
.
VEC_FSLIDE1DOWN
)
{
//LMUL
for
(
i
<-
0
until
MAX_VLMUL
)
{
csBundle
(
2
*
i
).
srcType
(
0
)
:=
SrcType
.
vp
...
...
@@ -640,7 +641,7 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
csBundle
(
numOfUop
-
1.
U
).
lsrc
(
0
)
:=
src1
csBundle
(
numOfUop
-
1.
U
).
ldest
:=
dest
+
lmul
-
1.
U
}
is
(
Uop
Div
Type
.
VEC_VRED
)
{
is
(
Uop
Split
Type
.
VEC_VRED
)
{
when
(
simple
.
io
.
enq
.
vtype
.
vlmul
===
"b001"
.
U
){
csBundle
(
0
).
srcType
(
2
)
:=
SrcType
.
DC
csBundle
(
0
).
lsrc
(
0
)
:=
src2
+
1.
U
...
...
@@ -696,7 +697,7 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
}
}
is
(
Uop
Div
Type
.
VEC_SLIDEUP
)
{
is
(
Uop
Split
Type
.
VEC_SLIDEUP
)
{
// FMV.D.X
csBundle
(
0
).
srcType
(
0
)
:=
SrcType
.
reg
csBundle
(
0
).
srcType
(
1
)
:=
SrcType
.
imm
...
...
@@ -729,7 +730,7 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
}
}
is
(
Uop
Div
Type
.
VEC_ISLIDEUP
)
{
is
(
Uop
Split
Type
.
VEC_ISLIDEUP
)
{
// LMUL
for
(
i
<-
0
until
MAX_VLMUL
)
for
(
j
<-
0
to
i
){
...
...
@@ -742,7 +743,7 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
}
}
is
(
Uop
Div
Type
.
VEC_SLIDEDOWN
)
{
is
(
Uop
Split
Type
.
VEC_SLIDEDOWN
)
{
// FMV.D.X
csBundle
(
0
).
srcType
(
0
)
:=
SrcType
.
reg
csBundle
(
0
).
srcType
(
1
)
:=
SrcType
.
imm
...
...
@@ -777,7 +778,7 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
}
}
is
(
Uop
Div
Type
.
VEC_ISLIDEDOWN
)
{
is
(
Uop
Split
Type
.
VEC_ISLIDEDOWN
)
{
// LMUL
for
(
i
<-
0
until
MAX_VLMUL
)
for
(
j
<-
(
0
to
i
).
reverse
){
...
...
@@ -792,7 +793,7 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
}
}
is
(
Uop
Div
Type
.
VEC_M0X
)
{
is
(
Uop
Split
Type
.
VEC_M0X
)
{
// LMUL
for
(
i
<-
0
until
MAX_VLMUL
)
{
val
srcType0
=
if
(
i
==
0
)
SrcType
.
DC
else
SrcType
.
vp
...
...
@@ -831,7 +832,7 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
csBundle
(
lmul
).
fpu
.
fcvt
:=
false
.
B
}
is
(
Uop
Div
Type
.
VEC_MVV
)
{
is
(
Uop
Split
Type
.
VEC_MVV
)
{
// LMUL
for
(
i
<-
0
until
MAX_VLMUL
)
{
val
srcType0
=
if
(
i
==
0
)
SrcType
.
DC
else
SrcType
.
vp
...
...
@@ -853,7 +854,7 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
}
}
is
(
Uop
Div
Type
.
VEC_M0X_VFIRST
)
{
is
(
Uop
Split
Type
.
VEC_M0X_VFIRST
)
{
// LMUL
csBundle
(
0
).
rfWen
:=
false
.
B
csBundle
(
0
).
fpWen
:=
true
.
B
...
...
@@ -945,4 +946,3 @@ class DecodeUnitComp()(implicit p : Parameters) extends XSModule with DecodeUnit
io
.
deq
.
readyToIBuf
:=
readyToIBuf
}
src/main/scala/xiangshan/backend/decode/VecDecoder.scala
浏览文件 @
17ec87f2
...
...
@@ -24,35 +24,35 @@ abstract class VecDecode extends XSDecodeBase {
}
}
case
class
OPIVV
(
fu
:
BitPa
t
,
fuOp
:
BitPat
,
vWen
:
Boolean
,
mWen
:
Boolean
,
vxsatWen
:
Boolean
,
uopSplitType
:
BitPat
=
UopSplitType
.
VEC_VVV
,
src3
:
BitPat
=
SrcType
.
vp
)
extends
XSDecodeBase
{
case
class
OPIVV
(
fu
:
In
t
,
fuOp
:
BitPat
,
vWen
:
Boolean
,
mWen
:
Boolean
,
vxsatWen
:
Boolean
,
uopSplitType
:
BitPat
=
UopSplitType
.
VEC_VVV
,
src3
:
BitPat
=
SrcType
.
vp
)
extends
XSDecodeBase
{
def
generate
()
:
List
[
BitPat
]
=
{
XSDecode
(
SrcType
.
vp
,
SrcType
.
vp
,
src3
,
fu
,
fuOp
,
SelImm
.
X
,
uopSplitType
,
xWen
=
F
,
fWen
=
F
,
vWen
=
vWen
,
mWen
=
mWen
,
xsTrap
=
F
,
noSpec
=
F
,
blockBack
=
F
,
flushPipe
=
F
).
generate
()
}
}
case
class
OPIVX
(
fu
:
BitPa
t
,
fuOp
:
BitPat
,
vWen
:
Boolean
,
mWen
:
Boolean
,
vxsatWen
:
Boolean
,
uopSplitType
:
BitPat
=
UopSplitType
.
VEC_VXV
,
src3
:
BitPat
=
SrcType
.
vp
)
extends
XSDecodeBase
{
case
class
OPIVX
(
fu
:
In
t
,
fuOp
:
BitPat
,
vWen
:
Boolean
,
mWen
:
Boolean
,
vxsatWen
:
Boolean
,
uopSplitType
:
BitPat
=
UopSplitType
.
VEC_VXV
,
src3
:
BitPat
=
SrcType
.
vp
)
extends
XSDecodeBase
{
def
generate
()
:
List
[
BitPat
]
=
{
XSDecode
(
SrcType
.
xp
,
SrcType
.
vp
,
src3
,
fu
,
fuOp
,
SelImm
.
X
,
uopSplitType
,
xWen
=
F
,
fWen
=
F
,
vWen
=
vWen
,
mWen
=
mWen
,
xsTrap
=
F
,
noSpec
=
F
,
blockBack
=
F
,
flushPipe
=
F
).
generate
()
}
}
case
class
OPIVI
(
fu
:
BitPa
t
,
fuOp
:
BitPat
,
vWen
:
Boolean
,
mWen
:
Boolean
,
vxsatWen
:
Boolean
,
selImm
:
BitPat
=
SelImm
.
IMM_OPIVIS
,
uopSplitType
:
BitPat
=
UopSplitType
.
VEC_VVV
,
src3
:
BitPat
=
SrcType
.
vp
)
extends
XSDecodeBase
{
case
class
OPIVI
(
fu
:
In
t
,
fuOp
:
BitPat
,
vWen
:
Boolean
,
mWen
:
Boolean
,
vxsatWen
:
Boolean
,
selImm
:
BitPat
=
SelImm
.
IMM_OPIVIS
,
uopSplitType
:
BitPat
=
UopSplitType
.
VEC_VVV
,
src3
:
BitPat
=
SrcType
.
vp
)
extends
XSDecodeBase
{
def
generate
()
:
List
[
BitPat
]
=
{
XSDecode
(
SrcType
.
imm
,
SrcType
.
vp
,
src3
,
fu
,
fuOp
,
selImm
,
uopSplitType
,
xWen
=
F
,
fWen
=
F
,
vWen
=
vWen
,
mWen
=
mWen
,
xsTrap
=
F
,
noSpec
=
F
,
blockBack
=
F
,
flushPipe
=
F
).
generate
()
}
}
case
class
OPMVV
(
vdRen
:
Boolean
,
fu
:
BitPa
t
,
fuOp
:
BitPat
,
xWen
:
Boolean
,
vWen
:
Boolean
,
mWen
:
Boolean
,
uopSplitType
:
BitPat
=
UopSplitType
.
dummy
)
extends
XSDecodeBase
{
case
class
OPMVV
(
vdRen
:
Boolean
,
fu
:
In
t
,
fuOp
:
BitPat
,
xWen
:
Boolean
,
vWen
:
Boolean
,
mWen
:
Boolean
,
uopSplitType
:
BitPat
=
UopSplitType
.
dummy
)
extends
XSDecodeBase
{
private
def
src3
:
BitPat
=
if
(
vdRen
)
SrcType
.
vp
else
SrcType
.
X
def
generate
()
:
List
[
BitPat
]
=
{
XSDecode
(
SrcType
.
vp
,
SrcType
.
vp
,
src3
,
fu
,
fuOp
,
SelImm
.
X
,
uopSplitType
,
xWen
,
F
,
vWen
,
mWen
,
F
,
F
,
F
,
F
).
generate
()
}
}
case
class
OPMVX
(
vdRen
:
Boolean
,
fu
:
BitPa
t
,
fuOp
:
BitPat
,
xWen
:
Boolean
,
vWen
:
Boolean
,
mWen
:
Boolean
,
uopSplitType
:
BitPat
=
UopSplitType
.
dummy
)
extends
XSDecodeBase
{
case
class
OPMVX
(
vdRen
:
Boolean
,
fu
:
In
t
,
fuOp
:
BitPat
,
xWen
:
Boolean
,
vWen
:
Boolean
,
mWen
:
Boolean
,
uopSplitType
:
BitPat
=
UopSplitType
.
dummy
)
extends
XSDecodeBase
{
private
def
src3
:
BitPat
=
if
(
vdRen
)
SrcType
.
vp
else
SrcType
.
X
def
generate
()
:
List
[
BitPat
]
=
{
XSDecode
(
SrcType
.
xp
,
SrcType
.
vp
,
src3
,
fu
,
fuOp
,
SelImm
.
X
,
uopSplitType
,
...
...
@@ -60,14 +60,14 @@ case class OPMVX(vdRen: Boolean, fu: BitPat, fuOp: BitPat, xWen: Boolean, vWen:
}
}
case
class
OPFVV
(
src1
:
BitPat
,
src3
:
BitPat
,
fu
:
BitPa
t
,
fuOp
:
BitPat
,
fWen
:
Boolean
,
vWen
:
Boolean
,
mWen
:
Boolean
,
uopSplitType
:
BitPat
=
UopSplitType
.
dummy
)
extends
XSDecodeBase
{
case
class
OPFVV
(
src1
:
BitPat
,
src3
:
BitPat
,
fu
:
In
t
,
fuOp
:
BitPat
,
fWen
:
Boolean
,
vWen
:
Boolean
,
mWen
:
Boolean
,
uopSplitType
:
BitPat
=
UopSplitType
.
dummy
)
extends
XSDecodeBase
{
def
generate
()
:
List
[
BitPat
]
=
{
XSDecode
(
src1
,
SrcType
.
vp
,
src3
,
fu
,
fuOp
,
SelImm
.
X
,
uopSplitType
,
xWen
=
F
,
fWen
=
fWen
,
vWen
=
vWen
,
mWen
=
mWen
,
xsTrap
=
F
,
noSpec
=
F
,
blockBack
=
F
,
flushPipe
=
F
).
generate
()
}
}
case
class
OPFVF
(
src1
:
BitPat
,
src3
:
BitPat
,
fu
:
BitPa
t
,
fuOp
:
BitPat
,
fWen
:
Boolean
,
vWen
:
Boolean
,
mWen
:
Boolean
,
uopSplitType
:
BitPat
=
UopSplitType
.
dummy
)
extends
XSDecodeBase
{
case
class
OPFVF
(
src1
:
BitPat
,
src3
:
BitPat
,
fu
:
In
t
,
fuOp
:
BitPat
,
fWen
:
Boolean
,
vWen
:
Boolean
,
mWen
:
Boolean
,
uopSplitType
:
BitPat
=
UopSplitType
.
dummy
)
extends
XSDecodeBase
{
def
generate
()
:
List
[
BitPat
]
=
{
XSDecode
(
src1
,
SrcType
.
vp
,
src3
,
fu
,
fuOp
,
SelImm
.
X
,
uopSplitType
,
xWen
=
F
,
fWen
=
fWen
,
vWen
=
vWen
,
mWen
=
mWen
,
xsTrap
=
F
,
noSpec
=
F
,
blockBack
=
F
,
flushPipe
=
F
).
generate
()
...
...
@@ -78,7 +78,7 @@ case class VSET(vli: Boolean, vtypei: Boolean, fuOp: BitPat, flushPipe: Boolean,
def
generate
()
:
List
[
BitPat
]
=
{
val
src1
=
if
(
vli
)
SrcType
.
imm
else
SrcType
.
xp
val
src2
=
if
(
vtypei
)
SrcType
.
imm
else
SrcType
.
xp
XSDecode
(
src1
,
src2
,
SrcType
.
X
,
FuType
.
alu
,
fuOp
,
selImm
,
uopSplitType
,
XSDecode
(
src1
,
src2
,
SrcType
.
X
,
FuType
.
vsetiwf
,
fuOp
,
selImm
,
uopSplitType
,
xWen
=
T
,
fWen
=
F
,
vWen
=
F
,
mWen
=
F
,
xsTrap
=
F
,
noSpec
=
F
,
blockBack
=
F
,
flushPipe
=
flushPipe
).
generate
()
}
}
...
...
@@ -546,7 +546,7 @@ object VecDecoder extends DecodeConstants {
VFMV_V_F
->
OPFVF
(
SrcType
.
X
,
SrcType
.
X
,
FuType
.
vfpu
,
VfpuType
.
dummy
,
F
,
T
,
F
),
// src2=SrcType.X
// 16.2. Floating-Point Scalar Move Instructions
VFMV_S_F
->
OPFVF
(
SrcType
.
fp
,
SrcType
.
vp
,
FuType
.
vppu
,
VpermType
.
vfmv_s_f
,
F
,
T
,
F
),
// vs2=0 // vs3 = vd
VFMV_S_F
->
OPFVF
(
SrcType
.
fp
,
SrcType
.
vp
,
FuType
.
vppu
,
VpermType
.
dummy
,
F
,
T
,
F
),
// vs2=0 // vs3 = vd // Todo
// 16.3.3. Vector Slide1up
VFSLIDE1UP_VF
->
OPFVF
(
SrcType
.
fp
,
SrcType
.
vp
,
FuType
.
vppu
,
VpermType
.
vfslide1up
,
F
,
T
,
F
,
UopSplitType
.
VEC_FSLIDE1UP
),
// vd[0]=f[rs1], vd[i+1] = vs2[i]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录