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

[Bug] Instruction rv64uv-vaadd result of Ara is different from result of Spike. #214

Open
jin8495 opened this issue Feb 14, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@jin8495
Copy link

jin8495 commented Feb 14, 2023

I added a test case into vaadd intending to happen overflow as below.

// rv64uv/vaadd.c

#include "vector_macros.h"

void TEST_CASE1(void) {
// ...
}

void TEST_CASE2(void) {
// ...
}

void TEST_CASE3(void) {
// ...
}

// Dont use VCLEAR here, it results in a glitch where are values are off by 1
void TEST_CASE4(void) {
// ...
}

void TEST_CASE5(void) {
  set_vxrm(0); // setting vxrm to rnu rounding mode
  VSET(4, e8, m1);
  VLOAD_8(v1, -128, -128, -128, 128);
  VLOAD_8(v2, -2, -2, -2, -2);
  __asm__ volatile("vaadd.vv v3, v1, v2" ::);
  VCMP_U8(5, v3, -65, -65, -65, -65);
}

int main(void) {
  INIT_CHECK();
  enable_vec();
  TEST_CASE1();
  TEST_CASE2();
  TEST_CASE3();
  TEST_CASE4();
  TEST_CASE5();
  EXIT_CHECK();
}

And when I launched Spike to check the result. It passed the test.
image

But Verilator answers the test differently.
image

@mp-17
Copy link
Collaborator

mp-17 commented Apr 17, 2023

Hello @jin8495,

Thanks a lot for pointing that out! @M-Ijaz-10x, we can use this example to debug the issue :-)

@mp-17 mp-17 added the bug Something isn't working label Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants