Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 4cha
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
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
FMC DEL 1ns 4cha
Commits
f7b71bd6
Commit
f7b71bd6
authored
Dec 15, 2020
by
Federico Vaga
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release/v3.0.5' into master
parents
0bc3433c
96735dcb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
12 deletions
+20
-12
CHANGELOG.rst
CHANGELOG.rst
+6
-0
fdelay-init.c
software/lib/fdelay-init.c
+1
-1
test_fmcfd_loop.py
software/pytest/test-01-functionalities/test_fmcfd_loop.py
+13
-11
No files found.
CHANGELOG.rst
View file @
f7b71bd6
...
...
@@ -6,6 +6,12 @@
Changelog
=========
3.0.5 - 2020-12-14
==================
Fixed
-----
- sw: open_by_lun() path to /dev/ device changed
3.0.4 - 2020-12-11
==================
Changed
...
...
software/lib/fdelay-init.c
View file @
f7b71bd6
...
...
@@ -132,7 +132,7 @@ struct fdelay_board *fdelay_open_by_lun(int lun)
{
ssize_t
ret
;
char
dev_id_str
[
4
];
char
path_pattern
[]
=
"/dev/f
ine-delay
.%d"
;
char
path_pattern
[]
=
"/dev/f
d
.%d"
;
char
path
[
sizeof
(
path_pattern
)
+
1
];
uint32_t
dev_id
;
...
...
software/pytest/test-01-functionalities/test_fmcfd_loop.py
View file @
f7b71bd6
...
...
@@ -21,6 +21,8 @@ def fmcfd():
def
fmcfd_chan
(
request
,
fmcfd
):
yield
fmcfd
.
chan
[
request
.
param
]
pulse_train
=
[(
200000
,
10000000000
)]
@
pytest
.
fixture
(
scope
=
"function"
)
def
fmcfd_tdc
(
request
,
fmcfd
):
fmcfd
.
tdc
.
enable_input
=
False
...
...
@@ -36,7 +38,7 @@ def fmcfd_tdc(request, fmcfd):
def
timeout_compute
(
start
,
period_ps
,
count
):
proportional
=
((
count
*
period_ps
)
/
1000000000000.0
)
return
time
.
time
()
+
proportional
+
start
.
seconds
+
10
return
time
.
time
()
+
proportional
+
start
+
5
class
TestFmcfdLoop
(
object
):
"""
...
...
@@ -64,7 +66,7 @@ class TestFmcfdLoop(object):
@
pytest
.
mark
.
parametrize
(
"count"
,
[
1
,
2
,
3
,
5
,
7
,
10
,
100
,
1000
,
10000
,
65535
])
@
pytest
.
mark
.
parametrize
(
"width,period"
,
[(
200000
,
10000000000
)]
)
@
pytest
.
mark
.
parametrize
(
"width,period"
,
pulse_train
)
def
test_output_counter
(
self
,
fmcfd
,
fmcfd_chan
,
fmcfd_tdc
,
width
,
period
,
count
):
"""
...
...
@@ -73,10 +75,10 @@ class TestFmcfdLoop(object):
channel.
"""
ts
=
[]
start
=
fmcfd
.
time
+
FmcFineDelayTime
(
2
,
0
,
0
)
start_s
=
2
start
=
fmcfd
.
time
+
FmcFineDelayTime
(
start_s
,
0
,
0
)
fmcfd_chan
.
pulse_generate
(
start
,
width
,
period
,
count
)
timeout
=
timeout_compute
(
start
,
period
,
count
)
timeout
=
timeout_compute
(
start
_s
,
period
,
count
)
while
len
(
ts
)
<
count
and
time
.
time
()
<
timeout
:
if
len
(
fmcfd_tdc
.
poll
())
==
0
:
continue
...
...
@@ -88,7 +90,7 @@ class TestFmcfdLoop(object):
del
ts
@
pytest
.
mark
.
parametrize
(
"count"
,
[
10000
])
@
pytest
.
mark
.
parametrize
(
"width,period"
,
[(
200000
,
10000000000
)]
)
@
pytest
.
mark
.
parametrize
(
"width,period"
,
pulse_train
)
def
test_input_sequence_number
(
self
,
capsys
,
fmcfd_chan
,
fmcfd_tdc
,
width
,
period
,
count
):
"""
...
...
@@ -97,12 +99,12 @@ class TestFmcfdLoop(object):
"""
pending
=
count
ts
=
[]
start
=
FmcFineDelayTime
(
2
,
0
,
0
)
start_s
=
2
start
=
FmcFineDelayTime
(
start_s
,
0
,
0
)
fmcfd_chan
.
pulse_generate
(
fmcfd_chan
.
dev
.
time
+
start
,
width
,
period
,
count
)
timeout
=
timeout_compute
(
start
,
period
,
count
)
timeout
=
timeout_compute
(
start
_s
,
period
,
count
)
while
pending
>
0
and
time
.
time
()
<
timeout
:
if
len
(
fmcfd_tdc
.
poll
())
==
0
:
continue
...
...
@@ -134,7 +136,7 @@ class TestFmcfdLoop(object):
])
@
pytest
.
mark
.
parametrize
(
"wr"
,
[
False
,
True
])
@
pytest
.
mark
.
parametrize
(
"count"
,
[
1
])
@
pytest
.
mark
.
parametrize
(
"width,period"
,
[(
200000
,
10000000000
)]
)
@
pytest
.
mark
.
parametrize
(
"width,period"
,
pulse_train
)
def
test_output_input_start
(
self
,
fmcfd_chan
,
fmcfd_tdc
,
wr
,
start_rel
,
width
,
period
,
count
):
"""
...
...
@@ -151,7 +153,7 @@ class TestFmcfdLoop(object):
ts
=
fmcfd_tdc
.
read
(
count
,
os
.
O_NONBLOCK
)
assert
len
(
ts
)
==
count
assert
start
.
seconds
==
ts
[
0
]
.
seconds
assert
ts
[
0
]
.
coarse
-
start
.
coarse
<=
1
# there is a ~1
ns cable
assert
ts
[
0
]
.
coarse
-
start
.
coarse
<=
3
# there is < 3
ns cable
@
pytest
.
mark
.
parametrize
(
"width,period_ps"
,
[(
200000
,
1000000
),
...
...
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