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

Bring up Linux kernel #508

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ChinYikMing
Copy link
Collaborator

@ChinYikMing ChinYikMing commented Oct 28, 2024

Build rv32emu with ENALBE_SYSTEM config:

$ make ENABLE_SYSTEM=1

Then, boot Linux kernel by following:

$ build/rv32emu build/Image

@ChinYikMing ChinYikMing marked this pull request as draft October 28, 2024 19:11
Copy link
Contributor

@jserv jserv left a comment

Choose a reason for hiding this comment

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

Benchmarks

Benchmark suite Current: cfb3c3a Previous: 84ea32f Ratio
Dhrystone 1526 Average DMIPS over 10 runs 1535 Average DMIPS over 10 runs 1.01
Coremark 1434.13 Average iterations/sec over 10 runs 1403.237 Average iterations/sec over 10 runs 0.98

This comment was automatically generated by workflow using github-action-benchmark.

@jserv jserv requested a review from vacantron October 28, 2024 19:25
src/common.h Show resolved Hide resolved
@@ -922,9 +922,7 @@ static inline bool op_misc_mem(rv_insn_t *ir, const uint32_t insn)
* FENCE FM[3:0] pred[3:0] succ[3:0] rs1 000 rd 0001111
* FENCEI imm[11:0] rs1 001 rd 0001111
*/

Copy link
Contributor

Choose a reason for hiding this comment

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

Don't do this. Minimize the necessary changes.

@@ -90,7 +90,7 @@ enum op_field {
) \
/* RV32 Zicsr Standard Extension */ \
IIF(RV32_HAS(Zicsr))( \
_(csrrw, 0, 4, 0, ENC(rs1, rd)) \
_(csrrw, 1, 4, 0, ENC(rs1, rd)) \
Copy link
Contributor

Choose a reason for hiding this comment

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

If SYSTEM configuration is set, the Zicsr should be set accordingly.

@jserv
Copy link
Contributor

jserv commented Oct 28, 2024

Can you exploit the prebuilt image files used by semu?

@ChinYikMing
Copy link
Collaborator Author

Can you exploit the prebuilt image files used by semu?

Yes, intended. Ultimately, the Image in current build directory will be removed.

Copy link
Contributor

@jserv jserv left a comment

Choose a reason for hiding this comment

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

Move the hardware model files such as UART and PLIC to the directory src/devices for maintenance purposes.

@jserv jserv added this to the release-2024.2 milestone Oct 28, 2024
@jserv

This comment was marked as outdated.

src/common.h Outdated Show resolved Hide resolved
@jserv
Copy link
Contributor

jserv commented Nov 1, 2024

Consider to use recent clang for static analysis in CI pipeline: (maybe another pull request)

--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -139,16 +139,17 @@ jobs:
     - name: set up scan-build
       run: |
             sudo apt-get update -q -y
-            sudo apt-get install -q -y clang clang-tools libsdl2-dev libsdl2-mixer-dev
+            sudo apt-get install -q -y libsdl2-dev libsdl2-mixer-dev
             wget https://apt.llvm.org/llvm.sh
             chmod +x ./llvm.sh
             sudo ./llvm.sh 18
+            sudo apt-get install -q -y clang-18 clang-tools-18
       shell: bash
     - name: run scan-build without JIT
-      run: make distclean && scan-build -v -o ~/scan-build --status-bugs --use-cc=clang --force-analyze-debug-code --show-description -analyzer-config stable-report-filename=true -enable-checker valist,nullability make ENABLE_EXT_F=0 ENABLE_SDL=0 ENABLE_JIT=0
+      run: make distclean && scan-build-18 -v -o ~/scan-build --status-bugs --use-cc=clang-18 --force-analyze-debug-code --show-description -analyzer-config stable-report-filename=true -enable-checker valist,nullability make ENABLE_EXT_F=0 ENABLE_SDL=0 ENABLE_JIT=0
     - name: run scan-build with JIT
       run: |
-          make ENABLE_JIT=1 distclean && scan-build -v -o ~/scan-build --status-bugs --use-cc=clang --force-analyze-debug-code --show-description -analyzer-config stable-report-filename=true -enable-checker valist,nullability make ENABLE_EXT_F=0 ENABLE_SDL=0 ENABLE_JIT=1
+          make ENABLE_JIT=1 distclean && scan-build-18 -v -o ~/scan-build --status-bugs --use-cc=clang-18 --force-analyze-debug-code --show-description -analyzer-config stable-report-filename=true -enable-checker valist,nullability make ENABLE_EXT_F=0 ENABLE_SDL=0 ENABLE_JIT=1
 
   compliance-test:
     needs: [detect-code-related-file-changes]

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.

2 participants