Use double quotes for all strings

This commit is contained in:
Sebastien Bourdeauducq 2012-02-14 13:12:43 +01:00
parent e11d9b9322
commit 0c214b484e
10 changed files with 26 additions and 26 deletions

View 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}))

View 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)

View 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))

View 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)

View 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

View 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)

View 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):

View 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):

View 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)

View File

@ -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",