data/full_repos/permissive/42434302/ivltests/pr540b.v
1: b'%Warning-STMTDLY: data/full_repos/permissive/42434302/ivltests/pr540b.v:23: Unsupported: Ignoring delay on this delayed statement.\n    #1;\n    ^\n                  ... Use "/* verilator lint_off STMTDLY */" and lint_on around source to disable this message.\n%Warning-STMTDLY: data/full_repos/permissive/42434302/ivltests/pr540b.v:38: Unsupported: Ignoring delay on this delayed statement.\n    #4;\n    ^\n%Warning-STMTDLY: data/full_repos/permissive/42434302/ivltests/pr540b.v:40: Unsupported: Ignoring delay on this delayed statement.\n    #4\n    ^\n%Warning-STMTDLY: data/full_repos/permissive/42434302/ivltests/pr540b.v:62: Unsupported: Ignoring delay on this delayed statement.\n    #2;\n    ^\n%Warning-STMTDLY: data/full_repos/permissive/42434302/ivltests/pr540b.v:69: Unsupported: Ignoring delay on this delayed statement.\n    #2;\n    ^\n%Error: data/full_repos/permissive/42434302/ivltests/pr540b.v:72: Unsupported: wait statements\n wait (fred);\n ^~~~\n%Warning-STMTDLY: data/full_repos/permissive/42434302/ivltests/pr540b.v:84: Unsupported: Ignoring delay on this delayed statement.\n    #2;\n    ^\n%Error: data/full_repos/permissive/42434302/ivltests/pr540b.v:86: Unsupported: fork statements\n      fork\n      ^~~~\n%Warning-STMTDLY: data/full_repos/permissive/42434302/ivltests/pr540b.v:88: Unsupported: Ignoring delay on this delayed statement.\n   #5;\n   ^\n%Error: data/full_repos/permissive/42434302/ivltests/pr540b.v:92: syntax error, unexpected \'@\'\n   @(fred);\n   ^\n%Warning-STMTDLY: data/full_repos/permissive/42434302/ivltests/pr540b.v:119: Unsupported: Ignoring delay on this delayed statement.\n    #2;\n    ^\n%Error: data/full_repos/permissive/42434302/ivltests/pr540b.v:122: Unsupported: wait statements\n wait (fred);\n ^~~~\n%Warning-STMTDLY: data/full_repos/permissive/42434302/ivltests/pr540b.v:134: Unsupported: Ignoring delay on this delayed statement.\n    #2;\n    ^\n%Error: data/full_repos/permissive/42434302/ivltests/pr540b.v:136: Unsupported: fork statements\n      fork\n      ^~~~\n%Warning-STMTDLY: data/full_repos/permissive/42434302/ivltests/pr540b.v:138: Unsupported: Ignoring delay on this delayed statement.\n   #5;\n   ^\n%Error: data/full_repos/permissive/42434302/ivltests/pr540b.v:142: syntax error, unexpected \'@\'\n   @(fred);\n   ^\n%Warning-STMTDLY: data/full_repos/permissive/42434302/ivltests/pr540b.v:154: Unsupported: Ignoring delay on this delayed statement.\n    #2;\n    ^\n%Error: data/full_repos/permissive/42434302/ivltests/pr540b.v:156: Unsupported: fork statements\n      fork\n      ^~~~\n%Warning-STMTDLY: data/full_repos/permissive/42434302/ivltests/pr540b.v:158: Unsupported: Ignoring delay on this delayed statement.\n   #5;\n   ^\n%Error: data/full_repos/permissive/42434302/ivltests/pr540b.v:162: syntax error, unexpected \'@\'\n   @(fred);\n   ^\n%Warning-STMTDLY: data/full_repos/permissive/42434302/ivltests/pr540b.v:174: Unsupported: Ignoring delay on this delayed statement.\n    #2;\n    ^\n%Error: data/full_repos/permissive/42434302/ivltests/pr540b.v:176: Unsupported: fork statements\n      fork\n      ^~~~\n%Warning-STMTDLY: data/full_repos/permissive/42434302/ivltests/pr540b.v:178: Unsupported: Ignoring delay on this delayed statement.\n   #5;\n   ^\n%Error: data/full_repos/permissive/42434302/ivltests/pr540b.v:182: syntax error, unexpected \'@\'\n   @(fred);\n   ^\n%Error: Exiting due to 10 error(s), 14 warning(s)\n        ... See the manual and https://verilator.org for more assistance.\n'
module top;

  integer simple_fail, loop_fail, fork_fail, tlp_fail;
  integer tfk_fail, tfk2_fail, tfk3_fail;
  integer tfk2pos, tfk2nega, tfk2negb;
  integer tfk3pos, tfk3nega, tfk3negb;
  integer loop_cntr, tlp_cntr;
  reg fred, abort;

  initial begin
    #1;
    simple_fail = 0;
    loop_fail = 0;
    fork_fail = 0;
    tlp_fail = 0;
    tfk_fail = 0;
    tfk2_fail = 0;
    tfk2pos = 0;
    tfk2nega = 1;
    tfk2negb = 1;
    tfk3pos = 0;
    tfk3nega = 1;
    tfk3negb = 1;
    fred = 0;
    abort = 1;
    #4;
    fred = 1;
    #4
    $display("Check disable:");
    if(simple_fail) $display("***** simple block           FAILED *****");
    else            $display("***** simple block           PASSED *****");
    if(loop_fail)   $display("***** block with loop        FAILED *****");
    else            $display("***** block with loop        PASSED *****");
    if(fork_fail)   $display("***** forked block           FAILED *****");
    else            $display("***** forked block           PASSED *****");
    if(tlp_fail)    $display("***** task with loop         FAILED *****");
    else            $display("***** task with loop         PASSED *****");
    if(tfk_fail)    $display("***** task with forked block FAILED *****");
    else            $display("***** task with forked block PASSED *****");
    if(tfk2_fail)   $display("***** one forked block       FAILED *****");
    else            $display("***** one forked block       PASSED *****");
    if(tfk3_fail)   $display("***** the other forked block FAILED *****");
    else            $display("***** the other forked block PASSED *****");
    $display("");
    $finish;
  end


  initial begin: block_name
    #2;
    disable block_name;
    simple_fail = 1;
  end


  initial begin
    #2;
    begin: configloop
      for (loop_cntr = 0; loop_cntr < 3; loop_cntr=loop_cntr+1) begin
	wait (fred);
	if (abort) begin
	  disable configloop;
	end
	loop_fail = 1;
      end
    end
    if (loop_fail) $display("\n\ttime: %0t, loop_cntr: %0d",$time,loop_cntr);
  end


  initial begin
    #2;
    begin: forked_tasks
      fork
	begin
	  #5;
	  fork_fail = 1;
	end
	begin
	  @(fred);
	  disable forked_tasks;
	  fork_fail = 1;
	end
      join
      fork_fail = 1;
    end
  end


  initial begin
    task_with_loop;
  end
  initial begin
    task_with_fork;
  end
  initial begin
    task_with_fork2;
    if(tfk2pos || tfk2nega || tfk2negb) tfk2_fail = 1;
  end
  initial begin
    task_with_fork3;
    if(tfk3pos || tfk3nega || tfk3negb) tfk3_fail = 1;
  end

task task_with_loop;
  begin
    #2;
    begin: configtlp
      for (tlp_cntr = 0; tlp_cntr < 3; tlp_cntr=tlp_cntr+1) begin
	wait (fred);
	if (abort) begin
	  disable configtlp;
	end
	tlp_fail = 1;
      end
    end
  end
endtask

task task_with_fork;
  begin
    #2;
    begin: forked_tasks_in_task
      fork
	begin: alf
	  #5;
	  tfk_fail = 1;
	end
	begin: bet
	  @(fred);
	  disable forked_tasks_in_task;
	  tfk_fail = 1;
	end
      join
      tfk_fail = 1;
    end
  end
endtask

task task_with_fork2;
  begin
    #2;
    begin: forked_tasks_in_task2
      fork
	begin: gam
	  #5;
	  tfk2pos = 1;
	end
	begin: delt
	  @(fred);
	  disable gam;
	  tfk2nega = 0;
	end
      join
      tfk2negb = 0;
    end
  end
endtask

task task_with_fork3;
  begin
    #2;
    begin: forked_tasks_in_task3
      fork
	begin: eps
	  #5;
	  tfk3nega = 0;
	end
	begin: zet
	  @(fred);
	  disable zet;
	  tfk3pos = 1;
	end
      join
      tfk3negb = 0;
    end
  end
endtask

endmodule
module top;


  integer simple_fail, loop_fail, fork_fail, tlp_fail;
  integer tfk_fail, tfk2_fail, tfk3_fail;
  integer tfk2pos, tfk2nega, tfk2negb;
  integer tfk3pos, tfk3nega, tfk3negb;
  integer loop_cntr, tlp_cntr;
  reg fred, abort;

  initial begin
    #1;
    simple_fail = 0;
    loop_fail = 0;
    fork_fail = 0;
    tlp_fail = 0;
    tfk_fail = 0;
    tfk2_fail = 0;
    tfk2pos = 0;
    tfk2nega = 1;
    tfk2negb = 1;
    tfk3pos = 0;
    tfk3nega = 1;
    tfk3negb = 1;
    fred = 0;
    abort = 1;
    #4;
    fred = 1;
    #4
    $display("Check disable:");
    if(simple_fail) $display("***** simple block           FAILED *****");
    else            $display("***** simple block           PASSED *****");
    if(loop_fail)   $display("***** block with loop        FAILED *****");
    else            $display("***** block with loop        PASSED *****");
    if(fork_fail)   $display("***** forked block           FAILED *****");
    else            $display("***** forked block           PASSED *****");
    if(tlp_fail)    $display("***** task with loop         FAILED *****");
    else            $display("***** task with loop         PASSED *****");
    if(tfk_fail)    $display("***** task with forked block FAILED *****");
    else            $display("***** task with forked block PASSED *****");
    if(tfk2_fail)   $display("***** one forked block       FAILED *****");
    else            $display("***** one forked block       PASSED *****");
    if(tfk3_fail)   $display("***** the other forked block FAILED *****");
    else            $display("***** the other forked block PASSED *****");
    $display("");
    $finish;
  end


  initial begin: block_name
    #2;
    disable block_name;
    simple_fail = 1;
  end


  initial begin
    #2;
    begin: configloop
      for (loop_cntr = 0; loop_cntr < 3; loop_cntr=loop_cntr+1) begin
	wait (fred);
	if (abort) begin
	  disable configloop;
	end
	loop_fail = 1;
      end
    end
    if (loop_fail) $display("\n\ttime: %0t, loop_cntr: %0d",$time,loop_cntr);
  end


  initial begin
    #2;
    begin: forked_tasks
      fork
	begin
	  #5;
	  fork_fail = 1;
	end
	begin
	  @(fred);
	  disable forked_tasks;
	  fork_fail = 1;
	end
      join
      fork_fail = 1;
    end
  end


  initial begin
    task_with_loop;
  end
  initial begin
    task_with_fork;
  end
  initial begin
    task_with_fork2;
    if(tfk2pos || tfk2nega || tfk2negb) tfk2_fail = 1;
  end
  initial begin
    task_with_fork3;
    if(tfk3pos || tfk3nega || tfk3negb) tfk3_fail = 1;
  end

task task_with_loop;
  begin
    #2;
    begin: configtlp
      for (tlp_cntr = 0; tlp_cntr < 3; tlp_cntr=tlp_cntr+1) begin
	wait (fred);
	if (abort) begin
	  disable configtlp;
	end
	tlp_fail = 1;
      end
    end
  end
endtask

task task_with_fork;
  begin
    #2;
    begin: forked_tasks_in_task
      fork
	begin: alf
	  #5;
	  tfk_fail = 1;
	end
	begin: bet
	  @(fred);
	  disable forked_tasks_in_task;
	  tfk_fail = 1;
	end
      join
      tfk_fail = 1;
    end
  end
endtask

task task_with_fork2;
  begin
    #2;
    begin: forked_tasks_in_task2
      fork
	begin: gam
	  #5;
	  tfk2pos = 1;
	end
	begin: delt
	  @(fred);
	  disable gam;
	  tfk2nega = 0;
	end
      join
      tfk2negb = 0;
    end
  end
endtask

task task_with_fork3;
  begin
    #2;
    begin: forked_tasks_in_task3
      fork
	begin: eps
	  #5;
	  tfk3nega = 0;
	end
	begin: zet
	  @(fred);
	  disable zet;
	  tfk3pos = 1;
	end
      join
      tfk3negb = 0;
    end
  end
endtask

endmodule