Skip to content

Commit 37536bf

Browse files
authored
Merge pull request #9 from patagona-technologies/master
Autodetect clock when the name ends with clock or clk.
2 parents 4d58d91 + 703a2a6 commit 37536bf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pyverilator/pyverilator.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,12 @@ def __init__(self, so_file, auto_eval=True, command_args=()):
531531
if sig_name.startswith('clock') or sig_name.startswith('clk'):
532532
self.clock = Clock(self.io[sig_name].signal)
533533
break
534+
# if neither are found, look for names that end with clock or clk
535+
if self.clock is None:
536+
for sig_name in self.io:
537+
if sig_name.endswith('clock') or sig_name.endswith('clk'):
538+
self.clock = Clock(self.io[sig_name].signal)
539+
break
534540

535541
def __del__(self):
536542
if self.model is not None:

0 commit comments

Comments
 (0)