Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PyPCC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
LOFAR2.0
PyPCC
Commits
729bff3f
Commit
729bff3f
authored
4 years ago
by
Paulus Kruger
Browse files
Options
Downloads
Patches
Plain Diff
Startup script added
parent
446fbcf9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
scripts/CLK_reset.py
+16
-0
16 additions, 0 deletions
scripts/CLK_reset.py
scripts/RCUupdate.py
+2
-1
2 additions, 1 deletion
scripts/RCUupdate.py
scripts/Startup.py
+47
-0
47 additions, 0 deletions
scripts/Startup.py
scripts/test_common.py
+14
-4
14 additions, 4 deletions
scripts/test_common.py
with
79 additions
and
5 deletions
scripts/CLK_reset.py
0 → 100644
+
16
−
0
View file @
729bff3f
from
test_common
import
*
#callmethod("CLK_off")
#time.sleep(3)
#callmethod("CLK_on")
#time.sleep(3)
callmethod
(
"
CLK_PLL_reset
"
)
#exit()
#time.sleep(1)
#callmethod("CLK_update")
#callmethod("RCU_on")
#time.sleep(1)
#callmethod("ADC_on")
disconnect
();
This diff is collapsed.
Click to expand it.
scripts/RCUupdate.py
+
2
−
1
View file @
729bff3f
from
test_common
import
*
RCUs
=
[
3
];
RCUs
=
[
0
,
1
,
2
,
3
];
setRCUmask
(
RCUs
)
#for RCU in RCUs:
setAntmask
(
RCUs
,[
True
,
True
,
True
])
callmethod
(
"
RCU_update
"
)
#callmethod("CLK_update")
disconnect
();
\ No newline at end of file
This diff is collapsed.
Click to expand it.
scripts/Startup.py
0 → 100644
+
47
−
0
View file @
729bff3f
from
test_common
import
*
RCUs
=
[
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
];
restart
=
False
;
#False do not restart, but only check status
if
restart
:
print
(
"
Startup CLK
"
);
if
restart
:
callmethod
(
"
CLK_off
"
)
wait_not_busy
(
"
CLK_translator_busy_R
"
)
if
restart
:
callmethod
(
"
CLK_on
"
)
wait_not_busy
(
"
CLK_translator_busy_R
"
)
print
(
"
CLK status:
"
)
locked
=
get_value
(
"
CLK_PLL_locked_R
"
)
if
locked
:
print
(
"
CLK working (locked)
"
)
else
:
#not locked:
i2c_status
=
get_value
(
"
CLK_I2C_STATUS_R
"
);
if
(
i2c_status
>
0
):
print
(
"
CLK I2C not working. Maybe power cycle subrack to restart CLK board and translator.
"
)
else
:
print
(
"
CLK not locked! Subrack probably do not receive clock input (or CLK PCB broken)
"
)
setRCUmask
(
RCUs
)
if
restart
:
print
(
"
Startup RCUs:
"
,
RCUs
);
if
restart
:
callmethod
(
"
RCU_off
"
)
wait_not_busy
(
"
RCU_translator_busy_R
"
)
if
restart
:
callmethod
(
"
RCU_on
"
)
wait_not_busy
(
"
RCU_translator_busy_R
"
)
print
(
"
RCU status:
"
)
i2c_status
=
get_value
(
"
RCU_I2C_STATUS_R
"
)
i2c_working
=
[];
i2c_not_working
=
[]
for
x
in
RCUs
:
(
i2c_working
.
append
(
x
)
if
i2c_status
[
x
]
==
0
else
i2c_not_working
.
append
(
x
))
if
len
(
i2c_not_working
)
>
0
:
print
(
"
RCUs not availabel
"
,
i2c_not_working
)
locked
=
get_value
(
"
RCU_ADC_lock_R
"
)
locklist
=
[];
notlocklist
=
[]
for
x
in
i2c_working
:
if
(
locked
[
x
*
3
+
0
]
>
0
)
and
(
locked
[
x
*
3
+
1
]
>
0
)
and
(
locked
[
x
*
3
+
2
]
>
0
):
locklist
.
append
(
x
)
else
:
notlocklist
.
append
(
x
)
# (locklist.append(x) if locked[x]>0 else notlocklist.append(x))
print
(
"
RCUs working
"
,
locklist
)
if
len
(
notlocklist
)
>
0
:
print
(
"
RCUs with unlocked ADCs:
"
,
notlocklist
)
disconnect
();
This diff is collapsed.
Click to expand it.
scripts/test_common.py
+
14
−
4
View file @
729bff3f
...
...
@@ -36,24 +36,24 @@ def set_value(name,value):
def
setRCUmask
(
rcu
=
[]):
name
=
"
RCU_mask_RW
"
M
=
get_value
(
name
)
print
(
name
,
"
old:
"
,
M
)
#
print(name," old:",M)
M
=
[
False
for
m
in
M
]
for
r
in
rcu
:
M
[
r
]
=
True
set_value
(
name
,
M
)
print
(
name
,
"
new:
"
,
get_value
(
name
))
#
print(name," new:",get_value(name))
def
setAntmask
(
rcu
=
[],
ant
=
[
True
,
True
,
True
]):
name
=
"
Ant_mask_RW
"
M
=
get_value
(
name
)
print
(
name
,
"
old:
"
,
M
)
#
print(name," old:",M)
for
i
,
j
in
enumerate
(
M
):
M
[
i
]
=
False
for
r
in
rcu
:
for
i
in
range
(
3
):
M
[
r
*
3
+
i
]
=
ant
[
i
]
set_value
(
name
,
M
)
print
(
name
,
"
new:
"
,
get_value
(
name
))
#
print(name," new:",get_value(name))
def
callmethod
(
name
):
try
:
...
...
@@ -62,3 +62,13 @@ def callmethod(name):
except
:
# print("error")
return
None
def
wait_not_busy
(
var1
,
timeout_sec
=
2
):
for
x
in
range
(
int
(
timeout_sec
*
10
)):
busy
=
get_value
(
var1
)
if
not
(
busy
):
# print("Wait time=%f s" %(x/10))
return
True
time
.
sleep
(
0.1
)
print
(
"
Timeout waiting for translator:
"
,
var1
)
return
False
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