Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Simple VME FMC Carrier SVEC - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
Simple VME FMC Carrier SVEC - Software
Commits
867c8c2c
Commit
867c8c2c
authored
Mar 05, 2014
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools/svec-wrc-loader: much faster thanks to sysfs vme_data multiple write feature
parent
397a544b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
4 deletions
+21
-4
svec-wrc-loader
tools/svec-wrc-loader
+21
-4
No files found.
tools/svec-wrc-loader
View file @
867c8c2c
...
...
@@ -28,7 +28,15 @@ def sysfs_write(path, value):
print
(
"An I/O error occured when trying to write to the SVEC sysfs attribute (
%
s)"
%
path
)
print
(
"The most common reason is that the program does not have write permissions (try running me as root)"
)
sys
.
exit
(
-
1
)
f
.
write
(
"0x
%
x
\n
"
%
value
)
if
type
(
value
)
is
list
:
vtab
=
value
else
:
vtab
=
[
value
];
s
=
""
for
v
in
vtab
:
s
+=
"0x
%
x "
%
v
f
.
write
(
s
+
"
\n
"
)
f
.
close
()
class
CSvec
:
...
...
@@ -55,6 +63,10 @@ class CSvec:
s
+=
1
return
False
def
writel
(
self
,
addr
,
data
):
sysfs_write
(
self
.
path
+
"/vme_addr"
,
addr
)
sysfs_write
(
self
.
path
+
"/vme_data"
,
data
)
def
writel
(
self
,
addr
,
data
):
sysfs_write
(
self
.
path
+
"/vme_addr"
,
addr
)
sysfs_write
(
self
.
path
+
"/vme_data"
,
data
)
...
...
@@ -127,11 +139,16 @@ def load_wrcore(dev, filename):
pass
offset
=
0
for
i
in
range
(
0
,
(
len
(
image
)
+
3
)
/
4
):
d
=
struct
.
unpack
(
">I"
,
image
[
i
*
4
:
i
*
4
+
4
])
nwords
=
(
len
(
image
)
+
3
)
/
4
for
i
in
range
(
0
,
nwords
,
128
):
count
=
min
(
nwords
-
i
,
128
)
d
=
[]
for
j
in
range
(
0
,
count
):
d
+=
struct
.
unpack
(
">I"
,
image
[(
i
+
j
)
*
4
:(
i
+
j
)
*
4
+
4
])
# fixme: the WRCore CPU RAM has no unique SDB ID. We simply reference to it relatively to the syscon address
dev
.
writel
(
syscon_addr
-
0x20400
+
offset
,
d
)
offset
+=
4
offset
+=
count
*
4
# start the CPU
dev
.
writel
(
syscon_addr
,
0x0deadbee
)
...
...
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