`include "wally-config.vh" // FOpCtrlE values // 111 min // 101 max // 010 equal // 001 less than // 011 less than or equal module fcmp ( input logic [`FPSIZES/3:0] FmtE, // precision 1 = double 0 = single input logic [2:0] FOpCtrlE, // see above table input logic XSgnE, YSgnE, // input signs input logic [`NE-1:0] XExpE, YExpE, // input exponents input logic [`NF:0] XManE, YManE, // input mantissa input logic XZeroE, YZeroE, // is zero input logic XNaNE, YNaNE, // is NaN input logic XSNaNE, YSNaNE, // is signaling NaN input logic [`FLEN-1:0] FSrcXE, FSrcYE, // original, non-converted to double, inputs output logic CmpNVE, // invalid flag output logic [`FLEN-1:0] CmpResE // compare resilt ); logic LTabs, LT, EQ; // is X < or > or = Y logic [`FLEN-1:0] NaNRes; logic BothZeroE, EitherNaNE, EitherSNaNE; assign LTabs= {1'b0, XExpE, XManE} < {1'b0, YExpE, YManE}; // unsigned comparison, treating FP as integers assign LT = (XSgnE & ~YSgnE) | (XSgnE & YSgnE & ~LTabs & ~EQ) | (~XSgnE & ~YSgnE & LTabs); // assign LT = {~XSgnE, XExpE, XManE[`NF-1:0]} < {~YSgnE, YExpE, YManE[`NF-1:0]}; // *** James look at whether we can simplify to this, but it fails regression //assign LT = $signed({XSgnE, XExpE, XManE[`NF-1:0]}) < $signed({YSgnE, YExpE, YManE[`NF-1:0]}); //assign LT = XInt < YInt; // assign LT = XSgnE^YSgnE ? XSgnE : XExpE==YExpE ? ((XManE