Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenXiangShan
XiangShan
提交
e98af34d
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 搜索 >>
提交
e98af34d
编写于
2月 23, 2021
作者:
Z
zhanglinjuan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
MissQueue/DCache: reply GrantAck via channel E before sending pipe req
上级
70051210
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
28 addition
and
6 deletion
+28
-6
src/main/scala/xiangshan/cache/DCacheWrapper.scala
src/main/scala/xiangshan/cache/DCacheWrapper.scala
+3
-1
src/main/scala/xiangshan/cache/MissQueue.scala
src/main/scala/xiangshan/cache/MissQueue.scala
+25
-5
未找到文件。
src/main/scala/xiangshan/cache/DCacheWrapper.scala
浏览文件 @
e98af34d
...
...
@@ -253,10 +253,12 @@ class DCacheImp(outer: DCache) extends LazyModuleImp(outer) with HasDCacheParame
// tilelink stuff
bus
.
a
<>
missQueue
.
io
.
mem_acquire
bus
.
e
<>
missQueue
.
io
.
mem_finish
missQueue
.
io
.
probe_req
:=
bus
.
b
.
bits
.
address
//----------------------------------------
// probe
probeQueue
.
io
.
mem_probe
<>
bus
.
b
// probeQueue.io.mem_probe <> bus.b
block_decoupled
(
bus
.
b
,
probeQueue
.
io
.
mem_probe
,
missQueue
.
io
.
probe_block
)
//----------------------------------------
// mainPipe
...
...
src/main/scala/xiangshan/cache/MissQueue.scala
浏览文件 @
e98af34d
...
...
@@ -58,9 +58,12 @@ class MissEntry(edge: TLEdgeOut) extends DCacheModule
val
pipe_req
=
DecoupledIO
(
new
MainPipeReq
)
val
pipe_resp
=
Flipped
(
ValidIO
(
new
MainPipeResp
))
// block probe
val
block_addr
=
ValidIO
(
UInt
(
PAddrBits
.
W
))
})
// MSHR:
//
old
MSHR:
// 1. receive req
// 2. send acquire req
// 3. receive grant resp
...
...
@@ -72,7 +75,10 @@ class MissEntry(edge: TLEdgeOut) extends DCacheModule
// See Tilelink spec 1.8.1 page 69
// A slave should not issue a Probe if there is a pending GrantAck on the block. Once the Probe is
// issued, the slave should not issue further Probes on that block until it receives a ProbeAck.
val
s_invalid
::
s_refill_req
::
s_refill_resp
::
s_main_pipe_req
::
s_main_pipe_resp
::
s_mem_finish
::
Nil
=
Enum
(
6
)
// new MSHR:
// send finish to end the transaction before sending pipe_req
val
s_invalid
::
s_refill_req
::
s_refill_resp
::
s_mem_finish
::
s_main_pipe_req
::
s_main_pipe_resp
::
Nil
=
Enum
(
6
)
val
state
=
RegInit
(
s_invalid
)
...
...
@@ -147,6 +153,9 @@ class MissEntry(edge: TLEdgeOut) extends DCacheModule
io
.
pipe_req
.
valid
:=
false
.
B
io
.
pipe_req
.
bits
:=
DontCare
io
.
block_addr
.
valid
:=
state
===
s_mem_finish
||
state
===
s_main_pipe_req
||
state
===
s_main_pipe_resp
io
.
block_addr
.
bits
:=
req
.
addr
when
(
state
=/=
s_invalid
)
{
XSDebug
(
"entry: %d state: %d\n"
,
io
.
id
,
state
)
req
.
dump
()
...
...
@@ -277,7 +286,7 @@ class MissEntry(edge: TLEdgeOut) extends DCacheModule
grantack
.
bits
:=
edge
.
GrantAck
(
io
.
mem_grant
.
bits
)
grant_param
:=
io
.
mem_grant
.
bits
.
param
state
:=
s_m
ain_pipe_req
state
:=
s_m
em_finish
}
}
...
...
@@ -316,7 +325,7 @@ class MissEntry(edge: TLEdgeOut) extends DCacheModule
when
(
state
===
s_main_pipe_resp
)
{
when
(
io
.
pipe_resp
.
fire
())
{
state
:=
s_
mem_finish
state
:=
s_
invalid
}
}
...
...
@@ -326,7 +335,7 @@ class MissEntry(edge: TLEdgeOut) extends DCacheModule
when
(
io
.
mem_finish
.
fire
())
{
grantack
.
valid
:=
false
.
B
state
:=
s_
invalid
state
:=
s_
main_pipe_req
}
}
}
...
...
@@ -344,6 +353,10 @@ class MissQueue(edge: TLEdgeOut) extends DCacheModule with HasTLDump
val
pipe_req
=
DecoupledIO
(
new
MainPipeReq
)
val
pipe_resp
=
Flipped
(
ValidIO
(
new
MainPipeResp
))
// block probe
val
probe_req
=
Input
(
UInt
(
PAddrBits
.
W
))
val
probe_block
=
Output
(
Bool
())
})
val
pipe_req_arb
=
Module
(
new
RRArbiter
(
new
MainPipeReq
,
cfg
.
nMissEntries
))
...
...
@@ -353,6 +366,7 @@ class MissQueue(edge: TLEdgeOut) extends DCacheModule with HasTLDump
val
primary_ready
=
Wire
(
Vec
(
cfg
.
nMissEntries
,
Bool
()))
val
secondary_ready
=
Wire
(
Vec
(
cfg
.
nMissEntries
,
Bool
()))
val
secondary_reject
=
Wire
(
Vec
(
cfg
.
nMissEntries
,
Bool
()))
val
probe_block_vec
=
Wire
(
Vec
(
cfg
.
nMissEntries
,
Bool
()))
// try merging with existing reqs
val
merge
=
secondary_ready
.
asUInt
.
orR
...
...
@@ -390,6 +404,7 @@ class MissQueue(edge: TLEdgeOut) extends DCacheModule with HasTLDump
primary_ready
(
i
)
:=
entry
.
io
.
primary_ready
secondary_ready
(
i
)
:=
entry
.
io
.
secondary_ready
secondary_reject
(
i
)
:=
entry
.
io
.
secondary_reject
probe_block_vec
(
i
)
:=
entry
.
io
.
block_addr
.
valid
&&
entry
.
io
.
block_addr
.
bits
===
io
.
probe_req
entry
.
io
.
req
:=
io
.
req
.
bits
// entry refill
...
...
@@ -440,6 +455,7 @@ class MissQueue(edge: TLEdgeOut) extends DCacheModule with HasTLDump
io
.
pipe_req
<>
pipe_req_arb
.
io
.
out
io
.
probe_block
:=
probe_block_vec
.
asUInt
.
orR
// print all input/output requests for debug purpose
...
...
@@ -492,6 +508,10 @@ class MissQueue(edge: TLEdgeOut) extends DCacheModule with HasTLDump
io
.
mem_finish
.
bits
.
dump
}
when
(
io
.
probe_block
)
{
XSDebug
(
p
"block probe req ${Hexadecimal(io.probe_req)}\n"
)
}
if
(!
env
.
FPGAPlatform
&&
!
env
.
DualCore
)
{
ExcitingUtils
.
addSource
(
io
.
req
.
fire
(),
"perfCntDCacheMiss"
,
Perf
)
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录