Skip to content

Commit

Permalink
remove hard-coded gcc options (#1652)
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinThomazic authored Nov 23, 2023
1 parent 42f29c6 commit 34f631f
Show file tree
Hide file tree
Showing 6 changed files with 170 additions and 10 deletions.
3 changes: 3 additions & 0 deletions verif/regress/benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ GCC_COMMON_SRC=(

GCC_CFLAGS=(
-fno-tree-loop-distribute-patterns
-static
-mcmodel=medany
-fvisibility=hidden
-nostdlib
-nostartfiles
-lgcc
Expand Down
3 changes: 3 additions & 0 deletions verif/regress/coremark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ srcA=(
cflags_opt=(
-O3 -g
-fno-tree-loop-distribute-patterns
-static
-mcmodel=medany
-fvisibility=hidden
-nostdlib
-nostartfiles
-lgcc
Expand Down
3 changes: 3 additions & 0 deletions verif/regress/dhrystone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ srcA=(
)
cflags=(
-fno-tree-loop-distribute-patterns
-static
-mcmodel=medany
-fvisibility=hidden
-nostdlib
-nostartfiles
-lgcc
Expand Down
4 changes: 2 additions & 2 deletions verif/regress/smoke-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ python3 cva6.py --testlist=../tests/testlist_riscv-compliance-cv64a6_imafdc_sv39
python3 cva6.py --testlist=../tests/testlist_riscv-arch-test-cv64a6_imafdc_sv39.yaml --test rv64i_m-add-01 --iss_yaml cva6.yaml --target cv64a6_imafdc_sv39 --iss=$DV_SIMULATORS $DV_OPTS --linker=../tests/riscv-arch-test/riscv-target/spike/link.ld
python3 cva6.py --testlist=../tests/testlist_custom.yaml --test custom_test_template --iss_yaml cva6.yaml --target cv64a6_imafdc_sv39 --iss=$DV_SIMULATORS $DV_OPTS
python3 cva6.py --target cv64a6_imafdc_sv39 --iss=$DV_SIMULATORS --iss_yaml=cva6.yaml --c_tests ../tests/custom/hello_world/hello_world.c\
--gcc_opts "-g ../tests/custom/common/syscalls.c ../tests/custom/common/crt.S -I../tests/custom/env -I../tests/custom/common -T ../tests/custom/common/test.ld"
--gcc_opts="-static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles -g ../tests/custom/common/syscalls.c ../tests/custom/common/crt.S -I../tests/custom/env -I../tests/custom/common -T ../tests/custom/common/test.ld"
make -C ../.. clean
make clean_all
python3 cva6.py --testlist=../tests/testlist_riscv-compliance-cv32a60x.yaml --test rv32i-I-ADD-01 --iss_yaml cva6.yaml --target cv32a60x --iss=$DV_SIMULATORS $DV_OPTS
python3 cva6.py --testlist=../tests/testlist_riscv-tests-cv32a60x-p.yaml --test rv32ui-p-add --iss_yaml cva6.yaml --target cv32a60x --iss=$DV_SIMULATORS $DV_OPTS
python3 cva6.py --testlist=../tests/testlist_riscv-arch-test-cv32a60x.yaml --test rv32im-cadd-01 --iss_yaml cva6.yaml --target cv32a60x --iss=$DV_SIMULATORS $DV_OPTS --linker=../tests/riscv-arch-test/riscv-target/spike/link.ld
python3 cva6.py --target cv32a60x --iss=$DV_SIMULATORS --iss_yaml=cva6.yaml --c_tests ../tests/custom/hello_world/hello_world.c --linker=../tests/custom/common/test.ld\
--gcc_opts "-g ../tests/custom/common/syscalls.c ../tests/custom/common/crt.S -lgcc -I../tests/custom/env -I../tests/custom/common"
--gcc_opts="-static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles -g ../tests/custom/common/syscalls.c ../tests/custom/common/crt.S -lgcc -I../tests/custom/env -I../tests/custom/common"
make -C ../.. clean
make clean_all

Expand Down
11 changes: 3 additions & 8 deletions verif/sim/cva6.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,7 @@ def gcc_compile(test_list, output_dir, isa, mabi, opts, debug_cmd, linker):
logging.error("Cannot find assembly test: %s\n", asm)
sys.exit(RET_FAIL)
# gcc comilation
cmd = ("%s -static -mcmodel=medany \
-fvisibility=hidden -nostdlib \
-nostartfiles %s \
cmd = ("%s %s \
-I%s/../env/corev-dv/user_extension \
-T%s %s -o %s " % \
(get_env_var("RISCV_GCC", debug_cmd = debug_cmd), asm, cwd, linker, opts, elf))
Expand Down Expand Up @@ -444,9 +442,7 @@ def run_assembly(asm_test, iss_yaml, isa, target, mabi, gcc_opts, iss_opts, outp
logging.info("Compiling assembly test : %s" % asm_test)

# gcc compilation
cmd = ("%s -static -mcmodel=medany \
-fvisibility=hidden -nostdlib \
-nostartfiles %s \
cmd = ("%s %s \
-I%s/../env/corev-dv/user_extension \
-T%s %s -o %s " % \
(get_env_var("RISCV_GCC", debug_cmd = debug_cmd), asm_test, cwd, linker,
Expand Down Expand Up @@ -583,8 +579,7 @@ def run_c(c_test, iss_yaml, isa, target, mabi, gcc_opts, iss_opts, output_dir,
logging.info("Compiling c test : %s" % c_test)

# gcc compilation
cmd = ("%s -mcmodel=medany -nostdlib \
-nostartfiles %s \
cmd = ("%s %s \
-I%s/dv/user_extension \
-T%s %s -o %s " % \
(get_env_var("RISCV_GCC", debug_cmd = debug_cmd), c_test, cwd,
Expand Down
Loading

0 comments on commit 34f631f

Please sign in to comment.