Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenXiangShan
XiangShan
提交
6527e46b
X
XiangShan
项目概览
OpenXiangShan
/
XiangShan
8 个月 前同步成功
通知
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 搜索 >>
未验证
提交
6527e46b
编写于
5月 18, 2021
作者:
L
Lemover
提交者:
GitHub
5月 18, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
PTW: add perf counter for req's count and cycle (#814)
* PTW: fix typo * PTW: add perf for req's count & cycle
上级
0a1a21a6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
4 deletion
+20
-4
src/main/scala/xiangshan/cache/PTW.scala
src/main/scala/xiangshan/cache/PTW.scala
+20
-4
未找到文件。
src/main/scala/xiangshan/cache/PTW.scala
浏览文件 @
6527e46b
...
...
@@ -501,7 +501,7 @@ class PtwMissQueue(implicit p: Parameters) extends XSModule with HasPtwConst {
count
:=
0.
U
}
for
(
i
<-
0
until
MSHRSize
)
{
XSPerfAccumulate
(
s
"numExist${i}"
,
count
===
1
.
U
)
XSPerfAccumulate
(
s
"numExist${i}"
,
count
===
i
.
U
)
}
}
...
...
@@ -527,6 +527,10 @@ class PTWRepeater(implicit p: Parameters) extends XSModule with HasPtwConst {
tlb
.
resp
.
valid
:=
haveOne
&&
recv
ptw
.
resp
.
ready
:=
!
recv
XSPerfAccumulate
(
"req_count"
,
ptw
.
req
(
0
).
fire
())
XSPerfAccumulate
(
"tlb_req_cycle"
,
BoolStopWatch
(
tlb
.
req
(
0
).
fire
(),
tlb
.
resp
.
fire
()
||
sfence
))
XSPerfAccumulate
(
"ptw_req_cycle"
,
BoolStopWatch
(
ptw
.
req
(
0
).
fire
(),
ptw
.
resp
.
fire
()
||
sfence
))
XSDebug
(
haveOne
,
p
"haveOne:${haveOne} sent:${sent} recv:${recv} sfence:${sfence} req:${req} resp:${resp}"
)
XSDebug
(
io
.
tlb
.
req
(
0
).
valid
||
io
.
tlb
.
resp
.
valid
,
p
"tlb: ${tlb}\n"
)
XSDebug
(
io
.
ptw
.
req
(
0
).
valid
||
io
.
ptw
.
resp
.
valid
,
p
"ptw: ${ptw}\n"
)
...
...
@@ -646,13 +650,25 @@ class PTWFilter(Width: Int, Size: Int)(implicit p: Parameters) extends XSModule
reqs
}
XSPerfAccumulate
(
"req_count"
,
PopCount
(
Cat
(
io
.
tlb
.
req
.
map
(
_
.
valid
))))
XSPerfAccumulate
(
"req_count_filter"
,
Mux
(
do_enq
,
accumEnqNum
(
Width
-
1
),
0.
U
))
XSPerfAccumulate
(
"resp_count"
,
PopCount
(
Cat
(
io
.
tlb
.
resp
.
fire
())))
// perf
val
inflight_counter
=
RegInit
(
0.
U
(
log2Up
(
Size
+
1
).
W
))
when
(
io
.
ptw
.
req
(
0
).
fire
()
=/=
io
.
ptw
.
resp
.
fire
())
{
inflight_counter
:=
Mux
(
io
.
ptw
.
req
(
0
).
fire
(),
inflight_counter
+
1.
U
,
inflight_counter
-
1.
U
)
}
when
(
sfence
.
valid
)
{
inflight_counter
:=
0.
U
}
XSPerfAccumulate
(
"tlb_req_count"
,
PopCount
(
Cat
(
io
.
tlb
.
req
.
map
(
_
.
valid
))))
XSPerfAccumulate
(
"tlb_req_count_filtered"
,
Mux
(
do_enq
,
accumEnqNum
(
Width
-
1
),
0.
U
))
XSPerfAccumulate
(
"ptw_req_count"
,
io
.
ptw
.
req
(
0
).
fire
())
XSPerfAccumulate
(
"ptw_req_cycle"
,
inflight_counter
)
XSPerfAccumulate
(
"tlb_resp_count"
,
io
.
tlb
.
resp
.
fire
())
XSPerfAccumulate
(
"ptw_resp_count"
,
io
.
ptw
.
resp
.
fire
())
XSPerfAccumulate
(
"inflight_cycle"
,
!
isEmptyDeq
)
for
(
i
<-
0
until
Size
+
1
)
{
XSPerfAccumulate
(
s
"counter${i}"
,
counter
===
i
.
U
)
}
}
/* ptw cache caches the page table of all the three layers
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录