verilator/test_regress/t/t_leak.v
Wilson Snyder 2cad22a22a
Add simulation context (VerilatedContext) (#2660). (#2813)
**   Add simulation context (VerilatedContext) to allow multiple fully independent
      models to be in the same process.  Please see the updated examples.
**   Add context->time() and context->timeInc() API calls, to set simulation time.
      These now are recommended in place of the legacy sc_time_stamp().
2021-03-07 11:01:54 -05:00

26 lines
554 B
Systemverilog

// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain, for
// any use, without warranty, 2006 by Wilson Snyder.
// SPDX-License-Identifier: CC0-1.0
module t (clk);
sub sub ();
input clk;
integer cyc=1;
always @ (posedge clk) begin
cyc <= cyc + 1;
if (cyc==2) begin
// Not $finish; as we don't want a message to scroll by
$c("Verilated::threadContextp()->gotFinish(true);");
end
end
endmodule
module sub;
/* verilator public_module */
endmodule