Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MooreOnline
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
LHCb
MooreOnline
Commits
17b38e7e
Commit
17b38e7e
authored
10 months ago
by
Andre Gunther
Browse files
Options
Downloads
Patches
Plain Diff
add testbench arg for writing encoding keys
parent
1bcb76e5
No related branches found
No related tags found
1 merge request
!429
Testbench throughput and profiling updates
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MooreScripts/python/MooreScripts/testbench/architecture.py
+25
-0
25 additions, 0 deletions
MooreScripts/python/MooreScripts/testbench/architecture.py
MooreScripts/scripts/testbench.py
+9
-0
9 additions, 0 deletions
MooreScripts/scripts/testbench.py
with
34 additions
and
0 deletions
MooreScripts/python/MooreScripts/testbench/architecture.py
+
25
−
0
View file @
17b38e7e
...
...
@@ -12,6 +12,7 @@ import os
import
platform
import
xml.etree.ElementTree
as
ET
from
string
import
Template
from
typing
import
Any
def
node_name
():
...
...
@@ -92,3 +93,27 @@ def instance_args(tasks, replacements):
"
INSTANCE
"
:
instance
,
}))
return
result
def
overwrite_dict_value
(
data
:
Any
,
mapping
:
dict
)
->
Any
:
"""
Recursively loop through data and overwrite item
'
s value with corresponding mapping
'
s value.
Args:
data (Any): Iterable input datra
mapping (dict): Key value pairs to overwrite.
Returns:
Any: Overwritten data.
"""
if
isinstance
(
data
,
dict
):
return
{
k
:
mapping
[
k
]
if
k
in
mapping
.
keys
()
else
overwrite_dict_value
(
v
,
mapping
)
for
k
,
v
in
data
.
items
()
}
elif
isinstance
(
data
,
list
):
return
[
overwrite_dict_value
(
item
,
mapping
)
for
item
in
data
]
elif
isinstance
(
data
,
tuple
):
return
(
overwrite_dict_value
(
item
,
mapping
)
for
item
in
data
)
else
:
return
data
This diff is collapsed.
Click to expand it.
MooreScripts/scripts/testbench.py
+
9
−
0
View file @
17b38e7e
...
...
@@ -117,6 +117,12 @@ parser.add_argument(
type
=
int
,
help
=
"
Number of files to download from the TestFileDB entry
"
,
)
parser
.
add_argument
(
"
--write-encoding-keys
"
,
action
=
"
store_true
"
,
help
=
"
Enables writing of the encoding keys by setting env WRITE_ENCODING_KEYS=1.
"
,
)
args
,
unknown_argv
=
parser
.
parse_known_args
()
args
.
data_dir
=
args
.
working_dir
/
args
.
data_dir
...
...
@@ -151,6 +157,9 @@ replacements = {
}
arch
=
architecture
.
read_xml
(
args
.
architecture
)
if
args
.
write_encoding_keys
:
arch
=
architecture
.
overwrite_dict_value
(
arch
,
{
"
WRITE_ENCODING_KEYS
"
:
"
1
"
})
task_instance_args
=
architecture
.
instance_args
(
arch
,
replacements
)
emulator
.
check_for_orphans
([
a
[
"
args
"
][
0
]
for
a
in
task_instance_args
])
...
...
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