Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
V
VME64x core
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
VME64x core
Commits
c42c01f3
Commit
c42c01f3
authored
Aug 11, 2011
by
palvarez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git-svn-id:
http://svn.ohwr.org/vme64x-core/trunk@121
665b4545-5c6b-4c24-801b-41150b02b44b
parent
d0797a97
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
conf_vme_core.py
tests/conf_vme_core.py
+16
-10
No files found.
tests/conf_vme_core.py
View file @
c42c01f3
import
pyvmelib
import
sys
class
CVMeCrPos
:
def
__init__
(
self
,
add
,
nbytes
,
name
):
...
...
@@ -19,16 +20,15 @@ class CVMeCrPos:
print
"I am going to check debug mode"
if
self
.
debug
==
1
:
print
self
.
name
;
print
self
.
readone
;
print
hex
(
self
.
value
)
print
self
.
read
d
one
;
print
[
hex
(
x
)
for
x
in
self
.
value
]
print
"I should have printed name and value"
def
write
(
self
,
map
,
data
):
for
i
in
range
(
0
,
self
.
nbytes
):
map
.
write
(
offset
=
self
.
add
-
3
+
i
*
4
,
width
=
32
,
values
=
data
[
i
])
self
.
writedone
=
1
+
self
.
writedone
;
class
CVmeCrList
:
def
__init__
(
self
,
ga
):
# par = self.parityOf(ga);
...
...
@@ -36,7 +36,11 @@ class CVmeCrList:
self
.
size
=
0x10000
;
self
.
data_width
=
32
;
self
.
am
=
0x2f
;
print
'
%
x'
%
self
.
gad
self
.
map
=
pyvmelib
.
Mapping
(
am
=
0x2f
,
base_address
=
self
.
gad
,
data_width
=
self
.
data_width
,
size
=
self
.
size
);
if
self
.
map
.
vaddr
is
None
:
print
"mapping failed!"
sys
.
exit
()
self
.
cr
=
{
"CHKSUMP"
:
CVMeCrPos
(
0x03
,
1
,
"CHKSUM"
),
"CRDW"
:
CVMeCrPos
(
0x13
,
3
,
"CRDW"
),
"ACSRDW"
:
CVMeCrPos
(
0x17
,
1
,
"ACSRDW"
),
...
...
@@ -50,12 +54,13 @@ class CVmeCrList:
"PID"
:
CVMeCrPos
(
0x7F
,
8
,
"PID"
),
"FDAW0"
:
CVMeCrPos
(
0x103
,
1
,
"FDAW0"
),
"FDAW1"
:
CVMeCrPos
(
0x107
,
1
,
"FDAW1"
),
"FDAW2"
:
CVMeCrPos
(
0x10B
,
1
,
"FDAW2"
),
#
"FDAW2": CVMeCrPos(0x10B,1,"FDAW2"),
"FDAW3"
:
CVMeCrPos
(
0x10F
,
1
,
"FDAW3"
),
"FDAW4"
:
CVMeCrPos
(
0x103
,
1
,
"FDAW4"
),
"FDAW5"
:
CVMeCrPos
(
0x107
,
1
,
"FDAW5"
),
"FDAW6"
:
CVMeCrPos
(
0x10B
,
1
,
"FDAW6"
),
"FDAW7"
:
CVMeCrPos
(
0x10F
,
1
,
"FDAW7"
)}
# "FDAW6": CVMeCrPos(0x10B,1,"FDAW6"),
"FDAW7"
:
CVMeCrPos
(
0x10F
,
1
,
"FDAW7"
),
}
# def parityOf(int_type):
# parity = 0;
...
...
@@ -64,9 +69,10 @@ class CVmeCrList:
# int_type = int_type & (int_type - 1)
# return(parity);
def
readCR
():
def
readCR
(
self
):
for
s
in
self
.
cr
:
s
.
read
(
self
.
map
);
print
s
self
.
cr
[
s
]
.
read
(
self
.
map
);
...
...
@@ -76,7 +82,7 @@ class CVmeCrList:
print
"I am going to create modcr= CVmeCrList(6)"
modcr
=
CVmeCrList
(
6
)
print
"I am going to read modcr.readCR"
modcr
.
readCR
modcr
.
readCR
()
##map = pyvmelib.Mapping(am=0x2f, base_address=0x300000, data_width=32, size=0x10000);
...
...
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