Pay a bit more attention to PEP8
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Fri, 16 Dec 2011 15:02:55 +0000 (16:02 +0100)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Fri, 16 Dec 2011 15:02:55 +0000 (16:02 +0100)
18 files changed:
examples/corelogic_conv.py
examples/lm32_inst.py
examples/simple_gpio.py
examples/wb_intercon/intercon_conv.py
migen/bank/csrgen.py
migen/bank/description.py
migen/bus/csr.py
migen/bus/simple.py
migen/bus/wishbone.py
migen/bus/wishbone2csr.py
migen/corelogic/divider.py
migen/corelogic/multimux.py
migen/corelogic/roundrobin.py
migen/corelogic/timeline.py
migen/fhdl/autofragment.py
migen/fhdl/convtools.py
migen/fhdl/structure.py
migen/fhdl/verilog.py

index cd141ccee101a87df8abf14674bca7a7d0d2011b..be3602c4009f666e99636756b7aaea6cc6084b7f 100644 (file)
@@ -4,6 +4,6 @@ from migen.corelogic import roundrobin, divider
 
 r = roundrobin.Inst(5)
 d = divider.Inst(16)
-frag = r.GetFragment() + d.GetFragment()
+frag = r.get_fragment() + d.get_fragment()
 o = verilog.Convert(frag, {r.request, r.grant, d.ready_o, d.quotient_o, d.remainder_o, d.start_i, d.dividend_i, d.divisor_i})
-print(o)
\ No newline at end of file
+print(o)
index 1af1751f3385997486254b6d66db648049afbdc9..c6e043ce6b946884487a03396c420e308a782b41 100644 (file)
@@ -37,11 +37,11 @@ class LM32:
                        "rst_i",
                        "lm32")
        
-       def GetFragment(self):
+       def get_fragment(self):
                return f.Fragment(instances=[self.inst])
 
 cpus = [LM32() for i in range(4)]
 frag = f.Fragment()
 for cpu in cpus:
-       frag += cpu.GetFragment()
-print(verilog.Convert(frag, set([cpus[0].inst.ins["interrupt"], cpus[0].inst.outs["I_WE_O"]])))
\ No newline at end of file
+       frag += cpu.get_fragment()
+print(verilog.Convert(frag, set([cpus[0].inst.ins["interrupt"], cpus[0].inst.outs["I_WE_O"]])))
index 29e75ebd0328e2299ed81111d9ab62a411eecb9e..b6d0943cd7cc0712a015f7757c63735b9d4d3885 100644 (file)
@@ -18,8 +18,8 @@ insync = [f.Assign(gpio_in_s, gpio_in), f.Assign(ifield.dev_w, gpio_in_s)]
 inf = f.Fragment(incomb, insync)
 
 bank = csrgen.Bank([oreg, ireg])
-f = bank.GetFragment() + inf
+f = bank.get_fragment() + inf
 i = bank.interface
 ofield.dev_r.name = "gpio_out"
 v = verilog.Convert(f, {i.d_o, ofield.dev_r, i.a_i, i.we_i, i.d_i, gpio_in})
-print(v)
\ No newline at end of file
+print(v)
index 06b046a8dc50710b4e4c91b4dda5cc471d957f0c..2bd788ff6c5f853aa2ece6e2022f4b46f3fc151a 100644 (file)
@@ -12,7 +12,7 @@ wishbonecon0 = wishbone.InterconnectShared(
                register=True,
                offset=1)
 
-frag = wishbonecon0.GetFragment()
+frag = wishbonecon0.get_fragment()
 v = verilog.Convert(frag, name="intercon", ios={m1.cyc_o, m1.stb_o, m1.we_o, m1.adr_o, m1.sel_o, m1.dat_o, m1.dat_i, m1.ack_i,
        m2.cyc_o, m2.stb_o, m2.we_o, m2.adr_o, m2.sel_o, m2.dat_o, m2.dat_i, m2.ack_i,
        s1.cyc_i, s1.stb_i, s1.we_i, s1.adr_i, s1.sel_i, s1.dat_i, s1.dat_o, s1.ack_o,
index 460966b46af6d40d3ef8418aeec7063837d502f3..2a538a072fc5c4c6bdf5ef275e748e4a65498426 100644 (file)
@@ -1,17 +1,15 @@
-from ..fhdl import structure as f
-from ..bus.csr import *
-from .description import *
-from functools import partial
+from migen.fhdl import structure as f
+from migen.bus.csr import *
+from migen.bank.description import *
 
 class Bank:
        def __init__(self, description, address=0):
                self.description = description
                self.address = address
                self.interface = Slave()
-               d = partial(f.Declare, self)
-               d("_sel")
+               f.declare_signal(self, "_sel")
        
-       def GetFragment(self):
+       def get_fragment(self):
                a = f.Assign
                comb = []
                sync = []
@@ -19,7 +17,7 @@ class Bank:
                comb.append(a(self._sel, self.interface.a_i[10:] == f.Constant(self.address, f.BV(4))))
                
                nregs = len(self.description)
-               nbits = f.BitsFor(nregs-1)
+               nbits = f.bits_for(nregs-1)
                
                # Bus writes
                bwcases = []
index accb1823266287752b929ceaa2fcb37402eef74d..ec405d23b1f618dbb6873b4f1cf48c09524dcd3c 100644 (file)
@@ -1,11 +1,11 @@
-from ..fhdl import structure as f
+from migen.fhdl import structure as f
 
 class Register:
        def __init__(self, name):
                self.name = name
                self.fields = []
        
-       def AddField(self, f):
+       def add_field(self, f):
                self.fields.append(f)
 
 (READ_ONLY, WRITE_ONLY, READ_WRITE) = range(3)
@@ -25,4 +25,4 @@ class Field:
                if self.access_dev == WRITE_ONLY or self.access_dev == READ_WRITE:
                        self.dev_w = f.Signal(f.BV(self.size), fullname + "_w")
                        self.dev_we = f.Signal(name=fullname + "_we")
-               self.parent.AddField(self)
\ No newline at end of file
+               self.parent.add_field(self)
\ No newline at end of file
index c62f4fafb1e5f3a34f78264342c22e95af2214d6..74fc42735fc95b4f1eaf157bbf4aea5f86f279e3 100644 (file)
@@ -1,5 +1,5 @@
 from migen.fhdl import structure as f
-from .simple import Simple
+from migen.bus.simple import Simple
 
 _desc = [
        (True,  "a",    14),
@@ -21,7 +21,7 @@ class Interconnect:
                self.master = master
                self.slaves = slaves
        
-       def GetFragment(self):
+       def get_fragment(self):
                a = f.Assign
                comb = []
                rb = f.Constant(0, f.BV(32))
index 5b578f97aec281e753128eb2fb574de7c6938794..83fee1d1cfc8dc50ffcedfa4e2ec1fa1e4254ab7 100644 (file)
@@ -1,6 +1,6 @@
 from migen.fhdl import structure as f
 
-def GetSigName(signal, slave):
+def get_sig_name(signal, slave):
        if signal[0] ^ slave:
                suffix = "_o"
        else:
@@ -18,5 +18,5 @@ class Simple():
                        busname = modules[len(modules)-1]
                        if name:
                                busname += "_" + name
-                       signame = GetSigName(signal, slave)
+                       signame = get_sig_name(signal, slave)
                        setattr(self, signame, f.Signal(f.BV(signal[2]), busname + "_" + signame))
index b464adea8dfe6e3ad1f3c90ac4bb45bb5e985e88..140f1ba72cc6d799f4821b250c12cf1e317dbbea 100644 (file)
@@ -1,7 +1,8 @@
+from functools import partial
+
 from migen.fhdl import structure as f
 from migen.corelogic import roundrobin, multimux
-from .simple import Simple, GetSigName
-from functools import partial
+from migen.bus.simple import Simple, get_sig_name
 
 _desc = [
        (True,  "adr",  32),
@@ -31,17 +32,17 @@ class Arbiter:
                self.target = target
                self.rr = roundrobin.Inst(len(self.masters))
 
-       def GetFragment(self):
+       def get_fragment(self):
                comb = []
                
                # mux master->slave signals
-               m2s_names = [GetSigName(x, False) for x in _desc if x[0]]
+               m2s_names = [get_sig_name(x, False) for x in _desc if x[0]]
                m2s_masters = [[getattr(m, name) for name in m2s_names] for m in self.masters]
                m2s_target = [getattr(self.target, name) for name in m2s_names]
-               comb += multimux.MultiMux(self.rr.grant, m2s_masters, m2s_target)
+               comb += multimux.multimux(self.rr.grant, m2s_masters, m2s_target)
                
                # connect slave->master signals
-               s2m_names = [GetSigName(x, False) for x in _desc if not x[0]]
+               s2m_names = [get_sig_name(x, False) for x in _desc if not x[0]]
                for name in s2m_names:
                        source = getattr(self.target, name)
                        i = 0
@@ -57,7 +58,7 @@ class Arbiter:
                reqs = [m.cyc_o for m in self.masters]
                comb.append(f.Assign(self.rr.request, f.Cat(*reqs)))
                
-               return f.Fragment(comb) + self.rr.GetFragment()
+               return f.Fragment(comb) + self.rr.get_fragment()
 
 class Decoder:
        # slaves is a list of pairs:
@@ -75,7 +76,7 @@ class Decoder:
                self.register = register
                
                addresses = [slave[0] for slave in self.slaves]
-               maxbits = max([f.BitsFor(addr) for addr in addresses])
+               maxbits = max([f.bits_for(addr) for addr in addresses])
                def mkconst(x):
                        if isinstance(x, int):
                                return f.Constant(x, f.BV(maxbits))
@@ -84,11 +85,11 @@ class Decoder:
                self.addresses = list(map(mkconst, addresses))
                
                ns = len(self.slaves)
-               d = partial(f.Declare, self)
+               d = partial(f.declare_signal, self)
                d("_slave_sel", f.BV(ns))
                d("_slave_sel_r", f.BV(ns))
 
-       def GetFragment(self):
+       def get_fragment(self):
                comb = []
                sync = []
                
@@ -105,7 +106,7 @@ class Decoder:
                        comb.append(f.Assign(self._slave_sel_r, self._slave_sel))
                
                # connect master->slaves signals except cyc
-               m2s_names = [(GetSigName(x, False), GetSigName(x, True))
+               m2s_names = [(get_sig_name(x, False), get_sig_name(x, True))
                        for x in _desc if x[0] and x[1] != "cyc"]
                comb += [f.Assign(getattr(slave[1], name[1]), getattr(self.master, name[0]))
                        for name in m2s_names for slave in self.slaves]
@@ -142,5 +143,5 @@ class InterconnectShared:
                self._decoder = Decoder(self._shared, slaves, offset, register)
                self.addresses = self._decoder.addresses
        
-       def GetFragment(self):
-               return self._arbiter.GetFragment() + self._decoder.GetFragment()
+       def get_fragment(self):
+               return self._arbiter.get_fragment() + self._decoder.get_fragment()
index 3244dd05f68e8299e26c1f1313f6202389a22fd8..c7ea78fab682a7e73d627278477959cf0a0728f4 100644 (file)
@@ -1,7 +1,7 @@
+from migen.bus import wishbone
+from migen.bus import csr
 from migen.fhdl import structure as f
 from migen.corelogic import timeline
-from . import wishbone
-from . import csr
 
 class Inst():
        def __init__(self):
@@ -12,11 +12,11 @@ class Inst():
                        (2, [f.Assign(self.wishbone.ack_o, 1)]),
                        (3, [f.Assign(self.wishbone.ack_o, 0)])])
        
-       def GetFragment(self):
+       def get_fragment(self):
                sync = [
                        f.Assign(self.csr.we_o, 0),
                        f.Assign(self.csr.d_o, self.wishbone.dat_i),
                        f.Assign(self.csr.a_o, self.wishbone.adr_i[2:16]),
                        f.Assign(self.wishbone.dat_o, self.csr.d_i)
                ]
-               return f.Fragment(sync=sync) + self.timeline.GetFragment()
+               return f.Fragment(sync=sync) + self.timeline.get_fragment()
index 4fffda08d02821e38f1586b9abce991a1d106b1d..9c82ad6cfa738cbb60a3fa5fee1e6e88fe99ff17 100644 (file)
@@ -1,11 +1,12 @@
-from migen.fhdl import structure as f
 from functools import partial
 
+from migen.fhdl import structure as f
+
 class Inst:
        def __init__(self, w):
                self.w = w
                
-               d = partial(f.Declare, self)
+               d = partial(f.declare_signal, self)
                
                d("start_i")
                d("dividend_i", f.BV(w))
@@ -15,11 +16,11 @@ class Inst:
                d("remainder_o", f.BV(w))
                
                d("_qr", f.BV(2*w))
-               d("_counter", f.BV(f.BitsFor(w)))
+               d("_counter", f.BV(f.bits_for(w)))
                d("_divisor_r", f.BV(w))
                d("_diff", f.BV(w+1))
        
-       def GetFragment(self):
+       def get_fragment(self):
                a = f.Assign
                comb = [
                        a(self.quotient_o, self._qr[:self.w]),
index 9db49b7b68c5c7313a2d1593b75f08ce97f186ae..db8e24b5f4df614e45e9c0650ddba9cbff281046 100644 (file)
@@ -1,6 +1,6 @@
 from migen.fhdl import structure as f
 
-def MultiMux(sel, inputs, output):
+def multimux(sel, inputs, output):
        n = len(inputs)
        i = 0
        comb = []
@@ -10,4 +10,4 @@ def MultiMux(sel, inputs, output):
                default = cases.pop()[1]
                comb.append(f.Case(sel, cases, default))
                i += 1
-       return comb
\ No newline at end of file
+       return comb
index 834cfae58221bdb8dce4e45db09c2cc800555090..e079b00477f1fbf3872579b22a2ad7f88991832a 100644 (file)
@@ -3,11 +3,11 @@ from migen.fhdl import structure as f
 class Inst:
        def __init__(self, n):
                self.n = n
-               self.bn = f.BitsFor(self.n-1)
-               f.Declare(self, "request", f.BV(self.n))
-               f.Declare(self, "grant", f.BV(self.bn))
+               self.bn = f.bits_for(self.n-1)
+               f.declare_signal(self, "request", f.BV(self.n))
+               f.declare_signal(self, "grant", f.BV(self.bn))
        
-       def GetFragment(self):
+       def get_fragment(self):
                cases = []
                for i in range(self.n):
                        switch = []
@@ -19,4 +19,4 @@ class Inst:
                        case = f.If(~self.request[i], switch)
                        cases.append((f.Constant(i, f.BV(self.bn)), case))
                statement = f.Case(self.grant, cases)
-               return f.Fragment(sync=[statement])
\ No newline at end of file
+               return f.Fragment(sync=[statement])
index 1515c6ec1c27f23f00bfd70b3d699ec5184116a6..aed5727a6666eaf412ebe3b7e20fe9e6b782c1a7 100644 (file)
@@ -5,9 +5,9 @@ class Inst:
                self.trigger = trigger
                self.events = events
                self.lastevent = max([e[0] for e in events])
-               f.Declare(self, "_counter", f.BV(f.BitsFor(self.lastevent)))
+               f.declare_signal(self, "_counter", f.BV(f.bits_for(self.lastevent)))
        
-       def GetFragment(self):
+       def get_fragment(self):
                counterlogic = f.If(self._counter != f.Constant(0, self._counter.bv), 
                        [f.Assign(self._counter, self._counter + f.Constant(1, self._counter.bv))],
                        [f.If(self.trigger, [f.Assign(self._counter, f.Constant(1, self._counter.bv))])])
@@ -17,11 +17,11 @@ class Inst:
                        counterlogic = f.If(self._counter == self.lastevent,
                                [f.Assign(self._counter, f.Constant(0, self._counter.bv))],
                                [counterlogic])
-               def getcond(e):
+               def get_cond(e):
                        if e[0] == 0:
                                return self.trigger & (self._counter == f.Constant(0, self._counter.bv))
                        else:
                                return self._counter == f.Constant(e[0], self._counter.bv)
-               sync = [f.If(getcond(e), e[1]) for e in self.events]
+               sync = [f.If(get_cond(e), e[1]) for e in self.events]
                sync.append(counterlogic)
                return f.Fragment(sync=sync)
index 29002597c65fba567555df2a20c7c26fc921eab1..554db1a8d85c095e3fa92f59a02091a3c962c10d 100644 (file)
@@ -1,12 +1,13 @@
-from .structure import *
 import inspect
 
-def FromLocal():
+from migen.fhdl.structure import *
+
+def from_local():
        f = Fragment()
        frame = inspect.currentframe().f_back
        ns = frame.f_locals
        for x in ns:
                obj = ns[x]
-               if hasattr(obj, "GetFragment"):
-                       f += obj.GetFragment()
+               if hasattr(obj, "get_fragment"):
+                       f += obj.get_fragment()
        return f
index a8f30361a105374c94b56586d1369df815b7765a..b236ff1b5c83cba50e01395cc6f2777b025d408d 100644 (file)
@@ -5,7 +5,7 @@ class Namespace:
                self.counts = {}
                self.sigs = {}
        
-       def GetName(self, sig):
+       def get_name(self, sig):
                try:
                        n = self.sigs[sig]
                        if n:
@@ -24,77 +24,77 @@ class Namespace:
                        else:
                                return sig.name
 
-def ListSignals(node):
+def list_signals(node):
        if isinstance(node, Constant):
                return set()
        elif isinstance(node, Signal):
                return {node}
        elif isinstance(node, Operator):
-               l = list(map(ListSignals, node.operands))
+               l = list(map(list_signals, node.operands))
                return set().union(*l)
        elif isinstance(node, Slice):
-               return ListSignals(node.value)
+               return list_signals(node.value)
        elif isinstance(node, Cat):
-               l = list(map(ListSignals, node.l))
+               l = list(map(list_signals, node.l))
                return set().union(*l)
        elif isinstance(node, Replicate):
-               return ListSignals(node.v)
+               return list_signals(node.v)
        elif isinstance(node, Assign):
-               return ListSignals(node.l) | ListSignals(node.r)
+               return list_signals(node.l) | list_signals(node.r)
        elif isinstance(node, StatementList):
-               l = list(map(ListSignals, node.l))
+               l = list(map(list_signals, node.l))
                return set().union(*l)
        elif isinstance(node, If):
-               return ListSignals(node.cond) | ListSignals(node.t) | ListSignals(node.f)
+               return list_signals(node.cond) | list_signals(node.t) | list_signals(node.f)
        elif isinstance(node, Case):
-               l = list(map(lambda x: ListSignals(x[1]), node.cases))
-               return ListSignals(node.test).union(*l).union(ListSignals(node.default))
+               l = list(map(lambda x: list_signals(x[1]), node.cases))
+               return list_signals(node.test).union(*l).union(list_signals(node.default))
        elif isinstance(node, Fragment):
-               return ListSignals(node.comb) | ListSignals(node.sync)
+               return list_signals(node.comb) | list_signals(node.sync)
        else:
                raise TypeError
 
-def ListTargets(node):
+def list_targets(node):
        if isinstance(node, Signal):
                return {node}
        elif isinstance(node, Slice):
-               return ListTargets(node.value)
+               return list_targets(node.value)
        elif isinstance(node, Cat):
-               l = list(map(ListTargets, node.l))
+               l = list(map(list_targets, node.l))
                return set().union(*l)
        elif isinstance(node, Replicate):
-               return ListTargets(node.v)
+               return list_targets(node.v)
        elif isinstance(node, Assign):
-               return ListTargets(node.l)
+               return list_targets(node.l)
        elif isinstance(node, StatementList):
-               l = list(map(ListTargets, node.l))
+               l = list(map(list_targets, node.l))
                return set().union(*l)
        elif isinstance(node, If):
-               return ListTargets(node.t) | ListTargets(node.f)
+               return list_targets(node.t) | list_targets(node.f)
        elif isinstance(node, Case):
-               l = list(map(lambda x: ListTargets(x[1]), node.cases))
-               return ListTargets(node.default).union(*l)
+               l = list(map(lambda x: list_targets(x[1]), node.cases))
+               return list_targets(node.default).union(*l)
        elif isinstance(node, Fragment):
-               return ListTargets(node.comb) | ListTargets(node.sync)
+               return list_targets(node.comb) | list_targets(node.sync)
        else:
                raise TypeError
 
-def ListInstOuts(i):
+def list_inst_outs(i):
        if isinstance(i, Fragment):
-               return ListInstOuts(i.instances)
+               return list_inst_outs(i.instances)
        else:
                l = []
                for x in i:
                        l += list(map(lambda x: x[1], list(x.outs.items())))
                return set(l)
 
-def IsVariable(node):
+def is_variable(node):
        if isinstance(node, Signal):
                return node.variable
        elif isinstance(node, Slice):
-               return IsVariable(node.value)
+               return is_variable(node.value)
        elif isinstance(node, Cat):
-               arevars = list(map(IsVariable, node.l))
+               arevars = list(map(is_variable, node.l))
                r = arevars[0]
                for x in arevars:
                        if x != r:
@@ -103,8 +103,8 @@ def IsVariable(node):
        else:
                raise TypeError
 
-def InsertReset(rst, sl):
-       targets = ListTargets(sl)
+def insert_reset(rst, sl):
+       targets = list_targets(sl)
        resetcode = []
        for t in targets:
                resetcode.append(Assign(t, t.reset))
index b5a87f2cfedd4516082e760ec3c3ee09712bb792..009930e6eb03fcc4a4b6c5093fc57430a586e715 100644 (file)
@@ -1,6 +1,6 @@
 import math
 
-def BitsFor(n):
+def bits_for(n):
        if isinstance(n, Constant):
                return n.bv.width
        else:
@@ -108,7 +108,7 @@ class Replicate(Value):
 
 class Constant(Value):
        def __init__(self, n, bv=None):
-               self.bv = bv or BV(BitsFor(n))
+               self.bv = bv or BV(bits_for(n))
                self.n = n
        
        def __repr__(self):
@@ -130,7 +130,7 @@ class Signal(Value):
        def __hash__(self):
                return id(self)
 
-def Declare(parent, name, bv=BV(), variable=False, reset=0):
+def declare_signal(parent, name, bv=BV(), variable=False, reset=0):
        # try to find a meaningful prefix
        if parent.__module__ == "__main__":
                prefix = parent.__class__.__name__
index 6b68080158ba306e7bb0493660ef21c81e3adc6b..4ec02eb4fb7f255abc806d582885f0a72d617f85 100644 (file)
@@ -1,7 +1,8 @@
-from .structure import *
-from .convtools import *
 from functools import partial
 
+from migen.fhdl.structure import *
+from migen.fhdl.convtools import *
+
 def _printsig(ns, s):
        if s.bv.signed:
                n = "signed "
@@ -9,7 +10,7 @@ def _printsig(ns, s):
                n = ""
        if s.bv.width > 1:
                n += "[" + str(s.bv.width-1) + ":0] "
-       n += ns.GetName(s)
+       n += ns.get_name(s)
        return n
 
 def _printexpr(ns, node):
@@ -19,7 +20,7 @@ def _printexpr(ns, node):
                else:
                        return "-" + str(node.bv) + str(-self.n)
        elif isinstance(node, Signal):
-               return ns.GetName(node)
+               return ns.get_name(node)
        elif isinstance(node, Operator):
                arity = len(node.operands)
                if arity == 1:
@@ -46,7 +47,7 @@ def _printexpr(ns, node):
 
 def _printnode(ns, level, node):
        if isinstance(node, Assign):
-               if IsVariable(node.l):
+               if is_variable(node.l):
                        assignment = " = "
                else:
                        assignment = " <= "
@@ -96,7 +97,7 @@ def _printinstances(ns, i, clk, rst):
                                        raise TypeError
                                r += ")"
                        r += "\n) "
-               r += ns.GetName(x) 
+               r += ns.get_name(x) 
                if x.parameters: r += " "
                r += "(\n"
                ports = list(x.ins.items()) + list(x.outs.items())
@@ -109,7 +110,7 @@ def _printinstances(ns, i, clk, rst):
                        if not firstp:
                                r += ",\n"
                        firstp = False
-                       r += "\t." + p[0] + "(" + ns.GetName(p[1]) + ")"
+                       r += "\t." + p[0] + "(" + ns.get_name(p[1]) + ")"
                if not firstp:
                        r += "\n"
                r += ");\n\n"
@@ -123,14 +124,14 @@ def Convert(f, ios=set(), name="top", clkname="sys_clk", rstname="sys_rst", ns=N
 
        ios |= f.pads
 
-       sigs = ListSignals(f)
-       targets = ListTargets(f)
-       instouts = ListInstOuts(f)
+       sigs = list_signals(f)
+       targets = list_targets(f)
+       instouts = list_inst_outs(f)
        
        r = "/* Machine-generated using Migen */\n"
        r += "module " + name + "(\n"
-       r += "\tinput " + ns.GetName(clks) + ",\n"
-       r += "\tinput " + ns.GetName(rsts)
+       r += "\tinput " + ns.get_name(clks) + ",\n"
+       r += "\tinput " + ns.get_name(rsts)
        for sig in ios:
                if sig in targets:
                        r += ",\n\toutput reg " + _printsig(ns, sig)
@@ -151,8 +152,8 @@ def Convert(f, ios=set(), name="top", clkname="sys_clk", rstname="sys_rst", ns=N
                r += _printnode(ns, 1, f.comb)
                r += "end\n\n"
        if f.sync.l:
-               r += "always @(posedge " + ns.GetName(clks) + ") begin\n"
-               r += _printnode(ns, 1, InsertReset(rsts, f.sync))
+               r += "always @(posedge " + ns.get_name(clks) + ") begin\n"
+               r += _printnode(ns, 1, insert_reset(rsts, f.sync))
                r += "end\n\n"
        r += _printinstances(ns, f.instances, clks, rsts)