PrincetonUniversity / openpiton

The OpenPiton Platform
http://www.openpiton.org
639 stars 215 forks source link

Riscv qemu missing #149

Closed ChiaLiu0618 closed 2 months ago

ChiaLiu0618 commented 3 months ago

Hi, I am a student working under professor Kun-Chih(Jimmy) Chen. We are currently working on a project that would use OpenPiton. When we were building the files, it seems that the link doesn’t work when it tried cloning riscv-qemu from a GitHub link. The files from the link seems to have been deleted by the author. Here is our presentation containing information about this problem.

Thank you~ NoC_0710.pptx

Jbalkind commented 3 months ago

I've been travelling the last few weeks so this fell down my inbox unfortunately.

The issue you mention is a known problem. We have discussed a couple of times on the google group if you take a look there. There are a couple of ways to solve it:

  1. Update your Ariane - Joan has an openpiton fork+branch (https://github.com/jfarresg/openpiton/tree/openpiton-dev) and cva6 fork+branch (https://github.com/jfarresg/cva6) which should work
  2. Grab a pre-built riscv64-unknown-elf cross-compiler from elsewhere. While outdated, I have had some success with these older prebuilt ones from sifive: https://github.com/sifive/freedom-tools/releases
  3. Ignore the problem. QEMU isn't actually needed for any of our purposes. If you can just modify the scripts to ignore the missing submodule and complete the rest of the build, then I believe things should still function as intended
ChiaLiu0618 commented 3 months ago

I have been using the RISC-V toolchain from this repository "https://github.com/riscv-collab/riscv-gnu-toolchain.git". The build was successful, but I encountered the following error when I tried to build and run the model. Could you please provide any suggestions on what might be causing this issue?

截圖 2024-07-25 下午4 26 26
Jbalkind commented 3 months ago

Which version of verilator are you using? I would suggest you update to the latest release from github and then try (though note you will have to add -vlt_build_args=--no-timing to your sims build command. You should also delete your build/manycore/rel-0.1/obj_dir/ to avoid any other build weirdness)

ChiaLiu0618 commented 2 months ago

I've tried verilator versions from v5.002 to v5.026. v5.026 reports failed building model. v5.024 doesn't give any errors while running build, but still gives exec format error when I run the simulation. The transmission behavior seems to work properly and is saved in sims.log, but perf.log is empty. The image below is the message I got while running with v5.024.

截圖 2024-08-12 晚上10 34 06
Jbalkind commented 2 months ago

Could you show me your sims commands?

ChiaLiu0618 commented 2 months ago

Hi, these are the commands I used. sims -sys=manycore -x_tiles=2 -y_tiles=2 -vlt_build -ariane -vlt_build_args=--no-timing sims -sys=manycore -vlt_run -x_tiles=2 -y_tiles=2 hello_world_many.c -ariane -finish_mask 0x1111111111111111 -rtl_timeout 10000000

Jbalkind commented 2 months ago

Finish mask should be -finish_mask=1111 if you're running four cores - that could be the problem

ChiaLiu0618 commented 2 months ago

Hi, there seems to be the same issue.

截圖 2024-08-13 凌晨12 30 29
Jbalkind commented 2 months ago

Ok I think this is the same issue @guillemlp has been noting recently, which has been around for a long time. Multicore misbehaves with CVA6 and verilator but single core behaves correctly. Could we close this issue and open a new one for this specifically? I think we might have to dig into the CVA6 or OpenPiton code to try and figure out what's misbehaving.