Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenXiangShan
XiangShan
提交
2706ddbe
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 搜索 >>
提交
2706ddbe
编写于
7月 27, 2021
作者:
L
Lingrui98
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ftq: send request derived from predicted info to ifu
上级
64d17799
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
11 deletion
+17
-11
src/main/scala/xiangshan/decoupled-frontend/NewFtq.scala
src/main/scala/xiangshan/decoupled-frontend/NewFtq.scala
+17
-11
未找到文件。
src/main/scala/xiangshan/decoupled-frontend/NewFtq.scala
浏览文件 @
2706ddbe
...
...
@@ -96,6 +96,11 @@ class Ftq_1R_SRAMEntry(implicit p: Parameters) extends XSBundle {
val
meta
=
UInt
(
120.
W
)
}
class
Ftq_Pred_Info
(
implicit
p
:
Parameters
)
extends
XSBundle
{
val
target
=
UInt
(
VAddrBits
.
W
)
val
cfiIndex
=
ValidUndirectioned
(
UInt
(
log2Ceil
(
PredictWidth
).
W
))
}
class
FtqEntry
(
implicit
p
:
Parameters
)
extends
XSBundle
{
val
startAddr
=
UInt
(
VAddrBits
.
W
)
val
fallThruAddr
=
UInt
(
VAddrBits
.
W
)
...
...
@@ -338,10 +343,11 @@ class Ftq(implicit p: Parameters) extends XSModule with HasCircularQueuePtrHelpe
ftq_redirect_sram
.
io
.
wdata
.
rasEntry
:=
io
.
fromBpu
.
resp
.
bits
.
rasTop
ftq_redirect_sram
.
io
.
wdata
.
specCnt
:=
io
.
fromBpu
.
resp
.
bits
.
specCnt
val
pred_target_sram
=
Module
(
new
FtqNRSRAM
(
UInt
(
VAddrBits
.
W
),
1
))
pred_target_sram
.
io
.
wen
:=
enq_fire
pred_target_sram
.
io
.
waddr
:=
bpuPtr
.
value
pred_target_sram
.
io
.
wdata
:=
io
.
fromBpu
.
resp
.
bits
.
preds
.
target
val
pred_info_sram
=
Module
(
new
FtqNRSRAM
(
new
Ftq_Pred_Info
,
1
))
pred_info_sram
.
io
.
wen
:=
enq_fire
pred_info_sram
.
io
.
waddr
:=
bpuPtr
.
value
pred_info_sram
.
io
.
wdata
.
target
:=
io
.
fromBpu
.
resp
.
bits
.
preds
.
target
val
ftq_meta_1r_sram
=
Module
(
new
FtqNRSRAM
(
new
Ftq_1R_SRAMEntry
,
1
))
ftq_meta_1r_sram
.
io
.
wen
:=
enq_fire
...
...
@@ -405,6 +411,7 @@ class Ftq(implicit p: Parameters) extends XSModule with HasCircularQueuePtrHelpe
enq_cfiIndex
.
valid
:=
real_taken_mask
.
orR
enq_cfiIndex
.
bits
:=
ParallelPriorityMux
(
real_taken_mask
,
offset_vec
)
cfiIndex_vec
(
enqIdx
)
:=
enq_cfiIndex
pred_info_sram
.
io
.
wdata
.
cfiIndex
:=
enq_cfiIndex
mispredict_vec
(
enqIdx
)
:=
WireInit
(
VecInit
(
Seq
.
fill
(
16
)(
false
.
B
)))
update_target
(
enqIdx
)
:=
preds
.
target
}
...
...
@@ -471,8 +478,6 @@ class Ftq(implicit p: Parameters) extends XSModule with HasCircularQueuePtrHelpe
}
}
XSError
(
pdWb
.
valid
&&
pdWb
.
bits
.
misOffset
.
valid
&&
entry_replay_status
(
ifu_wb_idx
)
===
l_replaying
,
"unexpected misprediction detected by predecode during replay\n"
)
// ****************************************************************
// **************************** to ifu ****************************
...
...
@@ -496,13 +501,12 @@ class Ftq(implicit p: Parameters) extends XSModule with HasCircularQueuePtrHelpe
// read pc and target
ftq_pc_mem
.
io
.
raddr
.
init
.
last
:=
ifuPtr
.
value
pred_
target
_sram
.
io
.
raddr
(
0
)
:=
ifuPtr
.
value
pred_
target
_sram
.
io
.
ren
(
0
)
:=
to_buf_fire
pred_
info
_sram
.
io
.
raddr
(
0
)
:=
ifuPtr
.
value
pred_
info
_sram
.
io
.
ren
(
0
)
:=
to_buf_fire
val
loadReplayOffset
=
RegInit
(
0.
U
.
asTypeOf
(
Valid
(
UInt
(
log2Ceil
(
FtqSize
).
W
))))
when
(
to_buf_fire
)
{
ifu_req_buf
.
bits
.
ftqIdx
:=
ifuPtr
ifu_req_buf
.
bits
.
ftqOffset
:=
cfiIndex_vec
(
ifuPtr
.
value
)
ifu_req_buf
.
bits
.
ldReplayOffset
:=
loadReplayOffset
when
(
loadReplayOffset
.
valid
)
{
loadReplayOffset
.
valid
:=
false
.
B
...
...
@@ -512,7 +516,8 @@ class Ftq(implicit p: Parameters) extends XSModule with HasCircularQueuePtrHelpe
ifu_req_buf
.
bits
.
startAddr
:=
ftq_pc_mem
.
io
.
rdata
.
init
.
last
.
startAddr
ifu_req_buf
.
bits
.
fallThruAddr
:=
ftq_pc_mem
.
io
.
rdata
.
init
.
last
.
fallThruAddr
ifu_req_buf
.
bits
.
oversize
:=
ftq_pc_mem
.
io
.
rdata
.
init
.
last
.
oversize
ifu_req_buf
.
bits
.
target
:=
pred_target_sram
.
io
.
rdata
(
0
)
ifu_req_buf
.
bits
.
target
:=
pred_info_sram
.
io
.
rdata
(
0
).
target
ifu_req_buf
.
bits
.
ftqOffset
:=
pred_info_sram
.
io
.
rdata
(
0
).
cfiIndex
}
val
last_cycle_to_buf_fire
=
RegNext
(
to_buf_fire
)
...
...
@@ -522,7 +527,8 @@ class Ftq(implicit p: Parameters) extends XSModule with HasCircularQueuePtrHelpe
io
.
toIfu
.
req
.
bits
.
startAddr
:=
ftq_pc_mem
.
io
.
rdata
.
init
.
last
.
startAddr
io
.
toIfu
.
req
.
bits
.
fallThruAddr
:=
ftq_pc_mem
.
io
.
rdata
.
init
.
last
.
fallThruAddr
io
.
toIfu
.
req
.
bits
.
oversize
:=
ftq_pc_mem
.
io
.
rdata
.
init
.
last
.
oversize
io
.
toIfu
.
req
.
bits
.
target
:=
pred_target_sram
.
io
.
rdata
(
0
)
io
.
toIfu
.
req
.
bits
.
target
:=
pred_info_sram
.
io
.
rdata
(
0
).
target
io
.
toIfu
.
req
.
bits
.
ftqOffset
:=
pred_info_sram
.
io
.
rdata
(
0
).
cfiIndex
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录