Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenXiangShan
XiangShan
提交
1d28114a
X
XiangShan
项目概览
OpenXiangShan
/
XiangShan
9 个月 前同步成功
通知
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 搜索 >>
提交
1d28114a
编写于
1月 14, 2021
作者:
B
BigWhiteDog
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix unconnected io bug in L1D test
上级
b086c6da
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
27 addition
and
17 deletion
+27
-17
src/test/scala/cache/L1DTest/CoreAgent.scala
src/test/scala/cache/L1DTest/CoreAgent.scala
+9
-0
src/test/scala/cache/L1DTest/L1DTest.scala
src/test/scala/cache/L1DTest/L1DTest.scala
+18
-17
未找到文件。
src/test/scala/cache/L1DTest/CoreAgent.scala
浏览文件 @
1d28114a
...
...
@@ -58,6 +58,7 @@ class CoreAgent(ID: Int, name: String, addrStateMap: mutable.Map[BigInt, AddrSta
if
(!
resp
.
miss
)
{
val
wc
=
wordInBlock
(
loadAddr
)
insertMaskedRead
(
loadAddr
,
dataConcatWord
(
0
,
resp
.
data
,
wc
),
genWordMaskInBlock
(
loadAddr
,
loadT
.
req
.
get
.
mask
))
outerLoad
-=
loadT
}
else
if
(
resp
.
replay
)
{
outerLoad
-=
loadT
//drop it
...
...
@@ -70,6 +71,14 @@ class CoreAgent(ID: Int, name: String, addrStateMap: mutable.Map[BigInt, AddrSta
}
def
killS1
(
i
:
Int
)
:
Unit
=
{
val
l
=
s1_loadTrans
(
i
)
if
(
l
.
isDefined
){
outerLoad
-=
l
.
get
s1_loadTrans
(
i
)
=
None
}
}
def
s1Paddr
(
i
:
Int
)
:
BigInt
=
{
val
l
=
s1_loadTrans
(
i
)
if
(
l
.
isDefined
)
...
...
src/test/scala/cache/L1DTest/L1DTest.scala
浏览文件 @
1d28114a
...
...
@@ -32,15 +32,15 @@ class L1DTestTopIO extends Bundle {
class
L1DTestTop
()(
implicit
p
:
Parameters
)
extends
LazyModule
{
val
dcache
=
LazyModule
(
new
DCache
())
val
l2_ident
=
LazyModule
(
new
DebugIdentityNode
())
val
dcache_outer
=
LazyModule
(
new
DebugIdentityNode
())
val
slave
=
LazyModule
(
new
TLCSlaveMMIO
())
slave
.
node
:=
l2_ident
.
node
:=
dcache_outer
.
node
:=
dcache
.
clientNode
slave
.
node
:=
dcache_outer
.
node
:=
dcache
.
clientNode
lazy
val
module
=
new
LazyModuleImp
(
this
)
with
HasXSLog
{
val
io
=
IO
(
new
L1DTestTopIO
())
dcache
.
module
.
io
.
lsu
<>
io
.
dcacheIO
slave
.
module
.
io
<>
io
.
slaveIO
}
}
...
...
@@ -64,9 +64,10 @@ class L1DCacheTest extends AnyFlatSpec with ChiselScalatestTester with Matchers
val
rand
=
new
Random
(
0xbeef
)
val
addr_pool
=
{
for
(
_
<-
0
to
32
)
yield
BigInt
(
rand
.
nextInt
(
0xfffc
)
<<
6
)
|
0x80000000
L
.
U
.
litValue
()
for
(
_
<-
0
until
10
)
yield
BigInt
(
rand
.
nextInt
(
0xff
)
<<
12
)
|
0x80000000
L
.
U
.
litValue
()
}.
distinct
.
toList
// align to block size
val
addr_list_len
=
addr_pool
.
length
println
(
f
"addr pool length: $addr_list_len"
)
val
probeProbMap
=
Map
(
nothing
->
0.4
,
branch
->
0.5
,
trunk
->
0.1
)
def
peekBigInt
(
source
:
Data
)
:
BigInt
=
{
...
...
@@ -109,12 +110,12 @@ class L1DCacheTest extends AnyFlatSpec with ChiselScalatestTester with Matchers
c
.
io
.
slaveIO
.
DChannel
.
valid
.
poke
(
false
.
B
)
val
total_clock
=
1500
00
val
total_clock
=
5
00
c
.
reset
.
poke
(
true
.
B
)
c
.
clock
.
step
(
100
)
c
.
reset
.
poke
(
false
.
B
)
c
.
clock
.
setTimeout
(
200
)
c
.
clock
.
setTimeout
(
8192
)
val
slaveIO
=
c
.
io
.
slaveIO
...
...
@@ -129,20 +130,20 @@ class L1DCacheTest extends AnyFlatSpec with ChiselScalatestTester with Matchers
val
coreAgent
=
new
CoreAgent
(
ID
=
0
,
name
=
"core"
,
coreStateList
,
serialList
,
scoreboard
)
val
sio
=
slaveIO
for
(
_
<-
0
until
total_clock
)
{
for
(
cl
<-
0
until
total_clock
)
{
//========= core trans ===========
//randomly add when low size
if
(
coreAgent
.
outerLoad
.
size
<=
6
)
{
if
(
true
)
{
for
(
i
<-
0
until
16
)
{
if
(
coreAgent
.
outerLoad
.
size
<=
0
)
{
if
(
cl
%
2048
==
0
)
{
for
(
i
<-
0
until
4
)
{
val
addr
=
getRandomElement
(
addr_pool
,
rand
)
coreAgent
.
addLoad
(
addr
)
}
}
}
if
(
coreAgent
.
outerStore
.
size
<=
6
)
{
if
(
true
)
{
for
(
i
<-
0
until
16
)
{
if
(
coreAgent
.
outerStore
.
size
<=
0
)
{
if
(
cl
%
1024
==
0
)
{
for
(
i
<-
0
until
9
)
{
val
addr
=
getRandomElement
(
addr_pool
,
rand
)
coreAgent
.
addStore
(
addr
)
}
...
...
@@ -183,9 +184,9 @@ class L1DCacheTest extends AnyFlatSpec with ChiselScalatestTester with Matchers
//========= slave ============
//randomly add when empty
if
(
slaveAgent
.
innerProbe
.
size
<=
6
)
{
if
(
true
)
{
for
(
i
<-
0
until
16
)
{
if
(
slaveAgent
.
innerProbe
.
size
<=
0
)
{
if
(
cl
%
4096
==
0
)
{
for
(
i
<-
0
until
2
)
{
val
addr
=
getRandomElement
(
addr_pool
,
rand
)
val
targetPerm
=
sample
(
probeProbMap
,
rand
)
slaveAgent
.
addProbe
(
addr
,
targetPerm
)
...
...
@@ -308,7 +309,7 @@ class L1DCacheTest extends AnyFlatSpec with ChiselScalatestTester with Matchers
coreAgent
.
fireStoreReq
()
}
val
storePortRespValid
=
peekBoolean
(
coreIO
.
store
.
resp
.
valid
)
if
(
storePortRespValid
&&
storePortRespReady
)
{
if
(
storePortRespValid
&&
storePortRespReady
)
{
val
storeM
=
new
LitDCacheLineResp
(
data
=
peekBigInt
(
coreIO
.
store
.
resp
.
bits
.
data
),
paddr
=
peekBigInt
(
coreIO
.
store
.
resp
.
bits
.
meta
.
paddr
),
...
...
@@ -318,7 +319,7 @@ class L1DCacheTest extends AnyFlatSpec with ChiselScalatestTester with Matchers
}
val
lsqRespValid
=
peekBoolean
(
coreIO
.
lsq
.
valid
)
if
(
lsqRespValid
)
{
if
(
lsqRespValid
)
{
val
lsqM
=
new
LitDCacheLineResp
(
data
=
peekBigInt
(
coreIO
.
lsq
.
bits
.
data
),
paddr
=
peekBigInt
(
coreIO
.
lsq
.
bits
.
addr
),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录