Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kestrel Collaboration
Kestrel LiteX
migen
Commits
c1041b9a
Commit
c1041b9a
authored
12 years ago
by
Sebastien Bourdeauducq
Browse files
Options
Download
Email Patches
Plain Diff
simplebus: export GetSigName function
parent
b2bc5ad4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
migen/bus/simple.py
migen/bus/simple.py
+8
-5
No files found.
migen/bus/simple.py
View file @
c1041b9a
from
migen.fhdl
import
structure
as
f
from
migen.fhdl
import
structure
as
f
def
GetSigName
(
signal
,
slave
):
if
signal
[
0
]
^
slave
:
suffix
=
"_o"
else
:
suffix
=
"_i"
return
signal
[
1
]
+
suffix
# desc is a list of tuples, each made up of:
# desc is a list of tuples, each made up of:
# 0) boolean: "master to slave"
# 0) boolean: "master to slave"
# 1) string: name
# 1) string: name
...
@@ -7,13 +14,9 @@ from migen.fhdl import structure as f
...
@@ -7,13 +14,9 @@ from migen.fhdl import structure as f
class
Simple
():
class
Simple
():
def
__init__
(
self
,
desc
,
slave
,
name
):
def
__init__
(
self
,
desc
,
slave
,
name
):
for
signal
in
desc
:
for
signal
in
desc
:
if
signal
[
0
]
^
slave
:
suffix
=
"_o"
else
:
suffix
=
"_i"
modules
=
self
.
__module__
.
split
(
'.'
)
modules
=
self
.
__module__
.
split
(
'.'
)
busname
=
modules
[
len
(
modules
)
-
1
]
busname
=
modules
[
len
(
modules
)
-
1
]
if
name
:
if
name
:
busname
+=
"_"
+
name
busname
+=
"_"
+
name
signame
=
signal
[
1
]
+
suffix
signame
=
GetSigName
(
signal
,
slave
)
setattr
(
self
,
signame
,
f
.
Signal
(
f
.
BV
(
signal
[
2
]),
busname
+
"_"
+
signame
))
setattr
(
self
,
signame
,
f
.
Signal
(
f
.
BV
(
signal
[
2
]),
busname
+
"_"
+
signame
))
This diff is collapsed.
Click to expand it.
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