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

Tests: test/src/hello.c doesn't run #22

Open
overminder opened this issue Jun 16, 2018 · 0 comments
Open

Tests: test/src/hello.c doesn't run #22

overminder opened this issue Jun 16, 2018 · 0 comments

Comments

@overminder
Copy link

overminder commented Jun 16, 2018

Problem Description

I was trying to run the tests compiled in 32-bit mode with the simulator. Some of the tests work fine (e.g. test/src/add.c returns the result correctly) but things involving mmio work strangely. Namely, test/src/hello.c doesn't print anything and doesn't terminate.

Reproduction Steps

  1. Clone the repo on an x86_64 Mac, then run install_riscv_gcc.sh and . setup.sh to get riscv-none-embed-gcc and put it into PATH.
  2. cd into test and run make to build the test binaries.
  3. cd back into the repo root and run stack exec riscv-semantics -- test/build/hello32.hex.

Other Findings

  • putchar('A'); putchar('\n'); alone works fine. I suppose the problem is related to reading from .rodata section...
  • Calling putchar('A'); in main causes the program to never terminate.
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

1 participant