X-Git-Url: https://git.libre-soc.org/?p=sv2nmigen.git;a=blobdiff_plain;f=examples%2Fassignment.py;h=d70d8508c84a63af6b7fab6264e814baf861c810;hp=b5a5862405fa58658152b7cbf2e4eaed768dd459;hb=e2973c57aa90034c4fb3bff4a1de95b0fd1c9ccc;hpb=1a995ea028ff7f563f1d453f7736bd548120b604 diff --git a/examples/assignment.py b/examples/assignment.py index b5a5862..d70d850 100644 --- a/examples/assignment.py +++ b/examples/assignment.py @@ -1,15 +1,16 @@ -from nmigen import Memory, Module, Signal, Cat, Elaboratable - -# module_1 -#clsdeclNode(compound_stmt, [Node(classdef, [Leaf(1, 'class'), Leaf(1, 'up_counter'), Leaf(11, ':'), Node(suite, [Leaf(4, '\n'), Leaf(5, ' '), Node(stmt, [Node(small_stmt, [Node(pass_stmt, [Leaf(1, 'pass')]), Leaf(4, '\n')]), Leaf(3, '\n #self.i1 = Signal() # input\n #self.o1 = Signal() # output')]), Leaf(6, '')])])]) -#clsstr: +# this file has been generated by sv2nmigen + +from nmigen import Signal, Module, Const, Cat, Elaboratable + + + class assignment(Elaboratable): + def __init__(self): - self.i = Signal() # input self.o = Signal() # output - def elaborate(self, platform): + self.i = Signal() # input + def elaborate(self, platform=None): m = Module() - m.d.comb += [self.o.eq(self.i)] + m.d.comb += self.o.eq(self.i) return m - -assignment() +