Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
KED ARM trusted-firmware Fork
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
KED Software Projects
Miscellaneous
KED ARM trusted-firmware Fork
Commits
7c72beae
Commit
7c72beae
authored
5 years ago
by
Sandrine Bailleux
Committed by
TrustedFirmware Code Review
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge "tools: Small improvement to print_memory_map script" into integration
parents
8d48810f
b890b36d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Makefile
+2
-1
2 additions, 1 deletion
Makefile
docs/getting_started/build-options.rst
+5
-0
5 additions, 0 deletions
docs/getting_started/build-options.rst
tools/memory/print_memory_map.py
+21
-10
21 additions, 10 deletions
tools/memory/print_memory_map.py
with
28 additions
and
11 deletions
Makefile
+
2
−
1
View file @
7c72beae
...
@@ -779,6 +779,7 @@ $(eval $(call assert_boolean,GENERATE_COT))
...
@@ -779,6 +779,7 @@ $(eval $(call assert_boolean,GENERATE_COT))
$(
eval
$(
call assert_boolean,GICV2_G0_FOR_EL3
))
$(
eval
$(
call assert_boolean,GICV2_G0_FOR_EL3
))
$(
eval
$(
call assert_boolean,HANDLE_EA_EL3_FIRST
))
$(
eval
$(
call assert_boolean,HANDLE_EA_EL3_FIRST
))
$(
eval
$(
call assert_boolean,HW_ASSISTED_COHERENCY
))
$(
eval
$(
call assert_boolean,HW_ASSISTED_COHERENCY
))
$(
eval
$(
call assert_boolean,INVERTED_MEMMAP
))
$(
eval
$(
call assert_boolean,MEASURED_BOOT
))
$(
eval
$(
call assert_boolean,MEASURED_BOOT
))
$(
eval
$(
call assert_boolean,NS_TIMER_SWITCH
))
$(
eval
$(
call assert_boolean,NS_TIMER_SWITCH
))
$(
eval
$(
call assert_boolean,OVERRIDE_LIBC
))
$(
eval
$(
call assert_boolean,OVERRIDE_LIBC
))
...
@@ -1120,7 +1121,7 @@ romlib.bin: libraries
...
@@ -1120,7 +1121,7 @@ romlib.bin: libraries
# Call print_memory_map tool
# Call print_memory_map tool
memmap
:
all
memmap
:
all
${
Q
}${
PYTHON
}
$
(
PRINT_MEMORY_MAP
)
$
(
BUILD_PLAT
)
${
Q
}${
PYTHON
}
$
{
PRINT_MEMORY_MAP
}
$
{
BUILD_PLAT
}
${
INVERTED_MEMMAP
}
doc
:
doc
:
@
echo
" BUILD DOCUMENTATION"
@
echo
" BUILD DOCUMENTATION"
...
...
This diff is collapsed.
Click to expand it.
docs/getting_started/build-options.rst
+
5
−
0
View file @
7c72beae
...
@@ -340,6 +340,11 @@ Common build options
...
@@ -340,6 +340,11 @@ Common build options
translation library (xlat tables v2) must be used; version 1 of translation
translation library (xlat tables v2) must be used; version 1 of translation
library is not supported.
library is not supported.
- ``INVERTED_MEMMAP``: memmap tool print by default lower addresses at the
bottom, higher addresses at the top. This buid flag can be set to '1' to
invert this behavior. Lower addresses will be printed at the top and higher
addresses at the bottom.
- ``JUNO_AARCH32_EL3_RUNTIME``: This build flag enables you to execute EL3
- ``JUNO_AARCH32_EL3_RUNTIME``: This build flag enables you to execute EL3
runtime software in AArch32 mode, which is required to run AArch32 on Juno.
runtime software in AArch32 mode, which is required to run AArch32 on Juno.
By default this flag is set to '0'. Enabling this flag builds BL1 and BL2 in
By default this flag is set to '0'. Enabling this flag builds BL1 and BL2 in
...
...
This diff is collapsed.
Click to expand it.
tools/memory/print_memory_map.py
+
21
−
10
View file @
7c72beae
#!/usr/bin/env python3
#!/usr/bin/env python3
#
#
# Copyright (c) 2019, Arm Limited. All rights reserved.
# Copyright (c) 2019
-2020
, Arm Limited. All rights reserved.
#
#
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-License-Identifier: BSD-3-Clause
#
#
...
@@ -22,6 +22,7 @@ blx_symbols = ['__BL1_RAM_START__', '__BL1_RAM_END__',
...
@@ -22,6 +22,7 @@ blx_symbols = ['__BL1_RAM_START__', '__BL1_RAM_END__',
'
__DATA_START__
'
,
'
__DATA_END__
'
,
'
__DATA_START__
'
,
'
__DATA_END__
'
,
'
__STACKS_START__
'
,
'
__STACKS_END__
'
,
'
__STACKS_START__
'
,
'
__STACKS_END__
'
,
'
__BSS_END
'
,
'
__BSS_END
'
,
'
__COHERENT_RAM_START__
'
,
'
__COHERENT_RAM_END__
'
,
]
]
# Regex to extract address from map file
# Regex to extract address from map file
...
@@ -31,8 +32,11 @@ address_pattern = re.compile(r"\b0x\w*")
...
@@ -31,8 +32,11 @@ address_pattern = re.compile(r"\b0x\w*")
address_list
=
[]
address_list
=
[]
# Get the directory from command line or use a default one
# Get the directory from command line or use a default one
inverted_print
=
True
if
len
(
sys
.
argv
)
>=
2
:
if
len
(
sys
.
argv
)
>=
2
:
build_dir
=
sys
.
argv
[
1
]
build_dir
=
sys
.
argv
[
1
]
if
len
(
sys
.
argv
)
>=
3
:
inverted_print
=
sys
.
argv
[
2
]
==
'
0
'
else
:
else
:
build_dir
=
'
build/fvp/debug
'
build_dir
=
'
build/fvp/debug
'
...
@@ -43,7 +47,10 @@ for image in bl_images:
...
@@ -43,7 +47,10 @@ for image in bl_images:
with
open
(
file_path
,
'
rt
'
)
as
mapfile
:
with
open
(
file_path
,
'
rt
'
)
as
mapfile
:
for
line
in
mapfile
:
for
line
in
mapfile
:
for
symbol
in
blx_symbols
:
for
symbol
in
blx_symbols
:
if
line
.
find
(
symbol
)
>
0
and
line
.
find
(
"
ASSERT
"
)
<
0
:
# Regex to find symbol definition
line_pattern
=
re
.
compile
(
r
"
\b0x\w*\s*
"
+
symbol
+
"
\s= .
"
)
match
=
line_pattern
.
search
(
line
)
if
match
:
# Extract address from line
# Extract address from line
match
=
address_pattern
.
search
(
line
)
match
=
address_pattern
.
search
(
line
)
if
match
:
if
match
:
...
@@ -52,17 +59,21 @@ for image in bl_images:
...
@@ -52,17 +59,21 @@ for image in bl_images:
# Sort by address
# Sort by address
address_list
.
sort
(
key
=
operator
.
itemgetter
(
0
))
address_list
.
sort
(
key
=
operator
.
itemgetter
(
0
))
# Invert list for lower address at bottom
if
inverted_print
:
address_list
=
reversed
(
address_list
)
# Generate memory view
# Generate memory view
print
(
'
{:-^
87
}
'
.
format
(
'
Memory Map from:
'
+
build_dir
))
print
(
'
{:-^
93
}
'
.
format
(
'
Memory Map from:
'
+
build_dir
))
for
address
in
reversed
(
address_list
)
:
for
address
in
address_list
:
if
"
bl1
"
in
address
[
2
]:
if
"
bl1
"
in
address
[
2
]:
print
(
address
[
0
],
'
+{:-^2
0
}+ |{:^2
0
}| |{:^2
0
}|
'
.
format
(
address
[
1
],
''
,
''
))
print
(
address
[
0
],
'
+{:-^2
2
}+ |{:^2
2
}| |{:^2
2
}|
'
.
format
(
address
[
1
],
''
,
''
))
elif
"
bl2
"
in
address
[
2
]:
elif
"
bl2
"
in
address
[
2
]:
print
(
address
[
0
],
'
|{:^2
0
}| +{:-^2
0
}+ |{:^2
0
}|
'
.
format
(
''
,
address
[
1
],
''
))
print
(
address
[
0
],
'
|{:^2
2
}| +{:-^2
2
}+ |{:^2
2
}|
'
.
format
(
''
,
address
[
1
],
''
))
elif
"
bl31
"
in
address
[
2
]:
elif
"
bl31
"
in
address
[
2
]:
print
(
address
[
0
],
'
|{:^2
0
}| |{:^2
0
}| +{:-^2
0
}+
'
.
format
(
''
,
''
,
address
[
1
]))
print
(
address
[
0
],
'
|{:^2
2
}| |{:^2
2
}| +{:-^2
2
}+
'
.
format
(
''
,
''
,
address
[
1
]))
else
:
else
:
print
(
address
[
0
],
'
|{:^2
0
}| |{:^2
0
}| +{:-^2
0
}+
'
.
format
(
''
,
''
,
address
[
1
]))
print
(
address
[
0
],
'
|{:^2
2
}| |{:^2
2
}| +{:-^2
2
}+
'
.
format
(
''
,
''
,
address
[
1
]))
print
(
'
{:^20}{:_^2
0
} {:_^2
0
} {:_^2
0
}
'
.
format
(
''
,
''
,
''
,
''
))
print
(
'
{:^20}{:_^2
2
} {:_^2
2
} {:_^2
2
}
'
.
format
(
''
,
''
,
''
,
''
))
print
(
'
{:^20}{:^2
0
} {:^2
0
} {:^2
0
}
'
.
format
(
'
address
'
,
'
bl1
'
,
'
bl2
'
,
'
bl31
'
))
print
(
'
{:^20}{:^2
2
} {:^2
2
} {:^2
2
}
'
.
format
(
'
address
'
,
'
bl1
'
,
'
bl2
'
,
'
bl31
'
))
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