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

make prep fails #25

Open
JefferyLim opened this issue Feb 27, 2025 · 19 comments
Open

make prep fails #25

JefferyLim opened this issue Feb 27, 2025 · 19 comments

Comments

@JefferyLim
Copy link

JefferyLim commented Feb 27, 2025

I am trying to follow the docker build (since I am on Windows 11), but finding no success in building prep.

git clone https://github.com/black-parrot/black-parrot-sim.git
cd black-parrot-sim
make docker-image docker-run

My docker version is Docker version 27.5.1, build 9f9e405.

Running make prep:

make prep
[  3%] Building CXX object source/CMakeFiles/slang_slang.dir/AllSyntax.cpp.o
In file included from /home/build/black-parrot-sim/black-parrot-tools/yosys-slang/third_party/slang/source/../include/slang/parsing/Token.h:10,
                 from /home/build/black-parrot-sim/black-parrot-tools/yosys-slang/build/slang/source/slang/syntax/AllSyntax.h:10,
                 from /home/build/black-parrot-sim/black-parrot-tools/yosys-slang/build/slang/source/AllSyntax.cpp:8:
/home/build/black-parrot-sim/black-parrot-tools/yosys-slang/third_party/slang/source/../include/slang/numeric/SVInt.h:12:10: fatal error: concepts: No such file or directory
   12 | #include <concepts>
      |          ^~~~~~~~~~
compilation terminated.
make[8]: *** [source/CMakeFiles/slang_slang.dir/build.make:154: source/CMakeFiles/slang_slang.dir/AllSyntax.cpp.o] Error 1
make[8]: Leaving directory '/home/build/black-parrot-sim/black-parrot-tools/yosys-slang/build/slang'
make[7]: *** [CMakeFiles/Makefile2:183: source/CMakeFiles/slang_slang.dir/all] Error 2
make[7]: Leaving directory '/home/build/black-parrot-sim/black-parrot-tools/yosys-slang/build/slang'
make[6]: *** [Makefile:156: all] Error 2
make[6]: Leaving directory '/home/build/black-parrot-sim/black-parrot-tools/yosys-slang/build/slang'
make[5]: *** [Makefile:38: build-slang] Error 2
make[5]: Leaving directory '/home/build/black-parrot-sim/black-parrot-tools/yosys-slang'
make[4]: *** [Makefile:43: build/slang_install/.built] Error 2
make[4]: Leaving directory '/home/build/black-parrot-sim/black-parrot-tools/yosys-slang'
cp: cannot stat 'build/*.so': No such file or directory
make[3]: *** [/home/build/black-parrot-sim/black-parrot-tools/mk/Makefile.tools:78: /home/build/black-parrot-sim/black-parrot-tools/yosys-slang/.yslang_build] Error 1
make[3]: Leaving directory '/home/build/black-parrot-sim/black-parrot-tools'
make[2]: *** [/home/build/black-parrot-sim/black-parrot-tools/mk/Makefile.tools:73: /home/build/black-parrot-sim/black-parrot-tools/install/touchfiles/yslang.cf348c4dc4315bf6f0f72625dbd5027403a69bea] Error 2
make[2]: Leaving directory '/home/build/black-parrot-sim/black-parrot-tools'
make[1]: *** [Makefile:41: tools] Error 2
make[1]: Leaving directory '/home/build/black-parrot-sim/black-parrot-tools'
make: *** [Makefile:35: prep] Error 2

Currently, I'm cleaning and redoing this with prep_lite and will report back once I'm done.

@dpetrisko
Copy link
Collaborator

Hm interesting. We don't use yosys slang for much so I think it can safely be ignored.

Looks like probably there's a stray stdc++ flag preventing the header from being found:
https://stackoverflow.com/questions/73965388/where-is-my-concepts-library-for-c20-concepts

@dpetrisko
Copy link
Collaborator

Btw this is almost certainly due to windows. Happy to merge a patch for docker on windows builds but we don't directly support the platform. Are you using WSL?

@JefferyLim
Copy link
Author

Btw this is almost certainly due to windows. Happy to merge a patch for docker on windows builds but we don't directly support the platform. Are you using WSL?

I am using WSL (unfortunately, don't have a Linux machine right now). I was hoping the docker image would be enough to get a basic test going.

The prep_lite is still building (with some hiccups), so I'm still waiting to see if it goes through.

@JefferyLim
Copy link
Author

JefferyLim commented Feb 28, 2025

I was able to build prep_lite, but the test fails:

make -C black-parrot/bp_top/syn build.verilator sim.verilator.

Specific errors seems to be related to verilator.

In file included from /home/build/black-parrot-sim/black-parrot-tools/install/share/verilator/include/verilated_timing.cpp:23:
/home/build/black-parrot-sim/black-parrot-tools/install/share/verilator/include/verilated_timing.h:51:11: fatal error: coroutine: No such file or directory
   51 | # include <coroutine>
      |           ^~~~~~~~~~~
compilation terminated.
make[1]: *** [/home/build/black-parrot-sim/black-parrot-tools/install/share/verilator/include/verilated.mk:275: verilated_timing.o] Error 1

Related issues:
verilator/verilator#5262

Trying latest verilator version...

BTW, is the Eval Guide is out of date? Example Commands use [ACTION].v/sc, but I don't think those are recognized.

@dpetrisko
Copy link
Collaborator

Yeah seems the same issue, unrecognized C++20 support

Thanks for the reminder; yes vcs/verilator are the correct extensions

@JefferyLim
Copy link
Author

JefferyLim commented Feb 28, 2025

Thanks for the reminder; yes vcs/verilator are the correct extensions

vcs doesn't work for me, or at least isn't recognized.

build@631b3b4fcde7:~/black-parrot-sim$ make -C black-parrot/bp_top/syn build.verilator sim.verilator --debug
GNU Make 4.2.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
make: Entering directory '/home/build/black-parrot-sim/black-parrot/bp_top/syn'
Updating makefiles....
Updating goal targets....
 File 'build.verilator' does not exist.
Must remake target 'build.verilator'.
Successfully remade target file 'build.verilator'.
make: Nothing to be done for 'build.verilator'.
 File 'sim.verilator' does not exist.
   File '/home/build/black-parrot-sim/black-parrot/bp_top/syn/results/verilator/bp_tethered.e_bp_default_cfg.none.sim.bp-tests.hello_world/run_simsc' does not exist.
  Must remake target '/home/build/black-parrot-sim/black-parrot/bp_top/syn/results/verilator/bp_tethered.e_bp_default_cfg.none.sim.bp-tests.hello_world/run_simsc'.
/bin/bash: ./simsc: No such file or directory
  Successfully remade target file '/home/build/black-parrot-sim/black-parrot/bp_top/syn/results/verilator/bp_tethered.e_bp_default_cfg.none.sim.bp-tests.hello_world/run_simsc'.
Must remake target 'sim.verilator'.
Successfully remade target file 'sim.verilator'.
make: Leaving directory '/home/build/black-parrot-sim/black-parrot/bp_top/syn'
build@631b3b4fcde7:~/black-parrot-sim$ make -C black-parrot/bp_top/syn build.vcs sim.vcs --debug
GNU Make 4.2.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
make: Entering directory '/home/build/black-parrot-sim/black-parrot/bp_top/syn'
/home/build/black-parrot-sim/black-parrot/mk/Makefile.vcs:3: *** VCS not found.  Stop.
make: Leaving directory '/home/build/black-parrot-sim/black-parrot/bp_top/syn'
build@631b3b4fcde7:~/black-parrot-sim$ make -C black-parrot/bp_top/syn build.v sim.v --debug
GNU Make 4.2.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
make: Entering directory '/home/build/black-parrot-sim/black-parrot/bp_top/syn'
Updating makefiles....
Updating goal targets....
 File 'build.v' does not exist.
Must remake target 'build.v'.
make: *** No rule to make target 'build.v'.  Stop.
make: Leaving directory '/home/build/black-parrot-sim/black-parrot/bp_top/syn'

I know it's not related to this topic, but just figured I would ask.

@dpetrisko
Copy link
Collaborator

The target is correct but synopsys vcs is a proprietary tool, so you first need to have it installed. The actual error message there is:

/home/build/black-parrot-sim/black-parrot/mk/Makefile.vcs:3: *** VCS not found.  Stop.

which is saying that the binary itself is not found

@JefferyLim
Copy link
Author

The target is correct but synopsys vcs is a proprietary tool, so you first need to have it installed. The actual error message there is:

/home/build/black-parrot-sim/black-parrot/mk/Makefile.vcs:3: *** VCS not found.  Stop.

which is saying that the binary itself is not found

Ah got it. I misunderstood your original message.

I'm currently attempting to re-build the docker image on a ubuntu machine, and will be re-running the instructions to try and test both ubuntu 20.04 and the docker instructions. I tried to run the docker instructions on an AlmaLinux machine (RedHat 8.1), but the docker ran into the same issue with concepts

@JefferyLim
Copy link
Author

JefferyLim commented Mar 4, 2025

Yeah seems the same issue, unrecognized C++20 support

Thanks for the reminder; yes vcs/verilator are the correct extensions

It looks like the docker image is using gcc 9 instead of the installed gcc 10.

Adding this from https://askubuntu.com/a/1331764 to the docker file seems to have fixed this issue, but I'm still unable to sim.

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10

Turns out, there's nothing calling git submodule update --init inside black-parrot, so there were missing files in external. Not sure why these submodules were missing.

@JefferyLim
Copy link
Author

Even when setting the submodules correctly, verilator keeps complaining about bad libraries:

In file included from /home/jlim/black-parrot-sim/black-parrot-tools/install/share/verilator/include/verilated_timing.h:51,
                 from /home/jlim/black-parrot-sim/black-parrot-tools/install/share/verilator/include/verilated_timing.cpp:23:
/usr/include/c++/10/coroutine:295:2: error: #error "the coroutine header requires -fcoroutines"
  295 | #error "the coroutine header requires -fcoroutines"
      |  ^~~~~

With what the makefile produces:

%Error: make -C obj_dir -f Vtestbench.mk -j 4 exited with 2
%Error: Command Failed ulimit -s unlimited 2>/dev/null; exec /home/jlim/black-parrot-sim/black-parrot-tools/install/bin/verilator_bin --cc -O3 --x-assign fast --x-initial fast -j 4 --verilate-jobs 4 --threads 1 --trace-threads 1 --top-module testbench --main-top-name TOP -f flist.vcs --build --exe --timing -o simsc -Wno-timescalemod --Wno-fatal --Wno-lint --Wno-style --Wno-widthconcat --Wno-unoptflat --stats --stats-vars /home/jlim/black-parrot-sim/black-parrot/external/basejump_stl/bsg_mem/bsg_mem_dma.cpp /home/jlim/black-parrot-sim/black-parrot/bp_top/test/tb/bp_tethered/main.cpp -CFLAGS -I/home/jlim/black-parrot-sim/black-parrot/external/basejump_stl/bsg_test /home/jlim/black-parrot-sim/black-parrot/external/basejump_stl/bsg_test/bsg_nonsynth_dramsim3.sv /home/jlim/black-parrot-sim/black-parrot/external/basejump_stl/bsg_test/bsg_nonsynth_dramsim3_map.sv /home/jlim/black-parrot-sim/black-parrot/external/basejump_stl/bsg_test/bsg_nonsynth_dramsim3_unmap.sv -CFLAGS -I/home/jlim/black-parrot-sim/black-parrot/install/include -LDFLAGS -Wl\,-rpath\,/home/jlim/black-parrot-sim/black-parrot/install/lib\ -ldramsim3 -LDFLAGS -L/home/jlim/black-parrot-sim/black-parrot/install/lib /home/jlim/black-parrot-sim/black-parrot/bp_top/test/common/null_cosim.cpp -pvalue+cce_trace_p=0 -pvalue+lce_trace_p=0 -pvalue+cmt_trace_p=0 -pvalue+dram_trace_p=0 -pvalue+icache_trace_p=0 -pvalue+dcache_trace_p=0 -pvalue+vm_trace_p=0 -pvalue+core_profile_p=0 -pvalue+pc_profile_p=0 -pvalue+br_profile_p=0 -pvalue+dev_trace_p=0 -pvalue+cosim_p=0 -pvalue+max_instr_p=0 -pvalue+warmup_instr_p=0 -pvalue+checkpoint_p=0 -pvalue+preload_mem_p=1 +define+BP_SIM_CLK_PERIOD=1000 +define+BP_RT_CLK_PERIOD=1000000 +define+den2048Mb+sg5+x16+FULL_MEM

Despite the environment, I would have to think that the docker image should be a guarantee way of being able to run the simulation in this repo.

@dpetrisko
Copy link
Collaborator

That'll be because of a mixed build of gcc-9 and gcc-10. You'd need to clean out the verilator build with e.g. git submodule deinit <path_to_verilator>. The submodules get checked out as part of "make checkout" which runs before prep. So likely something failed or was interrupted and then the repo checkpointed success for whatever reason.

I'll take a quick look with a fresh build to make sure it works on my end. I also have a 24.04 docker I've been playing with for other reasons so I'll give that a shot too. Since 20.04 is EOL this year, might be worth updating

@JefferyLim
Copy link
Author

That'll be because of a mixed build of gcc-9 and gcc-10. You'd need to clean out the verilator build with e.g. git submodule deinit <path_to_verilator>. The submodules get checked out as part of "make checkout" which runs before prep. So likely something failed or was interrupted and then the repo checkpointed success for whatever reason.

So I've learned ahah. I've been bleaching things to re-test things to try and get something going.

I'll take a quick look with a fresh build to make sure it works on my end. I also have a 24.04 docker I've been playing with for other reasons so I'll give that a shot too. Since 20.04 is EOL this year, might be worth updating

👍

@JefferyLim
Copy link
Author

JefferyLim commented Mar 5, 2025

Okay, so I was finally able to get something to build, but man that was painful.

  1. I'm running 24.04 Ubuntu on a AWS EC2 instance because I don't have a Linux machine at home.
  2. I ran the commands:
sudo apt-get install apt-utils tzdata git vim gettext-base uuid-dev default-jre bash autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev wget byacc device-tree-compiler python-is-python3 gtkwave python3-yaml pkg-config swig python3-dev pip virtualenv help2man tcl8.6-dev libreadline-dev libffi-dev software-properties-common lsb-release
sudo apt-get install cmake
sudo apt-get install python3-orderedmultidict
  1. Ubuntu 24.04 is using gcc 13.3

This took multiple tries though. I had to run make prep_lite multiple times, and I'm not really confident it will work again if I clean and try again, so I'm going to do it again to verify.

@dpetrisko
Copy link
Collaborator

Interesting thanks for the update!

@JefferyLim
Copy link
Author

As an FYI, I haven't see the output

Hello world!
[CORE0 FSH] PASS
[CORE0 STATS]
    clk   :                  220
    instr :                   66
    mIPC  :                  300
All cores finished! Terminating...

yet.... just a bunch of

TOP.testbench.wrapper.processor.u.unicore.unicore_lite.core_minimal.be.watchdog.stall_counter error: counter overflow at time           4165377000
TOP.testbench.wrapper.processor.u.unicore.unicore_lite.core_minimal.be.watchdog.stall_counter error: counter overflow at time           4296449000
TOP.testbench.wrapper.processor.u.unicore.unicore_lite.core_minimal.be.watchdog.stall_counter error: counter overflow at time           4427521000
TOP.testbench.wrapper.processor.u.unicore.unicore_lite.core_minimal.be.watchdog.stall_counter error: counter overflow at time           4558593000
TOP.testbench.wrapper.processor.u.unicore.unicore_lite.core_minimal.be.watchdog.stall_counter error: counter overflow at time           4689665000
TOP.testbench.wrapper.processor.u.unicore.unicore_lite.core_minimal.be.watchdog.stall_counter error: counter overflow at time           4820737000
TOP.testbench.wrapper.processor.u.unicore.unicore_lite.core_minimal.be.watchdog.stall_counter error: counter overflow at time           49518090

@dpetrisko
Copy link
Collaborator

Okay great, that's not your setup. I just got an email yesterday with the same issue. I think there's some verilator-related problem with the latest versions (VCS works fine). I'll try to look into it by this weekend but ping me if you don't hear back!

@JefferyLim
Copy link
Author

Okay great, that's not your setup. I just got an email yesterday with the same issue. I think there's some verilator-related problem with the latest versions (VCS works fine). I'll try to look into it by this weekend but ping me if you don't hear back!

Great thanks!

@JefferyLim
Copy link
Author

After seeing that email chain , I updated black-parrot to latest, and it works now.

@JefferyLim
Copy link
Author

Solution is:

Update black-parrot to latest commit.
Add :

RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 && \
    update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100

To the docker file OR transition to 24.04. That being said, 24.04 hasn't been fully tested.

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