cleanup, add example output
[sv2nmigen.git] / examples / assignment.py
index d48fff95bcdf8fddeb247c9c2aa748dbcb2c94ea..d70d8508c84a63af6b7fab6264e814baf861c810 100644 (file)
@@ -1,8 +1,16 @@
-from nmigen import Memory, Module, Signal, Cat, Elaboratable
-# module_1
-#clsdeclNode(compound_stmt, [Node(classdef, [Leaf(1, 'class'), Leaf(1, 'assignment'), Leaf(11, ':'), Node(suite, [Leaf(4, '\n'), Leaf(5, '    '), Node(stmt, [Node(small_stmt, [Node(pass_stmt, [Leaf(1, 'pass')]), Leaf(4, '\n')]), Leaf(5, '        '), Leaf(3, 'self.i = Signal() # input'), Leaf(5, '        '), Leaf(3, Leaf(4, '\n')), Leaf(5, '        '), Leaf(3, 'self.o = Signal() # output')]), Leaf(6, '')])])])
-#clsstr:
-class assignment(self):
+# 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
+        self.i = Signal() # input
+    def elaborate(self, platform=None):
+        m = Module()
+        m.d.comb += self.o.eq(self.i)
+        return m
+