Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Scan-Operator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
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
YARR
Utilities
Scan-Operator
Commits
6d139e17
Commit
6d139e17
authored
4 years ago
by
Mario
Browse files
Options
Downloads
Patches
Plain Diff
bugFix on parameterOptimizer.py
parent
e044341d
No related branches found
No related tags found
No related merge requests found
Pipeline
#2640595
passed
4 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
configs/so_optimizer.json
+17
-5
17 additions, 5 deletions
configs/so_optimizer.json
libDCS/parameterOptimizer.py
+17
-9
17 additions, 9 deletions
libDCS/parameterOptimizer.py
with
34 additions
and
14 deletions
configs/so_optimizer.json
+
17
−
5
View file @
6d139e17
{
"targetChipNumber"
:
4
,
"targetChipNumber"
:
1
,
"repetitions"
:
2
,
"parameters"
:
[
{
"name"
:
"CmlTapBias0"
,
"min"
:
5
00
,
"max"
:
8
00
,
"min"
:
3
00
,
"max"
:
9
00
,
"step"
:
100
},
{
"name"
:
"CmlTapBias1"
,
"min"
:
10
0
,
"max"
:
3
00
,
"min"
:
0
,
"max"
:
4
00
,
"step"
:
100
}
],
...
...
@@ -41,6 +41,18 @@
"min"
:
20
,
"max"
:
26
,
"step"
:
1
},
{
"name"
:
"OutputActiveLanes"
,
"min"
:
1
,
"max"
:
15
,
"step"
:
1
},
{
"name"
:
"CmlEn"
,
"min"
:
1
,
"max"
:
7
,
"step"
:
6
}
]
}
This diff is collapsed.
Click to expand it.
libDCS/parameterOptimizer.py
+
17
−
9
View file @
6d139e17
...
...
@@ -35,6 +35,8 @@ def count0(enMaskPath):
data
=
json
.
load
(
file1
)
for
y
in
data
[
"
Data
"
]:
badPixels
+=
y
.
count
(
0
)
return
float
(
badPixels
)
except
:
...
...
@@ -75,10 +77,11 @@ def updatecfg(args, chipName, name_v1, name_v2, v1range, v2range, xtest, ytest):
cfg
=
json
.
load
(
f
)
cfg
[
"
RD53A
"
][
"
GlobalConfig
"
][
name_v1
]
=
v1range
[
xtest
]
cfg
[
"
RD53A
"
][
"
GlobalConfig
"
][
name_v2
]
=
v2range
[
ytest
]
with
open
(
chipCfg
,
'
w
'
)
as
f
:
json
.
dump
(
cfg
,
f
,
indent
=
4
)
def
find
(
args
):
"""
Finds a minimum amongst some setting parameters
"""
...
...
@@ -173,12 +176,14 @@ def find(args):
# run first digitalScan
total
=
0
for
j
in
range
(
nReps
):
print
(
"
[ info ][po] Running a digital scan at %i %i...
"
%
(
v1range
[
xtest0
[
i
]],
v2range
[
ytest0
[
i
]]))
print
(
"
[ info ][po] Running a digital scan at %i %i...
"
%
(
v1range
[
xtest0
[
i
]],
v2range
[
ytest0
[
i
]]))
process
=
subprocess
.
Popen
(
cmd
.
split
(),
stdout
=
subprocess
.
PIPE
)
output
,
error
=
process
.
communicate
()
enMaskPath
=
args
.
basepath
+
"
/data/optimizer/last_scan/
"
+
chipName
+
"
_EnMask.json
"
count
=
count0
(
enMaskPath
)
print
(
"
-> Counted %i
"
%
count
)
total
+=
count
if
count
<
0
:
...
...
@@ -211,12 +216,12 @@ def find(args):
lookaround_y
=
min
(
prev3validY
)
if
prev3validY
!=
[]
else
randint
(
0
,
len
(
v2range
)
-
1
)
xtest1
,
ytest1
=
whereToGoNext
(
lookaround_x
,
lookaround_y
,
results
)
updatecfg
(
args
,
chipName
,
name_v1
,
name_v2
,
v1range
,
v2range
,
xtest1
,
ytest1
)
print
(
"
[ info ][po] Entering the loop...
"
)
while
True
:
updatecfg
(
args
,
chipName
,
name_v1
,
name_v2
,
v1range
,
v2range
,
xtest1
,
ytest1
)
# power cycle
if
args
.
powercycle
:
os
.
system
(
"
python3 libDCS/qaqc.py -e
"
+
args
.
equip
+
"
-c
"
+
args
.
channel
+
"
power-off
"
)
...
...
@@ -224,12 +229,8 @@ def find(args):
print
()
# If the matrix is filled
if
xtest1
==
None
:
return
# If we have already tested this point
el
if
results
[
xtest1
][
ytest1
]
!=
'
'
:
if
results
[
xtest1
][
ytest1
]
!=
'
'
:
# Find another one random
xtest1
=
randint
(
0
,
len
(
v1range
))
...
...
@@ -248,6 +249,8 @@ def find(args):
enMaskPath
=
args
.
basepath
+
"
/data/optimizer/last_scan/
"
+
chipName
+
"
_EnMask.json
"
count
=
count0
(
enMaskPath
)
print
(
"
-> Counted %i
"
%
count
)
total
+=
count
if
count
<
0
:
...
...
@@ -281,6 +284,11 @@ def find(args):
print
(
""
)
print
(
t
)
# If the matrix is filled
if
xtest1
==
None
:
return
...
...
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