From 0c214b484ec4b342e6338fc6b66d655b3c06f06a Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 14 Feb 2012 13:12:43 +0100 Subject: [PATCH] Use double quotes for all strings --- examples/fsm.py | 2 +- migen/bank/eventmanager.py | 2 +- migen/bus/simple.py | 2 +- migen/bus/wishbone.py | 6 +++--- migen/corelogic/record.py | 2 +- migen/flow/actor.py | 2 +- migen/flow/ala.py | 24 ++++++++++++------------ migen/flow/network.py | 2 +- migen/flow/plumbing.py | 2 +- setup.py | 8 ++++---- 10 files changed, 26 insertions(+), 26 deletions(-) diff --git a/examples/fsm.py b/examples/fsm.py index 2ee86e54..f1716aea 100644 --- a/examples/fsm.py +++ b/examples/fsm.py @@ -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})) diff --git a/migen/bank/eventmanager.py b/migen/bank/eventmanager.py index 406e355e..37a83b2c 100644 --- a/migen/bank/eventmanager.py +++ b/migen/bank/eventmanager.py @@ -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) diff --git a/migen/bus/simple.py b/migen/bus/simple.py index 4340f682..c4b22177 100644 --- a/migen/bus/simple.py +++ b/migen/bus/simple.py @@ -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)) diff --git a/migen/bus/wishbone.py b/migen/bus/wishbone.py index fa1ce454..fa63fedd 100644 --- a/migen/bus/wishbone.py +++ b/migen/bus/wishbone.py @@ -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) diff --git a/migen/corelogic/record.py b/migen/corelogic/record.py index ffebb928..6c3136e7 100644 --- a/migen/corelogic/record.py +++ b/migen/corelogic/record.py @@ -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 diff --git a/migen/flow/actor.py b/migen/flow/actor.py index 7203083a..0c7f762b 100644 --- a/migen/flow/actor.py +++ b/migen/flow/actor.py @@ -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) diff --git a/migen/flow/ala.py b/migen/flow/ala.py index 6b74bb38..85edef55 100644 --- a/migen/flow/ala.py +++ b/migen/flow/ala.py @@ -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): diff --git a/migen/flow/network.py b/migen/flow/network.py index a5a0b794..6a9d3fb0 100644 --- a/migen/flow/network.py +++ b/migen/flow/network.py @@ -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): diff --git a/migen/flow/plumbing.py b/migen/flow/plumbing.py index 398b3da9..3120055c 100644 --- a/migen/flow/plumbing.py +++ b/migen/flow/plumbing.py @@ -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) diff --git a/setup.py b/setup.py index a2cbc0b2..84bfd55e 100755 --- 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", -- 2.30.2