Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
Mock Turtle
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
Mock Turtle
Commits
2a3e5f29
Commit
2a3e5f29
authored
May 03, 2018
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw:py: store name and sysfs path
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
98bd939a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
PyMockTurtle.py
software/lib/PyMockTurtle/PyMockTurtle/PyMockTurtle.py
+12
-3
No files found.
software/lib/PyMockTurtle/PyMockTurtle/PyMockTurtle.py
View file @
2a3e5f29
...
...
@@ -177,6 +177,9 @@ class TrtlDevice(object):
rom_ptr
=
self
.
libtrtl
.
trtl_config_get
(
self
.
tkn
)
self
.
rom
=
rom_ptr
.
contents
self
.
name
=
"trtl-{:04x}"
.
format
(
self
.
device_id
)
self
.
sysfspath
=
os
.
path
.
join
(
"/sys/class/mockturtle/"
,
self
.
name
)
self
.
cpu
=
[]
for
i
in
range
(
self
.
rom
.
n_cpu
):
self
.
cpu
.
append
(
TrtlCpu
(
self
,
i
))
...
...
@@ -187,7 +190,7 @@ class TrtlDevice(object):
self
.
libtrtl
.
trtl_exit
()
def
__str__
(
self
):
return
"trtl-{:04x}"
.
format
(
self
.
device_id
)
return
self
.
name
def
__repr__
(
self
):
return
"{:s}"
.
format
(
str
(
self
))
...
...
@@ -330,6 +333,9 @@ class TrtlCpu(object):
self
.
trtl_dev
=
trtl_dev
self
.
idx_cpu
=
idx_cpu
self
.
name
=
"{:s}-{:02d}"
.
format
(
str
(
self
.
trtl_dev
),
self
.
idx_cpu
)
self
.
sysfspath
=
os
.
path
.
join
(
"/sys/class/mockturtle/"
,
self
.
name
)
self
.
hmq
=
[]
for
i
in
range
(
self
.
trtl_dev
.
rom
.
n_hmq
[
self
.
idx_cpu
]):
self
.
hmq
.
append
(
TrtlHmq
(
self
,
i
))
...
...
@@ -337,7 +343,7 @@ class TrtlCpu(object):
self
.
libtrtl
=
self
.
trtl_dev
.
libtrtl
def
__str__
(
self
):
return
"{:s}-{:02d}"
.
format
(
str
(
self
.
trtl_dev
),
self
.
idx_cpu
)
return
self
.
name
def
__repr__
(
self
):
return
"{:s}"
.
format
(
str
(
self
))
...
...
@@ -435,8 +441,11 @@ class TrtlHmq(object):
self
.
idx_hmq
=
idx_hmq
self
.
libtrtl
=
self
.
trtl_dev
.
libtrtl
self
.
name
=
"{:s}-{:02d}"
.
format
(
str
(
self
.
trtl_cpu
),
self
.
idx_hmq
)
self
.
sysfspath
=
os
.
path
.
join
(
"/sys/class/mockturtle/"
,
self
.
name
)
def
__str__
(
self
):
return
"{:s}-{:02d}"
.
format
(
str
(
self
.
trtl_cpu
),
self
.
idx_hmq
)
return
self
.
name
def
__repr__
(
self
):
return
"{:s}"
.
format
(
str
(
self
))
...
...
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