parser refactoring
[sv2nmigen.git] / examples / assignment.py
1 from nmigen import Memory, Module, Signal, Cat, Elaboratable
2
3 # module_1
4 #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, '')])])])
5 #clsstr:
6 class assignment(Elaboratable):
7 def __init__(self):
8 self.i = Signal() # input
9 self.o = Signal() # output
10 def elaborate(self, platform):
11 m = Module()
12 m.d.comb += [self.o.eq(self.i)]
13 return m
14
15 assignment()