Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenXiangShan
XiangShan
提交
4fb541a1
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 搜索 >>
提交
4fb541a1
编写于
10月 25, 2020
作者:
Y
Yinan Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mem,lsq: remove instIsStore and use commitType instead
上级
c56933fe
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
9 addition
and
36 deletion
+9
-36
src/main/scala/xiangshan/Bundle.scala
src/main/scala/xiangshan/Bundle.scala
+0
-20
src/main/scala/xiangshan/backend/dispatch/Dispatch1.scala
src/main/scala/xiangshan/backend/dispatch/Dispatch1.scala
+6
-4
src/main/scala/xiangshan/backend/fu/CSR.scala
src/main/scala/xiangshan/backend/fu/CSR.scala
+1
-2
src/main/scala/xiangshan/backend/rename/Rename.scala
src/main/scala/xiangshan/backend/rename/Rename.scala
+0
-1
src/main/scala/xiangshan/backend/roq/Roq.scala
src/main/scala/xiangshan/backend/roq/Roq.scala
+0
-1
src/main/scala/xiangshan/mem/lsqueue/separated/LSQWrapper.scala
...in/scala/xiangshan/mem/lsqueue/separated/LSQWrapper.scala
+1
-3
src/main/scala/xiangshan/mem/lsqueue/separated/LoadQueue.scala
...ain/scala/xiangshan/mem/lsqueue/separated/LoadQueue.scala
+0
-1
src/main/scala/xiangshan/mem/lsqueue/separated/StoreQueue.scala
...in/scala/xiangshan/mem/lsqueue/separated/StoreQueue.scala
+0
-4
src/main/scala/xiangshan/package.scala
src/main/scala/xiangshan/package.scala
+1
-0
未找到文件。
src/main/scala/xiangshan/Bundle.scala
浏览文件 @
4fb541a1
...
...
@@ -155,26 +155,6 @@ trait HasLSIdx { this: HasXSParameter =>
// Separate LSQ
val
lqIdx
=
new
LqPtr
val
sqIdx
=
new
SqPtr
val
instIsLoad
=
Bool
()
// }
// def isLoad(): Bool = instIsLoad
// def isLoadAfter(thatLqIdx: UInt): Bool = {
// Mux(
// lqIdx.head(1) === thatLqIdx.head(1),
// lqIdx.tail(1) > thatLqIdx.tail(1),
// lqIdx.tail(1) < thatLqIdx.tail(1)
// )
// }
// def isStoreAfter(thatSqIdx: UInt): Bool = {
// Mux(
// sqIdx.head(1) === thatSqIdx.head(1),
// sqIdx.tail(1) > thatSqIdx.tail(1),
// sqIdx.tail(1) < thatSqIdx.tail(1)
// )
// }
}
class
LSIdx
extends
XSBundle
with
HasLSIdx
{}
...
...
src/main/scala/xiangshan/backend/dispatch/Dispatch1.scala
浏览文件 @
4fb541a1
...
...
@@ -69,12 +69,15 @@ class Dispatch1 extends XSModule {
for
(
i
<-
0
until
RenameWidth
)
{
// input for ROQ and LSROQ
val
commitType
=
Cat
(
isLs
(
i
),
isStore
(
i
)
|
isFp
(
i
))
io
.
toRoq
(
i
).
valid
:=
io
.
fromRename
(
i
).
valid
&&
!
roqIndexRegValid
(
i
)
io
.
toRoq
(
i
).
bits
:=
io
.
fromRename
(
i
).
bits
io
.
toRoq
(
i
).
bits
.
ctrl
.
commitType
:=
Cat
(
isLs
(
i
),
isStore
(
i
)
|
isFp
(
i
))
// TODO: add it to decod
e
io
.
toRoq
(
i
).
bits
.
ctrl
.
commitType
:=
commitTyp
e
io
.
toLsroq
(
i
).
valid
:=
io
.
fromRename
(
i
).
valid
&&
!
lsIndexRegValid
(
i
)
&&
isLs
(
i
)
&&
io
.
fromRename
(
i
).
bits
.
ctrl
.
fuType
=/=
FuType
.
mou
&&
roqIndexAcquired
(
i
)
&&
!
cancelled
(
i
)
io
.
toLsroq
(
i
).
bits
:=
io
.
fromRename
(
i
).
bits
io
.
toLsroq
(
i
).
bits
.
ctrl
.
commitType
:=
commitType
io
.
toLsroq
(
i
).
bits
.
roqIdx
:=
Mux
(
roqIndexRegValid
(
i
),
roqIndexReg
(
i
),
io
.
roqIdxs
(
i
))
// receive indexes from ROQ and LSROQ
...
...
@@ -100,8 +103,7 @@ class Dispatch1 extends XSModule {
}
else
{
uopWithIndex
(
i
).
lqIdx
:=
Mux
(
lsIndexRegValid
(
i
),
lsIndexReg
(
i
),
io
.
lsIdx
(
i
)).
lqIdx
uopWithIndex
(
i
).
sqIdx
:=
Mux
(
lsIndexRegValid
(
i
),
lsIndexReg
(
i
),
io
.
lsIdx
(
i
)).
sqIdx
uopWithIndex
(
i
).
instIsLoad
:=
Mux
(
lsIndexRegValid
(
i
),
lsIndexReg
(
i
),
io
.
lsIdx
(
i
)).
instIsLoad
XSDebug
(
io
.
toLsroq
(
i
).
fire
(),
p
"pc 0x${Hexadecimal(io.fromRename(i).bits.cf.pc)} receives lq ${io.lsIdx(i).lqIdx} sq ${io.lsIdx(i).sqIdx} isLoad ${io.lsIdx(i).instIsLoad}\n"
)
XSDebug
(
io
.
toLsroq
(
i
).
fire
(),
p
"pc 0x${Hexadecimal(io.fromRename(i).bits.cf.pc)} receives lq ${io.lsIdx(i).lqIdx} sq ${io.lsIdx(i).sqIdx}\n"
)
}
XSDebug
(
io
.
toRoq
(
i
).
fire
(),
p
"pc 0x${Hexadecimal(io.fromRename(i).bits.cf.pc)} receives nroq ${io.roqIdxs(i)}\n"
)
...
...
@@ -165,7 +167,7 @@ class Dispatch1 extends XSModule {
}
else
{
XSInfo
(
io
.
recv
(
i
)
&&
!
cancelled
(
i
),
p
"pc 0x${Hexadecimal(io.fromRename(i).bits.cf.pc)} type(${isInt(i)}, ${isFp(i)}, ${isLs(i)}) "
+
p
"roq ${uopWithIndex(i).roqIdx} lq ${uopWithIndex(i).lqIdx} sq ${uopWithIndex(i).sqIdx}
isLoad ${uopWithIndex(i).instIsLoad}
"
+
p
"roq ${uopWithIndex(i).roqIdx} lq ${uopWithIndex(i).lqIdx} sq ${uopWithIndex(i).sqIdx}"
+
p
"(${intIndex.io.reverseMapping(i).bits}, ${fpIndex.io.reverseMapping(i).bits}, ${lsIndex.io.reverseMapping(i).bits})\n"
)
}
...
...
src/main/scala/xiangshan/backend/fu/CSR.scala
浏览文件 @
4fb541a1
...
...
@@ -603,13 +603,12 @@ class CSR extends FunctionUnit(csrCfg) with HasCSRConst{
val
lsIdx
=
WireInit
(
0.
U
.
asTypeOf
(
new
LSIdx
()))
lsIdx
.
lqIdx
:=
io
.
exception
.
bits
.
lqIdx
lsIdx
.
sqIdx
:=
io
.
exception
.
bits
.
sqIdx
lsIdx
.
instIsLoad
:=
io
.
exception
.
bits
.
instIsLoad
ExcitingUtils
.
addSource
(
lsIdx
,
"EXECPTION_LSROQIDX"
)
val
lqExceptionAddr
=
WireInit
(
0.
U
(
VAddrBits
.
W
))
val
sqExceptionAddr
=
WireInit
(
0.
U
(
VAddrBits
.
W
))
ExcitingUtils
.
addSink
(
lqExceptionAddr
,
"EXECPTION_LOAD_VADDR"
)
ExcitingUtils
.
addSink
(
sqExceptionAddr
,
"EXECPTION_STORE_VADDR"
)
lsroqExceptionAddr
:=
Mux
(
io
.
exception
.
bits
.
instIsLoad
,
lqExceptionAddr
,
s
qExceptionAddr
)
lsroqExceptionAddr
:=
Mux
(
CommitType
.
lsInstIsStore
(
io
.
exception
.
bits
.
ctrl
.
commitType
),
sqExceptionAddr
,
l
qExceptionAddr
)
}
val
atomExceptionAddr
=
WireInit
(
0.
U
(
VAddrBits
.
W
))
...
...
src/main/scala/xiangshan/backend/rename/Rename.scala
浏览文件 @
4fb541a1
...
...
@@ -71,7 +71,6 @@ class Rename extends XSModule {
uop
.
diffTestDebugLrScValid
:=
DontCare
uop
.
lsroqIdx
:=
DontCare
uop
.
instIsLoad
:=
DontCare
uop
.
lqIdx
:=
DontCare
uop
.
sqIdx
:=
DontCare
})
...
...
src/main/scala/xiangshan/backend/roq/Roq.scala
浏览文件 @
4fb541a1
...
...
@@ -112,7 +112,6 @@ class Roq extends XSModule with HasCircularQueuePtrHelper {
microOp
(
wbIdx
).
lsroqIdx
:=
io
.
exeWbResults
(
i
).
bits
.
uop
.
lsroqIdx
microOp
(
wbIdx
).
lqIdx
:=
io
.
exeWbResults
(
i
).
bits
.
uop
.
lqIdx
microOp
(
wbIdx
).
sqIdx
:=
io
.
exeWbResults
(
i
).
bits
.
uop
.
sqIdx
microOp
(
wbIdx
).
instIsLoad
:=
io
.
exeWbResults
(
i
).
bits
.
uop
.
instIsLoad
microOp
(
wbIdx
).
ctrl
.
flushPipe
:=
io
.
exeWbResults
(
i
).
bits
.
uop
.
ctrl
.
flushPipe
microOp
(
wbIdx
).
diffTestDebugLrScValid
:=
io
.
exeWbResults
(
i
).
bits
.
uop
.
diffTestDebugLrScValid
exuData
(
wbIdx
)
:=
io
.
exeWbResults
(
i
).
bits
.
data
...
...
src/main/scala/xiangshan/mem/lsqueue/separated/LSQWrapper.scala
浏览文件 @
4fb541a1
...
...
@@ -122,14 +122,12 @@ class LsqWrappper extends XSModule with HasDCacheParameters with NeedImpl {
// fix valid, allocate lq / sq index
(
0
until
RenameWidth
).
map
(
i
=>
{
val
isStore
=
LSUOpType
.
isStore
(
io
.
dp1Req
(
i
).
bits
.
ctrl
.
fuOp
Type
)
val
isStore
=
CommitType
.
lsInstIsStore
(
io
.
dp1Req
(
i
).
bits
.
ctrl
.
commit
Type
)
val
prevCanIn
=
if
(
i
==
0
)
true
.
B
else
Cat
((
0
until
i
).
map
(
i
=>
io
.
dp1Req
(
i
).
ready
)).
andR
loadQueue
.
io
.
dp1Req
(
i
).
valid
:=
!
isStore
&&
io
.
dp1Req
(
i
).
valid
&&
prevCanIn
storeQueue
.
io
.
dp1Req
(
i
).
valid
:=
isStore
&&
io
.
dp1Req
(
i
).
valid
&&
prevCanIn
io
.
lsIdxs
(
i
)
:=
DontCare
loadQueue
.
io
.
lqIdxs
(
i
)
<>
io
.
lsIdxs
(
i
).
lqIdx
storeQueue
.
io
.
sqIdxs
(
i
)
<>
io
.
lsIdxs
(
i
).
sqIdx
io
.
lsIdxs
(
i
).
instIsLoad
:=
!
isStore
io
.
dp1Req
(
i
).
ready
:=
storeQueue
.
io
.
dp1Req
(
i
).
ready
&&
loadQueue
.
io
.
dp1Req
(
i
).
ready
})
}
...
...
src/main/scala/xiangshan/mem/lsqueue/separated/LoadQueue.scala
浏览文件 @
4fb541a1
...
...
@@ -90,7 +90,6 @@ class LoadQueue extends XSModule with HasDCacheParameters with HasCircularQueueP
}
val
numTryEnqueue
=
offset
+&
io
.
dp1Req
(
i
).
valid
io
.
dp1Req
(
i
).
ready
:=
numTryEnqueue
<=
emptyEntries
io
.
lqIdxs
(
i
)
:=
lqIdx
XSDebug
(
false
,
true
.
B
,
"(%d, %d) "
,
io
.
dp1Req
(
i
).
ready
,
io
.
dp1Req
(
i
).
valid
)
}
...
...
src/main/scala/xiangshan/mem/lsqueue/separated/StoreQueue.scala
浏览文件 @
4fb541a1
...
...
@@ -86,11 +86,7 @@ class StoreQueue extends XSModule with HasDCacheParameters with HasCircularQueue
// data(index).bwdMask := 0.U(8.W).asBools
}
val
numTryEnqueue
=
offset
+&
io
.
dp1Req
(
i
).
valid
// if (i == 0) {
io
.
dp1Req
(
i
).
ready
:=
numTryEnqueue
<=
emptyEntries
// } else {
// io.dp1Req(i).ready := ringBufferAllowin && !allocated(index)// && io.dp1Req(i - 1).ready
// }
io
.
sqIdxs
(
i
)
:=
sqIdx
XSDebug
(
false
,
true
.
B
,
"(%d, %d) "
,
io
.
dp1Req
(
i
).
ready
,
io
.
dp1Req
(
i
).
valid
)
}
...
...
src/main/scala/xiangshan/package.scala
浏览文件 @
4fb541a1
...
...
@@ -90,5 +90,6 @@ package object xiangshan {
def
apply
()
=
UInt
(
2.
W
)
def
isLoadStore
(
commitType
:
UInt
)
=
commitType
(
1
)
def
lsInstIsStore
(
commitType
:
UInt
)
=
commitType
(
0
)
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录