data/full_repos/permissive/143278/ivltests/sdw_function5.v
data/verilator_xmls/125bc2fd-9fa4-44d2-940b-5d0a0d571b72.xml
module main ();

reg [3:0] global_var;
reg [3:0] result;

function [3:0] my_func ;
input [3:0] a;
begin
   case(a)
      4'b000: my_func = 4'b0;
      default: my_func = a + a;
   endcase
end
endfunction

initial
  begin
    global_var = 2;
    result = my_func(global_var);

    if(result != 4)
      begin
         $display("FAILED - function didn't function!\n");
         $finish ;
      end

    $display("PASSED\n");
    $finish ;
  end
endmodule
module main ();


reg [3:0] global_var;
reg [3:0] result;

function [3:0] my_func ;
input [3:0] a;
begin
   case(a)
      4'b000: my_func = 4'b0;
      default: my_func = a + a;
   endcase
end
endfunction

initial
  begin
    global_var = 2;
    result = my_func(global_var);

    if(result != 4)
      begin
         $display("FAILED - function didn't function!\n");
         $finish ;
      end

    $display("PASSED\n");
    $finish ;
  end
endmodule