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

rv-b: mark B-ext in misa #397

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 39 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,30 @@ jobs:
make -j
make clean-all

Guard-for-NEMU-as-DUT:
runs-on: nemu
continue-on-error: false
name: NEMU should report error if RVV agnostic is enabled when comparing against Spike ref; It should crash in the expected way
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
- name: Setup env
run: |
echo "NEMU_HOME=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "TEST_HOME=/nfs/home/share/ci-workloads/V-extension-tests" >> $GITHUB_ENV
- name: Build NEMU with V extension and agnostic
run: |
make clean-all
make riscv64-xs-diff-spike-agnostic_defconfig
make -j
set -x
./build/riscv64-nemu-interpreter -b --diff $TEST_HOME/riscv64-spike-GCBVH-ref-so --restore $TEST_HOME/hmmer_retro_6200_0.0378585.gz -r $TEST_HOME/v-gcpt.bin -I 2000000 > crash.log || exit_code=$?
if [ ${exit_code} -eq 0 ]; then echo "Difftest is broken, it should report error!" exit 1; fi
match=$(grep "wrong.*=.*ffff" crash.log -c)
if [ ${match} -eq 0 ]; then echo "Difftest is broken, it should report at least one agnostic related difference!" exit 1; fi
make clean-all
set +x
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@poemonsense @cebarobot I check the behavior of a failed case here.


H-ext-tests:
runs-on: nemu
continue-on-error: false
Expand Down Expand Up @@ -130,7 +154,7 @@ jobs:
make riscv64-rvh-diff-spike_defconfig
Copy link
Member

Choose a reason for hiding this comment

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

I think this config should be changed to riscv64-xs-diff-spike_defconfig. This will solved the current stack overflow problem. But there are still problems because of #407

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, but before 407 is merged, I want to add a guard for NEMU as DUT.

Copy link
Contributor Author

@shinezyy shinezyy Jul 24, 2024

Choose a reason for hiding this comment

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

I think this config should be changed to riscv64-xs-diff-spike_defconfig. This will solved the current stack overflow problem. But there are still problems because of #407

I enabled RVV in riscv64-rvh-diff-spike_defconfig, and it works.
It does not work with riscv64-xs-diff-spike_defconfig, here is diff:

< # CONFIG_RV_ZICNTR is not set
< # CONFIG_RV_ZIHPM is not set
---
> CONFIG_RV_ZICNTR=y
> # CONFIG_RV_CSR_TIME is not set
> CONFIG_RV_ZIHPM=y
30,31c31,32
< # CONFIG_RV_CSR_MCOUNTINHIBIT_CNTR is not set
< # CONFIG_RV_CSR_MCOUNTINHIBIT_HPM is not set
---
> CONFIG_RV_CSR_MCOUNTINHIBIT_CNTR=y
> CONFIG_RV_CSR_MCOUNTINHIBIT_HPM=y
112c113
< # CONFIG_MEM_COMPRESS is not set
---
> CONFIG_MEM_COMPRESS=y

echo "#define CONFIG_DETERMINISTIC 1" >> ./include/generated/autoconf.h
make -j
./build/riscv64-nemu-interpreter -b -d ./ready-to-run/riscv64-spike-H-ext-so $TEST_HOME/xvisor
./build/riscv64-nemu-interpreter -b -d $TEST_HOME/riscv64-spike-GCBVH-ref-so $TEST_HOME/xvisor
make clean-all
# - name: Run KVM with DiffTest
# run: |
Expand All @@ -157,15 +181,21 @@ jobs:
make clean-all
- name: Run Vector-spec06-checkpoint with Spike DiffTest
run: |
make riscv64-rvv-diff-spike-ckpt_defconfig
make riscv64-xs-diff-spike_defconfig
make -j
./build/riscv64-nemu-interpreter -b --diff $TEST_HOME/riscv64-spike-GCBVH-ref-so --restore $TEST_HOME/hmmer_nph3_1886_0.000268086.gz -r $TEST_HOME/v-gcpt.bin -I 40000000
./build/riscv64-nemu-interpreter -b --diff $TEST_HOME/riscv64-spike-GCBVH-ref-so --restore $TEST_HOME/hmmer_retro_6200_0.0378585.gz -r $TEST_HOME/v-gcpt.bin -I 40000000
./build/riscv64-nemu-interpreter -b --diff $TEST_HOME/riscv64-spike-GCBVH-ref-so --restore $TEST_HOME/h264ref_sss_88321_0.0346343.gz -r $TEST_HOME/v-gcpt.bin -I 40000000
./build/riscv64-nemu-interpreter -b --diff $TEST_HOME/riscv64-spike-GCBVH-ref-so --restore $TEST_HOME/h264ref_foreman.baseline_8028_0.0414445.gz -r $TEST_HOME/v-gcpt.bin -I 40000000
./build/riscv64-nemu-interpreter -b --diff $TEST_HOME/riscv64-spike-GCBVH-ref-so --restore $TEST_HOME/h264ref_foreman.main_3027_0.0443573.gz -r $TEST_HOME/v-gcpt.bin -I 40000000
./build/riscv64-nemu-interpreter -b --diff $TEST_HOME/riscv64-spike-GCBVH-ref-so --restore $TEST_HOME/libquantum_41028_0.0840681.gz -r $TEST_HOME/v-gcpt.bin -I 40000000
./build/riscv64-nemu-interpreter -b --diff $TEST_HOME/riscv64-spike-GCBVH-ref-so --restore $TEST_HOME/bzip2_402_0.00785398.gz -r $TEST_HOME/v-gcpt.bin -I 40000000
make clean-all
- name: Run OpenSBI+Linux+Vectorized_h264 with Spike DiffTest
run: |
make riscv64-xs-diff-spike_defconfig
make -j
./build/riscv64-nemu-interpreter -b --diff $TEST_HOME/riscv64-spike-V-ext-so-vstart --restore $TEST_HOME/hmmer_nph3_1886_0.000268086.gz -r $TEST_HOME/v-gcpt.bin -I 40000000
./build/riscv64-nemu-interpreter -b --diff $TEST_HOME/riscv64-spike-V-ext-so-vstart --restore $TEST_HOME/hmmer_retro_6200_0.0378585.gz -r $TEST_HOME/v-gcpt.bin -I 40000000
./build/riscv64-nemu-interpreter -b --diff $TEST_HOME/riscv64-spike-V-ext-so-vstart --restore $TEST_HOME/h264ref_sss_88321_0.0346343.gz -r $TEST_HOME/v-gcpt.bin -I 40000000
./build/riscv64-nemu-interpreter -b --diff $TEST_HOME/riscv64-spike-V-ext-so-vstart --restore $TEST_HOME/h264ref_foreman.baseline_8028_0.0414445.gz -r $TEST_HOME/v-gcpt.bin -I 40000000
./build/riscv64-nemu-interpreter -b --diff $TEST_HOME/riscv64-spike-V-ext-so-vstart --restore $TEST_HOME/h264ref_foreman.main_3027_0.0443573.gz -r $TEST_HOME/v-gcpt.bin -I 40000000
./build/riscv64-nemu-interpreter -b --diff $TEST_HOME/riscv64-spike-V-ext-so-vstart --restore $TEST_HOME/libquantum_41028_0.0840681.gz -r $TEST_HOME/v-gcpt.bin -I 40000000
./build/riscv64-nemu-interpreter -b --diff $TEST_HOME/riscv64-spike-V-ext-so-vstart --restore $TEST_HOME/bzip2_402_0.00785398.gz -r $TEST_HOME/v-gcpt.bin -I 40000000
./build/riscv64-nemu-interpreter -b --diff $TEST_HOME/riscv64-spike-GCBVH-ref-so $TEST_HOME/opensbi_rvv_h264ref_sss -I 200000000
make clean-all

compilation-test:
Expand Down
2 changes: 1 addition & 1 deletion configs/riscv64-rvh-diff-spike_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ CONFIG_CLINT_MMIO=0x38000000
CONFIG_RVB=y
CONFIG_RVK=y
CONFIG_RV_ZICOND=y
# CONFIG_RVV is not set
CONFIG_RVV=y
CONFIG_RV_DEBUG=y
CONFIG_RVH=y
# CONFIG_RV_SDEXT is not set
Expand Down
173 changes: 173 additions & 0 deletions configs/riscv64-xs-diff-spike-agnostic_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
#
# Automatically generated file; DO NOT EDIT.
# NEMU Configuration Menu
#
# CONFIG_ISA_x86 is not set
# CONFIG_ISA_mips32 is not set
# CONFIG_ISA_riscv32 is not set
CONFIG_ISA_riscv64=y
CONFIG_ISA="riscv64"
CONFIG_ILEN_MIN=2
CONFIG_ISA64=y

#
# ISA-dependent Options for riscv64
#
CONFIG_CLINT_MMIO=0x38000000
# CONFIG_MULTICORE_DIFF is not set
CONFIG_RVB=y
CONFIG_RVK=y
CONFIG_RV_ZICOND=y
CONFIG_RVV=y
CONFIG_RV_DEBUG=y
CONFIG_RVH=y
# CONFIG_RV_SDEXT is not set
# CONFIG_RV_SDTRIG is not set
# CONFIG_RV_AIA is not set
CONFIG_RV_ZICNTR=y
# CONFIG_RV_CSR_TIME is not set
CONFIG_RV_ZIHPM=y
CONFIG_RV_CSR_MCOUNTINHIBIT=y
CONFIG_RV_CSR_MCOUNTINHIBIT_CNTR=y
CONFIG_RV_CSR_MCOUNTINHIBIT_HPM=y
# CONFIG_RV_PMP_ENTRY_0 is not set
CONFIG_RV_PMP_ENTRY_16=y
# CONFIG_RV_PMP_ENTRY_64 is not set
CONFIG_RV_PMP_CSR=y
CONFIG_RV_PMP_NUM=16
CONFIG_RV_PMP_ACTIVE_NUM=16
CONFIG_PMP_GRANULARITY=12

#
# PMP Check Disabled when enabling PERF_OPT
#
CONFIG_RV_SVINVAL=y
# CONFIG_RV_SSCOFPMF is not set
CONFIG_RV_SMSTATEEN=y
CONFIG_MISA_UNCHANGEABLE=y
CONFIG_XTVEC_VECTORED_MODE=y
# CONFIG_TVAL_EX_II is not set
CONFIG_FS_CLEAN_STATE=y
CONFIG_USE_XS_ARCH_CSRS=y
CONFIG_RVV_AGNOSTIC=y
# end of ISA-dependent Options for riscv64

CONFIG_ENGINE_INTERPRETER=y
CONFIG_ENGINE="interpreter"
CONFIG_MODE_SYSTEM=y
# CONFIG_MODE_USER is not set

#
# Build Options
#
CONFIG_CC_GCC=y
# CONFIG_CC_GPP is not set
# CONFIG_CC_CLANG is not set
CONFIG_CC="gcc"
# CONFIG_CC_O0 is not set
# CONFIG_CC_O1 is not set
CONFIG_CC_O2=y
# CONFIG_CC_O3 is not set
CONFIG_CC_OPT="-O2"
CONFIG_CC_LTO=y
# CONFIG_CC_DEBUG is not set
# CONFIG_CC_ASAN is not set
# end of Build Options

#
# Testing and Debugging
#
# CONFIG_DEBUG is not set
CONFIG_DIFFTEST=y
# CONFIG_DIFFTEST_REF_QEMU_DL is not set
# CONFIG_DIFFTEST_REF_QEMU_SOCKET is not set
# CONFIG_DIFFTEST_REF_KVM is not set
# CONFIG_DIFFTEST_REF_NEMU is not set
CONFIG_DIFFTEST_REF_SPIKE=y
# CONFIG_DIFFTEST_STORE_COMMIT is not set
CONFIG_DIFFTEST_REF_PATH="none"
CONFIG_DIFFTEST_REF_NAME="none"
# CONFIG_DETERMINISTIC is not set
# CONFIG_IQUEUE is not set
# CONFIG_MEMLOG is not set
# CONFIG_TRANSLOG is not set
# CONFIG_EXITLOG is not set
# CONFIG_TRACE_INST is not set
# CONFIG_TRACE_BB is not set
# CONFIG_SIMPOINT_LOG is not set
# end of Testing and Debugging

#
# Memory Configuration
#
CONFIG_MBASE=0x80000000
# CONFIG_USE_SPARSEMM is not set
CONFIG_MSIZE=0x200000000
CONFIG_PADDRBITS=36
# CONFIG_STORE_LOG is not set
# CONFIG_BR_LOG is not set
CONFIG_BBL_OFFSET_WITH_CPT=0xa0000
# CONFIG_RESET_FROM_MMIO is not set
CONFIG_PC_RESET_OFFSET=0x0
CONFIG_USE_MMAP=y
CONFIG_MEM_COMPRESS=y
# end of Memory Configuration

CONFIG_DEVICE=y
CONFIG_HAS_PORT_IO=y
# CONFIG_HAS_SERIAL is not set
CONFIG_HAS_UARTLITE=y
CONFIG_UARTLITE_PORT=0x3f8
CONFIG_UARTLITE_MMIO=0x40600000
# CONFIG_UARTLITE_INPUT_FIFO is not set
CONFIG_UARTLITE_ASSERT_FOUR=y
# CONFIG_HAS_UART_SNPS is not set
CONFIG_HAS_PLIC=y
CONFIG_PLIC_ADDRESS=0x3c000000
CONFIG_HAS_TIMER=y
CONFIG_RTC_PORT=0x48
CONFIG_RTC_MMIO=0xa1000048
CONFIG_HAS_KEYBOARD=y
CONFIG_I8042_DATA_PORT=0x60
CONFIG_I8042_DATA_MMIO=0xa1000060
CONFIG_HAS_VGA=y
CONFIG_FB_ADDR=0x50000000
CONFIG_VGA_CTL_PORT=0x100
CONFIG_VGA_CTL_MMIO=0x40001000
# CONFIG_VGA_SHOW_SCREEN is not set
CONFIG_VGA_SIZE_400x300=y
# CONFIG_VGA_SIZE_800x600 is not set
# CONFIG_HAS_AUDIO is not set
# CONFIG_HAS_DISK is not set
CONFIG_HAS_SDCARD=y
CONFIG_SDCARD_CTL_MMIO=0x40002000
CONFIG_SDCARD_IMG_PATH=""
# CONFIG_HAS_FLASH is not set
# CONFIG_FPU_HOST is not set
CONFIG_FPU_SOFT=y
# CONFIG_FPU_NONE is not set
# CONFIG_AC_HOST is not set
CONFIG_AC_SOFT=y
# CONFIG_AC_NONE is not set

#
# Processor difftest reference config
#
# CONFIG_SHARE is not set
# end of Processor difftest reference config

#
# Miscellaneous
#
CONFIG_TIMER_GETTIMEOFDAY=y
# CONFIG_TIMER_CLOCK_GETTIME is not set
# CONFIG_MEMORY_REGION_ANALYSIS is not set
CONFIG_REPORT_ILLEGAL_INSTR=y
CONFIG_RT_CHECK=y
CONFIG_PERF_OPT=y
CONFIG_TCACHE_SIZE=8192
CONFIG_BB_LIST_SIZE=1024
CONFIG_BB_POOL_SIZE=1024
# CONFIG_DISABLE_INSTR_CNT is not set
CONFIG_ENABLE_INSTR_CNT=y
# end of Miscellaneous
Loading
Loading