Major Tools
Other Tools
General Info

Testbench patterns to run N cycles ?

Added by Patrick Mulder 9 months ago


as I understand from the example replaces the testbench. The main loop stops when it receives the "finish" signal from the module.

How would I approach the testbench when the e.g. full adder module ( ) does not have the finish signal built in?

i.e. how would I stop main loop after N cycles?


Replies (1)

RE: Testbench patterns to run N cycles ? - Added by Wilson Snyder 9 months ago

It finishes when there's a $finish, that's not really a signal.

Anyhow the example you point to should have s $finish after the # 40 in the test bench.

Note this isn't a Verilator-friendly example, as the test bench provided for Verilator would need to be in C++, or a FSM in Verilog. Also $monitor isn't supported. I don't have a great alternative page, maybe look at

Please report back if you look for and find a good alternative tutorial that is Verilator friendly.