Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenXiangShan
XiangShan
提交
dd1ffd4d
X
XiangShan
项目概览
OpenXiangShan
/
XiangShan
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
dd1ffd4d
编写于
10月 26, 2020
作者:
W
William Wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[WIP] LoadUnit: reorg pipeline to avoid comb loop
上级
6c4a4192
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
24 addition
and
21 deletion
+24
-21
src/main/scala/xiangshan/mem/pipeline/LoadUnit.scala
src/main/scala/xiangshan/mem/pipeline/LoadUnit.scala
+24
-21
未找到文件。
src/main/scala/xiangshan/mem/pipeline/LoadUnit.scala
浏览文件 @
dd1ffd4d
...
...
@@ -22,11 +22,15 @@ class LoadUnit_S0 extends XSModule {
val
out
=
Decoupled
(
new
LsPipelineBundle
)
val
redirect
=
Flipped
(
ValidIO
(
new
Redirect
))
val
dtlbReq
=
Valid
(
new
TlbReq
)
val
dtlbResp
=
Flipped
(
Valid
(
new
TlbResp
))
val
tlbFeedback
=
ValidIO
(
new
TlbFeedback
)
val
dcacheReq
=
DecoupledIO
(
new
DCacheLoadReq
)
})
val
s0_uop
=
io
.
in
.
bits
.
uop
val
s0_vaddr
=
io
.
in
.
bits
.
src1
+
s0_uop
.
ctrl
.
imm
val
s0_paddr
=
io
.
dtlbResp
.
bits
.
paddr
val
s0_tlb_miss
=
io
.
dtlbResp
.
bits
.
miss
val
s0_mask
=
genWmask
(
s0_vaddr
,
s0_uop
.
ctrl
.
fuOpType
(
1
,
0
))
// query DTLB
...
...
@@ -37,6 +41,12 @@ class LoadUnit_S0 extends XSModule {
io
.
dtlbReq
.
bits
.
debug
.
pc
:=
s0_uop
.
cf
.
pc
io
.
dtlbReq
.
bits
.
debug
.
lsroqIdx
:=
s0_uop
.
lsroqIdx
// feedback tlb result to RS
// Note: can be moved to s1
io
.
tlbFeedback
.
valid
:=
io
.
out
.
valid
io
.
tlbFeedback
.
bits
.
hit
:=
!
s0_tlb_miss
io
.
tlbFeedback
.
bits
.
roqIdx
:=
s0_uop
.
roqIdx
// query DCache
io
.
dcacheReq
.
valid
:=
io
.
out
.
valid
io
.
dcacheReq
.
bits
.
cmd
:=
MemoryOpConstants
.
M_XRD
...
...
@@ -64,9 +74,12 @@ class LoadUnit_S0 extends XSModule {
io
.
out
.
valid
:=
io
.
in
.
valid
&&
!
s0_uop
.
needFlush
(
io
.
redirect
)
io
.
out
.
bits
:=
DontCare
io
.
out
.
bits
.
vaddr
:=
s0_vaddr
io
.
out
.
bits
.
paddr
:=
s0_paddr
io
.
out
.
bits
.
tlbMiss
:=
io
.
dtlbResp
.
bits
.
miss
io
.
out
.
bits
.
mask
:=
s0_mask
io
.
out
.
bits
.
uop
:=
s0_uop
io
.
out
.
bits
.
uop
.
cf
.
exceptionVec
(
loadAddrMisaligned
)
:=
!
addrAligned
io
.
out
.
bits
.
uop
.
cf
.
exceptionVec
(
loadPageFault
)
:=
io
.
dtlbResp
.
bits
.
excp
.
pf
.
ld
io
.
in
.
ready
:=
io
.
out
.
ready
}
...
...
@@ -79,30 +92,19 @@ class LoadUnit_S1 extends XSModule {
val
in
=
Flipped
(
Decoupled
(
new
LsPipelineBundle
))
val
out
=
Decoupled
(
new
LsPipelineBundle
)
val
redirect
=
Flipped
(
ValidIO
(
new
Redirect
))
val
tlbFeedback
=
ValidIO
(
new
TlbFeedback
)
val
dtlbResp
=
Flipped
(
Valid
(
new
TlbResp
))
val
forward
=
new
LoadForwardQueryIO
val
s1_kill
=
Output
(
Bool
())
//
val s1_kill = Output(Bool())
val
s1_paddr
=
Output
(
UInt
(
PAddrBits
.
W
))
})
val
s1_uop
=
io
.
in
.
bits
.
uop
val
s1_
tlb_miss
=
io
.
dtlbResp
.
bits
.
miss
val
s1_
paddr
=
io
.
dtlbResp
.
bits
.
paddr
val
s1_
paddr
=
io
.
in
.
bits
.
paddr
val
s1_
tlb_miss
=
io
.
in
.
bits
.
tlbMiss
val
s1_mmio
=
!
s1_tlb_miss
&&
AddressSpace
.
isMMIO
(
s1_paddr
)
// io.dtlbResp.ready := io.out.ready
io
.
tlbFeedback
.
valid
:=
io
.
out
.
valid
io
.
tlbFeedback
.
bits
.
hit
:=
!
s1_tlb_miss
io
.
tlbFeedback
.
bits
.
roqIdx
:=
s1_uop
.
roqIdx
// if tlb misses or mmio, kill prvious cycles dcache request
// TODO: kill dcache request when flushed
io
.
s1_kill
:=
s1_tlb_miss
||
s1_mmio
io
.
s1_paddr
:=
s1_paddr
io
.
forward
.
valid
:=
io
.
out
.
valid
io
.
forward
.
valid
:=
io
.
in
.
valid
// && !s1_uop.needFlush(io.redirect) will cause comb. loop
io
.
forward
.
paddr
:=
s1_paddr
io
.
forward
.
mask
:=
io
.
in
.
bits
.
mask
io
.
forward
.
lsroqIdx
:=
s1_uop
.
lsroqIdx
...
...
@@ -115,7 +117,6 @@ class LoadUnit_S1 extends XSModule {
io
.
out
.
bits
.
paddr
:=
s1_paddr
io
.
out
.
bits
.
mmio
:=
s1_mmio
io
.
out
.
bits
.
tlbMiss
:=
s1_tlb_miss
io
.
out
.
bits
.
uop
.
cf
.
exceptionVec
(
loadPageFault
)
:=
io
.
dtlbResp
.
bits
.
excp
.
pf
.
ld
io
.
in
.
ready
:=
io
.
out
.
ready
||
!
io
.
in
.
valid
...
...
@@ -195,7 +196,9 @@ class LoadUnit_S2 extends XSModule {
// TODO: ECC check
io
.
out
.
valid
:=
io
.
in
.
valid
&&
!
s2_uop
.
needFlush
(
io
.
redirect
)
io
.
out
.
valid
:=
io
.
in
.
valid
// && !s2_uop.needFlush(io.redirect) will cause comb. loop
// Inst will be canceled in store queue / lsroq,
// so we do not need to care about flush in load / store unit's out.valid
io
.
out
.
bits
:=
io
.
in
.
bits
io
.
out
.
bits
.
data
:=
rdataPartialLoad
io
.
out
.
bits
.
miss
:=
s2_cache_miss
&&
!
fullForward
...
...
@@ -224,15 +227,15 @@ class LoadUnit extends XSModule {
load_s0
.
io
.
in
<>
io
.
ldin
load_s0
.
io
.
redirect
<>
io
.
redirect
load_s0
.
io
.
dtlbReq
<>
io
.
dtlb
.
req
load_s0
.
io
.
dtlbResp
<>
io
.
dtlb
.
resp
load_s0
.
io
.
dcacheReq
<>
io
.
dcache
.
req
load_s0
.
io
.
tlbFeedback
<>
io
.
tlbFeedback
PipelineConnect
(
load_s0
.
io
.
out
,
load_s1
.
io
.
in
,
load_s1
.
io
.
out
.
fire
(),
false
.
B
)
io
.
dcache
.
s1_paddr
:=
load_s1
.
io
.
out
.
bits
.
paddr
load_s1
.
io
.
redirect
<>
io
.
redirect
load_s1
.
io
.
tlbFeedback
<>
io
.
tlbFeedback
load_s1
.
io
.
dtlbResp
<>
io
.
dtlb
.
resp
load_s1
.
io
.
s1_kill
<>
io
.
dcache
.
s1_kill
io
.
dcache
.
s1_kill
:=
DontCare
// FIXME
io
.
sbuffer
<>
load_s1
.
io
.
forward
io
.
lsroq
.
forward
<>
load_s1
.
io
.
forward
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录