Use double quotes for all strings
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Tue, 14 Feb 2012 12:12:43 +0000 (13:12 +0100)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Tue, 14 Feb 2012 12:12:43 +0000 (13:12 +0100)
examples/fsm.py
migen/bank/eventmanager.py
migen/bus/simple.py
migen/bus/wishbone.py
migen/corelogic/record.py
migen/flow/actor.py
migen/flow/ala.py
migen/flow/network.py
migen/flow/plumbing.py
setup.py

index 2ee86e5465d8711484d6870df36009d2d5389798..f1716aea69230376bd8b3f555d3c70fa76587576 100644 (file)
@@ -3,7 +3,7 @@ from migen.fhdl import verilog
 from migen.corelogic.fsm import FSM
 
 s = Signal()
-myfsm = FSM('FOO', 'BAR')
+myfsm = FSM("FOO", "BAR")
 myfsm.act(myfsm.FOO, s.eq(1), myfsm.next_state(myfsm.BAR))
 myfsm.act(myfsm.BAR, s.eq(0), myfsm.next_state(myfsm.FOO))
 print(verilog.convert(myfsm.get_fragment(), {s}))
index 406e355e5bb569a7e0e072fdebafe94333d37270..37a83b2c4c570965fd9a3b3cc2315e28bc33bd29 100644 (file)
@@ -59,6 +59,6 @@ class EventManager:
                
                # IRQ
                irqs = [self.pending.w[i] & field.r for i, field in enumerate(self.enable.fields)]
-               comb.append(self.irq.eq(optree('|', irqs)))
+               comb.append(self.irq.eq(optree("|", irqs)))
                
                return Fragment(comb, sync)
index 4340f682f7ee6af3694b0a60a2bc04f75e83cab5..c4b22177a01caa29150ddce787b04ea0cb7c5817 100644 (file)
@@ -14,7 +14,7 @@ def get_sig_name(signal, slave):
 class Simple():
        def __init__(self, desc, slave):
                for signal in desc:
-                       modules = self.__module__.split('.')
+                       modules = self.__module__.split(".")
                        busname = modules[len(modules)-1]
                        signame = get_sig_name(signal, slave)
                        setattr(self, signame, Signal(BV(signal[2]), busname + "_" + signame))
index fa1ce4546b1480f3739473590d0fa1f4882ddc66..fa63fedd6f0d0d0ee594e4ff639ab22432e91606 100644 (file)
@@ -116,12 +116,12 @@ class Decoder:
                        i += 1
                
                # generate master ack (resp. err) by ORing all slave acks (resp. errs)
-               comb.append(self.master.ack_i.eq(optree('|', [slave[1].ack_o for slave in self.slaves])))
-               comb.append(self.master.err_i.eq(optree('|', [slave[1].err_o for slave in self.slaves])))
+               comb.append(self.master.ack_i.eq(optree("|", [slave[1].ack_o for slave in self.slaves])))
+               comb.append(self.master.err_i.eq(optree("|", [slave[1].err_o for slave in self.slaves])))
                
                # mux (1-hot) slave data return
                masked = [Replicate(slave_sel_r[i], self.master.dat_i.bv.width) & self.slaves[i][1].dat_o for i in range(len(self.slaves))]
-               comb.append(self.master.dat_i.eq(optree('|', masked)))
+               comb.append(self.master.dat_i.eq(optree("|", masked)))
                
                return Fragment(comb, sync)
 
index ffebb928de0b430305f51b47934c8923e61667fb..6c3136e74ccb071a0265baa8f49f17cb4419c714 100644 (file)
@@ -45,7 +45,7 @@ class Record:
        def subrecord(self, *descr):
                fields = []
                for item in descr:
-                       path = item.split('/')
+                       path = item.split("/")
                        last = path.pop()
                        pos_self = self
                        pos_fields = fields
index 7203083ab7b92e29233ef0fbc79dfe24c6624848..0c7f762bbc7ed5a0151177df6517f979d872f3b6 100644 (file)
@@ -92,7 +92,7 @@ def _control_fragment_pipe(latency, stb_i, ack_o, stb_o, ack_i, busy, pipe_ce):
                pipe_ce.eq(ack_i | ~last_valid),
                ack_o.eq(pipe_ce),
                stb_o.eq(last_valid),
-               busy.eq(optree('|', [valid[i] for i in range(latency)]))
+               busy.eq(optree("|", [valid[i] for i in range(latency)]))
        ]
        
        return Fragment(comb, sync)
index 6b74bb388e5c7d47055cdd7f09b86544c7691d9f..85edef558980f988166098ecc712dec17fe3f80e 100644 (file)
@@ -9,8 +9,8 @@ class _SimpleBinary(Actor):
                self.op = op
                Actor.__init__(self,
                        SchedulingModel(SchedulingModel.COMBINATORIAL),
-                       ("operands", Sink, [('a', bv_op), ('b', bv_op)]),
-                       ("result", Source, [('r', bv_r)]))
+                       ("operands", Sink, [("a", bv_op), ("b", bv_op)]),
+                       ("result", Source, [("r", bv_r)]))
 
        def get_process_fragment(self):
                return Fragment([
@@ -20,43 +20,43 @@ class _SimpleBinary(Actor):
 
 class Add(_SimpleBinary):
        def __init__(self, bv):
-               _SimpleBinary.__init__(self, '+', bv, BV(bv.width+1, bv.signed))
+               _SimpleBinary.__init__(self, "+", bv, BV(bv.width+1, bv.signed))
 
 class Sub(_SimpleBinary):
        def __init__(self, bv):
-               _SimpleBinary.__init__(self, '-', bv, BV(bv.width+1, bv.signed))
+               _SimpleBinary.__init__(self, "-", bv, BV(bv.width+1, bv.signed))
 
 class Mul(_SimpleBinary):
        def __init__(self, bv):
-               _SimpleBinary.__init__(self, '*', bv, BV(2*bv.width, bv.signed))
+               _SimpleBinary.__init__(self, "*", bv, BV(2*bv.width, bv.signed))
 
 class And(_SimpleBinary):
        def __init__(self, bv):
-               _SimpleBinary.__init__(self, '&', bv, bv)
+               _SimpleBinary.__init__(self, "&", bv, bv)
 
 class Xor(_SimpleBinary):
        def __init__(self, bv):
-               _SimpleBinary.__init__(self, '^', bv, bv)
+               _SimpleBinary.__init__(self, "^", bv, bv)
 
 class Or(_SimpleBinary):
        def __init__(self, bv):
-               _SimpleBinary.__init__(self, '|', bv, bv)
+               _SimpleBinary.__init__(self, "|", bv, bv)
 
 class LT(_SimpleBinary):
        def __init__(self, bv):
-               _SimpleBinary.__init__(self, '<', bv, BV(1))
+               _SimpleBinary.__init__(self, "<", bv, BV(1))
 
 class LE(_SimpleBinary):
        def __init__(self, bv):
-               _SimpleBinary.__init__(self, '<=', bv, BV(1))
+               _SimpleBinary.__init__(self, "<=", bv, BV(1))
 
 class EQ(_SimpleBinary):
        def __init__(self, bv):
-               _SimpleBinary.__init__(self, '==', bv, BV(1))
+               _SimpleBinary.__init__(self, "==", bv, BV(1))
 
 class NE(_SimpleBinary):
        def __init__(self, bv):
-               _SimpleBinary.__init__(self, '!=', bv, BV(1))
+               _SimpleBinary.__init__(self, "!=", bv, BV(1))
 
 class DivMod(Actor):
        def __init__(self, width):
index a5a0b7944442bf6ebbfe9d35db54c03cef7ec71d..6a9d3fb07c1c352f5b464fd0b89081489d1da4ad 100644 (file)
@@ -15,7 +15,7 @@ class CompositeActor(Actor):
                        for x in self.dfg.edges(data=True)]
                this = sum(this_fragments, Fragment())
                others = sum([node.get_fragment() for node in self.dfg], Fragment())
-               busy = Fragment([self.busy.eq(optree('|', [node.busy for node in self.dfg]))])
+               busy = Fragment([self.busy.eq(optree("|", [node.busy for node in self.dfg]))])
                return this + others + busy
 
 def add_connection(dfg, source_node, sink_node, source_ep=None, sink_ep=None):
index 398b3da9e8d8401cabd26fd7be400f00819ca341..3120055cfbd163233bd958b89480f782e9014d7e 100644 (file)
@@ -31,7 +31,7 @@ class Combinator(Actor):
                source = self.endpoints["source"]
                sinks = [self.endpoints["sink{0}".format(n)]
                        for n in range(len(self.endpoints)-1)]
-               comb = [source.stb.eq(optree('&', [sink.stb for sink in sinks]))]
+               comb = [source.stb.eq(optree("&", [sink.stb for sink in sinks]))]
                comb += [sink.ack.eq(source.ack & source.stb) for sink in sinks]
                return Fragment(comb)
 
index a2cbc0b2676b3b656e9085dc58ef4518098c78b3..84bfd55e5e29226283aeca62d1808d06c83ef370 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -13,14 +13,14 @@ if sys.version_info < required_version:
        raise SystemExit("migen requires python {0} or greater".format(
                ".".join(map(str, required_version))))
 
-packages = ['migen']
+packages = ["migen"]
 packages_dir = os.path.sep.join((here, packages[0]))
 for entry in os.listdir(packages_dir):
        if (os.path.isdir(os.path.sep.join((packages_dir, entry))) and
-        os.path.isfile(os.path.sep.join((packages_dir, entry, '__init__.py')))):
-               packages.append('.'.join((packages[0], entry)))
+        os.path.isfile(os.path.sep.join((packages_dir, entry, "__init__.py")))):
+               packages.append(".".join((packages[0], entry)))
 
-packages_dir={'': 'migen'}
+packages_dir={"": "migen"}
 setup(
        name="migen",
        version="unknown",