Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
Conv TTL Blocking
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Conv TTL Blocking
Commits
fa72b27e
Commit
fa72b27e
authored
Aug 22, 2014
by
Theodor-Adrian Stana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes in diagnostics scripts, accounting for new memory map
parent
fab59cbd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
19 deletions
+59
-19
getsr.py
software/diag/getsr.py
+11
-5
therm.py
software/diag/therm.py
+1
-1
README.txt
software/diag/timetag/README.txt
+1
-0
getlatestts.py
software/diag/timetag/getlatestts.py
+46
-13
No files found.
software/diag/getsr.py
View file @
fa72b27e
...
...
@@ -75,11 +75,11 @@ if __name__ == "__main__":
# Strip SWITCHES and print
switches
=
(
v
&
0xff00
)
>>
8
print
(
"Switches : 0x
%02
x"
%
switches
)
if
not
(
switches
&
0x80
):
if
(
switches
&
0x80
):
print
(
" TTL repetition : on"
)
else
:
print
(
" TTL repetition : off"
)
if
not
(
switches
&
0x01
):
if
(
switches
&
0x01
):
print
(
" Glitch filter : on"
)
else
:
print
(
" Glitch filter : off"
)
...
...
@@ -89,13 +89,19 @@ if __name__ == "__main__":
rtmm
=
rtm
&
0x7
rtmp
=
(
rtm
&
0x3f
)
>>
3
print
(
"RTM detection : 0x
%02
x"
%
rtm
)
print
(
" RTMM[2:0] :
%
s"
%
(
"{0:#0
3
b}"
.
format
(
rtmm
)[
2
:]))
print
(
" RTMP[2:0] :
%
s"
%
(
"{0:#0
3
b}"
.
format
(
rtmp
)[
2
:]))
print
(
" RTMM[2:0] :
%
s"
%
(
"{0:#0
5
b}"
.
format
(
rtmm
)[
2
:]))
print
(
" RTMP[2:0] :
%
s"
%
(
"{0:#0
5
b}"
.
format
(
rtmp
)[
2
:]))
# Strip the other status bits and print
print
(
"I2C timeout error :
%
s"
%
(
"{0:#01b}"
.
format
(
int
(
bool
(
v
&
(
1
<<
22
))))[
2
]))
print
(
"White Rabbit pres. :
%
s"
%
(
"{0:#01b}"
.
format
(
int
(
bool
(
v
&
(
1
<<
23
))))[
2
]))
print
(
"I2C address error :
%
s"
%
(
"{0:#01b}"
.
format
(
int
(
bool
(
v
&
(
1
<<
24
))))[
2
]))
print
(
"Pulse miss error :
%
s"
%
(
"{0:#01b}"
.
format
(
int
(
bool
(
v
&
(
1
<<
25
))))[
2
]))
print
(
"Pulse miss error : 0x
%02
x"
%
((
v
&
0x7e000000
)
>>
24
))
print
(
" CH1 :
%
s"
%
(
"{0:#01b}"
.
format
(
int
(
bool
(
v
&
(
1
<<
25
))))[
2
]))
print
(
" CH2 :
%
s"
%
(
"{0:#01b}"
.
format
(
int
(
bool
(
v
&
(
1
<<
26
))))[
2
]))
print
(
" CH3 :
%
s"
%
(
"{0:#01b}"
.
format
(
int
(
bool
(
v
&
(
1
<<
27
))))[
2
]))
print
(
" CH4 :
%
s"
%
(
"{0:#01b}"
.
format
(
int
(
bool
(
v
&
(
1
<<
28
))))[
2
]))
print
(
" CH5 :
%
s"
%
(
"{0:#01b}"
.
format
(
int
(
bool
(
v
&
(
1
<<
29
))))[
2
]))
print
(
" CH6 :
%
s"
%
(
"{0:#01b}"
.
format
(
int
(
bool
(
v
&
(
1
<<
30
))))[
2
]))
testelma
.
close
()
software/diag/therm.py
View file @
fa72b27e
...
...
@@ -244,7 +244,7 @@ if __name__ == "__main__":
print
(
"Unexpected error: "
,
sys
.
exc_info
()[
0
])
# Create onewire and thermometer objects
onewire
=
COpenCoresOneWire
(
testelma
,
1
,
0x
8
0
,
99
,
19
)
onewire
=
COpenCoresOneWire
(
testelma
,
1
,
0x
20
0
,
99
,
19
)
ds18b20
=
CDS18B20
(
onewire
,
0
)
# Reading of unique ID
...
...
software/diag/timetag/README.txt
View file @
fa72b27e
...
...
@@ -3,6 +3,7 @@ Scripts for the time-tagging logic
On the time-tagging side, the following scripts exist:
getlatestts.py -- Read the latest timestamp registers (CHxLTS*R)
rdtb.py -- Read samples of the tag buffer while they exist
tsdiff.py -- Output the difference between two time-stamps from the buffer
tsset.py -- set TAI time stamp value, clearing the cycles counter in the
...
...
software/
ei2c/ei2cdefine
.py
→
software/
diag/timetag/getlatestts
.py
100644 → 100755
View file @
fa72b27e
#!/usr/bin/python
#===============================================================================
# CERN (BE-CO-HT)
#
EI2C global definitions file
#
Get latest timestamp
#===============================================================================
# author: Theodor Stana (t.stana@cern.ch)
#
# date of creation: 2014-0
3-05
# date of creation: 2014-0
8-18
#
# version: 1.0
#
# description:
#
# This module defines some global constants that are used by other scripts in
# the software suite. The constants and their definitions are in the code
# below.
# dependencies:
#
# references:
#===============================================================================
# GNU LESSER GENERAL PUBLIC LICENSE
#===============================================================================
...
...
@@ -28,16 +28,49 @@
# source; if not, download it from http://www.gnu.org/licenses/lgpl-2.1.html
#===============================================================================
# last changes:
# 2014-0
3-05
Theodor Stana File created
# 2014-0
8-18
Theodor Stana File created
#===============================================================================
# TODO: -
#===============================================================================
import
sys
sys
.
path
.
append
(
"../../ei2c"
)
from
ei2c
import
*
import
ei2cdefine
# Hostname, username and password
HNAME
=
""
USER
=
""
PWD
=
""
if
__name__
==
"__main__"
:
# Get the IP, user and password for the ELMA crate from ei2cdefine.py
ip
=
ei2cdefine
.
HNAME
user
=
ei2cdefine
.
USER
pwd
=
ei2cdefine
.
PWD
testelma
=
EI2C
(
ip
,
user
,
pwd
)
testelma
.
open
()
# Ask for slot number
while
1
:
try
:
slot
=
raw_input
(
"Slot no.: "
)
slot
=
int
(
slot
)
break
except
TypeError
as
e
:
print
(
"Please input a decimal slot number."
)
except
SlotError
as
e
:
print
(
e
.
strerror
)
except
KeyboardInterrupt
:
sys
.
exit
();
except
:
print
(
"Unexpected error: "
,
sys
.
exc_info
()[
0
])
# Get and print latest timestamps
addr
=
0x40
for
i
in
range
(
6
):
cyc
=
testelma
.
read
(
slot
,
addr
)
tail
=
testelma
.
read
(
slot
,
addr
+
4
)
taih
=
testelma
.
read
(
slot
,
addr
+
8
)
&
0x000000ff
ns
=
cyc
*
8
s
=
(
taih
<<
32
)
|
tail
print
(
"CH
%
d:
%
d.
%09
d sec"
%
(
i
+
1
,
s
,
ns
))
addr
+=
0x0c
testelma
.
close
()
# Boolean to tell the ei2c.py module whether to create a dump file for the ELMA
# command replies
DUMP
=
False
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment