fhdl: export DUID
This commit is contained in:
parent
af88a7a3f9
commit
67903494bf
|
@ -1,7 +1,7 @@
|
||||||
from operator import itemgetter
|
from operator import itemgetter
|
||||||
|
|
||||||
from migen.fhdl.structure import *
|
from migen.fhdl.structure import *
|
||||||
from migen.fhdl.structure import _DUID, _Value
|
from migen.fhdl.structure import _Value
|
||||||
from migen.fhdl.bitcontainer import bits_for, value_bits_sign
|
from migen.fhdl.bitcontainer import bits_for, value_bits_sign
|
||||||
from migen.fhdl.tools import *
|
from migen.fhdl.tools import *
|
||||||
from migen.fhdl.tracer import get_obj_var_name
|
from migen.fhdl.tracer import get_obj_var_name
|
||||||
|
@ -12,7 +12,7 @@ __all__ = ["TSTriple", "Instance", "Memory",
|
||||||
"READ_FIRST", "WRITE_FIRST", "NO_CHANGE"]
|
"READ_FIRST", "WRITE_FIRST", "NO_CHANGE"]
|
||||||
|
|
||||||
|
|
||||||
class Special(_DUID):
|
class Special(DUID):
|
||||||
def iter_expressions(self):
|
def iter_expressions(self):
|
||||||
for x in []:
|
for x in []:
|
||||||
yield x
|
yield x
|
||||||
|
|
|
@ -5,15 +5,15 @@ from migen.fhdl import tracer as _tracer
|
||||||
from migen.util.misc import flat_iteration as _flat_iteration
|
from migen.util.misc import flat_iteration as _flat_iteration
|
||||||
|
|
||||||
|
|
||||||
class _DUID:
|
class DUID:
|
||||||
"""Deterministic Unique IDentifier"""
|
"""Deterministic Unique IDentifier"""
|
||||||
__next_uid = 0
|
__next_uid = 0
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.duid = _DUID.__next_uid
|
self.duid = DUID.__next_uid
|
||||||
_DUID.__next_uid += 1
|
DUID.__next_uid += 1
|
||||||
|
|
||||||
|
|
||||||
class _Value(_DUID):
|
class _Value(DUID):
|
||||||
"""Base class for operands
|
"""Base class for operands
|
||||||
|
|
||||||
Instances of `_Value` or its subclasses can be operands to
|
Instances of `_Value` or its subclasses can be operands to
|
||||||
|
|
Loading…
Reference in New Issue