-
Notifications
You must be signed in to change notification settings - Fork 207
Open
Description
Currently, pyverilog recognize clock and reset signal by their name at bind_visitor._createAlwaysinfo.
But I hope to be implemented other method using if branch structure (as command-line option or default).
That is, if the first "if" branch conditions is a signal in the sensitivity list, it should be determined as reset.
i.e.
def _is_reset(self, node, sig):
if not isinstance(node.statement.statements[0], pyverilog.vparser.ast.IfStatement):
return False
if isinstance(node.statement.statements[0].cond, pyverilog.vparser.ast.Ulnot) and edge == 'negedge':
target = node.statement.statements[0].cond.children()[0]
elif edge == 'posedge':
target = node.statement.statements[0].cond
else:
return False
if isinstance(target, pyverilog.vparser.ast.Pointer):
if sig.ptr == target.ptr:
target = target.var
else:
return False
return target == sigI look forward to listening your opinion when there is your time.
Metadata
Metadata
Assignees
Labels
No labels