Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenXiangShan
XiangShan
提交
b0ed7239
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 搜索 >>
提交
b0ed7239
编写于
7月 18, 2022
作者:
L
Lingrui98
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ftq: use previous update_target as difftest
上级
6bf9b30d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
14 addition
and
0 deletion
+14
-0
src/main/scala/xiangshan/frontend/NewFtq.scala
src/main/scala/xiangshan/frontend/NewFtq.scala
+14
-0
未找到文件。
src/main/scala/xiangshan/frontend/NewFtq.scala
浏览文件 @
b0ed7239
...
...
@@ -547,6 +547,7 @@ class Ftq(implicit p: Parameters) extends XSModule with HasCircularQueuePtrHelpe
// multi-write
val
update_target
=
Reg
(
Vec
(
FtqSize
,
UInt
(
VAddrBits
.
W
)))
// could be taken target or fallThrough //TODO: remove this
val
newest_entry_target
=
Reg
(
UInt
(
VAddrBits
.
W
))
val
newest_entry_ptr
=
Reg
(
new
FtqPtr
)
val
cfiIndex_vec
=
Reg
(
Vec
(
FtqSize
,
ValidUndirectioned
(
UInt
(
log2Ceil
(
PredictWidth
).
W
))))
...
...
@@ -578,6 +579,7 @@ class Ftq(implicit p: Parameters) extends XSModule with HasCircularQueuePtrHelpe
mispredict_vec
(
last_cycle_bpu_in_idx
)
:=
WireInit
(
VecInit
(
Seq
.
fill
(
PredictWidth
)(
false
.
B
)))
pred_stage
(
last_cycle_bpu_in_idx
)
:=
last_cycle_bpu_in_stage
update_target
(
last_cycle_bpu_in_idx
)
:=
last_cycle_bpu_target
// TODO: remove this
newest_entry_target
:=
last_cycle_bpu_target
newest_entry_ptr
:=
last_cycle_bpu_in_ptr
}
...
...
@@ -645,12 +647,14 @@ class Ftq(implicit p: Parameters) extends XSModule with HasCircularQueuePtrHelpe
val
entry_is_to_send
=
WireInit
(
entry_fetch_status
(
ifuPtr
.
value
)
===
f_to_send
)
val
entry_ftq_offset
=
WireInit
(
cfiIndex_vec
(
ifuPtr
.
value
))
val
entry_next_addr
=
Wire
(
UInt
(
VAddrBits
.
W
))
val
diff_entry_next_addr
=
WireInit
(
update_target
(
ifuPtr
.
value
))
//TODO: remove this
when
(
last_cycle_bpu_in
&&
bpu_in_bypass_ptr
===
ifuPtr
)
{
toIfuPcBundle
:=
bpu_in_bypass_buf
.
head
entry_is_to_send
:=
true
.
B
entry_next_addr
:=
last_cycle_bpu_target
entry_ftq_offset
:=
last_cycle_cfiIndex
diff_entry_next_addr
:=
last_cycle_bpu_target
// TODO: remove this
}.
elsewhen
(
last_cycle_to_ifu_fire
)
{
toIfuPcBundle
:=
RegNext
(
ftq_pc_mem
.
io
.
ifuPtrPlus1_rdata
)
toICachePcBundle
:=
ftq_pc_mem
.
io
.
ifuPtrPlus1_rdata
...
...
@@ -685,6 +689,11 @@ class Ftq(implicit p: Parameters) extends XSModule with HasCircularQueuePtrHelpe
bypassWrtie
.
nextlineStart
:=
bpu_in_bypass_buf
.
tail
(
i
).
nextLineAddr
}
// TODO: remove this
XSError
(
io
.
toIfu
.
req
.
valid
&&
diff_entry_next_addr
=/=
entry_next_addr
,
"\nifu_req_target wrong! ifuPtr: %d, entry_next_addr: %d, diff_entry_next_addr: %d\n"
,
ifuPtr
,
entry_next_addr
,
diff_entry_next_addr
)
// when fall through is smaller in value than start address, there must be a false hit
when
(
toIfuPcBundle
.
fallThruError
&&
entry_hit_status
(
ifuPtr
.
value
)
===
h_hit
)
{
when
(
io
.
toIfu
.
req
.
fire
&&
...
...
@@ -883,6 +892,7 @@ class Ftq(implicit p: Parameters) extends XSModule with HasCircularQueuePtrHelpe
when
(
newest_entry_ptr
===
r_ptr
&&
isFull
(
newest_entry_ptr
,
commPtr
)){
newest_entry_target
:=
redirect
.
bits
.
cfiUpdate
.
target
}
update_target
(
r_idx
)
:=
redirect
.
bits
.
cfiUpdate
.
target
// TODO: remove this
if
(
isBackend
)
{
mispredict_vec
(
r_idx
)(
r_offset
)
:=
r_mispred
}
...
...
@@ -1005,6 +1015,7 @@ class Ftq(implicit p: Parameters) extends XSModule with HasCircularQueuePtrHelpe
})
val
can_commit_hit
=
entry_hit_status
(
commPtr
.
value
)
val
commit_hit
=
RegNext
(
can_commit_hit
)
val
diff_commit_target
=
RegNext
(
update_target
)
// TODO: remove this
val
commit_stage
=
RegNext
(
pred_stage
(
commPtr
.
value
))
val
commit_valid
=
commit_hit
===
h_hit
||
commit_cfi
.
valid
// hit or taken
...
...
@@ -1026,6 +1037,9 @@ class Ftq(implicit p: Parameters) extends XSModule with HasCircularQueuePtrHelpe
}
}
// TODO: remove this
XSError
(
do_commit
&&
diff_commit_target
=/=
commit_target
,
"\ncommit target should be the same as update target\n"
)
io
.
toBpu
.
update
:=
DontCare
io
.
toBpu
.
update
.
valid
:=
commit_valid
&&
do_commit
val
update
=
io
.
toBpu
.
update
.
bits
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录