From: Sebastien Bourdeauducq Date: Sat, 26 Sep 2015 05:46:57 +0000 (+0800) Subject: fhdl: export DUID X-Git-Tag: 24jan2021_ls180~2099^2~3^2~42 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=67903494bf516e5dc6983e8d4cd3b5bfd07d076e;p=litex.git fhdl: export DUID --- diff --git a/migen/fhdl/specials.py b/migen/fhdl/specials.py index 873c86fb..52d1686b 100644 --- a/migen/fhdl/specials.py +++ b/migen/fhdl/specials.py @@ -1,7 +1,7 @@ from operator import itemgetter 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.tools import * from migen.fhdl.tracer import get_obj_var_name @@ -12,7 +12,7 @@ __all__ = ["TSTriple", "Instance", "Memory", "READ_FIRST", "WRITE_FIRST", "NO_CHANGE"] -class Special(_DUID): +class Special(DUID): def iter_expressions(self): for x in []: yield x diff --git a/migen/fhdl/structure.py b/migen/fhdl/structure.py index 7f23184a..996da4eb 100644 --- a/migen/fhdl/structure.py +++ b/migen/fhdl/structure.py @@ -5,15 +5,15 @@ from migen.fhdl import tracer as _tracer from migen.util.misc import flat_iteration as _flat_iteration -class _DUID: +class DUID: """Deterministic Unique IDentifier""" __next_uid = 0 def __init__(self): - self.duid = _DUID.__next_uid - _DUID.__next_uid += 1 + self.duid = DUID.__next_uid + DUID.__next_uid += 1 -class _Value(_DUID): +class _Value(DUID): """Base class for operands Instances of `_Value` or its subclasses can be operands to