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

SPIKE + PK C++ iostream support #1778

Open
mp-17 opened this issue Aug 19, 2024 · 2 comments
Open

SPIKE + PK C++ iostream support #1778

mp-17 opened this issue Aug 19, 2024 · 2 comments

Comments

@mp-17
Copy link

mp-17 commented Aug 19, 2024

Does spike + pk support C++ iostream?

For example, can this program be run with spike pk?

#include <iostream>

int main(int argc, char* argv[]) {

  std::cout << "Hello, World!";

  return 0;
}

I statically compile it, but during simulation, I get:

The futex facility returned an unexpected error code.

The error appears just by including iostream. If I replace the stream with a printf, the simulation works ONLY IF I also remove the #include <iostream> directive.

Thank you for the support!

@mp-17 mp-17 changed the title iostream support SPIKE + PK C++ iostream support Aug 19, 2024
@muhammadtalhasami
Copy link

Does spike + pk support C++ iostream?

For example, can this program be run with spike pk?

#include <iostream>

int main(int argc, char* argv[]) {

  std::cout << "Hello, World!";

  return 0;
}

I statically compile it, but during simulation, I get:

The futex facility returned an unexpected error code.

The error appears just by including iostream. If I replace the stream with a printf, the simulation works ONLY IF I also remove the #include <iostream> directive.

Thank you for the support!

Screenshot from 2024-08-26 00-08-33

@muhammadtalhasami
Copy link

@mp-17 for the c++
used this commamd riscv64-unknown-elf-g++ filename.cpp -o filename
and for c use this
riscv64-unknown-elf-gcc filename.c -o filename
and then simply run it with spike + pk

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