data/full_repos/permissive/520695407/sim/tb-metaball.sv
1: b'%Error: data/full_repos/permissive/520695407/sim/tb-metaball.sv:5: Unsupported: event data types\n  input event start,\n        ^~~~~\n%Error: data/full_repos/permissive/520695407/sim/tb-metaball.sv:6: Unsupported: event data types\n  input event done\n        ^~~~~\n%Warning-STMTDLY: data/full_repos/permissive/520695407/sim/tb-metaball.sv:21: Unsupported: Ignoring delay on this delayed statement.\n  always #10 clk <= ~clk;\n         ^\n                  ... Use "/* verilator lint_off STMTDLY */" and lint_on around source to disable this message.\n%Error: data/full_repos/permissive/520695407/sim/tb-metaball.sv:94: Unsupported: wait statements\n    wait (start.triggered);\n    ^~~~\n%Error: data/full_repos/permissive/520695407/sim/tb-metaball.sv:111: syntax error, unexpected \'@\'\n    @ (negedge vld);\n    ^\n%Error: data/full_repos/permissive/520695407/sim/tb-metaball.sv:125: syntax error, unexpected ->\n    ->done;\n    ^~\n%Error: Exiting due to 5 error(s), 1 warning(s)\n        ... See the manual and https://verilator.org for more assistance.\n'
function automatic logic[31:0] real_to_fp(real num);
    logic[31:0] out = '0;
    logic neg_flag = 0;
    real bit_val = 0;
    if (num < 0) neg_flag = 1;
    num = $sqrt($pow(num, 2));
    for (int i = 30; i >= 15; i--) begin
      bit_val = $pow(2, i - 15);
      if (num >= bit_val) begin
	out[i] = 1'b1;
	num -= bit_val;
      end
    end
    for (int i = 14; i >= 0; i--) begin
      bit_val = 1 / $pow(2, 15 - i);
      if (num >= bit_val) begin
	out[i] = 1'b1;
	num -= bit_val;
      end
    end
    if (neg_flag) out = ~out + 1;
    return out;
  endfunction
function automatic logic[31:0] real_to_fp(real num);

    logic[31:0] out = '0;
    logic neg_flag = 0;
    real bit_val = 0;
    if (num < 0) neg_flag = 1;
    num = $sqrt($pow(num, 2));
    for (int i = 30; i >= 15; i--) begin
      bit_val = $pow(2, i - 15);
      if (num >= bit_val) begin
	out[i] = 1'b1;
	num -= bit_val;
      end
    end
    for (int i = 14; i >= 0; i--) begin
      bit_val = 1 / $pow(2, 15 - i);
      if (num >= bit_val) begin
	out[i] = 1'b1;
	num -= bit_val;
      end
    end
    if (neg_flag) out = ~out + 1;
    return out;
  endfunction