Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenXiangShan
XiangShan
提交
1d7e5011
X
XiangShan
项目概览
OpenXiangShan
/
XiangShan
9 个月 前同步成功
通知
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 搜索 >>
提交
1d7e5011
编写于
10月 18, 2021
作者:
L
Lingrui98
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ftq: add performance counters for mispredicts and corrects from each
bp stage of each cfi type
上级
eeb5ff92
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
23 addition
and
5 deletion
+23
-5
src/main/scala/xiangshan/frontend/BPU.scala
src/main/scala/xiangshan/frontend/BPU.scala
+5
-4
src/main/scala/xiangshan/frontend/NewFtq.scala
src/main/scala/xiangshan/frontend/NewFtq.scala
+18
-1
未找到文件。
src/main/scala/xiangshan/frontend/BPU.scala
浏览文件 @
1d7e5011
...
...
@@ -36,10 +36,11 @@ trait HasBPUConst extends HasXSParameter with HasIFUConst {
val
numBrSlot
=
if
(
shareTailSlot
)
numBr
-
1
else
numBr
val
totalSlot
=
numBrSlot
+
1
def
BP_S1
=
1.
U
(
2.
W
)
def
BP_S2
=
2.
U
(
2.
W
)
def
BP_S3
=
3.
U
(
2.
W
)
def
BP_STAGES
=
(
0
until
3
).
map
(
_
.
U
(
2.
W
))
def
BP_S1
=
BP_STAGES
(
0
)
def
BP_S2
=
BP_STAGES
(
1
)
def
BP_S3
=
BP_STAGES
(
2
)
val
numBpStages
=
BP_STAGES
.
length
val
debug
=
true
val
resetVector
=
0x80000000
L
//TODO: set reset vec
...
...
src/main/scala/xiangshan/frontend/NewFtq.scala
浏览文件 @
1d7e5011
...
...
@@ -1048,6 +1048,21 @@ class Ftq(implicit p: Parameters) extends XSModule with HasCircularQueuePtrHelpe
val
mbpCWrongs
=
mbpWrongs
&
commit_call_mask
val
mbpRWrongs
=
mbpWrongs
&
commit_ret_mask
val
commit_pred_stage
=
RegNext
(
pred_stage
(
commPtr
.
value
))
def
pred_stage_map
(
src
:
UInt
,
name
:
String
)
=
{
(
0
until
numBpStages
).
map
(
i
=>
f
"${name}_stage_${i+1}"
->
PopCount
(
src
.
asBools
.
map
(
_
&&
commit_pred_stage
===
BP_STAGES
(
i
)))
).
foldLeft
(
Map
[
String
,
UInt
]())(
_
+
_
)
}
val
mispred_stage_map
=
pred_stage_map
(
mbpWrongs
,
"mispredict"
)
val
br_mispred_stage_map
=
pred_stage_map
(
mbpBWrongs
,
"br_mispredict"
)
val
jalr_mispred_stage_map
=
pred_stage_map
(
mbpIWrongs
,
"jalr_mispredict"
)
val
correct_stage_map
=
pred_stage_map
(
mbpRights
,
"correct"
)
val
br_correct_stage_map
=
pred_stage_map
(
mbpBRights
,
"br_correct"
)
val
jalr_correct_stage_map
=
pred_stage_map
(
mbpIRights
,
"jalr_correct"
)
val
update_valid
=
io
.
toBpu
.
update
.
valid
def
u
(
cond
:
Bool
)
=
update_valid
&&
cond
val
ftb_false_hit
=
u
(
update
.
false_hit
)
...
...
@@ -1110,7 +1125,9 @@ class Ftq(implicit p: Parameters) extends XSModule with HasCircularQueuePtrHelpe
"ftb_modified_entry_always_taken"
->
PopCount
(
ftb_modified_entry_always_taken
)
)
++
ftb_init_entry_len_map
++
ftb_modified_entry_len_map
++
s1_entry_len_map
++
s2_entry_len_map
++
s3_entry_len_map
++
to_ifu_entry_len_map
++
commit_num_inst_map
++
ftq_occupancy_map
to_ifu_entry_len_map
++
commit_num_inst_map
++
ftq_occupancy_map
++
mispred_stage_map
++
br_mispred_stage_map
++
jalr_mispred_stage_map
++
correct_stage_map
++
br_correct_stage_map
++
jalr_correct_stage_map
for
((
key
,
value
)
<-
perfCountsMap
)
{
XSPerfAccumulate
(
key
,
value
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录