Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenXiangShan
XiangShan
提交
672664b1
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 搜索 >>
提交
672664b1
编写于
8月 16, 2021
作者:
J
JinYue
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TLB: add multi-port support for blocking tlb
上级
14405578
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
25 addition
and
24 deletion
+25
-24
src/main/scala/xiangshan/cache/TLB.scala
src/main/scala/xiangshan/cache/TLB.scala
+10
-8
src/main/scala/xiangshan/decoupled-frontend/Frontend.scala
src/main/scala/xiangshan/decoupled-frontend/Frontend.scala
+8
-6
src/main/scala/xiangshan/decoupled-frontend/IFU.scala
src/main/scala/xiangshan/decoupled-frontend/IFU.scala
+1
-6
src/main/scala/xiangshan/decoupled-frontend/PreDecode.scala
src/main/scala/xiangshan/decoupled-frontend/PreDecode.scala
+5
-3
src/main/scala/xiangshan/decoupled-frontend/uBTB.scala
src/main/scala/xiangshan/decoupled-frontend/uBTB.scala
+1
-1
未找到文件。
src/main/scala/xiangshan/cache/TLB.scala
浏览文件 @
672664b1
...
...
@@ -615,14 +615,16 @@ object TLB {
// tlb.io.requestor(i).resp.ready := in(i).resp.ready
}
}
else
{
// itlb
require
(
width
==
1
)
tlb
.
io
.
requestor
(
0
).
req
.
valid
:=
in
(
0
).
req
.
valid
tlb
.
io
.
requestor
(
0
).
req
.
bits
:=
in
(
0
).
req
.
bits
in
(
0
).
req
.
ready
:=
!
tlb
.
io
.
requestor
(
0
).
resp
.
bits
.
miss
&&
in
(
0
).
resp
.
ready
&&
tlb
.
io
.
requestor
(
0
).
req
.
ready
in
(
0
).
resp
.
valid
:=
tlb
.
io
.
requestor
(
0
).
resp
.
valid
&&
!
tlb
.
io
.
requestor
(
0
).
resp
.
bits
.
miss
in
(
0
).
resp
.
bits
:=
tlb
.
io
.
requestor
(
0
).
resp
.
bits
tlb
.
io
.
requestor
(
0
).
resp
.
ready
:=
in
(
0
).
resp
.
ready
//require(width == 1)
(
0
until
width
).
map
{
i
=>
tlb
.
io
.
requestor
(
i
).
req
.
valid
:=
in
(
i
).
req
.
valid
tlb
.
io
.
requestor
(
i
).
req
.
bits
:=
in
(
i
).
req
.
bits
in
(
i
).
req
.
ready
:=
!
tlb
.
io
.
requestor
(
i
).
resp
.
bits
.
miss
&&
in
(
i
).
resp
.
ready
&&
tlb
.
io
.
requestor
(
i
).
req
.
ready
in
(
i
).
resp
.
valid
:=
tlb
.
io
.
requestor
(
i
).
resp
.
valid
&&
!
tlb
.
io
.
requestor
(
i
).
resp
.
bits
.
miss
in
(
i
).
resp
.
bits
:=
tlb
.
io
.
requestor
(
i
).
resp
.
bits
tlb
.
io
.
requestor
(
i
).
resp
.
ready
:=
in
(
i
).
resp
.
ready
}
}
tlb
.
io
.
ptw
...
...
src/main/scala/xiangshan/decoupled-frontend/Frontend.scala
浏览文件 @
672664b1
...
...
@@ -68,7 +68,14 @@ class FrontendImp (outer: Frontend) extends LazyModuleImp(outer)
val
icacheMeta
=
Module
(
new
ICacheMetaArray
)
val
icacheData
=
Module
(
new
ICacheDataArray
)
val
icacheMissQueue
=
Module
(
new
ICacheMissQueue
)
val
itlb
=
Module
(
new
TLB
(
Width
=
2
,
isDtlb
=
false
))
io
.
ptw
<>
TLB
(
in
=
Seq
(
ifu
.
io
.
iTLBInter
(
0
),
ifu
.
io
.
iTLBInter
(
1
)),
sfence
=
io
.
sfence
,
csr
=
io
.
tlbCsr
,
width
=
2
,
isDtlb
=
false
,
shouldBlock
=
true
)
//TODO: modules need to be removed
val
instrUncache
=
outer
.
instrUncache
.
module
val
l1plusPrefetcher
=
Module
(
new
L1plusPrefetcher
)
...
...
@@ -85,11 +92,6 @@ class FrontendImp (outer: Frontend) extends LazyModuleImp(outer)
ifu
.
io
.
icacheInter
.
fromIMeta
<>
icacheMeta
.
io
.
readResp
ifu
.
io
.
icacheInter
.
toIData
<>
icacheData
.
io
.
read
ifu
.
io
.
icacheInter
.
fromIData
<>
icacheData
.
io
.
readResp
//IFU-ITLB
ifu
.
io
.
iTLBInter
<>
itlb
.
io
.
requestor
io
.
ptw
<>
itlb
.
io
.
ptw
io
.
sfence
<>
itlb
.
io
.
sfence
io
.
tlbCsr
<>
itlb
.
io
.
csr
for
(
i
<-
0
until
2
){
...
...
src/main/scala/xiangshan/decoupled-frontend/IFU.scala
浏览文件 @
672664b1
...
...
@@ -44,7 +44,7 @@ class NewIFUIO(implicit p: Parameters) extends XSBundle {
val
ftqInter
=
new
FtqInterface
val
icacheInter
=
new
ICacheInterface
val
toIbuffer
=
Decoupled
(
new
FetchToIBuffer
)
val
iTLBInter
=
Vec
(
2
,
new
TlbRequestIO
)
val
iTLBInter
=
Vec
(
2
,
new
Block
TlbRequestIO
)
}
// record the situation in which fallThruAddr falls into
...
...
@@ -60,7 +60,6 @@ class IfuToPreDecode(implicit p: Parameters) extends XSBundle {
val
startAddr
=
UInt
(
VAddrBits
.
W
)
val
fallThruAddr
=
UInt
(
VAddrBits
.
W
)
val
ftqOffset
=
Valid
(
UInt
(
log2Ceil
(
PredictWidth
).
W
))
val
startRange
=
Vec
(
PredictWidth
,
Bool
())
val
target
=
UInt
(
VAddrBits
.
W
)
val
pageFault
=
Vec
(
2
,
Bool
())
val
accessFault
=
Vec
(
2
,
Bool
())
...
...
@@ -374,12 +373,8 @@ class NewIFU(implicit p: Parameters) extends XSModule with HasICacheParameters
preDecoderIn
.
target
:=
f2_ftq_req
.
target
preDecoderIn
.
oversize
:=
f2_ftq_req
.
oversize
preDecoderIn
.
lastHalfMatch
:=
f2_lastHalfMatch
<<<<<<<
HEAD
preDecoderIn
.
startRange
:=
f2_ldreplay_valids
.
asTypeOf
(
Vec
(
PredictWidth
,
Bool
())
)
preDecoderIn
.
pageFault
:=
f2_except_pf
preDecoderIn
.
accessFault
:=
f2_except_af
=======
>>>>>>>
decoupled
-
frontend
predecodeOutValid
:=
fetchFinish
...
...
src/main/scala/xiangshan/decoupled-frontend/PreDecode.scala
浏览文件 @
672664b1
...
...
@@ -114,13 +114,15 @@ class PreDecode(implicit p: Parameters) extends XSModule with HasPdConst{
val
rawInsts
=
if
(
HasCExtension
)
VecInit
((
0
until
PredictWidth
).
map
(
i
=>
Cat
(
data
(
i
+
1
),
data
(
i
))))
else
VecInit
((
0
until
PredictWidth
).
map
(
i
=>
data
(
i
)))
val
nextLinePC
=
align
(
pcStart
,
64
)
+
64.
U
for
(
i
<-
0
until
PredictWidth
)
{
//TODO: Terrible timing for pc comparing
val
hasPageFault
=
instRange
(
i
)
&&
validStart
(
i
)
&&
((
io
.
out
.
pc
(
i
)
<
align
(
realEndPC
,
64
)
&&
pageFault
(
0
))
||
(
io
.
out
.
pc
(
i
)
>
align
(
realEndPC
,
64
)
&&
pageFault
(
1
)))
val
hasAccessFault
=
instRange
(
i
)
&&
validStart
(
i
)
&&
((
io
.
out
.
pc
(
i
)
<
align
(
realEndPC
,
64
)
&&
accessFault
(
0
))
||
(
io
.
out
.
pc
(
i
)
>
align
(
realEndPC
,
64
)
&&
accessFault
(
1
)))
val
hasPageFault
=
validStart
(
i
)
&&
((
io
.
out
.
pc
(
i
)
<
nextLinePC
&&
pageFault
(
0
))
||
(
io
.
out
.
pc
(
i
)
>
nextLinePC
&&
pageFault
(
1
)))
val
hasAccessFault
=
validStart
(
i
)
&&
((
io
.
out
.
pc
(
i
)
<
nextLinePC
&&
accessFault
(
0
))
||
(
io
.
out
.
pc
(
i
)
>
nextLinePC
&&
accessFault
(
1
)))
val
exception
=
hasPageFault
||
hasAccessFault
val
inst
=
Mux
(
exception
,
NOP
,
WireInit
(
rawInsts
(
i
)))
val
inst
=
Mux
(
exception
,
NOP
,
WireInit
(
rawInsts
(
i
)))
val
expander
=
Module
(
new
RVCExpander
)
val
isFirstInBlock
=
i
.
U
===
0.
U
...
...
src/main/scala/xiangshan/decoupled-frontend/uBTB.scala
浏览文件 @
672664b1
...
...
@@ -220,7 +220,7 @@ class MicroBTB(implicit p: Parameters) extends BasePredictor
val
read_resps
=
banks
.
read_resp
XSDebug
(
p
"uBTB entry, read_pc=${Hexadecimal(s1_pc)}\n"
)
XSDebug
(
p
"v=${read_resps.valid}, brValids=${Binary(read_resps.brValids.asUInt)}, jmpValid=${read_resps.jmpValid}, pred0=${Binary(read_resps.pred(0).asUInt)}, pred1=${Binary(read_resps.pred(1).asUInt)}, hit=${read_resps.hit}\n"
)
//
XSDebug(p"v=${read_resps.valid}, brValids=${Binary(read_resps.brValids.asUInt)}, jmpValid=${read_resps.jmpValid}, pred0=${Binary(read_resps.pred(0).asUInt)}, pred1=${Binary(read_resps.pred(1).asUInt)}, hit=${read_resps.hit}\n")
// XSDebug(p"v=${read_resps.valid}, brValids=${Binary(read_resps.brValids.asUInt)}, jmpValid=${read_resps.jmpValid}, pred0=${Binary(read_resps.pred(0).asUInt)}, pred1=${Binary(read_resps.pred(1).asUInt)}, hit=${read_resps.hit}\n")
// XSDebug(p"v=${read_resps.valid}, brValids=${Binary(read_resps.brValids.asUInt)}, jmpValid=${read_resps.jmpValid}, pred0=${Binary(read_resps.pred(0).asUInt)}, hit=${read_resps.hit}\n")
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录