Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenXiangShan
XiangShan
提交
33426ec2
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,发现更多精彩内容 >>
提交
33426ec2
编写于
10月 10, 2020
作者:
A
Allen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
MissQueue, WBU: sync with prober on writebacked block.
上级
99561ce7
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
50 addition
and
5 deletion
+50
-5
src/main/scala/xiangshan/cache/dcacheWrapper.scala
src/main/scala/xiangshan/cache/dcacheWrapper.scala
+7
-1
src/main/scala/xiangshan/cache/missQueue.scala
src/main/scala/xiangshan/cache/missQueue.scala
+32
-0
src/main/scala/xiangshan/cache/wbu.scala
src/main/scala/xiangshan/cache/wbu.scala
+11
-4
未找到文件。
src/main/scala/xiangshan/cache/dcacheWrapper.scala
浏览文件 @
33426ec2
...
...
@@ -410,6 +410,9 @@ class DCacheImp(outer: DCache) extends LazyModuleImp(outer) with HasDCacheParame
prober
.
io
.
wb_resp
:=
wb
.
io
.
resp
wb
.
io
.
mem_grant
:=
bus
.
d
.
fire
()
&&
bus
.
d
.
bits
.
source
===
cfg
.
nMissEntries
.
U
missQueue
.
io
.
probe_wb_req
.
valid
:=
prober
.
io
.
wb_req
.
fire
()
missQueue
.
io
.
probe_wb_req
.
bits
:=
prober
.
io
.
wb_req
.
bits
TLArbiter
.
lowestFromSeq
(
edge
,
bus
.
c
,
Seq
(
prober
.
io
.
rep
,
wb
.
io
.
release
))
// synchronization stuff
...
...
@@ -469,7 +472,10 @@ class DCacheImp(outer: DCache) extends LazyModuleImp(outer) with HasDCacheParame
val
miss_idx_matches
=
VecInit
(
missQueue
.
io
.
block_probe_idxes
map
(
entry
=>
entry
.
valid
&&
entry
.
bits
===
get_idx
(
addr
)))
val
miss_idx_match
=
miss_idx_matches
.
reduce
(
_
||
_
)
store_addr_match
||
atomics_addr_match
||
lrsc_addr_match
||
miss_idx_match
// the missed req
val
miss_req_idx_match
=
missReq
.
fire
()
&&
get_idx
(
missReq
.
bits
.
addr
)
===
get_idx
(
addr
)
store_addr_match
||
atomics_addr_match
||
lrsc_addr_match
||
miss_idx_match
||
miss_req_idx_match
}
def
block_decoupled
[
T
<:
Data
](
source
:
DecoupledIO
[
T
],
sink
:
DecoupledIO
[
T
],
block_signal
:
Bool
)
=
{
...
...
src/main/scala/xiangshan/cache/missQueue.scala
浏览文件 @
33426ec2
...
...
@@ -57,6 +57,9 @@ class MissEntry(edge: TLEdgeOut) extends DCacheModule
val
wb_req
=
DecoupledIO
(
new
WritebackReq
(
edge
.
bundle
.
sourceBits
))
val
wb_resp
=
Input
(
Bool
())
// watch prober's write back requests
val
probe_wb_req
=
Flipped
(
ValidIO
(
new
WritebackReq
(
edge
.
bundle
.
sourceBits
)))
})
// MSHR:
...
...
@@ -356,6 +359,32 @@ class MissEntry(edge: TLEdgeOut) extends DCacheModule
}
}
// during refill, probe may step in, it may release our blocks
// if it releases the block we are trying to acquire, we don't care, since we will get it back eventually
// but we need to know whether it releases the block we are trying to evict
val
prober_writeback_our_block
=
(
state
===
s_refill_req
||
state
===
s_refill_resp
)
&&
io
.
probe_wb_req
.
valid
&&
!
io
.
probe_wb_req
.
bits
.
voluntary
&&
io
.
probe_wb_req
.
bits
.
tag
===
req_old_meta
.
tag
&&
io
.
probe_wb_req
.
bits
.
idx
===
req_idx
&&
io
.
probe_wb_req
.
bits
.
way_en
===
req_way_en
&&
needs_writeback
def
onShrink
(
param
:
UInt
)
:
ClientMetadata
=
{
import
freechips.rocketchip.tilelink.ClientStates._
import
freechips.rocketchip.tilelink.TLPermissions._
val
state
=
MuxLookup
(
param
,
Nothing
,
Seq
(
TtoB
->
Branch
,
TtoN
->
Nothing
,
BtoN
->
Nothing
))
ClientMetadata
(
state
)
}
when
(
prober_writeback_our_block
)
{
req_old_meta
.
coh
:=
onShrink
(
io
.
probe_wb_req
.
bits
.
param
)
}
// --------------------------------------------
// data write
when
(
state
===
s_data_write_req
)
{
io
.
refill
.
valid
:=
true
.
B
io
.
refill
.
bits
.
addr
:=
req_block_addr
...
...
@@ -445,6 +474,8 @@ class MissQueue(edge: TLEdgeOut) extends DCacheModule with HasTLDump
val
wb_req
=
Decoupled
(
new
WritebackReq
(
edge
.
bundle
.
sourceBits
))
val
wb_resp
=
Input
(
Bool
())
val
probe_wb_req
=
Flipped
(
ValidIO
(
new
WritebackReq
(
edge
.
bundle
.
sourceBits
)))
val
inflight_req_idxes
=
Output
(
Vec
(
cfg
.
nMissEntries
,
Valid
(
UInt
())))
val
inflight_req_block_addrs
=
Output
(
Vec
(
cfg
.
nMissEntries
,
Valid
(
UInt
())))
...
...
@@ -495,6 +526,7 @@ class MissQueue(edge: TLEdgeOut) extends DCacheModule with HasTLDump
wb_req_arb
.
io
.
in
(
i
)
<>
entry
.
io
.
wb_req
entry
.
io
.
wb_resp
:=
io
.
wb_resp
entry
.
io
.
probe_wb_req
<>
io
.
probe_wb_req
entry
.
io
.
mem_grant
.
valid
:=
false
.
B
entry
.
io
.
mem_grant
.
bits
:=
DontCare
...
...
src/main/scala/xiangshan/cache/wbu.scala
浏览文件 @
33426ec2
...
...
@@ -56,10 +56,17 @@ class WritebackUnit(edge: TLEdgeOut) extends DCacheModule {
when
(
state
===
s_invalid
)
{
io
.
req
.
ready
:=
true
.
B
when
(
io
.
req
.
fire
())
{
state
:=
s_data_read_req
data_req_cnt
:=
0.
U
req
:=
io
.
req
.
bits
acked
:=
false
.
B
// for report types: TtoT, BtoB, NtoN, we do nothing
import
freechips.rocketchip.tilelink.TLPermissions._
def
do_nothing
(
x
:
UInt
)
=
x
>
BtoN
when
(
do_nothing
(
io
.
req
.
bits
.
param
))
{
state
:=
s_resp
}
.
otherwise
{
state
:=
s_data_read_req
data_req_cnt
:=
0.
U
req
:=
io
.
req
.
bits
acked
:=
false
.
B
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录