module __std__round_up_to_nearest( input wire [31:0] x, input wire [31:0] y, output wire [31:0] out ); function automatic [31:0] udiv_32b (input reg [31:0] lhs, input reg [31:0] rhs); begin udiv_32b = rhs == 32'h0000_0000 ? 32'hffff_ffff : lhs / rhs; end endfunction // lint_off MULTIPLY function automatic [31:0] umul32b_32b_x_32b (input reg [31:0] lhs, input reg [31:0] rhs); begin umul32b_32b_x_32b = lhs * rhs; end endfunction // lint_on MULTIPLY wire [31:0] add_40; wire [31:0] udiv_42; wire [31:0] usual; wire [31:0] umul_48; assign add_40 = x + 32'hffff_ffff; assign udiv_42 = udiv_32b(add_40, y); assign usual = udiv_42 + 32'h0000_0001; assign umul_48 = umul32b_32b_x_32b(usual & {32{x != 32'h0000_0000}}, y); assign out = umul_48; endmodule