data/full_repos/permissive/214858095/FPGA_Exploration/spartan6/B205mini/ISE_Project/sim/general/sim_math.vh
 line:23: before: "function"
1: b"%Error: data/full_repos/permissive/214858095/FPGA_Exploration/spartan6/B205mini/ISE_Project/sim/general/sim_math.vh:122: Can't find definition of task/function: 'fabs'\n    x1 = fabs(x)*1.44269504;\n         ^~~~\n%Error: Exiting due to 1 error(s)\n"
function real exp;
  input x;
  real x;
  real x1,power,prod;
  integer i;
  begin
    x1 = fabs(x)*1.44269504;
    if (x1 > 255.0)
      begin
        exp = 0.0;
        if (x>0.0)
          begin
            $display("exp illegal argument:",x);
            $stop;
          end
      end
    else
      begin
        prod = 1.0;
        power = 128.0;
        for (i=7; i>=-23; i=i-1)
          begin
            if (x1 > power)
              begin
                prod = prod * rootof2(i);
                x1 = x1 - power;
              end
            power = power / 2.0;
          end
        if (x < 0)
          exp = 1.0/prod;
        else
          exp = prod;
      end
  end
endfunction
function real exp;

  input x;
  real x;
  real x1,power,prod;
  integer i;
  begin
    x1 = fabs(x)*1.44269504;
    if (x1 > 255.0)
      begin
        exp = 0.0;
        if (x>0.0)
          begin
            $display("exp illegal argument:",x);
            $stop;
          end
      end
    else
      begin
        prod = 1.0;
        power = 128.0;
        for (i=7; i>=-23; i=i-1)
          begin
            if (x1 > power)
              begin
                prod = prod * rootof2(i);
                x1 = x1 - power;
              end
            power = power / 2.0;
          end
        if (x < 0)
          exp = 1.0/prod;
        else
          exp = prod;
      end
  end
endfunction