Skip to content

Environment Setup and Makefile Target Errors #2277

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

WajahatRiaz
Copy link

I cloned the repository and followed the steps outlined in the README.md. To verify functionality, I ran the following Makefile targets. However, I encountered errors in both cases. Screenshots of the corresponding error logs are attached below.

Target/Issue No. 1: make build-simple-system

When I run make build-simple-system I get the following error:

image

Target/Issue No. 2: make build-csr-test

When I run make build-csr-test I get the following error:

image

Environment Details

  • FuseSoC version: 0.1
  • Verilator version: 5.035 (development version: v5.034-27-g258becd17)
  • RISC-V Toolchain version: 13.2.0
  • Operating System: Ubuntu 24.10 (Codename: oracular)

Please let me know if any additional setup steps are required or if the errors are known issues with the current branch/version. I'm happy to help troubleshoot further.

Add -fexceptions flag to verilator CFLAGS to support C++ exception handling
in the simple system simulation environment.
@rswarbrick
Copy link
Contributor

Something seems rather odd about the first commit. I think that GCC defaults to fexceptions (see here). Is there something interesting about your environment that turns this off?

@WajahatRiaz
Copy link
Author

Well I built verilator from their GitHub repository. Would that be causing this issue?

@WajahatRiaz
Copy link
Author

@rswarbrick can you test things out using the environment details I provided?

Copy link
Contributor

@marnovandermaas marnovandermaas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting that you need to add these include directories relative to verilator root. I appreciate you putting the effort into getting the Verilator root directly from Verilator.

@WajahatRiaz WajahatRiaz marked this pull request as draft May 19, 2025 16:35
@WajahatRiaz
Copy link
Author

@marnovandermaas @rswarbrick Here you go, added appropriate changes. Please review.

@WajahatRiaz WajahatRiaz marked this pull request as ready for review May 20, 2025 19:08
@WajahatRiaz
Copy link
Author

@marnovandermaas @rswarbrick any feedback on this?

@@ -175,7 +175,7 @@ targets:
- '--trace-structs'
- '--trace-params'
- '--trace-max-array 1024'
- '-CFLAGS "-std=c++14 -Wall -DVM_TRACE_FMT_FST -DTOPLEVEL_NAME=ibex_simple_system -g"'
- '-CFLAGS "-std=c++14 -Wall -fexceptions -DVM_TRACE_FMT_FST -DTOPLEVEL_NAME=ibex_simple_system -g"'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rupert mentioned that this flag should be enabled by default. Do you know why you need this explicitly? Do you still need this after you changed to the lowRISC toolchain?

@@ -8,7 +8,7 @@ COMMON_SRCS = $(wildcard $(COMMON_DIR)/*.c)
INCS := -I$(COMMON_DIR)

# ARCH = rv32im # to disable compressed instructions
ARCH ?= rv32imc
ARCH ?= rv32imc_zicsr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind squashing this change to remove it from the commit history?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, will let you know once I'm done.

Comment on lines 35 to 44
$(TOOLDIR)share/verilator/include \
$(TOOLDIR)share/verilator/include/vltstd \
/usr/share/verilator/include \
/usr/share/verilator/include/vltstd \
/usr/local/share/verilator/include \
/usr/local/share/verilator/include/vltstd \
/opt/verilator/share/verilator/include \
$(HOME)/verilator/include
/opt/verilator/share/verilator/include/vltstd \
$(HOME)/verilator/include \
$(HOME)/verilator/include/vltstd
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I think it's a good idea to list all possible paths where Verilator is installed. What's the problem with requiring people to define verilator root?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I defined verilator root and still couldn't find the svdpi header file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that's the problem I'm on board with adding the "vlstd" path to the Verilator root, but I don't think it's a good idea to add all the possible locations where Verilator could be installed.

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

Successfully merging this pull request may close these issues.

3 participants