data/full_repos/permissive/473423187/hw/rtl/fp_cores/fpnew/src/fpnew_rounding.sv
1: b"%Error: data/full_repos/permissive/473423187/hw/rtl/fp_cores/fpnew/src/fpnew_rounding.sv:22: syntax error, unexpected ::, expecting ')' or ','\n  input fpnew_pkg::roundmode_e rnd_mode_i,\n                 ^~\n                                                                                           : ... Perhaps 'fpnew_pkg' is a package which needs to be predeclared? (IEEE 1800-2017 26.3)\n%Error: data/full_repos/permissive/473423187/hw/rtl/fp_cores/fpnew/src/fpnew_rounding.sv:25: syntax error, unexpected output, expecting IDENTIFIER or '=' or do or final\n  output logic [AbsWidth-1:0]  abs_rounded_o,            \n  ^~~~~~\n%Error: data/full_repos/permissive/473423187/hw/rtl/fp_cores/fpnew/src/fpnew_rounding.sv:26: syntax error, unexpected output, expecting IDENTIFIER or '=' or do or final\n  output logic                 sign_o,\n  ^~~~~~\n%Error: data/full_repos/permissive/473423187/hw/rtl/fp_cores/fpnew/src/fpnew_rounding.sv:28: syntax error, unexpected output, expecting IDENTIFIER or '=' or do or final\n  output logic                 exact_zero_o              \n  ^~~~~~\n%Error: data/full_repos/permissive/473423187/hw/rtl/fp_cores/fpnew/src/fpnew_rounding.sv:42: syntax error, unexpected always_comb\n  always_comb begin : rounding_decision\n  ^~~~~~~~~~~\n%Error: Exiting due to 5 error(s)\n"
module fpnew_rounding #(
  parameter int unsigned AbsWidth=2
) (

  input logic [AbsWidth-1:0]   abs_value_i,
  input logic                  sign_i,

  input logic [1:0]            round_sticky_bits_i,
  input fpnew_pkg::roundmode_e rnd_mode_i,
  input logic                  effective_subtraction_i,

  output logic [AbsWidth-1:0]  abs_rounded_o,
  output logic                 sign_o,

  output logic                 exact_zero_o
);

  logic round_up;










  always_comb begin : rounding_decision
    unique case (rnd_mode_i)
      fpnew_pkg::RNE:
        unique case (round_sticky_bits_i)
          2'b00,
          2'b01: round_up = 1'b0;
          2'b10: round_up = abs_value_i[0];
          2'b11: round_up = 1'b1;
          default: round_up = fpnew_pkg::DONT_CARE;
        endcase
      fpnew_pkg::RTZ: round_up = 1'b0;
      fpnew_pkg::RDN: round_up = (| round_sticky_bits_i) ? sign_i  : 1'b0;
      fpnew_pkg::RUP: round_up = (| round_sticky_bits_i) ? ~sign_i : 1'b0;
      fpnew_pkg::RMM: round_up = round_sticky_bits_i[1];
      default: round_up = fpnew_pkg::DONT_CARE;
    endcase
  end


  assign abs_rounded_o = abs_value_i + round_up;


  assign exact_zero_o = (abs_value_i == '0) && (round_sticky_bits_i == '0);



  assign sign_o = (exact_zero_o && effective_subtraction_i)
                  ? (rnd_mode_i == fpnew_pkg::RDN)
                  : sign_i;

endmodule
module fpnew_rounding #(
  parameter int unsigned AbsWidth=2
) (

  input logic [AbsWidth-1:0]   abs_value_i,
  input logic                  sign_i,

  input logic [1:0]            round_sticky_bits_i,
  input fpnew_pkg::roundmode_e rnd_mode_i,
  input logic                  effective_subtraction_i,

  output logic [AbsWidth-1:0]  abs_rounded_o,
  output logic                 sign_o,

  output logic                 exact_zero_o
);


  logic round_up;










  always_comb begin : rounding_decision
    unique case (rnd_mode_i)
      fpnew_pkg::RNE:
        unique case (round_sticky_bits_i)
          2'b00,
          2'b01: round_up = 1'b0;
          2'b10: round_up = abs_value_i[0];
          2'b11: round_up = 1'b1;
          default: round_up = fpnew_pkg::DONT_CARE;
        endcase
      fpnew_pkg::RTZ: round_up = 1'b0;
      fpnew_pkg::RDN: round_up = (| round_sticky_bits_i) ? sign_i  : 1'b0;
      fpnew_pkg::RUP: round_up = (| round_sticky_bits_i) ? ~sign_i : 1'b0;
      fpnew_pkg::RMM: round_up = round_sticky_bits_i[1];
      default: round_up = fpnew_pkg::DONT_CARE;
    endcase
  end


  assign abs_rounded_o = abs_value_i + round_up;


  assign exact_zero_o = (abs_value_i == '0) && (round_sticky_bits_i == '0);



  assign sign_o = (exact_zero_o && effective_subtraction_i)
                  ? (rnd_mode_i == fpnew_pkg::RDN)
                  : sign_i;

endmodule