Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenXiangShan
XiangShan
提交
e2801f97
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 搜索 >>
提交
e2801f97
编写于
8月 17, 2020
作者:
L
linjiawei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add debug info
上级
753c7418
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
70 addition
and
26 deletion
+70
-26
src/main/scala/device/AXI4SlaveModule.scala
src/main/scala/device/AXI4SlaveModule.scala
+8
-7
src/main/scala/device/TLTimer.scala
src/main/scala/device/TLTimer.scala
+2
-2
src/main/scala/utils/DebugIdentityNode.scala
src/main/scala/utils/DebugIdentityNode.scala
+7
-7
src/main/scala/utils/TLDump.scala
src/main/scala/utils/TLDump.scala
+44
-0
src/main/scala/xiangshan/cache/missQueue.scala
src/main/scala/xiangshan/cache/missQueue.scala
+5
-6
src/main/scala/xiangshan/cache/uncache.scala
src/main/scala/xiangshan/cache/uncache.scala
+4
-4
未找到文件。
src/main/scala/device/AXI4SlaveModule.scala
浏览文件 @
e2801f97
...
...
@@ -6,6 +6,7 @@ import utils._
import
freechips.rocketchip.diplomacy.
{
AddressSet
,
LazyModule
,
LazyModuleImp
,
RegionType
,
TransferSizes
}
import
chipsalliance.rocketchip.config.Parameters
import
freechips.rocketchip.amba.axi4.
{
AXI4Parameters
,
AXI4SlaveNode
,
AXI4SlaveParameters
,
AXI4SlavePortParameters
}
import
xiangshan.HasXSLog
abstract
class
AXI4SlaveModule
[
T
<:
Data
]
(
...
...
@@ -33,7 +34,7 @@ abstract class AXI4SlaveModule[T <: Data]
}
class
AXI4SlaveModuleImp
[
T
<:
Data
](
outer
:
AXI4SlaveModule
[
T
])
extends
LazyModuleImp
(
outer
)
extends
LazyModuleImp
(
outer
)
with
HasXSLog
{
val
io
=
IO
(
new
Bundle
{
val
extra
=
if
(
outer
.
_extra
==
null
)
None
else
Some
(
outer
.
_extra
.
cloneType
)
...
...
@@ -41,27 +42,27 @@ class AXI4SlaveModuleImp[T<:Data](outer: AXI4SlaveModule[T])
val
(
in
,
edge
)
=
outer
.
node
.
in
.
head
val
timer
=
GTimer
()
//
val timer = GTimer()
when
(
in
.
ar
.
fire
()){
printf
(
p
"[$timer]
[ar] addr: ${Hexadecimal(in.ar.bits.addr)} "
+
XSDebug
(
p
"
[ar] addr: ${Hexadecimal(in.ar.bits.addr)} "
+
p
"arlen:${in.ar.bits.len} arsize:${in.ar.bits.size} "
+
p
"id: ${in.ar.bits.id}\n"
)
}
when
(
in
.
aw
.
fire
()){
printf
(
p
"[$timer]
[aw] addr: ${Hexadecimal(in.aw.bits.addr)} "
+
XSDebug
(
p
"
[aw] addr: ${Hexadecimal(in.aw.bits.addr)} "
+
p
"awlen:${in.aw.bits.len} awsize:${in.aw.bits.size} "
+
p
"id: ${in.aw.bits.id}\n"
)
}
when
(
in
.
w
.
fire
()){
printf
(
p
"[$timer]
[w] wmask: ${Binary(in.w.bits.strb)} last:${in.w.bits.last}\n"
)
XSDebug
(
p
"
[w] wmask: ${Binary(in.w.bits.strb)} last:${in.w.bits.last}\n"
)
}
when
(
in
.
b
.
fire
()){
printf
(
p
"[$timer]
[b] id: ${in.b.bits.id}\n"
)
XSDebug
(
p
"
[b] id: ${in.b.bits.id}\n"
)
}
when
(
in
.
r
.
fire
()){
printf
(
p
"[$timer]
[r] id: ${in.r.bits.id}\n"
)
XSDebug
(
p
"
[r] id: ${in.r.bits.id}\n"
)
}
...
...
src/main/scala/device/TLTimer.scala
浏览文件 @
e2801f97
...
...
@@ -44,8 +44,8 @@ class TLTimer(address: Seq[AddressSet], sim: Boolean)(implicit p: Parameters) ex
0xbff8
->
RegField
.
bytes
(
mtime
)
)
val
gtime
=
GTimer
()
printf
(
p
"[$gtime][Timer] mtime=$mtime cnt=$cnt freq=$freq\n"
)
//
val gtime = GTimer()
//
printf(p"[$gtime][Timer] mtime=$mtime cnt=$cnt freq=$freq\n")
mtip
:=
RegNext
(
mtime
>=
mtimecmp
)
}
...
...
src/main/scala/utils/DebugIdentityNode.scala
浏览文件 @
e2801f97
...
...
@@ -4,8 +4,9 @@ import chisel3._
import
chipsalliance.rocketchip.config.Parameters
import
freechips.rocketchip.diplomacy.
{
LazyModule
,
LazyModuleImp
}
import
freechips.rocketchip.tilelink.
{
TLClientNode
,
TLIdentityNode
,
TLMasterParameters
,
TLMasterPortParameters
}
import
xiangshan.HasXSLog
class
DebugIdentityNode
()(
implicit
p
:
Parameters
)
extends
LazyModule
{
class
DebugIdentityNode
()(
implicit
p
:
Parameters
)
extends
LazyModule
{
val
node
=
TLIdentityNode
()
...
...
@@ -15,17 +16,16 @@ class DebugIdentityNode()(implicit p: Parameters) extends LazyModule {
)
)))
lazy
val
module
=
new
LazyModuleImp
(
this
){
lazy
val
module
=
new
LazyModuleImp
(
this
)
with
HasXSLog
with
HasTLDump
{
val
(
out
,
_
)
=
node
.
out
(
0
)
val
(
in
,
_
)
=
node
.
in
(
0
)
val
timer
=
GTimer
()
when
(
in
.
a
.
fire
()){
printf
(
p
"[$timer][A] addr: ${Hexadecimal(in.a.bits.address)} "
+
p
"opcode: ${in.a.bits.opcode} data: ${Hexadecimal(in.a.bits.data)} size: ${in.a.bits.size} source: ${in.a.bits.source}\n"
)
XSDebug
(
" "
)
in
.
a
.
bits
.
dump
}
when
(
in
.
d
.
fire
()){
printf
(
p
"[$timer][D] opcode: ${in.d.bits.opcode} data: ${Hexadecimal(in.d.bits.data)} size:${in.d.bits.size} source: ${in.d.bits.source}\n"
)
XSDebug
(
" "
)
in
.
d
.
bits
.
dump
}
}
}
...
...
src/main/scala/utils/TLDump.scala
0 → 100644
浏览文件 @
e2801f97
package
utils
import
chisel3._
import
freechips.rocketchip.tilelink.
{
TLBundle
,
TLBundleA
,
TLBundleB
,
TLBundleC
,
TLBundleD
,
TLBundleE
,
TLChannel
}
trait
HasTLDump
{
implicit
class
dumpA
(
a
:
TLBundleA
)
{
def
dump
=
printf
(
s
"${a.channelName} opcode: %x param: %x size: %x source: %d address: %x mask: %x data: %x corrupt: %b\n"
,
a
.
opcode
,
a
.
param
,
a
.
size
,
a
.
source
,
a
.
address
,
a
.
mask
,
a
.
data
,
a
.
corrupt
)
}
implicit
class
dumpB
(
b
:
TLBundleB
)
{
def
dump
=
printf
(
s
"${b.channelName} opcode: %x param: %x size: %x source: %d address: %x mask: %x data: %x corrupt: %b\n"
,
b
.
opcode
,
b
.
param
,
b
.
size
,
b
.
source
,
b
.
address
,
b
.
mask
,
b
.
data
,
b
.
corrupt
)
}
implicit
class
dumpC
(
c
:
TLBundleC
)
{
def
dump
=
printf
(
s
"${c.channelName} opcode: %x param: %x size: %x source: %d address: %x data: %x corrupt: %b\n"
,
c
.
opcode
,
c
.
param
,
c
.
size
,
c
.
source
,
c
.
address
,
c
.
data
,
c
.
corrupt
)
}
implicit
class
dumpD
(
d
:
TLBundleD
)
{
def
dump
=
printf
(
s
"${d.channelName} opcode: %x param: %x size: %x source: %d sink: %d denied: %b data: %x corrupt: %b\n"
,
d
.
opcode
,
d
.
param
,
d
.
size
,
d
.
source
,
d
.
sink
,
d
.
denied
,
d
.
data
,
d
.
corrupt
)
}
implicit
class
dumpE
(
e
:
TLBundleE
)
{
def
dump
=
printf
(
s
"${e.channelName} sink: %d\n"
,
e
.
sink
)
}
}
src/main/scala/xiangshan/cache/missQueue.scala
浏览文件 @
e2801f97
...
...
@@ -3,7 +3,7 @@ package xiangshan.cache
import
chisel3._
import
chisel3.util._
import
freechips.rocketchip.tilelink._
import
utils.
XSDebug
import
utils.
{
HasTLDump
,
XSDebug
}
class
MissReq
extends
DCacheBundle
{
...
...
@@ -344,7 +344,7 @@ class MissEntry(edge: TLEdgeOut) extends DCacheModule
}
class
MissQueue
(
edge
:
TLEdgeOut
)
extends
DCacheModule
class
MissQueue
(
edge
:
TLEdgeOut
)
extends
DCacheModule
with
HasTLDump
{
val
io
=
IO
(
new
Bundle
{
val
req
=
Flipped
(
DecoupledIO
(
new
MissReq
))
...
...
@@ -469,17 +469,16 @@ class MissQueue(edge: TLEdgeOut) extends DCacheModule
io
.
wb_req
.
bits
.
way_en
,
io
.
wb_req
.
bits
.
voluntary
)
// print tilelink messages
// TODO: impl TLBundle.dump
when
(
io
.
mem_acquire
.
fire
())
{
XSDebug
(
"mem_acquire "
)
//
io.mem_acquire.bits.dump
io
.
mem_acquire
.
bits
.
dump
}
when
(
io
.
mem_grant
.
fire
())
{
XSDebug
(
"mem_grant "
)
//
io.mem_grant.bits.dump
io
.
mem_grant
.
bits
.
dump
}
when
(
io
.
mem_finish
.
fire
())
{
XSDebug
(
"mem_finish "
)
//
io.mem_finish.bits.dump
io
.
mem_finish
.
bits
.
dump
}
}
src/main/scala/xiangshan/cache/uncache.scala
浏览文件 @
e2801f97
...
...
@@ -2,7 +2,7 @@ package xiangshan.cache
import
chisel3._
import
chisel3.util._
import
utils.
XSDebug
import
utils.
{
HasTLDump
,
XSDebug
}
import
chipsalliance.rocketchip.config.Parameters
import
freechips.rocketchip.diplomacy.
{
IdRange
,
LazyModule
,
LazyModuleImp
,
TransferSizes
}
import
freechips.rocketchip.tilelink.
{
TLArbiter
,
TLBundleA
,
TLBundleD
,
TLClientNode
,
TLEdgeOut
,
TLMasterParameters
,
TLMasterPortParameters
}
...
...
@@ -138,6 +138,7 @@ class UncacheImp(outer: Uncache)
extends
LazyModuleImp
(
outer
)
with
HasDCacheParameters
with
HasXSLog
with
HasTLDump
{
val
io
=
IO
(
new
UncacheIO
)
...
...
@@ -199,13 +200,12 @@ class UncacheImp(outer: Uncache)
XSDebug
(
resp
.
fire
(),
"data: %x\n"
,
req
.
bits
.
data
)
// print tilelink messages
// TODO: add dump info
when
(
mem_acquire
.
fire
())
{
XSDebug
(
"mem_acquire \n"
)
//
mem_acquire.bits.dump
mem_acquire
.
bits
.
dump
}
when
(
mem_grant
.
fire
())
{
XSDebug
(
"mem_grant \n"
)
//
mem_grant.bits.dump
mem_grant
.
bits
.
dump
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录