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

feat(build): Adjust RV target - riscv64g -> riscv64ima #868

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

clabby
Copy link
Collaborator

@clabby clabby commented Dec 11, 2024

Overview

Note

I validated locally that this target works out fine for running on asterisc, but will need to cut a release of the asterisc-builder cross compilation image for this to pass CI. Will do after vaca.

For anyone who wants to experiment with this, head over to the build dir, and build the asterisc image locally w/ just asterisc. Then, head over to the root justfile, and adjust the build-asterisc recipe to use the local asterisc-pipeline:latest image that was built in the previous step.

Once this is done, head over to bin/client, and run kona on asterisc w/ just run-client-asterisc to use the new riscv64ima binary.

Adjusts the build pipeline to use riscv64imac-unknown-none-elf as the target rather than riscv64gc. We still turn off compressed instructions, but this target forces LLVM to use soft-float operations for any floating point / doubleword floating point operations.

@clabby clabby added K-feature Kind: feature A-build Area: Build Pipelines labels Dec 11, 2024
@clabby clabby self-assigned this Dec 11, 2024
@clabby clabby requested a review from refcell as a code owner December 11, 2024 18:35
@clabby clabby marked this pull request as draft December 11, 2024 18:35
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.6%. Comparing base (f2b634f) to head (17142e8).

✅ All tests successful. No failed tests found.

Additional details and impacted files

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zigtur
Copy link

zigtur commented Dec 17, 2024

I wonder if there is a way to exclude Zicsr instructions from the build.

The LLVM docs are unclear about it:

zicntr, zicsr, zifencei, zihpm
Between versions 2.0 and 2.1 of the base I specification, a backwards incompatible change was made to remove selected instructions and CSRs from the base ISA. These instructions were grouped into a set of new extensions, but were no longer required by the base ISA. This change is partially described in “Preface to Document Version 20190608-Base-Ratified” from the specification document (the zicntr and zihpm bits are not mentioned). LLVM currently implements version 2.1 of the base specification. To maintain compatibility, instructions from these extensions are accepted without being in the -march string. LLVM also allows the explicit specification of the extensions in an -march string.

It would make sense to also exclude these instructions as they are not supported by Asterisc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build Area: Build Pipelines K-feature Kind: feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants