Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenXiangShan
XiangShan
提交
21cffc97
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,发现更多精彩内容 >>
提交
21cffc97
编写于
9月 10, 2020
作者:
Y
Yinan Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pc: SignExt to XLEN for pc as imm and pc for difftest
上级
40f79903
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
8 deletion
+10
-8
src/main/scala/xiangshan/backend/dispatch/Dispatch2Int.scala
src/main/scala/xiangshan/backend/dispatch/Dispatch2Int.scala
+1
-1
src/main/scala/xiangshan/backend/roq/Roq.scala
src/main/scala/xiangshan/backend/roq/Roq.scala
+7
-5
src/test/scala/top/XSSim.scala
src/test/scala/top/XSSim.scala
+2
-2
未找到文件。
src/main/scala/xiangshan/backend/dispatch/Dispatch2Int.scala
浏览文件 @
21cffc97
...
@@ -122,7 +122,7 @@ class Dispatch2Int extends XSModule {
...
@@ -122,7 +122,7 @@ class Dispatch2Int extends XSModule {
io
.
enqIQData
(
i
)
:=
DontCare
io
.
enqIQData
(
i
)
:=
DontCare
io
.
enqIQData
(
i
).
src1
:=
Mux
(
uopReg
(
i
).
ctrl
.
src1Type
===
SrcType
.
pc
,
io
.
enqIQData
(
i
).
src1
:=
Mux
(
uopReg
(
i
).
ctrl
.
src1Type
===
SrcType
.
pc
,
uopReg
(
i
).
cf
.
pc
,
io
.
readRf
(
readPortIndexReg
(
i
)).
data
)
SignExt
(
uopReg
(
i
).
cf
.
pc
,
XLEN
)
,
io
.
readRf
(
readPortIndexReg
(
i
)).
data
)
io
.
enqIQData
(
i
).
src2
:=
Mux
(
uopReg
(
i
).
ctrl
.
src2Type
===
SrcType
.
imm
,
io
.
enqIQData
(
i
).
src2
:=
Mux
(
uopReg
(
i
).
ctrl
.
src2Type
===
SrcType
.
imm
,
uopReg
(
i
).
ctrl
.
imm
,
io
.
readRf
(
readPortIndexReg
(
i
)
+
1.
U
).
data
)
uopReg
(
i
).
ctrl
.
imm
,
io
.
readRf
(
readPortIndexReg
(
i
)
+
1.
U
).
data
)
...
...
src/main/scala/xiangshan/backend/roq/Roq.scala
浏览文件 @
21cffc97
...
@@ -169,10 +169,12 @@ class Roq extends XSModule {
...
@@ -169,10 +169,12 @@ class Roq extends XSModule {
when
(
io
.
commits
(
i
).
valid
){
v
:=
false
.
B
}
when
(
io
.
commits
(
i
).
valid
){
v
:=
false
.
B
}
XSInfo
(
io
.
commits
(
i
).
valid
,
XSInfo
(
io
.
commits
(
i
).
valid
,
"retired pc %x wen %d ld
st %d
data %x\n"
,
"retired pc %x wen %d ld
est %d pdest %x old_pdest %x
data %x\n"
,
commitUop
.
cf
.
pc
,
commitUop
.
cf
.
pc
,
commitUop
.
ctrl
.
rfWen
,
commitUop
.
ctrl
.
rfWen
,
commitUop
.
ctrl
.
ldest
,
commitUop
.
ctrl
.
ldest
,
commitUop
.
pdest
,
commitUop
.
old_pdest
,
exuData
(
commitIdx
)
exuData
(
commitIdx
)
)
)
XSInfo
(
io
.
commits
(
i
).
valid
&&
exuDebug
(
commitIdx
).
isMMIO
,
XSInfo
(
io
.
commits
(
i
).
valid
&&
exuDebug
(
commitIdx
).
isMMIO
,
...
@@ -298,7 +300,7 @@ class Roq extends XSModule {
...
@@ -298,7 +300,7 @@ class Roq extends XSModule {
val
wen
=
Wire
(
Vec
(
CommitWidth
,
Bool
()))
val
wen
=
Wire
(
Vec
(
CommitWidth
,
Bool
()))
val
wdata
=
Wire
(
Vec
(
CommitWidth
,
UInt
(
XLEN
.
W
)))
val
wdata
=
Wire
(
Vec
(
CommitWidth
,
UInt
(
XLEN
.
W
)))
val
wdst
=
Wire
(
Vec
(
CommitWidth
,
UInt
(
32.
W
)))
val
wdst
=
Wire
(
Vec
(
CommitWidth
,
UInt
(
32.
W
)))
val
wpc
=
Wire
(
Vec
(
CommitWidth
,
UInt
(
VAddrBits
.
W
)))
val
wpc
=
Wire
(
Vec
(
CommitWidth
,
UInt
(
XLEN
.
W
)))
val
trapVec
=
Wire
(
Vec
(
CommitWidth
,
Bool
()))
val
trapVec
=
Wire
(
Vec
(
CommitWidth
,
Bool
()))
val
isRVC
=
Wire
(
Vec
(
CommitWidth
,
Bool
()))
val
isRVC
=
Wire
(
Vec
(
CommitWidth
,
Bool
()))
for
(
i
<-
0
until
CommitWidth
){
for
(
i
<-
0
until
CommitWidth
){
...
@@ -309,7 +311,7 @@ class Roq extends XSModule {
...
@@ -309,7 +311,7 @@ class Roq extends XSModule {
wen
(
i
)
:=
io
.
commits
(
i
).
valid
&&
uop
.
ctrl
.
rfWen
&&
uop
.
ctrl
.
ldest
=/=
0.
U
wen
(
i
)
:=
io
.
commits
(
i
).
valid
&&
uop
.
ctrl
.
rfWen
&&
uop
.
ctrl
.
ldest
=/=
0.
U
wdata
(
i
)
:=
exuData
(
idx
)
wdata
(
i
)
:=
exuData
(
idx
)
wdst
(
i
)
:=
uop
.
ctrl
.
ldest
wdst
(
i
)
:=
uop
.
ctrl
.
ldest
wpc
(
i
)
:=
uop
.
cf
.
pc
wpc
(
i
)
:=
SignExt
(
uop
.
cf
.
pc
,
XLEN
)
trapVec
(
i
)
:=
io
.
commits
(
i
).
valid
&&
(
state
===
s_idle
)
&&
uop
.
ctrl
.
isXSTrap
trapVec
(
i
)
:=
io
.
commits
(
i
).
valid
&&
(
state
===
s_idle
)
&&
uop
.
ctrl
.
isXSTrap
isRVC
(
i
)
:=
uop
.
cf
.
brUpdate
.
pd
.
isRVC
isRVC
(
i
)
:=
uop
.
cf
.
brUpdate
.
pd
.
isRVC
}
}
...
@@ -320,7 +322,7 @@ class Roq extends XSModule {
...
@@ -320,7 +322,7 @@ class Roq extends XSModule {
ExcitingUtils
.
addSink
(
difftestIntrNO
,
"difftestIntrNOfromCSR"
)
ExcitingUtils
.
addSink
(
difftestIntrNO
,
"difftestIntrNOfromCSR"
)
XSDebug
(
difftestIntrNO
=/=
0.
U
,
"difftest intrNO set %x\n"
,
difftestIntrNO
)
XSDebug
(
difftestIntrNO
=/=
0.
U
,
"difftest intrNO set %x\n"
,
difftestIntrNO
)
val
retireCounterFix
=
Mux
(
io
.
redirect
.
valid
,
1.
U
,
retireCounter
)
val
retireCounterFix
=
Mux
(
io
.
redirect
.
valid
,
1.
U
,
retireCounter
)
val
retirePCFix
=
Mux
(
io
.
redirect
.
valid
,
microOp
(
deqPtr
).
cf
.
pc
,
microOp
(
firstValidCommit
).
cf
.
pc
)
val
retirePCFix
=
SignExt
(
Mux
(
io
.
redirect
.
valid
,
microOp
(
deqPtr
).
cf
.
pc
,
microOp
(
firstValidCommit
).
cf
.
pc
),
XLEN
)
val
retireInstFix
=
Mux
(
io
.
redirect
.
valid
,
microOp
(
deqPtr
).
cf
.
instr
,
microOp
(
firstValidCommit
).
cf
.
instr
)
val
retireInstFix
=
Mux
(
io
.
redirect
.
valid
,
microOp
(
deqPtr
).
cf
.
instr
,
microOp
(
firstValidCommit
).
cf
.
instr
)
if
(!
env
.
FPGAPlatform
){
if
(!
env
.
FPGAPlatform
){
BoringUtils
.
addSource
(
RegNext
(
retireCounterFix
),
"difftestCommit"
)
BoringUtils
.
addSource
(
RegNext
(
retireCounterFix
),
"difftestCommit"
)
...
@@ -337,7 +339,7 @@ class Roq extends XSModule {
...
@@ -337,7 +339,7 @@ class Roq extends XSModule {
val
hitTrap
=
trapVec
.
reduce
(
_
||
_
)
val
hitTrap
=
trapVec
.
reduce
(
_
||
_
)
val
trapCode
=
PriorityMux
(
wdata
.
zip
(
trapVec
).
map
(
x
=>
x
.
_2
->
x
.
_1
))
val
trapCode
=
PriorityMux
(
wdata
.
zip
(
trapVec
).
map
(
x
=>
x
.
_2
->
x
.
_1
))
val
trapPC
=
PriorityMux
(
wpc
.
zip
(
trapVec
).
map
(
x
=>
x
.
_2
->
x
.
_1
)
)
val
trapPC
=
SignExt
(
PriorityMux
(
wpc
.
zip
(
trapVec
).
map
(
x
=>
x
.
_2
->
x
.
_1
)),
XLEN
)
ExcitingUtils
.
addSource
(
RegNext
(
hitTrap
),
"trapValid"
)
ExcitingUtils
.
addSource
(
RegNext
(
hitTrap
),
"trapValid"
)
ExcitingUtils
.
addSource
(
RegNext
(
trapCode
),
"trapCode"
)
ExcitingUtils
.
addSource
(
RegNext
(
trapCode
),
"trapCode"
)
...
...
src/test/scala/top/XSSim.scala
浏览文件 @
21cffc97
...
@@ -18,13 +18,13 @@ import xstransforms.ShowPrintTransform
...
@@ -18,13 +18,13 @@ import xstransforms.ShowPrintTransform
class
DiffTestIO
extends
XSBundle
{
class
DiffTestIO
extends
XSBundle
{
val
r
=
Output
(
Vec
(
64
,
UInt
(
XLEN
.
W
)))
val
r
=
Output
(
Vec
(
64
,
UInt
(
XLEN
.
W
)))
val
commit
=
Output
(
UInt
(
32.
W
))
val
commit
=
Output
(
UInt
(
32.
W
))
val
thisPC
=
Output
(
UInt
(
VAddrBits
.
W
))
val
thisPC
=
Output
(
UInt
(
XLEN
.
W
))
val
thisINST
=
Output
(
UInt
(
32.
W
))
val
thisINST
=
Output
(
UInt
(
32.
W
))
val
skip
=
Output
(
UInt
(
32.
W
))
val
skip
=
Output
(
UInt
(
32.
W
))
val
wen
=
Output
(
UInt
(
32.
W
))
val
wen
=
Output
(
UInt
(
32.
W
))
val
wdata
=
Output
(
Vec
(
CommitWidth
,
UInt
(
XLEN
.
W
)))
// set difftest width to 6
val
wdata
=
Output
(
Vec
(
CommitWidth
,
UInt
(
XLEN
.
W
)))
// set difftest width to 6
val
wdst
=
Output
(
Vec
(
CommitWidth
,
UInt
(
32.
W
)))
// set difftest width to 6
val
wdst
=
Output
(
Vec
(
CommitWidth
,
UInt
(
32.
W
)))
// set difftest width to 6
val
wpc
=
Output
(
Vec
(
CommitWidth
,
UInt
(
VAddrBits
.
W
)))
// set difftest width to 6
val
wpc
=
Output
(
Vec
(
CommitWidth
,
UInt
(
XLEN
.
W
)))
// set difftest width to 6
val
isRVC
=
Output
(
Bool
())
val
isRVC
=
Output
(
Bool
())
val
intrNO
=
Output
(
UInt
(
64.
W
))
val
intrNO
=
Output
(
UInt
(
64.
W
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录