self.visit(choice)
+class _InputLister(NodeVisitor):
+ def __init__(self):
+ self.output_list = set()
+
+ def visit_Signal(self, node):
+ self.output_list.add(node)
+
+ def visit_Assign(self, node):
+ self.visit(node.r)
+
+
def list_signals(node):
lister = _SignalLister()
lister.visit(node)
return lister.output_list
+def list_inputs(node):
+ lister = _InputLister()
+ lister.visit(node)
+ return lister.output_list
+
+
def _resort_statements(ol):
return [statement for i, statement in
sorted(ol, key=lambda x: x[0])]