hdl.xfrm: Abstract*Transformer→*Visitor
authorwhitequark <whitequark@whitequark.org>
Sat, 22 Dec 2018 06:03:38 +0000 (06:03 +0000)
committerwhitequark <whitequark@whitequark.org>
Sat, 22 Dec 2018 06:03:39 +0000 (06:03 +0000)
nmigen/back/pysim.py
nmigen/hdl/xfrm.py

index 87fef0c9f525dd014b3bab008e75a761f4e1f232..dd8f24a1546a3458a8bc5df059f4c11f81338ecb 100644 (file)
@@ -7,7 +7,7 @@ from vcd.gtkw import GTKWSave
 
 from ..tools import flatten
 from ..hdl.ast import *
-from ..hdl.xfrm import AbstractValueTransformer, AbstractStatementTransformer
+from ..hdl.xfrm import ValueVisitor, StatementVisitor
 
 
 __all__ = ["Simulator", "Delay", "Tick", "Passive", "DeadlineError"]
@@ -71,7 +71,7 @@ class _State:
 normalize = Const.normalize
 
 
-class _RHSValueCompiler(AbstractValueTransformer):
+class _RHSValueCompiler(ValueVisitor):
     def __init__(self, signal_slots, sensitivity=None, mode="rhs"):
         self.signal_slots = signal_slots
         self.sensitivity  = sensitivity
@@ -201,7 +201,7 @@ class _RHSValueCompiler(AbstractValueTransformer):
         return eval
 
 
-class _LHSValueCompiler(AbstractValueTransformer):
+class _LHSValueCompiler(ValueVisitor):
     def __init__(self, signal_slots, rhs_compiler):
         self.signal_slots = signal_slots
         self.rhs_compiler = rhs_compiler
@@ -275,7 +275,7 @@ class _LHSValueCompiler(AbstractValueTransformer):
         return eval
 
 
-class _StatementCompiler(AbstractStatementTransformer):
+class _StatementCompiler(StatementVisitor):
     def __init__(self, signal_slots):
         self.sensitivity   = SignalSet()
         self.rrhs_compiler = _RHSValueCompiler(signal_slots, self.sensitivity, mode="rhs")
index 3aa10cbc92892abda7cf5d32c1ddb89d5fe4a04e..31525d9577dcfd7d2a3f34d0d950d2eacf3b0ac7 100644 (file)
@@ -9,13 +9,13 @@ from .cd import *
 from .ir import *
 
 
-__all__ = ["AbstractValueTransformer", "ValueTransformer",
-           "AbstractStatementTransformer", "StatementTransformer",
+__all__ = ["ValueVisitor", "ValueTransformer",
+           "StatementVisitor", "StatementTransformer",
            "FragmentTransformer",
            "DomainRenamer", "DomainLowerer", "ResetInserter", "CEInserter"]
 
 
-class AbstractValueTransformer(metaclass=ABCMeta):
+class ValueVisitor(metaclass=ABCMeta):
     @abstractmethod
     def on_Const(self, value):
         pass # :nocov:
@@ -91,7 +91,7 @@ class AbstractValueTransformer(metaclass=ABCMeta):
         return self.on_value(value)
 
 
-class ValueTransformer(AbstractValueTransformer):
+class ValueTransformer(ValueVisitor):
     def on_Const(self, value):
         return value
 
@@ -124,7 +124,7 @@ class ValueTransformer(AbstractValueTransformer):
                           self.on_value(value.index))
 
 
-class AbstractStatementTransformer(metaclass=ABCMeta):
+class StatementVisitor(metaclass=ABCMeta):
     @abstractmethod
     def on_Assign(self, stmt):
         pass # :nocov:
@@ -155,7 +155,7 @@ class AbstractStatementTransformer(metaclass=ABCMeta):
         return self.on_statement(value)
 
 
-class StatementTransformer(AbstractStatementTransformer):
+class StatementTransformer(StatementVisitor):
     def on_value(self, value):
         return value