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

Violation of ALU operand forwarding if preceded by FPU multicycle instruction #889

Closed
dd-baoshan opened this issue Oct 10, 2023 · 1 comment
Labels
Component:RTL For issues in the RTL (e.g. for files in the rtl directory) PARAM:FPU Issue depends on the FPU parameter Status:Resolved Issue has been resolved, but closure is pending on git merge and/or issuer confirmation Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system

Comments

@dd-baoshan
Copy link

There is PC mismatch in one of the fpu failing tests. Initial debug shows that it could be a potential bug in operand forwarding “addi x16 … -> jar x0 x16 …”

The error message as below and it happen for jalr instruction. From the trace log,

  • The first jalr reflect the correct X16 value (‘h26be) but it jumped to ‘h26b2 which cause the Imperas mismatch below
  • The second jalr reflect the correct X16 value (‘h26be) and it jumped correctly

image

From wave below

  • Red line indicates the start of decoding first jalr
  • At M1, fdiv writeback the result to port_b of regfile X4, the addi writeback to x16 is push one cycle later at M2
  • At M2, the first jalr uses previous X16 value which is ‘h26b2 as target jump (this caused PC mismatched)
  • The same sequence “addi -> jar” happen again at M4, this time it works normally because there is no contention of writeback at port_b between fdiv and addi

image

Component:RTL

Steps to Reproduce

  1. cv32e40p git hash: 7df7d2d
  2. core-v-verif git hash: 02ee75284e34acf908dda5344f642a7cb3b0ac0c
  3. Users need to checkout below core-v-verif to replicate the issue. The reproduce steps as followings.

git clone --branch cv32e40p/dev_dd https://github.com/XavierAubert/core-v-verif.git sandbox

cd sandbox/cv32e40p/sim/uvmt

make gen_corev-dv test TEST=corev_rand_fp_instr_data_fwd_test CFG_PLUSARGS=+UVM_TIMEOUT=1000000 CHECK_SIM:we_RESULT=YES COMP=1 CV_CORE=cv32e40p COREV=1 CFG=pulp_fpu_zfinx_1cyclat TEST_CFG_FILE=floating_pt_instr_en,floating_pt_zfinx_instr_en SIMULATOR=vsim USE_ISS=yes COV=NO RUN_INDEX=1567674295 GEN_START_INDEX=1567674295 SEED=1567674295

@pascalgouedo pascalgouedo added Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system Component:RTL For issues in the RTL (e.g. for files in the rtl directory) labels Oct 10, 2023
@pascalgouedo pascalgouedo changed the title [cv32e40p][pulp_fpu_zfinx_1cyclat] violation of ALU operand forwarding if preceded by FPU multicycle instruction Violation of ALU operand forwarding if preceded by FPU multicycle instruction Oct 10, 2023
pascalgouedo pushed a commit to pascalgouedo/cv32e40p that referenced this issue Oct 24, 2023
Signed-off-by: Pascal Gouedo <[email protected]>
@pascalgouedo
Copy link

Corrected with PR #897

@MikeOpenHWGroup MikeOpenHWGroup added the PARAM:FPU Issue depends on the FPU parameter label Oct 25, 2023
@pascalgouedo pascalgouedo added the Status:Resolved Issue has been resolved, but closure is pending on git merge and/or issuer confirmation label Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component:RTL For issues in the RTL (e.g. for files in the rtl directory) PARAM:FPU Issue depends on the FPU parameter Status:Resolved Issue has been resolved, but closure is pending on git merge and/or issuer confirmation Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system
Projects
None yet
Development

No branches or pull requests

3 participants