Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenXiangShan
XiangShan
提交
e5e79138
X
XiangShan
项目概览
OpenXiangShan
/
XiangShan
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
e5e79138
编写于
1月 12, 2021
作者:
Z
zhanglinjuan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
L2Prefetcher/L1plusPrefetcher: add perf cnt for prefetch penalty
上级
4b38697d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
48 addition
and
4 deletion
+48
-4
src/main/scala/xiangshan/backend/fu/CSR.scala
src/main/scala/xiangshan/backend/fu/CSR.scala
+13
-3
src/main/scala/xiangshan/cache/icacheMissQueue.scala
src/main/scala/xiangshan/cache/icacheMissQueue.scala
+1
-1
src/main/scala/xiangshan/cache/prefetch/L1plusPrefetcher.scala
...ain/scala/xiangshan/cache/prefetch/L1plusPrefetcher.scala
+17
-0
src/main/scala/xiangshan/cache/prefetch/L2Prefetcher.scala
src/main/scala/xiangshan/cache/prefetch/L2Prefetcher.scala
+17
-0
未找到文件。
src/main/scala/xiangshan/backend/fu/CSR.scala
浏览文件 @
e5e79138
...
...
@@ -833,7 +833,9 @@ class CSR extends FunctionUnit with HasCSRConst
"PtwL2TlbHit"
->
(
0xb27
,
"perfCntPtwL2TlbHit"
),
"ICacheReq"
->
(
0xb28
,
"perfCntIcacheReqCnt"
),
"ICacheMiss"
->
(
0xb29
,
"perfCntIcacheMissCnt"
),
"DCacheMiss"
->
(
0xb2a
,
"perfCntDCacheMiss"
)
"DCacheMiss"
->
(
0xb2a
,
"perfCntDCacheMiss"
),
"L1+PrefetchCnt"
->(
0xb2b
,
"perfCntL1plusPrefetchReqCnt"
),
"L2PrefetchCnt"
->(
0xb2c
,
"perfCntL2PrefetchReqCnt"
)
// "FetchFromICache" -> (0xb2a, "CntFetchFromICache"),
// "FetchFromLoopBuffer" -> (0xb2b, "CntFetchFromLoopBuffer"),
// "ExitLoop1" -> (0xb2c, "CntExitLoop1"),
...
...
@@ -850,11 +852,19 @@ class CSR extends FunctionUnit with HasCSRConst
// "Ml2cacheHit" -> (0xb23, "perfCntCondMl2cacheHit")
)
++
(
(
0
until
dcacheParameters
.
nMissEntries
).
map
(
i
=>
(
"DCacheMissQueuePenalty"
+
Integer
.
toString
(
i
,
10
),
(
0xb2
b
+
i
,
"perfCntDCacheMissQueuePenaltyEntry"
+
Integer
.
toString
(
i
,
10
)))
(
"DCacheMissQueuePenalty"
+
Integer
.
toString
(
i
,
10
),
(
0xb2
d
+
i
,
"perfCntDCacheMissQueuePenaltyEntry"
+
Integer
.
toString
(
i
,
10
)))
).
toMap
)
++
(
(
0
until
icacheParameters
.
nMissEntries
).
map
(
i
=>
(
"ICacheMissQueuePenalty"
+
Integer
.
toString
(
i
,
10
),
(
0xb2b
+
dcacheParameters
.
nMissEntries
+
i
,
"perfCntICacheMissQueuePenalty"
+
Integer
.
toString
(
i
,
10
)))
(
"ICacheMissQueuePenalty"
+
Integer
.
toString
(
i
,
10
),
(
0xb2d
+
dcacheParameters
.
nMissEntries
+
i
,
"perfCntICacheMissQueuePenaltyEntry"
+
Integer
.
toString
(
i
,
10
)))
).
toMap
)
++
(
(
0
until
l1plusPrefetcherParameters
.
nEntries
).
map
(
i
=>
(
"L1+PrefetchPenalty"
+
Integer
.
toString
(
i
,
10
),
(
0xb2d
+
dcacheParameters
.
nMissEntries
+
icacheParameters
.
nMissEntries
,
"perfCntL1plusPrefetchPenaltyEntry"
+
Integer
.
toString
(
i
,
10
)))
).
toMap
)
++
(
(
0
until
l2PrefetcherParameters
.
nEntries
).
map
(
i
=>
(
"L2PrefetchPenalty"
+
Integer
.
toString
(
i
,
10
),
(
0xb2d
+
dcacheParameters
.
nMissEntries
+
icacheParameters
.
nMissEntries
+
l1plusPrefetcherParameters
.
nEntries
,
"perfCntL2PrefetchPenaltyEntry"
+
Integer
.
toString
(
i
,
10
)))
).
toMap
)
...
...
src/main/scala/xiangshan/cache/icacheMissQueue.scala
浏览文件 @
e5e79138
...
...
@@ -233,7 +233,7 @@ class IcacheMissQueue extends ICacheMissQueueModule
ExcitingUtils
.
addSource
(
BoolStopWatch
(
start
=
entry
.
io
.
req
.
fire
(),
stop
=
entry
.
io
.
resp
.
fire
(),
stop
=
entry
.
io
.
resp
.
fire
()
||
entry
.
io
.
flush
,
startHighPriority
=
true
),
"perfCntICacheMissQueuePenaltyEntry"
+
Integer
.
toString
(
i
,
10
),
Perf
...
...
src/main/scala/xiangshan/cache/prefetch/L1plusPrefetcher.scala
浏览文件 @
e5e79138
...
...
@@ -5,6 +5,7 @@ import chisel3.util._
import
xiangshan._
import
xiangshan.cache._
import
utils._
import
chisel3.ExcitingUtils._
case
class
L1plusPrefetcherParameters
(
enable
:
Boolean
,
...
...
@@ -49,6 +50,22 @@ class L1plusPrefetcher extends PrefetchModule {
XSDebug
(
p
"io.mem_acquire: v=${io.mem_acquire.valid} r=${io.mem_acquire.ready} ${io.mem_acquire.bits}\n"
)
XSDebug
(
p
"io.mem_grant: v=${io.mem_grant.valid} r=${io.mem_grant.ready} ${io.mem_grant.bits}\n"
)
if
(!
env
.
FPGAPlatform
)
{
ExcitingUtils
.
addSource
(
io
.
mem_acquire
.
fire
(),
"perfCntL1plusPrefetchReqCnt"
,
Perf
)
def
idWidth
:
Int
=
log2Up
(
l1plusPrefetcherParameters
.
nEntries
)
(
0
until
l1plusPrefetcherParameters
.
nEntries
).
foreach
(
i
=>
ExcitingUtils
.
addSource
(
BoolStopWatch
(
start
=
io
.
mem_acquire
.
fire
()
&&
io
.
mem_acquire
.
bits
.
id
(
idWidth
-
1
,
0
)
===
i
.
U
,
stop
=
io
.
mem_grant
.
fire
()
&&
io
.
mem_grant
.
bits
.
id
(
idWidth
-
1
,
0
)
===
i
.
U
,
startHighPriority
=
true
),
"perfCntL1plusPrefetchPenaltyEntry"
+
Integer
.
toString
(
i
,
10
),
Perf
)
)
}
}
else
{
io
.
in
.
ready
:=
true
.
B
io
.
mem_acquire
.
valid
:=
false
.
B
...
...
src/main/scala/xiangshan/cache/prefetch/L2Prefetcher.scala
浏览文件 @
e5e79138
...
...
@@ -6,6 +6,7 @@ import freechips.rocketchip.tilelink.ClientMetadata
import
xiangshan._
import
xiangshan.cache._
import
utils._
import
chisel3.ExcitingUtils._
import
chipsalliance.rocketchip.config.Parameters
import
freechips.rocketchip.diplomacy.
{
LazyModule
,
LazyModuleImp
,
IdRange
}
...
...
@@ -79,6 +80,22 @@ class L2PrefetcherImp(outer: L2Prefetcher) extends LazyModuleImp(outer) with Has
bus
.
e
.
bits
:=
DontCare
dPrefetch
.
io
.
finish
.
ready
:=
true
.
B
if
(!
env
.
FPGAPlatform
)
{
ExcitingUtils
.
addSource
(
bus
.
a
.
fire
(),
"perfCntL2PrefetchReqCnt"
,
Perf
)
def
idWidth
=
log2Up
(
l2PrefetcherParameters
.
nEntries
)
(
0
until
l2PrefetcherParameters
.
nEntries
).
foreach
(
i
=>
ExcitingUtils
.
addSource
(
BoolStopWatch
(
start
=
bus
.
a
.
fire
()
&&
dPrefetch
.
io
.
req
.
bits
.
id
(
streamParams
.
totalWidth
-
1
,
0
)
===
i
.
U
,
stop
=
bus
.
d
.
fire
()
&&
bus
.
d
.
bits
.
source
(
streamParams
.
totalWidth
-
1
,
0
)
===
i
.
U
,
startHighPriority
=
true
),
"perfCntL2PrefetchPenaltyEntry"
+
Integer
.
toString
(
i
,
10
),
Perf
)
)
}
}
else
{
bus
.
a
.
valid
:=
false
.
B
bus
.
a
.
bits
:=
DontCare
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录