Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tools
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
public-release-test-restored
platform
vendor
qcom-opensource
tools
Commits
104da945
Commit
104da945
authored
7 years ago
by
lnx build
Committed by
Gerrit - the friendly Code Review server
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge "lrdp_v2: Add script to compare l1_cache contents" into opensource-tools.lnx.1.0-dev.1.0
parents
ad035dec
63b2e537
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
linux-ramdump-parser-v2/parsers/l1_cache_compare.py
+103
-0
103 additions, 0 deletions
linux-ramdump-parser-v2/parsers/l1_cache_compare.py
with
103 additions
and
0 deletions
linux-ramdump-parser-v2/parsers/l1_cache_compare.py
0 → 100755
+
103
−
0
View file @
104da945
# Copyright (c) 2017 The Linux Foundation. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 and
# only version 2 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
import
os
import
re
from
parser_util
import
register_parser
,
RamParser
file_names
=
[
'
MSM_DUMP_DATA_L1_DATA_CACHE_0x0
'
,
'
MSM_DUMP_DATA_L1_DATA_CACHE_0x1
'
,
'
MSM_DUMP_DATA_L1_DATA_CACHE_0x2
'
,
'
MSM_DUMP_DATA_L1_DATA_CACHE_0x3
'
,
'
MSM_DUMP_DATA_L1_DATA_CACHE_0x4
'
,
'
MSM_DUMP_DATA_L1_DATA_CACHE_0x5
'
,
'
MSM_DUMP_DATA_L1_DATA_CACHE_0x6
'
,
'
MSM_DUMP_DATA_L1_DATA_CACHE_0x7
'
]
@register_parser
(
'
--l1-compare
'
,
'
Compare L1 Cache Data with DDR contents
'
)
class
L1_Cache_Compare
(
RamParser
):
def
parse
(
self
):
with
self
.
ramdump
.
open_file
(
'
l1_cache.txt
'
)
as
out_l1_cache
:
for
file_name
in
file_names
:
file_path
=
os
.
path
.
join
(
self
.
ramdump
.
outdir
,
file_name
)
if
os
.
path
.
isfile
(
file_path
):
out_l1_cache
.
write
(
'
\n
-----begin
'
+
file_name
+
'
-----
\n
'
)
addr
=
None
values_from_file
=
None
values_from_dump
=
None
fin
=
self
.
ramdump
.
open_file
(
file_path
,
'
r
'
)
line_no
=
0
for
line
in
fin
:
line_no
+=
1
if
line
==
''
:
continue
elif
re
.
match
(
'
^Way Set P MOESI RAW_MOESI N.*
'
,
line
):
continue
elif
len
(
line
)
>=
195
:
colm
=
line
.
split
()
# Read address value from file
addr
=
colm
[
6
]
# Read values from file
values_from_file
=
[]
for
i
in
range
(
11
,
27
):
values_from_file
.
append
(
colm
[
i
])
# Read values from dump
values_from_dump
=
[]
temp_addr
=
int
(
addr
,
16
)
val
=
None
if
temp_addr
>
self
.
ramdump
.
phys_offset
:
for
i
in
range
(
0
,
16
):
try
:
val
=
self
.
ramdump
.
read_physical
(
temp_addr
,
4
)
except
:
out_l1_cache
.
write
(
'
Exception while reading {0:x}
'
.
format
(
temp_addr
))
val
=
val
[::
-
1
]
val
=
val
.
encode
(
'
hex
'
)
values_from_dump
.
append
(
val
)
temp_addr
+=
4
# compare both values
if
values_from_dump
!=
[]
and
\
values_from_dump
!=
values_from_file
:
out_l1_cache
.
write
(
'
phy addr: {0} Way:{1} Set:{2} P:{3} MOESI:{4}
'
.
format
(
addr
,
colm
[
0
],
colm
[
1
],
colm
[
2
],
colm
[
3
])
+
'
\n
'
)
out_l1_cache
.
write
(
'
Cache content:
'
+
'
'
.
join
(
values_from_file
)
+
'
\n
'
)
out_l1_cache
.
write
(
'
DDR content :
'
+
'
'
.
join
(
values_from_dump
)
+
'
\n\n
'
)
fin
.
close
()
out_l1_cache
.
write
(
'
------end
'
+
file_name
+
'
------
\n
'
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment