Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenXiangShan
XiangShan
提交
71326897
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 搜索 >>
提交
71326897
编写于
4月 18, 2023
作者:
Z
ZhangZifei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
perf: add some slot util perf counters of id/rn/dp
上级
bc8bcc94
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
3 deletion
+18
-3
src/main/scala/xiangshan/backend/decode/DecodeStage.scala
src/main/scala/xiangshan/backend/decode/DecodeStage.scala
+4
-0
src/main/scala/xiangshan/backend/dispatch/Dispatch.scala
src/main/scala/xiangshan/backend/dispatch/Dispatch.scala
+8
-2
src/main/scala/xiangshan/backend/rename/Rename.scala
src/main/scala/xiangshan/backend/rename/Rename.scala
+6
-1
未找到文件。
src/main/scala/xiangshan/backend/decode/DecodeStage.scala
浏览文件 @
71326897
...
...
@@ -76,6 +76,10 @@ class DecodeStage(implicit p: Parameters) extends XSModule with HasPerfEvents {
XSPerfAccumulate
(
"waitInstr"
,
PopCount
((
0
until
DecodeWidth
).
map
(
i
=>
io
.
in
(
i
).
valid
&&
!
io
.
in
(
i
).
ready
)))
XSPerfAccumulate
(
"stall_cycle"
,
hasValid
&&
!
io
.
out
(
0
).
ready
)
XSPerfHistogram
(
"slots_fire"
,
PopCount
(
io
.
out
.
map
(
_
.
fire
)),
true
.
B
,
0
,
DecodeWidth
+
1
,
1
)
XSPerfHistogram
(
"slots_valid_pure"
,
PopCount
(
io
.
in
.
map
(
_
.
valid
)),
io
.
out
(
0
).
fire
,
0
,
DecodeWidth
+
1
,
1
)
XSPerfHistogram
(
"slots_valid_rough"
,
PopCount
(
io
.
in
.
map
(
_
.
valid
)),
true
.
B
,
0
,
DecodeWidth
+
1
,
1
)
if
(
env
.
EnableTopDown
)
{
XSPerfAccumulate
(
"slots_issued"
,
PopCount
(
io
.
out
.
map
(
_
.
fire
)))
XSPerfAccumulate
(
"decode_bubbles"
,
PopCount
(
io
.
out
.
map
(
x
=>
!
x
.
valid
&&
x
.
ready
)))
// Unutilized issue-pipeline slots while there is no backend-stall
...
...
src/main/scala/xiangshan/backend/dispatch/Dispatch.scala
浏览文件 @
71326897
...
...
@@ -105,7 +105,7 @@ class Dispatch(implicit p: Parameters) extends XSModule with HasPerfEvents {
val
updatedUop
=
Wire
(
Vec
(
RenameWidth
,
new
MicroOp
))
val
updatedCommitType
=
Wire
(
Vec
(
RenameWidth
,
CommitType
()))
val
checkpoint_id
=
RegInit
(
0.
U
(
64.
W
))
checkpoint_id
:=
checkpoint_id
+
PopCount
((
0
until
RenameWidth
).
map
(
i
=>
checkpoint_id
:=
checkpoint_id
+
PopCount
((
0
until
RenameWidth
).
map
(
i
=>
io
.
fromRename
(
i
).
fire
()
))
...
...
@@ -151,7 +151,7 @@ class Dispatch(implicit p: Parameters) extends XSModule with HasPerfEvents {
if
(
i
==
0
){
debug_runahead_checkpoint_id
:=
checkpoint_id
}
else
{
debug_runahead_checkpoint_id
:=
checkpoint_id
+
PopCount
((
0
until
i
).
map
(
i
=>
debug_runahead_checkpoint_id
:=
checkpoint_id
+
PopCount
((
0
until
i
).
map
(
i
=>
io
.
fromRename
(
i
).
fire
()
))
}
...
...
@@ -204,6 +204,7 @@ class Dispatch(implicit p: Parameters) extends XSModule with HasPerfEvents {
// (1) resources are ready
// (2) previous instructions are ready
val
thisCanActualOut
=
(
0
until
RenameWidth
).
map
(
i
=>
!
thisIsBlocked
(
i
)
&&
notBlockedByPrevious
(
i
))
val
thisActualOut
=
(
0
until
RenameWidth
).
map
(
i
=>
io
.
enqRob
.
req
(
i
).
valid
&&
io
.
enqRob
.
canAccept
)
val
hasValidException
=
io
.
fromRename
.
zip
(
hasException
).
map
(
x
=>
x
.
_1
.
valid
&&
x
.
_2
)
// input for ROB, LSQ, Dispatch Queue
...
...
@@ -277,6 +278,11 @@ class Dispatch(implicit p: Parameters) extends XSModule with HasPerfEvents {
XSPerfAccumulate
(
"stall_cycle_fp_dq"
,
stall_fp_dq
)
XSPerfAccumulate
(
"stall_cycle_ls_dq"
,
stall_ls_dq
)
XSPerfHistogram
(
"slots_fire"
,
PopCount
(
thisActualOut
),
true
.
B
,
0
,
RenameWidth
+
1
,
1
)
// Explaination: when out(0) not fire, PopCount(valid) is not meaningfull
XSPerfHistogram
(
"slots_valid_pure"
,
PopCount
(
io
.
enqRob
.
req
.
map
(
_
.
valid
)),
thisActualOut
(
0
),
0
,
RenameWidth
+
1
,
1
)
XSPerfHistogram
(
"slots_valid_rough"
,
PopCount
(
io
.
enqRob
.
req
.
map
(
_
.
valid
)),
true
.
B
,
0
,
RenameWidth
+
1
,
1
)
if
(
env
.
EnableTopDown
)
{
val
rob_first_load
=
WireDefault
(
false
.
B
)
val
rob_first_store
=
WireDefault
(
false
.
B
)
...
...
src/main/scala/xiangshan/backend/rename/Rename.scala
浏览文件 @
71326897
...
...
@@ -372,11 +372,16 @@ class Rename(implicit p: Parameters) extends XSModule with HasCircularQueuePtrHe
XSPerfAccumulate
(
"stall_cycle_walk"
,
hasValid
&&
io
.
out
(
0
).
ready
&&
fpFreeList
.
io
.
canAllocate
&&
intFreeList
.
io
.
canAllocate
&&
io
.
robCommits
.
isWalk
)
XSPerfAccumulate
(
"recovery_bubbles"
,
PopCount
(
io
.
in
.
map
(
_
.
valid
&&
io
.
out
(
0
).
ready
&&
fpFreeList
.
io
.
canAllocate
&&
intFreeList
.
io
.
canAllocate
&&
io
.
robCommits
.
isWalk
)))
XSPerfHistogram
(
"slots_fire"
,
PopCount
(
io
.
out
.
map
(
_
.
fire
)),
true
.
B
,
0
,
RenameWidth
+
1
,
1
)
// Explaination: when out(0) not fire, PopCount(valid) is not meaningfull
XSPerfHistogram
(
"slots_valid_pure"
,
PopCount
(
io
.
in
.
map
(
_
.
valid
)),
io
.
out
(
0
).
fire
,
0
,
RenameWidth
+
1
,
1
)
XSPerfHistogram
(
"slots_valid_rough"
,
PopCount
(
io
.
in
.
map
(
_
.
valid
)),
true
.
B
,
0
,
RenameWidth
+
1
,
1
)
XSPerfAccumulate
(
"move_instr_count"
,
PopCount
(
io
.
out
.
map
(
out
=>
out
.
fire
&&
out
.
bits
.
ctrl
.
isMove
)))
val
is_fused_lui_load
=
io
.
out
.
map
(
o
=>
o
.
fire
&&
o
.
bits
.
ctrl
.
fuType
===
FuType
.
ldu
&&
o
.
bits
.
ctrl
.
srcType
(
0
)
===
SrcType
.
imm
)
XSPerfAccumulate
(
"fused_lui_load_instr_count"
,
PopCount
(
is_fused_lui_load
))
val
renamePerf
=
Seq
(
(
"rename_in "
,
PopCount
(
io
.
in
.
map
(
_
.
valid
&
io
.
in
(
0
).
ready
))
),
(
"rename_waitinstr "
,
PopCount
((
0
until
RenameWidth
).
map
(
i
=>
io
.
in
(
i
).
valid
&&
!
io
.
in
(
i
).
ready
))
),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录