compat.fhdl.bitcontainer: import/wrap Migen code.
This commit is contained in:
parent
1d4d00aac6
commit
356852a570
4 changed files with 45 additions and 1 deletions
0
nmigen/compat/fhdl/__init__.py
Normal file
0
nmigen/compat/fhdl/__init__.py
Normal file
21
nmigen/compat/fhdl/bitcontainer.py
Normal file
21
nmigen/compat/fhdl/bitcontainer.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
from ... import tools
|
||||
from ...fhdl import ast
|
||||
from ...tools import deprecated
|
||||
|
||||
|
||||
__all__ = ["log2_int", "bits_for", "value_bits_sign"]
|
||||
|
||||
|
||||
@deprecated("instead of `log2_int`, use `nmigen.tools.log2_int`")
|
||||
def log2_int(n, need_pow2=True):
|
||||
return tools.log2_int(n, need_pow2)
|
||||
|
||||
|
||||
@deprecated("instead of `bits_for`, use `nmigen.tools.bits_for`")
|
||||
def bits_for(n, require_sign_bit=False):
|
||||
return tools.bits_for(n, require_sign_bit)
|
||||
|
||||
|
||||
@deprecated("instead of `value_bits_sign(v)`, use `v.bits_sign()`")
|
||||
def value_bits_sign(v):
|
||||
return ast.Value.wrap(v).bits_sign()
|
||||
Loading…
Add table
Add a link
Reference in a new issue