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

Nanomips qemu runner #1

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

Conversation

nikolaperic
Copy link
Collaborator

@nikolaperic nikolaperic commented Mar 5, 2024

Fixed issues when running tests from llvm-test-sute.

Qemu runner script has been added.

Cmake config:

TOOLCHAIN_DIR="/home/syrmia/llvm-nanomips/nanomips-elf/2022.03-01"
TEST_SUITE_DIR="/home/syrmia/llvm-nanomips/llvm-test-suite"
cmake -G Ninja \
	-DCMAKE_C_COMPILER=$TOOLCHAIN_DIR/bin/clang \
	-C$TEST_SUITE_DIR/cmake/caches/Os.cmake \
	-DTEST_SUITE_RUN_UNDER="$TEST_SUITE_DIR/run-under-qemu.sh $TOOLCHAIN_DIR/bin/qemu-system-nanomips I7200" \
	-DCMAKE_C_FLAGS="--target=nanomips-elf -march=i7200 -mcpu=i7200 -I $TOOLCHAIN_DIR/nanomips-elf/include -I $TOOLCHAIN_DIR/lib/gcc/nanomips-elf/11.2.0/include-fixed -T$TOOLCHAIN_DIR/nanomips-elf/lib/nanomips-r6-soft-tiny/lib/uhi32.ld -Wl,--defsym,__memory_size=256M" \
	-DCMAKE_CXX_COMPILER=$TOOLCHAIN_DIR/bin/clang++ \
	-DCMAKE_CXX_FLAGS="--target=nanomips-elf -march=i7200 -mcpu=i7200 -I $TOOLCHAIN_DIR/nanomips-elf/include -I $TOOLCHAIN_DIR/lib/gcc/nanomips-elf/11.2.0/include-fixed -T$TOOLCHAIN_DIR/nanomips-elf/lib/nanomips-r6-soft-tiny/lib/uhi32.ld -Wl,--defsym,__memory_size=256M" \
	-DTEST_SUITE_COLLECT_CODE_SIZE=OFF \
	-DTEST_SUITE_USE_PERF=ON \
	-DTEST_SUITE_HOST_CC=gcc \
	-DTEST_SUITE_USER_MODE_EMULATION=ON \
	-DTEST_SUITE_RUN_BENCHMARKS=ON \
	-DTEST_SUITE_COLLECT_COMPILE_TIME=OFF \
	-DTEST_SUITE_SUBDIRS="$TEST_SUITE_DIR/SingleSource;$TEST_SUITE_DIR/MultiSource" \
	$TEST_SUITE_DIR

Run tests:

$ cd <llvm_test_suite_build_dir> && <llvm_build_dir>/bin/llvm-lit -v --no-progress-bar -o results.json .

Nikola Peric added 4 commits January 23, 2024 15:02
The spaces within the strings added to LDFLAGS were escaped using "\".
This caused unknown flag errors. Appending them individually fixes this issue.
run-under-qemu.sh Outdated Show resolved Hide resolved
run-under-qemu.sh Outdated Show resolved Hide resolved
- Add the ability to specify CPU through command line arguments
- Increase test stack memory
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