Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

what's the meaning for CPKAB and CPKCD operation? #59

Open
bysg opened this issue Dec 20, 2021 · 1 comment
Open

what's the meaning for CPKAB and CPKCD operation? #59

bysg opened this issue Dec 20, 2021 · 1 comment

Comments

@bysg
Copy link

bysg commented Dec 20, 2021

In the README.md, CPKAB and CPKCD operation is introduced, but I cannot get the meaning of these operations, or is there some difference between CPKAB and CPKCD? or op_mod is 0 or 1?

I read the rtl code(fpnew_opgroup_multifmt_slice.sv and fpnew_cast_multi.sv), and I tried to run some simulations to help understand,
however, when

  1. src_fmt is fp64, dst_fmt is fp16, op=fpnew_pkg::CPKAB, op=0
  2. src_fmt is fp64, dst_fmt is fp16, op=fpnew_pkg::CPKAB, op=1
  3. src_fmt is fp64, dst_fmt is fp16, op=fpnew_pkg::CPKCD, op=0
  4. src_fmt is fp64, dst_fmt is fp16, op=fpnew_pkg::CPKCD, op=1
    I got the same result.

So is there some detail description for CPKAB and CPKCD operation?
thanks.

@GiannaP
Copy link

GiannaP commented Sep 28, 2022

It is converting e.g. fp64 (D) into fp8 (B) and puts them into the correct position for SIMD packed fp data in a 64bit datapath. CPKAB takes care of the lower positions and CPKCD of the higher positions.

Indeed we recently fixed some issues for our latest project. One issue was related to the CPKCD operations. Have a look at the commits on this separate branch:

https://github.com/openhwgroup/cvfpu/commits/bugfix/vfcpk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants