Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenXiangShan
XiangShan
提交
882ec26f
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,发现更多精彩内容 >>
提交
882ec26f
编写于
12月 11, 2019
作者:
Z
Zihao Yu
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'fix-ipf-mtval' into debian
上级
57fb28ff
7d8c9130
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
8 addition
and
3 deletion
+8
-3
src/main/scala/noop/Bundle.scala
src/main/scala/noop/Bundle.scala
+1
-0
src/main/scala/noop/IDU1.scala
src/main/scala/noop/IDU1.scala
+6
-2
src/main/scala/noop/fu/CSR.scala
src/main/scala/noop/fu/CSR.scala
+1
-1
未找到文件。
src/main/scala/noop/Bundle.scala
浏览文件 @
882ec26f
...
@@ -45,6 +45,7 @@ class CtrlFlowIO extends NOOPBundle {
...
@@ -45,6 +45,7 @@ class CtrlFlowIO extends NOOPBundle {
val
exceptionVec
=
Output
(
Vec
(
16
,
Bool
()))
val
exceptionVec
=
Output
(
Vec
(
16
,
Bool
()))
val
intrVec
=
Output
(
Vec
(
12
,
Bool
()))
val
intrVec
=
Output
(
Vec
(
12
,
Bool
()))
val
brIdx
=
Output
(
UInt
(
4.
W
))
val
brIdx
=
Output
(
UInt
(
4.
W
))
val
crossPageIPFFix
=
Output
(
Bool
())
}
}
class
DecodeIO
extends
NOOPBundle
{
class
DecodeIO
extends
NOOPBundle
{
...
...
src/main/scala/noop/IDU1.scala
浏览文件 @
882ec26f
...
@@ -6,7 +6,7 @@ import chisel3.util.experimental.BoringUtils
...
@@ -6,7 +6,7 @@ import chisel3.util.experimental.BoringUtils
import
utils._
import
utils._
class
IDU1
extends
NOOPModule
with
HasInstrType
{
class
IDU1
extends
NOOPModule
with
HasInstrType
with
HasExceptionNO
{
val
io
=
IO
(
new
Bundle
{
val
io
=
IO
(
new
Bundle
{
val
in
=
Flipped
(
Decoupled
(
new
CtrlFlowIO
))
val
in
=
Flipped
(
Decoupled
(
new
CtrlFlowIO
))
val
out
=
Decoupled
(
new
CtrlFlowIO
)
val
out
=
Decoupled
(
new
CtrlFlowIO
)
...
@@ -48,6 +48,7 @@ class IDU1 extends NOOPModule with HasInstrType {
...
@@ -48,6 +48,7 @@ class IDU1 extends NOOPModule with HasInstrType {
val
specialPCR
=
Reg
(
UInt
(
VAddrBits
.
W
))
// reg for full inst that cross 2 inst line
val
specialPCR
=
Reg
(
UInt
(
VAddrBits
.
W
))
// reg for full inst that cross 2 inst line
val
specialNPCR
=
Reg
(
UInt
(
VAddrBits
.
W
))
// reg for pnc for full inst jump that cross 2 inst line
val
specialNPCR
=
Reg
(
UInt
(
VAddrBits
.
W
))
// reg for pnc for full inst jump that cross 2 inst line
val
specialInstR
=
Reg
(
UInt
(
16.
W
))
val
specialInstR
=
Reg
(
UInt
(
16.
W
))
val
specialIPFR
=
RegInit
(
Bool
(),
false
.
B
)
val
redirectPC
=
Cat
(
io
.
in
.
bits
.
pc
(
VAddrBits
-
1
,
3
),
0.
U
(
3.
W
))+
"b1010"
.
U
// IDU can got get full inst from a single inst line
val
redirectPC
=
Cat
(
io
.
in
.
bits
.
pc
(
VAddrBits
-
1
,
3
),
0.
U
(
3.
W
))+
"b1010"
.
U
// IDU can got get full inst from a single inst line
val
rvcForceLoadNext
=
(
pcOffset
===
2.
U
&&
!
isRVC
&&
io
.
in
.
bits
.
pnpc
(
2
,
0
)
===
4.
U
&&
!
brIdx
(
1
))
val
rvcForceLoadNext
=
(
pcOffset
===
2.
U
&&
!
isRVC
&&
io
.
in
.
bits
.
pnpc
(
2
,
0
)
===
4.
U
&&
!
brIdx
(
1
))
//------------------------------------------------------
//------------------------------------------------------
...
@@ -96,12 +97,14 @@ class IDU1 extends NOOPModule with HasInstrType {
...
@@ -96,12 +97,14 @@ class IDU1 extends NOOPModule with HasInstrType {
state
:=
s_waitnext
state
:=
s_waitnext
specialPCR
:=
pcOut
specialPCR
:=
pcOut
specialInstR
:=
io
.
in
.
bits
.
instr
(
63
,
63
-
16
+
1
)
specialInstR
:=
io
.
in
.
bits
.
instr
(
63
,
63
-
16
+
1
)
specialIPFR
:=
io
.
in
.
bits
.
exceptionVec
(
instrPageFault
)
}
}
when
(
rvcSpecialJump
&&
io
.
in
.
valid
){
when
(
rvcSpecialJump
&&
io
.
in
.
valid
){
state
:=
s_waitnext_thenj
state
:=
s_waitnext_thenj
specialPCR
:=
pcOut
specialPCR
:=
pcOut
specialNPCR
:=
io
.
in
.
bits
.
pnpc
specialNPCR
:=
io
.
in
.
bits
.
pnpc
specialInstR
:=
io
.
in
.
bits
.
instr
(
63
,
63
-
16
+
1
)
specialInstR
:=
io
.
in
.
bits
.
instr
(
63
,
63
-
16
+
1
)
specialIPFR
:=
io
.
in
.
bits
.
exceptionVec
(
instrPageFault
)
}
}
}
}
is
(
s_extra
){
//get 16 aligned inst, pc controled by this FSM
is
(
s_extra
){
//get 16 aligned inst, pc controled by this FSM
...
@@ -182,5 +185,6 @@ class IDU1 extends NOOPModule with HasInstrType {
...
@@ -182,5 +185,6 @@ class IDU1 extends NOOPModule with HasInstrType {
io
.
in
.
ready
:=
(!
io
.
in
.
valid
||
(
io
.
out
.
fire
()
&&
canIn
)
||
loadNextInstline
)
io
.
in
.
ready
:=
(!
io
.
in
.
valid
||
(
io
.
out
.
fire
()
&&
canIn
)
||
loadNextInstline
)
io
.
out
.
bits
.
exceptionVec
:=
io
.
in
.
bits
.
exceptionVec
/*.map(_ := false.B)*/
//Fix by zhangzifei from false.B
io
.
out
.
bits
.
exceptionVec
:=
io
.
in
.
bits
.
exceptionVec
/*.map(_ := false.B)*/
//Fix by zhangzifei from false.B
io
.
out
.
bits
.
exceptionVec
(
instrPageFault
)
:=
io
.
in
.
bits
.
exceptionVec
(
instrPageFault
)
||
specialIPFR
&&
(
state
===
s_waitnext_thenj
||
state
===
s_waitnext
)
io
.
out
.
bits
.
crossPageIPFFix
:=
io
.
in
.
bits
.
exceptionVec
(
instrPageFault
)
&&
(
state
===
s_waitnext_thenj
||
state
===
s_waitnext
)
&&
!
specialIPFR
}
}
src/main/scala/noop/fu/CSR.scala
浏览文件 @
882ec26f
...
@@ -501,7 +501,7 @@ class CSR(implicit val p: NOOPConfig) extends NOOPModule with HasCSRConst{
...
@@ -501,7 +501,7 @@ class CSR(implicit val p: NOOPConfig) extends NOOPModule with HasCSRConst{
val
hasStorePageFault
=
io
.
dmemMMU
.
storePF
val
hasStorePageFault
=
io
.
dmemMMU
.
storePF
when
(
hasInstrPageFault
||
hasLoadPageFault
||
hasStorePageFault
){
when
(
hasInstrPageFault
||
hasLoadPageFault
||
hasStorePageFault
){
val
tval
=
Mux
(
hasInstrPageFault
,
SignExt
(
io
.
cfIn
.
pc
,
XLEN
),
SignExt
(
io
.
dmemMMU
.
addr
,
XLEN
))
val
tval
=
Mux
(
hasInstrPageFault
,
Mux
(
io
.
cfIn
.
crossPageIPFFix
,
SignExt
(
io
.
cfIn
.
pc
+
2.
U
,
XLEN
),
SignExt
(
io
.
cfIn
.
pc
,
XLEN
)
),
SignExt
(
io
.
dmemMMU
.
addr
,
XLEN
))
when
(
priviledgeMode
===
ModeM
){
when
(
priviledgeMode
===
ModeM
){
mtval
:=
tval
mtval
:=
tval
}.
otherwise
{
}.
otherwise
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录