Skip to content

Commit

Permalink
[hardware] Make fp conv functions synthesizable
Browse files Browse the repository at this point in the history
  • Loading branch information
mp-17 committed Jun 26, 2024
1 parent 6d27cfe commit 8dc0249
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hardware/include/ara_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ package ara_pkg;
logic [51:0] m;
} fp64_t;

function int unsigned fp_mantissa_bits(rvv_pkg::vew_e fp_dtype, logic is_alt);
function automatic int unsigned fp_mantissa_bits(rvv_pkg::vew_e fp_dtype, logic is_alt);
unique case ({fp_dtype, is_alt})
{rvv_pkg::EW8, 1'b0}: fp_mantissa_bits = 2;
{rvv_pkg::EW8, 1'b1}: fp_mantissa_bits = 3;
Expand All @@ -248,7 +248,7 @@ package ara_pkg;
endcase
endfunction

function fp32_t fp32_from_fp16(fp16_t fp16, logic [$clog2(fp_mantissa_bits(rvv_pkg::EW16, 0)):0] fp16_m_lzc);
function automatic fp32_t fp32_from_fp16(fp16_t fp16, logic [$clog2(fp_mantissa_bits(rvv_pkg::EW16, 0)):0] fp16_m_lzc);
automatic fp16_t fp16_temp;
automatic fp32_t fp32;

Expand All @@ -272,7 +272,7 @@ package ara_pkg;
fp32_from_fp16 = fp32;
endfunction

function fp64_t fp64_from_fp32(fp32_t fp32, logic [$clog2(fp_mantissa_bits(rvv_pkg::EW32, 0)):0] fp32_m_lzc);
function automatic fp64_t fp64_from_fp32(fp32_t fp32, logic [$clog2(fp_mantissa_bits(rvv_pkg::EW32, 0)):0] fp32_m_lzc);
automatic fp32_t fp32_temp;
automatic fp64_t fp64;

Expand Down

0 comments on commit 8dc0249

Please sign in to comment.