Add rounding mode support for floating point arithmetic instructions
@@ -20,6 +20,7 @@ class riscv_floating_point_instr extends riscv_instr;
rand riscv_fpr_t fs2;
rand riscv_fpr_t fs3;
rand riscv_fpr_t fd;
+ rand f_rounding_mode_t rm;
bit has_fs1 = 1'b1;
bit has_fs2 = 1'b1;
bit has_fs3 = 1'b0;
@@ -67,6 +68,13 @@ class riscv_floating_point_instr extends riscv_instr;
default:
`uvm_fatal(`gfn, $sformatf("Unsupported floating point format: %0s", format.name()))
endcase
+ if ((category == ARITHMETIC) && (rm != RNE) &&
+ !(instr_name inside {FMIN_S, FMAX_S, FMIN_D, FMAX_D, FMV_W_X, FMV_X_W,
+ FMV_D_X, FMV_X_D, FCLASS_S, FCLASS_D,
+ FCVT_D_S, FCVT_D_W, FCVT_D_WU,
+ FSGNJ_S, FSGNJN_S, FSGNJX_S, FSGNJ_D, FSGNJN_D, FSGNJX_D})) begin
+ asm_str = {asm_str, ", ", rm.name()};
+ end
if(comment != "")
asm_str = {asm_str, " #",comment};
return asm_str.tolower();
