Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenXiangShan
XiangShan
提交
4e5d06f1
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 搜索 >>
未验证
提交
4e5d06f1
编写于
3月 08, 2023
作者:
Z
zhanglyGit
提交者:
GitHub
3月 08, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
decode: modify vx instruction uops and fix bug (#1952)
上级
22d6635a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
22 addition
and
32 deletion
+22
-32
src/main/scala/xiangshan/Parameters.scala
src/main/scala/xiangshan/Parameters.scala
+6
-0
src/main/scala/xiangshan/backend/decode/DecodeUnitComp.scala
src/main/scala/xiangshan/backend/decode/DecodeUnitComp.scala
+11
-27
src/main/scala/xiangshan/backend/rename/Rename.scala
src/main/scala/xiangshan/backend/rename/Rename.scala
+1
-1
src/main/scala/xiangshan/backend/rename/RenameTable.scala
src/main/scala/xiangshan/backend/rename/RenameTable.scala
+3
-3
src/main/scala/xiangshan/backend/rename/freelist/StdFreeList.scala
...scala/xiangshan/backend/rename/freelist/StdFreeList.scala
+1
-1
未找到文件。
src/main/scala/xiangshan/Parameters.scala
浏览文件 @
4e5d06f1
...
...
@@ -130,6 +130,9 @@ case class XSCoreParameters
FtqSize
:
Int
=
64
,
EnableLoadFastWakeUp
:
Boolean
=
true
,
// NOTE: not supported now, make it false
IssQueSize
:
Int
=
16
,
IntLogicRegs
:
Int
=
33
,
FpLogicRegs
:
Int
=
34
,
VecLogicRegs
:
Int
=
34
,
NRPhyRegs
:
Int
=
192
,
IntPhyRegs
:
Int
=
192
,
VfPhyRegs
:
Int
=
192
,
...
...
@@ -392,6 +395,9 @@ trait HasXSParameter {
val
FtqSize
=
coreParams
.
FtqSize
val
IssQueSize
=
coreParams
.
IssQueSize
val
EnableLoadFastWakeUp
=
coreParams
.
EnableLoadFastWakeUp
val
IntLogicRegs
=
coreParams
.
IntLogicRegs
val
FpLogicRegs
=
coreParams
.
FpLogicRegs
val
VecLogicRegs
=
coreParams
.
VecLogicRegs
val
NRPhyRegs
=
coreParams
.
NRPhyRegs
val
PhyRegIdxWidth
=
log2Up
(
NRPhyRegs
)
val
IntPhyRegs
=
coreParams
.
IntPhyRegs
...
...
src/main/scala/xiangshan/backend/decode/DecodeUnitComp.scala
浏览文件 @
4e5d06f1
...
...
@@ -85,7 +85,7 @@ class DecodeUnitComp(maxNumOfUop : Int)(implicit p : Parameters) extends XSModul
UopDivType
.
VEC_MV
->
2.
U
,
UopDivType
.
DIR
->
2.
U
,
UopDivType
.
VEC_LMUL
->
lmul
,
UopDivType
.
VEC_MV_LMUL
->
(
lmul
+
2
.
U
)
UopDivType
.
VEC_MV_LMUL
->
(
lmul
+
1
.
U
)
))
//uop div up to maxNumOfUop
...
...
@@ -162,43 +162,27 @@ class DecodeUnitComp(maxNumOfUop : Int)(implicit p : Parameters) extends XSModul
csBundle
(
0
).
ctrl
.
uopIdx
:=
0.
U
csBundle
(
0
).
ctrl
.
fuType
:=
FuType
.
i2f
csBundle
(
0
).
ctrl
.
rfWen
:=
false
.
B
csBundle
(
0
).
ctrl
.
fpWen
:=
tru
e
.
B
csBundle
(
0
).
ctrl
.
vecWen
:=
fals
e
.
B
csBundle
(
0
).
ctrl
.
fpWen
:=
fals
e
.
B
csBundle
(
0
).
ctrl
.
vecWen
:=
tru
e
.
B
csBundle
(
0
).
ctrl
.
fpu
.
isAddSub
:=
false
.
B
csBundle
(
0
).
ctrl
.
fpu
.
typeTagIn
:=
FPU
.
D
csBundle
(
0
).
ctrl
.
fpu
.
typeTagOut
:=
FPU
.
D
csBundle
(
0
).
ctrl
.
fpu
.
fromInt
:=
true
.
B
csBundle
(
0
).
ctrl
.
fpu
.
wflags
:=
false
.
B
csBundle
(
0
).
ctrl
.
fpu
.
fpWen
:=
tru
e
.
B
csBundle
(
0
).
ctrl
.
fpu
.
fpWen
:=
fals
e
.
B
csBundle
(
0
).
ctrl
.
fpu
.
div
:=
false
.
B
csBundle
(
0
).
ctrl
.
fpu
.
sqrt
:=
false
.
B
csBundle
(
0
).
ctrl
.
fpu
.
fcvt
:=
false
.
B
/*
vfmv.s.f
*/
csBundle
(
1
).
ctrl
.
srcType
(
0
)
:=
SrcType
.
fp
csBundle
(
1
).
ctrl
.
srcType
(
1
)
:=
SrcType
.
vp
csBundle
(
1
).
ctrl
.
srcType
(
2
)
:=
SrcType
.
vp
csBundle
(
1
).
ctrl
.
lsrc
(
0
)
:=
33.
U
csBundle
(
1
).
ctrl
.
lsrc
(
1
)
:=
0.
U
csBundle
(
1
).
ctrl
.
lsrc
(
2
)
:=
33.
U
csBundle
(
1
).
ctrl
.
ldest
:=
33.
U
csBundle
(
1
).
ctrl
.
uopIdx
:=
1.
U
csBundle
(
1
).
ctrl
.
fuType
:=
FuType
.
vppu
csBundle
(
1
).
ctrl
.
fuOpType
:=
VppuType
.
f2s
csBundle
(
1
).
ctrl
.
rfWen
:=
false
.
B
csBundle
(
1
).
ctrl
.
fpWen
:=
false
.
B
csBundle
(
1
).
ctrl
.
vecWen
:=
true
.
B
/*
LMUL
*/
for
(
i
<-
0
until
8
)
{
csBundle
(
i
+
2
).
ctrl
.
srcType
(
0
)
:=
SrcType
.
vp
csBundle
(
i
+
2
).
ctrl
.
srcType
(
3
)
:=
0.
U
csBundle
(
i
+
2
).
ctrl
.
lsrc
(
0
)
:=
33.
U
csBundle
(
i
+
2
).
ctrl
.
lsrc
(
1
)
:=
ctrl_flow
.
instr
(
24
,
20
)
+
i
.
U
csBundle
(
i
+
2
).
ctrl
.
ldest
:=
ctrl_flow
.
instr
(
11
,
7
)
+
i
.
U
csBundle
(
i
+
2
).
ctrl
.
uopIdx
:=
(
i
+
2
).
U
csBundle
(
i
+
1
).
ctrl
.
srcType
(
0
)
:=
SrcType
.
vp
csBundle
(
i
+
1
).
ctrl
.
srcType
(
3
)
:=
0.
U
csBundle
(
i
+
1
).
ctrl
.
lsrc
(
0
)
:=
33.
U
csBundle
(
i
+
1
).
ctrl
.
lsrc
(
1
)
:=
ctrl_flow
.
instr
(
24
,
20
)
+
i
.
U
csBundle
(
i
+
1
).
ctrl
.
ldest
:=
ctrl_flow
.
instr
(
11
,
7
)
+
i
.
U
csBundle
(
i
+
1
).
ctrl
.
uopIdx
:=
(
i
+
1
).
U
}
csBundle
(
numOfUop
-
1.
U
).
ctrl
.
uopIdx
:=
"b11111"
.
U
}
...
...
@@ -217,7 +201,7 @@ class DecodeUnitComp(maxNumOfUop : Int)(implicit p : Parameters) extends XSModul
when
(!
io
.
validFromIBuf
(
0
))
{
stateReg
:=
normal
uopRes
:=
0.
U
}.
elsewhen
(
numOfUop
>
readyCounter
&&
!
readyCounter
){
}.
elsewhen
(
(
numOfUop
>
readyCounter
)
&&
(
readyCounter
=/=
0.
U
)
){
stateReg
:=
ext
uopRes
:=
numOfUop
-
readyCounter
}.
otherwise
{
...
...
src/main/scala/xiangshan/backend/rename/Rename.scala
浏览文件 @
4e5d06f1
...
...
@@ -56,7 +56,7 @@ class Rename(implicit p: Parameters) extends XSModule with HasCircularQueuePtrHe
// create free list and rat
val
intFreeList
=
Module
(
new
MEFreeList
(
NRPhyRegs
))
val
intRefCounter
=
Module
(
new
RefCounter
(
NRPhyRegs
))
val
fpFreeList
=
Module
(
new
StdFreeList
(
NRPhyRegs
-
68
))
val
fpFreeList
=
Module
(
new
StdFreeList
(
NRPhyRegs
-
FpLogicRegs
-
VecLogicRegs
))
intRefCounter
.
io
.
commit
<>
io
.
robCommits
intRefCounter
.
io
.
redirect
:=
io
.
redirect
.
valid
...
...
src/main/scala/xiangshan/backend/rename/RenameTable.scala
浏览文件 @
4e5d06f1
...
...
@@ -61,9 +61,9 @@ class RenameTable(reg_t: RegType)(implicit p: Parameters) extends XSModule {
// speculative rename table
// fp and vec share the same free list, so the first init value of vecRAT is 32
val
rename_table_init
=
reg_t
match
{
case
Reg_I
=>
VecInit
.
fill
(
33
)(
0.
U
(
PhyRegIdxWidth
.
W
))
case
Reg_F
=>
VecInit
.
tabulate
(
34
)(
_
.
U
(
PhyRegIdxWidth
.
W
))
case
Reg_V
=>
VecInit
.
tabulate
(
34
)(
x
=>
(
x
+
34
).
U
(
PhyRegIdxWidth
.
W
))
case
Reg_I
=>
VecInit
.
fill
(
IntLogicRegs
)(
0.
U
(
PhyRegIdxWidth
.
W
))
case
Reg_F
=>
VecInit
.
tabulate
(
FpLogicRegs
)(
_
.
U
(
PhyRegIdxWidth
.
W
))
case
Reg_V
=>
VecInit
.
tabulate
(
VecLogicRegs
)(
x
=>
(
x
+
FpLogicRegs
).
U
(
PhyRegIdxWidth
.
W
))
}
val
spec_table
=
RegInit
(
rename_table_init
)
val
spec_table_next
=
WireInit
(
spec_table
)
...
...
src/main/scala/xiangshan/backend/rename/freelist/StdFreeList.scala
浏览文件 @
4e5d06f1
...
...
@@ -26,7 +26,7 @@ import utility._
class
StdFreeList
(
size
:
Int
)(
implicit
p
:
Parameters
)
extends
BaseFreeList
(
size
)
with
HasPerfEvents
{
val
freeList
=
RegInit
(
VecInit
(
Seq
.
tabulate
(
size
)(
i
=>
(
i
+
68
).
U
(
PhyRegIdxWidth
.
W
)
)))
val
freeList
=
RegInit
(
VecInit
(
Seq
.
tabulate
(
size
)(
i
=>
(
i
+
FpLogicRegs
+
VecLogicRegs
).
U
(
PhyRegIdxWidth
.
W
)
)))
val
headPtr
=
RegInit
(
FreeListPtr
(
false
,
0
))
val
headPtrOH
=
RegInit
(
1.
U
(
size
.
W
))
val
headPtrOHShift
=
CircularShift
(
headPtrOH
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录