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
629e771f
Commit
629e771f
authored
12 years ago
by
Sebastien Bourdeauducq
Browse files
Options
Download
Email Patches
Plain Diff
fhdl/structure: binary constant builder
parent
504a169a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
migen/fhdl/structure.py
migen/fhdl/structure.py
+3
-0
No files found.
migen/fhdl/structure.py
View file @
629e771f
...
...
@@ -127,6 +127,9 @@ class Constant(Value):
def
__eq__
(
self
,
other
):
return
self
.
bv
==
other
.
bv
and
self
.
n
==
other
.
n
def
binc
(
x
,
signed
=
False
):
return
Constant
(
int
(
x
,
2
),
BV
(
len
(
x
),
signed
))
def
_cst
(
x
):
if
isinstance
(
x
,
int
):
return
Constant
(
x
)
...
...
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