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
3c1dada9
Commit
3c1dada9
authored
12 years ago
by
Sebastien Bourdeauducq
Browse files
Options
Download
Email Patches
Plain Diff
record: compatibility check
parent
588f1a25
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
migen/corelogic/record.py
migen/corelogic/record.py
+6
-1
migen/fhdl/structure.py
migen/fhdl/structure.py
+3
-0
No files found.
migen/corelogic/record.py
View file @
3c1dada9
...
...
@@ -19,7 +19,7 @@ class Record:
def
template
(
self
):
l
=
[]
for
key
in
self
.
__dict__
:
for
key
in
sorted
(
self
.
__dict__
)
:
e
=
self
.
__dict__
[
key
]
if
isinstance
(
e
,
Signal
):
l
.
append
((
key
,
e
.
bv
))
...
...
@@ -59,6 +59,11 @@ class Record:
return
l
return
Record
(
dict_to_list
(
fields
),
"subrecord"
)
def
compatible
(
self
,
other
):
tpl1
=
self
.
template
()
tpl2
=
other
.
template
()
return
tpl1
==
tpl2
def
flatten
(
self
):
l
=
[]
for
key
in
sorted
(
self
.
__dict__
):
...
...
This diff is collapsed.
Click to expand it.
migen/fhdl/structure.py
View file @
3c1dada9
...
...
@@ -22,6 +22,9 @@ class BV:
r
+=
"s"
r
+=
"d"
return
r
def
__eq__
(
self
,
other
):
return
self
.
width
==
other
.
width
and
self
.
signed
==
other
.
signed
class
Value
:
def
__invert__
(
self
):
...
...
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