Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenXiangShan
XiangShan
提交
12cedb6f
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 搜索 >>
提交
12cedb6f
编写于
1月 04, 2022
作者:
L
Lingrui98
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tage_sc: use seperate wrbypass for each branch slot and use more entries for wrbypass in SC
上级
5df98e43
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
24 addition
and
31 deletion
+24
-31
src/main/scala/xiangshan/frontend/NewFtq.scala
src/main/scala/xiangshan/frontend/NewFtq.scala
+1
-1
src/main/scala/xiangshan/frontend/SC.scala
src/main/scala/xiangshan/frontend/SC.scala
+9
-7
src/main/scala/xiangshan/frontend/Tage.scala
src/main/scala/xiangshan/frontend/Tage.scala
+14
-23
未找到文件。
src/main/scala/xiangshan/frontend/NewFtq.scala
浏览文件 @
12cedb6f
...
...
@@ -1011,7 +1011,7 @@ class Ftq(implicit p: Parameters) extends XSModule with HasCircularQueuePtrHelpe
XSPerfAccumulate
(
"to_ifu_stall"
,
io
.
toIfu
.
req
.
valid
&&
!
io
.
toIfu
.
req
.
ready
)
XSPerfAccumulate
(
"from_bpu_real_bubble"
,
!
enq
.
valid
&&
enq
.
ready
&&
allowBpuIn
)
XSPerfAccumulate
(
"bpu_to_
ftq
_bubble"
,
bpuPtr
===
ifuPtr
)
XSPerfAccumulate
(
"bpu_to_
ifu
_bubble"
,
bpuPtr
===
ifuPtr
)
val
from_bpu
=
io
.
fromBpu
.
resp
.
bits
def
in_entry_len_map_gen
(
resp
:
BranchPredictionBundle
)(
stage
:
String
)
=
{
...
...
src/main/scala/xiangshan/frontend/SC.scala
浏览文件 @
12cedb6f
...
...
@@ -121,23 +121,25 @@ class SCTable(val nRows: Int, val ctrBits: Int, val histLen: Int)(implicit p: Pa
waymask
=
updateWayMask
.
asUInt
)
val
wrBypassEntries
=
4
val
wrBypassEntries
=
16
val
wrbypass
=
Module
(
new
WrBypass
(
SInt
(
ctrBits
.
W
),
wrBypassEntries
,
log2Ceil
(
nRows
),
numWays
=
2
*
numBr
))
val
wrbypass
es
=
Seq
.
fill
(
numBr
)(
Module
(
new
WrBypass
(
SInt
(
ctrBits
.
W
),
wrBypassEntries
,
log2Ceil
(
nRows
),
numWays
=
2
)
))
for
(
i
<-
0
until
numBr
)
{
val
wrbypass
=
wrbypasses
(
i
)
val
ctrPos
=
io
.
update
.
tagePreds
(
i
)
val
altPos
=
!
io
.
update
.
tagePreds
(
i
)
val
bypass_ctr
=
wrbypass
.
io
.
hit_data
(
(
i
<<
1
).
U
|
ctrPos
)
val
bypass_ctr
=
wrbypass
.
io
.
hit_data
(
ctrPos
)
val
hit_and_valid
=
wrbypass
.
io
.
hit
&&
bypass_ctr
.
valid
val
oldCtr
=
Mux
(
hit_and_valid
,
bypass_ctr
.
bits
,
io
.
update
.
oldCtrs
(
i
))
update_wdata
(
i
)
:=
ctrUpdate
(
oldCtr
,
io
.
update
.
takens
(
i
))
wrbypass
.
io
.
wen
:=
io
.
update
.
mask
(
i
)
wrbypass
.
io
.
write_data
:=
update_wdata_packed
.
slice
(
2
*
i
,
2
*
i
+
2
)
wrbypass
.
io
.
write_idx
:=
update_idx
wrbypass
.
io
.
write_way_mask
.
map
(
_
:=
updateWayMask
.
slice
(
2
*
i
,
2
*
i
+
2
))
}
wrbypass
.
io
.
wen
:=
io
.
update
.
mask
.
reduce
(
_
||
_
)
wrbypass
.
io
.
write_data
:=
update_wdata_packed
// only one of them are used
wrbypass
.
io
.
write_idx
:=
update_idx
wrbypass
.
io
.
write_way_mask
.
map
(
_
:=
updateWayMask
)
val
u
=
io
.
update
XSDebug
(
io
.
req
.
valid
,
...
...
src/main/scala/xiangshan/frontend/Tage.scala
浏览文件 @
12cedb6f
...
...
@@ -339,50 +339,41 @@ class TageTable
ctr
.
andR
&&
taken
||
!
ctr
.
orR
&&
!
taken
}
val
bank_wrbypasses
=
Seq
.
fill
(
nBanks
)(
Module
(
new
WrBypass
(
UInt
(
TageCtrBits
.
W
),
perBankWrbypassEntries
,
log2Ceil
(
nRows
/
nBanks
),
numWays
=
numBr
,
tagWidth
=
tagLen
)))
val
bank_wrbypasses
=
Seq
.
fill
(
nBanks
)(
Seq
.
fill
(
numBr
)(
Module
(
new
WrBypass
(
UInt
(
TageCtrBits
.
W
),
perBankWrbypassEntries
,
log2Ceil
(
nRows
/
nBanks
),
tagWidth
=
tagLen
))
))
for
(
b
<-
0
until
nBanks
)
{
val
update_wdata
=
per_bank_update_wdata
(
b
)
val
wrbypass
=
bank_wrbypasses
(
b
)
val
not_silent_update
=
per_bank_not_silent_update
(
b
)
wrbypass
.
io
.
wen
:=
io
.
update
.
mask
.
reduce
(
_
||
_
)
&&
update_req_bank_1h
(
b
)
wrbypass
.
io
.
write_way_mask
.
map
(
_
:=
io
.
update
.
mask
)
wrbypass
.
io
.
write_data
:=
update_wdata
.
ctrs
val
bypass_ctrs
=
wrbypass
.
io
.
hit_data
for
(
i
<-
0
until
numBr
)
{
val
wrbypass
=
bank_wrbypasses
(
b
)(
i
)
wrbypass
.
io
.
wen
:=
io
.
update
.
mask
(
i
)
&&
update_req_bank_1h
(
b
)
wrbypass
.
io
.
write_data
(
0
)
:=
update_wdata
.
ctrs
(
i
)
val
bypass_ctr
=
wrbypass
.
io
.
hit_data
(
0
).
bits
update_wdata
.
ctrs
(
i
)
:=
Mux
(
io
.
update
.
alloc
,
Mux
(
io
.
update
.
takens
(
i
),
4.
U
,
3.
U
),
Mux
(
wrbypass
.
io
.
hit
&&
bypass_ctrs
(
i
).
valid
,
inc_ctr
(
bypass_ctr
s
(
i
).
bits
,
io
.
update
.
takens
(
i
)),
Mux
(
wrbypass
.
io
.
hit
,
inc_ctr
(
bypass_ctr
,
io
.
update
.
takens
(
i
)),
inc_ctr
(
io
.
update
.
oldCtrs
(
i
),
io
.
update
.
takens
(
i
))
)
)
not_silent_update
(
i
)
:=
Mux
(
wrbypass
.
io
.
hit
&&
bypass_ctrs
(
i
).
valid
,
!
silentUpdate
(
bypass_ctr
s
(
i
).
bits
,
io
.
update
.
takens
(
i
)),
Mux
(
wrbypass
.
io
.
hit
,
!
silentUpdate
(
bypass_ctr
,
io
.
update
.
takens
(
i
)),
!
silentUpdate
(
io
.
update
.
oldCtrs
(
i
),
io
.
update
.
takens
(
i
)))
||
io
.
update
.
alloc
wrbypass
.
io
.
write_idx
:=
get_bank_idx
(
update_idx
)
wrbypass
.
io
.
write_tag
.
map
(
_
:=
update_tag
)
}
update_wdata
.
valid
:=
true
.
B
update_wdata
.
tag
:=
update_tag
wrbypass
.
io
.
write_idx
:=
get_bank_idx
(
update_idx
)
wrbypass
.
io
.
write_tag
.
map
(
_
:=
update_tag
)
}
// silent_update_from_wrbypass := wrbypass.io.hit && silentUpdate(bypass_ctr, io.update.taken)
for
(
i
<-
0
until
numBr
)
{
for
(
b
<-
0
until
nBanks
)
{
val
wrbypass
=
bank_wrbypasses
(
b
)
val
wrbypass
=
bank_wrbypasses
(
b
)
(
i
)
XSPerfAccumulate
(
f
"tage_table_bank_${b}_wrbypass_enq_$i"
,
io
.
update
.
mask
(
i
)
&&
update_req_bank_1h
(
b
)
&&
!
wrbypass
.
io
.
hit
)
XSPerfAccumulate
(
f
"tage_table_bank_${b}_wrbypass_hit_$i"
,
io
.
update
.
mask
(
i
)
&&
update_req_bank_1h
(
b
)
&&
wrbypass
.
io
.
hit
)
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录