Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenXiangShan
XiangShan
提交
65b6fa35
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 搜索 >>
提交
65b6fa35
编写于
7月 17, 2021
作者:
J
JinYue
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
IFU/ICache: fix invalid instructions bug
上级
7fe1cc1d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
9 deletion
+13
-9
src/main/scala/xiangshan/cache/L1plusCache.scala
src/main/scala/xiangshan/cache/L1plusCache.scala
+1
-1
src/main/scala/xiangshan/decoupled-frontend/ICache.scala
src/main/scala/xiangshan/decoupled-frontend/ICache.scala
+6
-6
src/main/scala/xiangshan/decoupled-frontend/IFU.scala
src/main/scala/xiangshan/decoupled-frontend/IFU.scala
+6
-2
未找到文件。
src/main/scala/xiangshan/cache/L1plusCache.scala
浏览文件 @
65b6fa35
...
...
@@ -944,7 +944,7 @@ class FakeL1plusCache()(implicit p: Parameters) extends XSModule with HasL1plusC
val
fakeRAM
=
Seq
.
fill
(
8
)(
Module
(
new
RAMHelper
(
64L
*
1024
*
1024
*
1024
)))
val
req_valid
=
RegNext
(
io
.
req
.
valid
)
val
req_addr
=
RegNext
((
io
.
req
.
bits
.
addr
-
"h80000000"
.
U
)
>>
3
)
assert
(!
req_valid
||
req_addr
(
2
,
0
)
===
0.
U
)
//
assert(!req_valid || req_addr(2, 0) === 0.U)
for
((
ram
,
i
)
<-
fakeRAM
.
zipWithIndex
)
{
ram
.
io
.
clk
:=
clock
ram
.
io
.
en
:=
req_valid
...
...
src/main/scala/xiangshan/decoupled-frontend/ICache.scala
浏览文件 @
65b6fa35
...
...
@@ -121,11 +121,11 @@ class ICacheMetaWriteBundle(implicit p: Parameters) extends ICacheBundle
class
ICacheDataWriteBundle
(
implicit
p
:
Parameters
)
extends
ICacheBundle
{
val
virIdx
=
UInt
(
idxBits
.
W
)
val
data
=
Vec
(
blockRows
,
UInt
(
blockBits
.
W
)
)
val
data
=
UInt
(
blockBits
.
W
)
val
waymask
=
UInt
(
nWays
.
W
)
val
bankIdx
=
Bool
()
def
apply
(
data
:
Vec
[
UInt
]
,
idx
:
UInt
,
waymask
:
UInt
,
bankIdx
:
Bool
){
def
apply
(
data
:
UInt
,
idx
:
UInt
,
waymask
:
UInt
,
bankIdx
:
Bool
){
this
.
virIdx
:=
idx
this
.
data
:=
data
this
.
waymask
:=
waymask
...
...
@@ -220,7 +220,7 @@ class ICacheDataArray(implicit p: Parameters) extends ICacheArray
if
(
i
==
0
)
way
.
io
.
w
.
req
.
valid
:=
io
.
write
.
valid
&&
!
io
.
write
.
bits
.
bankIdx
else
way
.
io
.
w
.
req
.
valid
:=
io
.
write
.
valid
&&
io
.
write
.
bits
.
bankIdx
way
.
io
.
w
.
req
.
bits
.
apply
(
data
=
io
.
write
.
bits
.
data
.
asUInt
()
,
setIdx
=
io
.
write
.
bits
.
virIdx
,
waymask
=
io
.
write
.
bits
.
waymask
)
way
.
io
.
w
.
req
.
bits
.
apply
(
data
=
io
.
write
.
bits
.
data
,
setIdx
=
io
.
write
.
bits
.
virIdx
,
waymask
=
io
.
write
.
bits
.
waymask
)
}
dataArray
...
...
@@ -335,9 +335,9 @@ class ICacheMissEntry(implicit p: Parameters) extends ICacheMissQueueModule
//TODO: Maybe this sate is noe necessary so we don't need respDataReg
is
(
s_write_back
){
when
((
io
.
data_write
.
fire
()
&&
io
.
meta_write
.
fire
())
||
needFlush
){
//
when((io.data_write.fire() && io.meta_write.fire()) || needFlush){
state
:=
s_wait_resp
}
//
}
}
is
(
s_wait_resp
){
...
...
@@ -354,7 +354,7 @@ class ICacheMissEntry(implicit p: Parameters) extends ICacheMissQueueModule
io
.
meta_write
.
bits
.
apply
(
tag
=
req_tag
,
idx
=
req_idx
,
waymask
=
req_waymask
,
bankIdx
=
req_idx
(
0
))
io
.
data_write
.
valid
:=
(
state
===
s_write_back
)
&&
!
needFlush
io
.
data_write
.
bits
.
apply
(
data
=
respDataReg
.
asTypeOf
(
Vec
(
blockRows
,
UInt
(
rowBits
.
W
)))
,
idx
=
req_idx
,
waymask
=
req_waymask
,
bankIdx
=
req_idx
(
0
))
io
.
data_write
.
bits
.
apply
(
data
=
respDataReg
,
idx
=
req_idx
,
waymask
=
req_waymask
,
bankIdx
=
req_idx
(
0
))
//mem request
io
.
mem_acquire
.
bits
.
cmd
:=
MemoryOpConstants
.
M_XRD
...
...
src/main/scala/xiangshan/decoupled-frontend/IFU.scala
浏览文件 @
65b6fa35
...
...
@@ -207,6 +207,11 @@ class NewIFU(implicit p: Parameters) extends XSModule with Temperary with HasICa
)
toMissQueue
<>
DontCare
val
f2_mq_datas
=
Reg
(
Vec
(
2
,
UInt
(
blockBits
.
W
)))
when
(
fromMissQueue
(
0
).
fire
)
{
f2_mq_datas
(
0
)
:=
fromMissQueue
(
0
).
bits
.
data
}
when
(
fromMissQueue
(
1
).
fire
)
{
f2_mq_datas
(
1
)
:=
fromMissQueue
(
1
).
bits
.
data
}
switch
(
wait_state
){
is
(
wait_idle
){
when
(
f2_valid
&&
!
f2_hit
){
...
...
@@ -286,7 +291,6 @@ class NewIFU(implicit p: Parameters) extends XSModule with Temperary with HasICa
}
val
f2_hit_datas
=
RegEnable
(
next
=
f1_hit_data
,
enable
=
f1_fire
)
val
f2_mq_datas
=
RegInit
(
VecInit
(
fromMissQueue
.
map
(
p
=>
p
.
bits
.
data
)))
//TODO: Implement miss queue response
val
f2_datas
=
Mux
(
f2_hit
,
f2_hit_datas
,
f2_mq_datas
)
// TODO: f1_hit_datas is error
def
cut
(
cacheline
:
UInt
,
start
:
UInt
)
:
Vec
[
UInt
]
={
...
...
@@ -299,7 +303,7 @@ class NewIFU(implicit p: Parameters) extends XSModule with Temperary with HasICa
result
}
preDecoderIn
.
data
:=
cut
(
Cat
(
f2_datas
.
map
(
cacheline
=>
cacheline
.
asUInt
)).
asUInt
,
f2_ftq_req
.
startAddr
)
preDecoderIn
.
data
:=
cut
(
Cat
(
f2_datas
.
map
(
cacheline
=>
cacheline
.
asUInt
)
.
reverse
).
asUInt
,
f2_ftq_req
.
startAddr
)
preDecoderIn
.
startAddr
:=
f2_ftq_req
.
startAddr
preDecoderIn
.
ftqOffset
:=
f2_ftq_req
.
ftqOffset
preDecoderIn
.
target
:=
f2_ftq_req
.
target
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录