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
e1ed6c8d
Commit
e1ed6c8d
authored
Apr 26, 2012
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software: updated python demo to work with the newest rawrabbit driver
parent
aade9e8b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
9 deletions
+15
-9
fdelay_lib.h
software/include/fdelay_lib.h
+1
-1
rr_io.h
software/include/rr_io.h
+1
-0
fdelay_lib.c
software/lib/fdelay_lib.c
+5
-5
demo.py
software/python/demo.py
+7
-2
fdelay_lib.py
software/python/fdelay_lib.py
+1
-1
No files found.
software/include/fdelay_lib.h
View file @
e1ed6c8d
...
...
@@ -51,7 +51,7 @@ PUBLIC API
*/
fdelay_device_t
*
fdelay_create_rawrabbit
(
uint32_t
base_addr
);
fdelay_device_t
*
fdelay_create_rawrabbit
(
int
fd
,
uint32_t
base_addr
);
fdelay_device_t
*
fdelay_create_minibone
(
char
*
iface
,
char
*
mac_addr
,
uint32_t
base_addr
);
fdelay_time_t
fdelay_from_picos
(
const
uint64_t
ps
);
...
...
software/include/rr_io.h
View file @
e1ed6c8d
...
...
@@ -4,6 +4,7 @@
#include <stdint.h>
#include <rawrabbit.h>
int
rr_bind
(
int
a_fd
);
int
rr_init
(
int
bus
,
int
devfn
);
int
rr_writel
(
uint32_t
data
,
uint32_t
addr
);
uint32_t
rr_readl
(
uint32_t
addr
);
...
...
software/lib/fdelay_lib.c
View file @
e1ed6c8d
...
...
@@ -1170,11 +1170,11 @@ int fdelay_configure_output(fdelay_device_t *dev, int channel, int enable, int64
delay_ps
-=
hw
->
calib
.
zero_offset
[
channel
-
1
];
start
=
fdelay_from_picos
(
delay_ps
);
end
=
fdelay_from_picos
(
delay_ps
+
width_ps
);
delta
=
fdelay_from_picos
(
delta_ps
);
end
=
fdelay_from_picos
(
delay_ps
+
width_ps
-
4000
);
delta
=
fdelay_from_picos
(
delta_ps
);
// printf("Start: %lld: %d:%d\n", start.utc, start.coarse, start.frac
);
printf
(
"Start: %lld: %d:%d rep %d
\n
"
,
start
.
utc
,
start
.
coarse
,
start
.
frac
,
rep_count
);
chan_writel
(
hw
->
frr_cur
[
channel
-
1
],
FD_REG_FRR
);
...
...
@@ -1192,7 +1192,7 @@ int fdelay_configure_output(fdelay_device_t *dev, int channel, int enable, int64
chan_writel
(
delta
.
frac
,
FD_REG_F_DELTA
);
// chan_writel(0, FD_REG_RCR);
chan_writel
(
FD_RCR_REP_CNT_W
(
rep_count
)
|
(
rep_count
<
0
?
FD_RCR_CONT
:
0
),
FD_REG_RCR
);
chan_writel
(
FD_RCR_REP_CNT_W
(
rep_count
-
1
)
|
(
rep_count
<
0
?
FD_RCR_CONT
:
0
),
FD_REG_RCR
);
dcr
=
0
;
...
...
software/python/demo.py
View file @
e1ed6c8d
...
...
@@ -68,11 +68,16 @@ def on_chk_wr():
if
__name__
==
"__main__"
:
import
os
import
os
,
sys
if
(
os
.
getuid
()
!=
0
):
print
(
"Sorry, I must be run as root..."
);
sys
.
exit
(
-
1
)
fd
=
os
.
open
(
"/dev/rawrabbit"
,
os
.
O_SYNC
)
if
(
fd
<
0
):
print
(
"Can't open the rawrabbit device. Is the rawrabbit driver installed?"
)
o
s
.
exit
(
-
1
)
sy
s
.
exit
(
-
1
)
card
=
FineDelay
(
fd
)
...
...
software/python/fdelay_lib.py
View file @
e1ed6c8d
...
...
@@ -53,7 +53,7 @@ class FineDelay:
self
.
fdelay
.
fdelay_configure_trigger
(
self
.
handle
,
c_int
(
enable
),
c_int
(
termination
))
def
conf_output
(
self
,
channel
,
enable
,
delay
,
width
):
self
.
fdelay
.
fdelay_configure_output
(
self
.
handle
,
c_int
(
channel
),
c_int
(
enable
),
c_ulonglong
(
delay
),
c_ulonglong
(
width
))
self
.
fdelay
.
fdelay_configure_output
(
self
.
handle
,
c_int
(
channel
),
c_int
(
enable
),
c_ulonglong
(
delay
),
c_ulonglong
(
width
)
,
c_ulonglong
(
200000
),
c_int
(
1
)
)
def
conf_readout
(
self
,
enable
):
self
.
fdelay
.
fdelay_configure_readout
(
self
.
handle
,
enable
)
...
...
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