From 67903494bf516e5dc6983e8d4cd3b5bfd07d076e Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 26 Sep 2015 13:46:57 +0800 Subject: [PATCH] fhdl: export DUID --- migen/fhdl/specials.py | 4 ++-- migen/fhdl/structure.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) 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 -- 2.30.2