Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenXiangShan
XiangShan
提交
7157d580
X
XiangShan
项目概览
OpenXiangShan
/
XiangShan
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
7157d580
编写于
2月 20, 2021
作者:
Z
zhanglinjuan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
L1plusPrefetcher: add latch of l1+prefetch req for timing optimization
上级
2118190b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
28 addition
and
8 deletion
+28
-8
src/main/scala/xiangshan/cache/prefetch/L1plusPrefetcher.scala
...ain/scala/xiangshan/cache/prefetch/L1plusPrefetcher.scala
+28
-8
未找到文件。
src/main/scala/xiangshan/cache/prefetch/L1plusPrefetcher.scala
浏览文件 @
7157d580
...
@@ -24,6 +24,23 @@ class L1plusPrefetcher extends PrefetchModule {
...
@@ -24,6 +24,23 @@ class L1plusPrefetcher extends PrefetchModule {
val
mem_grant
=
Flipped
(
DecoupledIO
(
new
L1plusCacheResp
))
val
mem_grant
=
Flipped
(
DecoupledIO
(
new
L1plusCacheResp
))
})
})
def
latch_decoupled
[
T
<:
Data
](
source
:
DecoupledIO
[
T
],
sink
:
DecoupledIO
[
T
])
=
{
val
latch
=
Reg
(
source
.
bits
.
cloneType
.
asInstanceOf
[
T
])
val
valid
=
RegInit
(
false
.
B
)
when
(
sink
.
fire
())
{
valid
:=
false
.
B
}
when
(
source
.
fire
())
{
valid
:=
true
.
B
latch
:=
source
.
bits
}
sink
.
valid
:=
valid
sink
.
bits
:=
latch
source
.
ready
:=
!
valid
||
sink
.
fire
()
}
if
(
l1plusPrefetcherParameters
.
enable
&&
l1plusPrefetcherParameters
.
_type
==
"stream"
)
{
if
(
l1plusPrefetcherParameters
.
enable
&&
l1plusPrefetcherParameters
.
_type
==
"stream"
)
{
val
streamParams
=
l1plusPrefetcherParameters
.
streamParams
val
streamParams
=
l1plusPrefetcherParameters
.
streamParams
val
pft
=
Module
(
new
StreamPrefetch
(
streamParams
))
val
pft
=
Module
(
new
StreamPrefetch
(
streamParams
))
...
@@ -33,11 +50,13 @@ class L1plusPrefetcher extends PrefetchModule {
...
@@ -33,11 +50,13 @@ class L1plusPrefetcher extends PrefetchModule {
pft
.
io
.
train
.
bits
.
miss
:=
true
.
B
pft
.
io
.
train
.
bits
.
miss
:=
true
.
B
io
.
in
.
ready
:=
true
.
B
io
.
in
.
ready
:=
true
.
B
io
.
mem_acquire
.
valid
:=
pft
.
io
.
req
.
valid
val
mem_acquire_source
=
Wire
(
DecoupledIO
(
new
L1plusCacheReq
))
io
.
mem_acquire
.
bits
.
cmd
:=
Mux
(
pft
.
io
.
req
.
bits
.
write
,
MemoryOpConstants
.
M_PFW
,
MemoryOpConstants
.
M_PFR
)
mem_acquire_source
.
valid
:=
pft
.
io
.
req
.
valid
io
.
mem_acquire
.
bits
.
addr
:=
pft
.
io
.
req
.
bits
.
addr
mem_acquire_source
.
bits
.
cmd
:=
Mux
(
pft
.
io
.
req
.
bits
.
write
,
MemoryOpConstants
.
M_PFW
,
MemoryOpConstants
.
M_PFR
)
io
.
mem_acquire
.
bits
.
id
:=
pft
.
io
.
req
.
bits
.
id
mem_acquire_source
.
bits
.
addr
:=
pft
.
io
.
req
.
bits
.
addr
pft
.
io
.
req
.
ready
:=
io
.
mem_acquire
.
ready
mem_acquire_source
.
bits
.
id
:=
pft
.
io
.
req
.
bits
.
id
pft
.
io
.
req
.
ready
:=
mem_acquire_source
.
ready
latch_decoupled
(
mem_acquire_source
,
io
.
mem_acquire
)
pft
.
io
.
resp
.
valid
:=
io
.
mem_grant
.
valid
pft
.
io
.
resp
.
valid
:=
io
.
mem_grant
.
valid
pft
.
io
.
resp
.
bits
.
id
:=
io
.
mem_grant
.
bits
.
id
(
streamParams
.
totalWidth
-
1
,
0
)
pft
.
io
.
resp
.
bits
.
id
:=
io
.
mem_grant
.
bits
.
id
(
streamParams
.
totalWidth
-
1
,
0
)
...
@@ -46,9 +65,10 @@ class L1plusPrefetcher extends PrefetchModule {
...
@@ -46,9 +65,10 @@ class L1plusPrefetcher extends PrefetchModule {
pft
.
io
.
finish
.
ready
:=
true
.
B
pft
.
io
.
finish
.
ready
:=
true
.
B
// debug info
// debug info
XSDebug
(
p
"io.in: v=${io.in.valid} r=${io.in.ready} ${io.in.bits}\n"
)
XSDebug
(
p
"io.in: v=${io.in.valid} r=${io.in.ready} ${io.in.bits}\n"
)
XSDebug
(
p
"io.mem_acquire: v=${io.mem_acquire.valid} r=${io.mem_acquire.ready} ${io.mem_acquire.bits}\n"
)
XSDebug
(
p
"mem_acquire_source: v=${mem_acquire_source.valid} r=${mem_acquire_source.ready} ${mem_acquire_source.bits}"
)
XSDebug
(
p
"io.mem_grant: v=${io.mem_grant.valid} r=${io.mem_grant.ready} ${io.mem_grant.bits}\n"
)
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
&&
!
env
.
DualCore
)
{
if
(!
env
.
FPGAPlatform
&&
!
env
.
DualCore
)
{
ExcitingUtils
.
addSource
(
io
.
mem_acquire
.
fire
(),
"perfCntL1plusPrefetchReqCnt"
,
Perf
)
ExcitingUtils
.
addSource
(
io
.
mem_acquire
.
fire
(),
"perfCntL1plusPrefetchReqCnt"
,
Perf
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录