Do not use super()
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Tue, 18 Dec 2012 13:54:33 +0000 (14:54 +0100)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Tue, 18 Dec 2012 13:54:33 +0000 (14:54 +0100)
18 files changed:
migen/actorlib/dma_asmi.py
migen/actorlib/dma_wishbone.py
migen/actorlib/misc.py
migen/actorlib/sim.py
migen/actorlib/spi.py
migen/actorlib/structuring.py
migen/bank/description.py
migen/bus/csr.py
migen/bus/wishbone.py
migen/fhdl/structure.py
migen/fhdl/tools.py
migen/flow/actor.py
migen/flow/isd.py
migen/flow/network.py
migen/flow/perftools.py
migen/flow/plumbing.py
migen/pytholite/io.py
migen/uio/ioo.py

index 76a2855dbd20de0b65a198d043784df2b63312bd..1f6d5d0b8d11ab2d9b574477a596c6edf595b215 100644 (file)
@@ -6,7 +6,7 @@ class SequentialReader(Actor):
        def __init__(self, port):
                self.port = port
                assert(len(self.port.slots) == 1)
-               super().__init__(
+               Actor.__init__(self,
                        ("address", Sink, [("a", self.port.hub.aw)]),
                        ("data", Source, [("d", self.port.hub.dw)]))
        
@@ -48,7 +48,7 @@ class OOOReader(Actor):
        def __init__(self, port):
                self.port = port
                assert(len(self.port.slots) > 1)
-               super().__init__(
+               Actor.__init__(self,
                        ("address", Sink, [("a", self.port.hub.aw)]),
                        ("data", Source, [("d", self.port.hub.dw)]))
        
index 24768825d44155555e1263e81f9c6249012ed2f0..d316a372a7698cbd980fde1a814be60d9ae71eb9 100644 (file)
@@ -5,7 +5,7 @@ from migen.flow.actor import *
 class Reader(Actor):
        def __init__(self):
                self.bus = wishbone.Interface()
-               super().__init__(
+               Actor.__init__(self,
                        ("address", Sink, [("a", 30)]),
                        ("data", Source, [("d", 32)]))
        
@@ -41,7 +41,7 @@ class Reader(Actor):
 class Writer(Actor):
        def __init__(self):
                self.bus = wishbone.Interface()
-               super().__init__(
+               Actor.__init__(self,
                        ("address_data", Sink, [("a", 30), ("d", 32)]))
 
        def get_fragment(self):
index adde77a5312c0834099881115e6ad87ebc5378f8..0115f56feea40a9396a25d3d598ecef73dcc280a 100644 (file)
@@ -14,7 +14,7 @@ class IntSequence(Actor):
                if self.offsetbits:
                        parameters_layout.append(("offset", self.offsetbits))
                
-               super().__init__(
+               Actor.__init__(self,
                        ("parameters", Sink, parameters_layout),
                        ("source", Source, [("value", max(self.nbits, self.offsetbits))]))
        
index d99b909d86bf4527ff084f0c3411f0bceb3870a2..de11f1c9796812cda5ec14f380460cd5d4f3ac7d 100644 (file)
@@ -72,7 +72,7 @@ class TokenExchanger(PureSimulable):
 
 class SimActor(Actor):
        def __init__(self, generator, *endpoint_descriptions, **misc):
-               super().__init__(*endpoint_descriptions, **misc)
+               Actor.__init__(self, *endpoint_descriptions, **misc)
                self.token_exchanger = TokenExchanger(generator, self)
        
        def update_busy(self, s):
@@ -92,5 +92,5 @@ class Dumper(SimActor):
                                else:
                                        s = str(list(t.value.values())[0])
                                print(prefix + s)
-               super().__init__(dumper_gen(),
+               SimActor.__init__(self, dumper_gen(),
                        ("result", Sink, layout))
index d556ae5c4a41a59499ea069f8e5701000087b39b..674c36c3565d1ef18f528f27adfa96724489cf3d 100644 (file)
@@ -50,7 +50,7 @@ def _create_registers_assign(layout, target, atomic, prefix=""):
 class SingleGenerator(Actor):
        def __init__(self, layout, mode):
                self._mode = mode
-               super().__init__(("source", Source, _convert_layout(layout)))
+               Actor.__init__(self, ("source", Source, _convert_layout(layout)))
                self._registers, self._assigns = _create_registers_assign(layout,
                        self.token("source"), self._mode != MODE_SINGLE_SHOT)
                if mode == MODE_EXTERNAL:
@@ -81,7 +81,7 @@ class SingleGenerator(Actor):
 
 class Collector(Actor):
        def __init__(self, layout, depth=1024):
-               super().__init__(("sink", Sink, layout))
+               Actor.__init__(self, ("sink", Sink, layout))
                self._depth = depth
                self._dw = sum(len(s) for s in self.token("sink").flatten())
                
index 2fc3985a8108d82fbb590d0604be3978ac8847e3..6f6483b280f748f5b9f5a291c14eb021f9c3f50a 100644 (file)
@@ -9,7 +9,7 @@ def _rawbits_layout(l):
 
 class Cast(CombinatorialActor):
        def __init__(self, layout_from, layout_to):
-               super().__init__(
+               CombinatorialActor.__init__(self,
                        ("sink", Sink, _rawbits_layout(layout_from)),
                        ("source", Source, _rawbits_layout(layout_to)))
        
@@ -28,7 +28,7 @@ def pack_layout(l, n):
 class Unpack(Actor):
        def __init__(self, n, layout_to):
                self.n = n
-               super().__init__(
+               Actor.__init__(self,
                        ("sink", Sink, pack_layout(layout_to, n)),
                        ("source", Source, layout_to))
        
@@ -58,7 +58,7 @@ class Unpack(Actor):
 class Pack(Actor):
        def __init__(self, layout_from, n):
                self.n = n
-               super().__init__(
+               Actor.__init__(self,
                        ("sink", Sink, layout_from),
                        ("source", Source, pack_layout(layout_from, n)))
        
index bfe4c3fb9739e8429252a5a1bb1612ea3bceb50a..44759b8151619a4f1e6ecd1aaf0d056b289c4214 100644 (file)
@@ -40,7 +40,7 @@ class RegisterFields:
 class RegisterField(RegisterFields):
        def __init__(self, name, size=1, access_bus=READ_WRITE, access_dev=READ_ONLY, reset=0, atomic_write=False):
                self.field = Field(name, size, access_bus, access_dev, reset, atomic_write)
-               super().__init__(name, [self.field])
+               RegisterFields.__init__(self, name, [self.field])
 
 (ALIAS_NON_ATOMIC, ALIAS_ATOMIC_HOLD, ALIAS_ATOMIC_COMMIT) = range(3)
 
index 0c403fa1c953440c97e36981c7d2d0869d86586f..6a75d7cd33a0701a5069bae72a4421ef69d4debc 100644 (file)
@@ -8,7 +8,7 @@ data_width = 8
 
 class Interface(SimpleInterface):
        def __init__(self):
-               super().__init__(Description(
+               SimpleInterface.__init__(self, Description(
                        (M_TO_S,        "adr",          14),
                        (M_TO_S,        "we",           1),
                        (M_TO_S,        "dat_w",        data_width),
index 20f644c1b427d21501fbadb6502b8eebc347c89b..efdf09adc9f6ce837d51851c7fe9c089c268cdfb 100644 (file)
@@ -21,11 +21,11 @@ _desc = Description(
 
 class Interface(SimpleInterface):
        def __init__(self):
-               super().__init__(_desc)
+               SimpleInterface.__init__(self, _desc)
 
 class InterconnectPointToPoint(SimpleInterconnect):
        def __init__(self, master, slave):
-               super().__init__(master, [slave])
+               SimpleInterconnect.__init__(self, master, [slave])
 
 class Arbiter:
        def __init__(self, masters, target):
index 1b2d38c5ab83892a9392ff586189ef0fcac9d33f..cf0383b38582f5ac5432135bc571ec643cc37e79 100644 (file)
@@ -105,35 +105,35 @@ class Value(HUID):
                return _Assign(self, r)
        
        def __hash__(self):
-               return super().__hash__()
+               return HUID.__hash__(self)
 
 class _Operator(Value):
        def __init__(self, op, operands):
-               super().__init__()
+               Value.__init__(self)
                self.op = op
                self.operands = operands
 
 class _Slice(Value):
        def __init__(self, value, start, stop):
-               super().__init__()
+               Value.__init__(self)
                self.value = value
                self.start = start
                self.stop = stop
 
 class Cat(Value):
        def __init__(self, *args):
-               super().__init__()
+               Value.__init__(self)
                self.l = args
 
 class Replicate(Value):
        def __init__(self, v, n):
-               super().__init__()
+               Value.__init__(self)
                self.v = v
                self.n = n
 
 class Signal(Value):
        def __init__(self, bits_sign=None, name=None, variable=False, reset=0, name_override=None, min=None, max=None):
-               super().__init__()
+               Value.__init__(self)
                
                # determine number of bits and signedness
                if bits_sign is None:
@@ -227,13 +227,13 @@ class Array(list):
                if isinstance(key, Value):
                        return _ArrayProxy(self, key)
                else:
-                       return super().__getitem__(key)
+                       return list.__getitem__(self, key)
 
 # extras
 
 class Instance(HUID):
        def __init__(self, of, *items, name=""):
-               super().__init__()
+               HUID.__init__(self)
                self.of = of
                if name:
                        self.name_override = name
@@ -292,7 +292,7 @@ class _MemoryPort:
 
 class Memory(HUID):
        def __init__(self, width, depth, init=None):
-               super().__init__()
+               HUID.__init__(self)
                self.width = width
                self.depth = depth
                self.ports = []
index c4af475a509df193b35ff226c1135d7d17f282a0..f6d11a090cb176650792f1351fab33127f8963d9 100644 (file)
@@ -191,7 +191,7 @@ class _ArrayLowerer(NodeTransformer):
                                cases[n] = [assign]
                        return Case(k, cases).makedefault()
                else:
-                       return super().visit_Assign(node)
+                       return NodeTransformer.visit_Assign(self, node)
        
        def visit_ArrayProxy(self, node):
                array_muxed = Signal(value_bits_sign(node))
index fd9fd20b72dc4e7339c6f5fc7245978f0ea666a4..15eee8c2a131dd008c0f712722eb4b5250507133 100644 (file)
@@ -34,7 +34,7 @@ class Source(Endpoint):
 
 class Actor(HUID):
        def __init__(self, *endpoint_descriptions, endpoints=None):
-               super().__init__()
+               HUID.__init__(self)
                if endpoints is None:
                        self.endpoints = {}
                        for desc in endpoint_descriptions:
@@ -109,7 +109,7 @@ class SequentialActor(BinaryActor):
        def __init__(self, delay, *endpoint_descriptions, **misc):
                self.delay = delay
                self.trigger = Signal()
-               super().__init__(*endpoint_descriptions, **misc)
+               BinaryActor.__init__(self, *endpoint_descriptions, **misc)
 
        def get_binary_control_fragment(self, stb_i, ack_o, stb_o, ack_i):
                ready = Signal()
@@ -141,7 +141,7 @@ class PipelinedActor(BinaryActor):
        def __init__(self, latency, *endpoint_descriptions, **misc):
                self.latency = latency
                self.pipe_ce = Signal()
-               super().__init__(*endpoint_descriptions, **misc)
+               BinaryActor.__init__(self, *endpoint_descriptions, **misc)
 
        def get_binary_control_fragment(self, stb_i, ack_o, stb_o, ack_i):
                valid = Signal(self.latency)
index 611d62d4e0c9749ee09338ee3eb8fc71a545d680..a077fc7ca05b9d1a935f73277bc8eacf3335c2e6 100644 (file)
@@ -64,7 +64,7 @@ class DFGReporter(DFGHook):
                self._r_reset = RegisterRaw("reset", 1)
                
                self.order = []
-               super().__init__(dfg, self._create)
+               DFGHook.__init__(self, dfg, self._create)
        
        def _create(self, u, ep, v):
                self.order.append((u, ep, v))
@@ -92,4 +92,4 @@ class DFGReporter(DFGHook):
                                h.freeze.eq(self._r_freeze.field.r),
                                h.reset.eq(self._r_reset.re)
                        ]
-               return Fragment(comb) + super().get_fragment()
+               return Fragment(comb) + DFGHook.get_fragment(self)
index f4cd69b772ba111893ad67c6b6f72dc26506da9d..494d906ef44263d17c50efef9d0467ef08e9248f 100644 (file)
@@ -12,7 +12,7 @@ from migen.flow.isd import DFGReporter
 
 class AbstractActor(HUID):
        def __init__(self, actor_class, parameters=dict(), name=None):
-               super().__init__()
+               HUID.__init__(self)
                self.actor_class = actor_class
                self.parameters = parameters
                self.name = name
@@ -29,7 +29,7 @@ class AbstractActor(HUID):
 
 class DataFlowGraph(MultiDiGraph):
        def __init__(self):
-               super().__init__()
+               MultiDiGraph.__init__(self)
                self.elaborated = False
        
        def add_connection(self, source_node, sink_node,
@@ -209,7 +209,7 @@ class CompositeActor(Actor):
                self.dfg = dfg
                if debugger:
                        self.debugger = DFGReporter(self.dfg, debugger_nbits)
-               super().__init__()
+               Actor.__init__(self)
        
        def get_registers(self):
                if hasattr(self, "debugger"):
index aa13f999204e72688676d99534c644b6891a59ec..42e5c8021de4d7b2612445caeef16e8c40f1f013 100644 (file)
@@ -2,7 +2,7 @@ from migen.flow.hooks import *
 
 class EndpointReporter(EndpointSimHook):
        def __init__(self, endpoint):
-               super().__init__(endpoint)
+               EndpointSimHook.__init__(self, endpoint)
                self.reset()
        
        def reset(self):
@@ -39,7 +39,7 @@ class EndpointReporter(EndpointSimHook):
 
 class DFGReporter(DFGHook):
        def __init__(self, dfg):
-               super().__init__(dfg, lambda u, ep, v: EndpointReporter(u.actor.endpoints[ep]))
+               DFGHook.__init__(self, dfg, lambda u, ep, v: EndpointReporter(u.actor.endpoints[ep]))
 
        def get_edge_labels(self):
                d = dict()
index 699b6fb8637a684a9c44167f8bb65ab922de39be..7c30f760d0abc7d4e0afd7d0637b3ca2cfb63b34 100644 (file)
@@ -5,7 +5,7 @@ from migen.corelogic.misc import optree
 
 class Buffer(PipelinedActor):
        def __init__(self, layout):
-               super().__init__(1,
+               PipelinedActor.__init__(self, 1,
                        ("d", Sink, layout), ("q", Source, layout))
        
        def get_process_fragment(self):
@@ -22,7 +22,7 @@ class Combinator(Actor):
                        for n, r in enumerate(subrecords)]
                ep_source = ("source", Source, source)
                eps.append(ep_source)
-               super().__init__(*eps)
+               Actor.__init__(self, *eps)
 
        def get_fragment(self):
                source = self.endpoints["source"]
@@ -45,7 +45,7 @@ class Splitter(Actor):
                        for n, r in enumerate(subr)]
                ep_sink = ("sink", Sink, sink)
                eps.append(ep_sink)
-               super().__init__(*eps)
+               Actor.__init__(self, *eps)
                
        def get_fragment(self):
                sources = [self.endpoints[e] for e in self.sources()]
index dbaa5613e0df55653ae6e90b7de2fb9430ee27e5..943e972626226d38ae41f45d49112fffda1fb2eb 100644 (file)
@@ -12,18 +12,18 @@ from migen.pytholite.expr import ExprCompiler
 
 class Pytholite(UnifiedIOObject):
        def __init__(self, dataflow=None, buses={}):
-               super().__init__(dataflow, buses)
+               UnifiedIOObject.__init__(self, dataflow, buses)
                if dataflow is not None:
                        self.busy.reset = 1
                self.memory_ports = dict((mem, mem.get_port(write_capable=True, we_granularity=8))
                        for mem in self._memories)
        
        def get_fragment(self):
-               return super().get_fragment() + self.fragment
+               return UnifiedIOObject.get_fragment(self) + self.fragment
 
 class _TokenPullExprCompiler(ExprCompiler):
        def __init__(self, symdict, modelname, ep):
-               super().__init__(symdict)
+               ExprCompiler.__init__(self, symdict)
                self.modelname = modelname
                self.ep = ep
        
@@ -85,7 +85,7 @@ def _gen_df_io(compiler, modelname, to_model, from_model):
 
 class _BusReadExprCompiler(ExprCompiler):
        def __init__(self, symdict, modelname, data_signal):
-               super().__init__(symdict)
+               ExprCompiler.__init__(self, symdict)
                self.modelname = modelname
                self.data_signal = data_signal
        
index 35500e695b579302b9db95c5d6ddd54af700b4ab..5dfdcba0c9054e9be1f99b9588b114e063d1e32f 100644 (file)
@@ -9,7 +9,7 @@ from migen.uio.trampoline import Trampoline
 class UnifiedIOObject(Actor):
        def __init__(self, dataflow=None, buses={}):
                if dataflow is not None:
-                       super().__init__(*dataflow)
+                       Actor.__init__(self, *dataflow)
                self.buses = buses
                self._memories = set(v for v in self.buses.values() if isinstance(v, Memory))
        
@@ -21,7 +21,7 @@ class UnifiedIOObject(Actor):
 class UnifiedIOSimulation(UnifiedIOObject):
        def __init__(self, generator, dataflow=None, buses={}):
                self.generator = Trampoline(generator)
-               super().__init__(dataflow, buses)
+               UnifiedIOObject.__init__(self, dataflow, buses)
                
                self.callers = []
                self.busname_to_caller_id = {}
@@ -76,5 +76,5 @@ class UnifiedIOSimulation(UnifiedIOObject):
                                yield None
        
        def get_fragment(self):
-               f = super().get_fragment()
+               f = UnifiedIOObject.get_fragment(self)
                return sum([c.get_fragment() for c in self.callers], f)