Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenXiangShan
XiangShan
提交
d85ca113
X
XiangShan
项目概览
OpenXiangShan
/
XiangShan
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
未验证
提交
d85ca113
编写于
6月 25, 2020
作者:
Y
Yinan Xu
提交者:
GitHub
6月 25, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #37 from RISCVERS/decoder-dev
Decoder: add XSDebug messages and modify toBrq(i).valid signal
上级
1befcca5
a89f7c15
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
13 addition
and
2 deletion
+13
-2
src/main/scala/xiangshan/backend/decode/DecodeStage.scala
src/main/scala/xiangshan/backend/decode/DecodeStage.scala
+8
-2
src/main/scala/xiangshan/backend/decode/Decoder.scala
src/main/scala/xiangshan/backend/decode/Decoder.scala
+5
-0
未找到文件。
src/main/scala/xiangshan/backend/decode/DecodeStage.scala
浏览文件 @
d85ca113
...
...
@@ -3,6 +3,7 @@ package xiangshan.backend.decode
import
chisel3._
import
chisel3.util._
import
xiangshan._
import
xiangshan.utils._
class
DecodeStage
extends
XSModule
{
val
io
=
IO
(
new
Bundle
()
{
...
...
@@ -24,7 +25,7 @@ class DecodeStage extends XSModule {
// Handshake ---------------------
// 1. if current instruction is valid, then:
// First, assert toBrq(i).valid and present toBrq(i).bits
// First, assert toBrq(i).valid
if (in.valid and out.ready and isBr)
and present toBrq(i).bits
// Second, check toBrq(i).ready and connect it to io.out(i).valid
// 2. To Decode Buffer:
// First, assert in(i).ready if out(i).ready
...
...
@@ -34,12 +35,17 @@ class DecodeStage extends XSModule {
decoders
(
i
).
io
.
in
<>
io
.
in
(
i
).
bits
decoderToBrq
(
i
)
:=
decoders
(
i
).
io
.
out
// CfCtrl without bfTag and brMask
// send CfCtrl without brTags and brMasks to brq
io
.
toBrq
(
i
).
valid
:=
io
.
in
(
i
).
valid
io
.
toBrq
(
i
).
valid
:=
io
.
in
(
i
).
valid
&&
io
.
out
(
i
).
ready
&&
decoders
(
i
).
io
.
out
.
cf
.
isBr
XSDebug
(
io
.
toBrq
(
i
).
valid
&&
io
.
toBrq
(
i
).
ready
,
p
"Branch instr detected. Sending it to BRQ."
)
XSDebug
(
io
.
toBrq
(
i
).
valid
&&
!
io
.
toBrq
(
i
).
ready
,
p
"Branch instr detected. BRQ full...waiting"
)
XSDebug
(
io
.
in
(
i
).
valid
&&
!
io
.
out
(
i
).
ready
,
p
"DecBuf full...waiting"
)
decoderToBrq
(
i
).
brMask
:=
DontCare
decoderToBrq
(
i
).
brTag
:=
DontCare
io
.
toBrq
(
i
).
bits
:=
decoderToBrq
(
i
)
// if brq returns ready, then assert valid and send CfCtrl with bfTag and brMask to DecBuffer
io
.
out
(
i
).
valid
:=
io
.
toBrq
(
i
).
ready
&&
io
.
in
(
i
).
valid
XSDebug
(
io
.
out
(
i
).
valid
&&
decoders
(
i
).
io
.
out
.
cf
.
isBr
&&
io
.
out
(
i
).
ready
,
p
"Sending branch instr to DecBuf"
)
XSDebug
(
io
.
out
(
i
).
valid
&&
!
decoders
(
i
).
io
.
out
.
cf
.
isBr
&&
io
.
out
(
i
).
ready
,
p
"Sending non-branch instr to DecBuf"
)
decoderToDecBuffer
(
i
)
:=
decoders
(
i
).
io
.
out
decoderToDecBuffer
(
i
).
brTag
:=
io
.
brTags
(
i
)
decoderToDecBuffer
(
i
).
brMask
:=
io
.
brMasks
(
i
)
...
...
src/main/scala/xiangshan/backend/decode/Decoder.scala
浏览文件 @
d85ca113
...
...
@@ -21,6 +21,11 @@ class Decoder extends XSModule with HasInstrType {
val
decodeList
=
ListLookup
(
instr
,
Instructions
.
DecodeDefault
,
Instructions
.
DecodeTable
)
val
instrType
::
fuType
::
fuOpType
::
Nil
=
decodeList
// todo: remove this when fetch stage can decide if an instr is br/jmp
io
.
out
.
cf
.
isBr
:=
(
instrType
===
InstrB
||
(
fuOpType
===
BRUOpType
.
jal
&&
instrType
===
InstrJ
&&
fuType
===
FuType
.
bru
)
||
(
fuOpType
===
BRUOpType
.
jalr
&&
instrType
===
InstrI
&&
fuType
===
FuType
.
bru
))
// val isRVC = instr(1, 0) =/= "b11".U
// val rvcImmType :: rvcSrc1Type :: rvcSrc2Type :: rvcDestType :: Nil =
// ListLookup(instr, CInstructions.DecodeDefault, CInstructions.CExtraDecodeTable)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录