mirror of
https://github.com/openhwgroup/cva6.git
synced 2025-04-22 21:27:10 -04:00
Create dedicated linker scripts for cv32a65x configuration. When another configuration is targeted, the default linker script is used (config/genxxx/linker/link.ld). When hwconfig is targeted, linker scripts are recopied into hwconfig directory.
Keep only one unique linker script: link.ldi. Remove test.ld file.
This commit is contained in:
parent
1d0076eec3
commit
9cfadbeded
16 changed files with 45 additions and 26 deletions
|
@ -97,7 +97,7 @@ cd ./verif/sim
|
|||
|
||||
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 \
|
||||
--linker=../../config/gen_from_riscv_config/linker/link.ld \
|
||||
--gcc_opts="-static -mcmodel=medany -fvisibility=hidden -nostdlib \
|
||||
-nostartfiles -g ../tests/custom/common/syscalls.c \
|
||||
../tests/custom/common/crt.S -lgcc \
|
||||
|
|
|
@ -23,6 +23,7 @@ SECTIONS
|
|||
|
||||
/* text: test code section */
|
||||
. = 0x80000000;
|
||||
_start_text = .;
|
||||
.text.init : { *(.text.init) }
|
||||
|
||||
. = ALIGN(0x1000);
|
||||
|
@ -33,6 +34,18 @@ SECTIONS
|
|||
|
||||
. = ALIGN(0x1000);
|
||||
.text : { *(.text) }
|
||||
. = ALIGN(0x1000);
|
||||
.text.startup : { *(.text.startup) }
|
||||
. = ALIGN(0x1000);
|
||||
_end_text = .;
|
||||
. = ALIGN(0x1000);
|
||||
.rodata : { *(.rodata*)}
|
||||
. = ALIGN(0x8);
|
||||
. = ALIGN(0x1000);
|
||||
.page_table : { *(.page_table) }
|
||||
.user_stack : { *(.user_stack) }
|
||||
.kernel_data : { *(.kernel_data) }
|
||||
.kernel_stack : { *(.kernel_stack) }
|
||||
|
||||
/* data segment */
|
||||
.data : { *(.data) }
|
|
@ -30,7 +30,7 @@ fi
|
|||
cd verif/sim/
|
||||
|
||||
BDIR=../tests/riscv-tests/benchmarks/
|
||||
CVA6_FLAGS="--target $DV_TARGET --iss=$DV_SIMULATORS --iss_yaml cva6.yaml --linker ../tests/custom/common/test.ld"
|
||||
CVA6_FLAGS="--target $DV_TARGET --iss=$DV_SIMULATORS --iss_yaml cva6.yaml --linker ../../config/gen_from_riscv_config/linker/link.ld"
|
||||
|
||||
GCC_COMMON_SRC=(
|
||||
../tests/custom/common/syscalls.c
|
||||
|
|
|
@ -60,7 +60,7 @@ for t in ${riscv_tests_list[@]} ; do
|
|||
[[ $? > 0 ]] && ((errors++))
|
||||
done
|
||||
|
||||
python3 cva6.py --target ${DV_TARGET} --iss=$DV_SIMULATORS --iss_yaml=cva6.yaml --c_tests ../tests/custom/hello_world/hello_world.c --linker=../tests/custom/common/test.ld\
|
||||
python3 cva6.py --target ${DV_TARGET} --iss=$DV_SIMULATORS --iss_yaml=cva6.yaml --c_tests ../tests/custom/hello_world/hello_world.c --linker=../../config/gen_from_riscv_config/linker/link.ld\
|
||||
--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" $DV_OPTS
|
||||
[[ $? > 0 ]] && ((errors++))
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ for t in ${riscv_tests_list[@]} ; do
|
|||
done
|
||||
|
||||
python3 cva6.py --target ${DV_TARGET} --iss=$DV_SIMULATORS --iss_yaml=cva6.yaml --c_tests ../tests/custom/hello_world/hello_world.c \
|
||||
--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" $DV_OPTS
|
||||
--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 ../../config/gen_from_riscv_config/linker/link.ld" $DV_OPTS
|
||||
[[ $? > 0 ]] && ((errors++))
|
||||
|
||||
make -C ../.. clean
|
||||
|
|
|
@ -42,10 +42,10 @@ export DV_OPTS="$DV_OPTS --issrun_opts=+debug_disable=1+UVM_VERBOSITY=$UVM_VERBO
|
|||
cd verif/sim/
|
||||
make -C ../.. clean
|
||||
make clean_all
|
||||
python3 cva6.py --testlist=../tests/testlist_cvxif.yaml --test cvxif_add_nop --iss_yaml cva6.yaml --target cv64a6_imafdc_sv39 --iss=$DV_SIMULATORS $DV_OPTS
|
||||
python3 cva6.py --testlist=../tests/testlist_cvxif.yaml --test cvxif_add_nop --iss_yaml cva6.yaml --target cv64a6_imafdc_sv39 --iss=$DV_SIMULATORS $DV_OPTS --linker=../../config/gen_from_riscv_config/linker/link.ld
|
||||
make -C ../.. clean
|
||||
make clean_all
|
||||
python3 cva6.py --testlist=../tests/testlist_cvxif.yaml --test cvxif_add_nop --iss_yaml cva6.yaml --target cv32a65x --iss=$DV_SIMULATORS $DV_OPTS
|
||||
python3 cva6.py --testlist=../tests/testlist_cvxif.yaml --test cvxif_add_nop --iss_yaml cva6.yaml --target cv32a65x --iss=$DV_SIMULATORS $DV_OPTS --linker=../../config/gen_from_riscv_config/cv32a65x/linker/link.ld
|
||||
make -C ../.. clean
|
||||
make clean_all
|
||||
|
||||
|
|
|
@ -31,6 +31,6 @@ if ! [ -n "$DV_SIMULATORS" ]; then
|
|||
fi
|
||||
|
||||
cd verif/sim/
|
||||
python3 cva6.py --testlist=../tests/testlist_csr_embedded.yaml --iss_yaml cva6.yaml --target $DV_TARGET --iss=$DV_SIMULATORS $DV_OPTS --priv=m --iss_timeout 600
|
||||
python3 cva6.py --testlist=../tests/testlist_csr_embedded.yaml --iss_yaml cva6.yaml --target $DV_TARGET --iss=$DV_SIMULATORS $DV_OPTS --priv=m --iss_timeout 600 --linker=../../config/gen_from_riscv_config/$DV_TARGET/linker/link.ld
|
||||
|
||||
cd -
|
||||
|
|
|
@ -137,6 +137,6 @@ done
|
|||
j=0
|
||||
elif [[ "$list_num" = 0 ]];then
|
||||
printf "==== Execute Directed tests to improve functional coverage of isa, by hitting corners !!! ====\n\n"
|
||||
python3 cva6.py --testlist=$DIRECTED_TESTLIST --iss_yaml cva6.yaml --isa_extension="zcb" --target $DV_TARGET --iss=vcs-uvm,spike --priv=m
|
||||
python3 cva6.py --testlist=$DIRECTED_TESTLIST --iss_yaml cva6.yaml --isa_extension="zcb" --target $DV_TARGET --iss=vcs-uvm,spike --priv=m --linker=../../config/gen_from_riscv_config/$DV_TARGET/linker/link.ld
|
||||
fi
|
||||
cd -
|
||||
|
|
|
@ -103,6 +103,6 @@ done
|
|||
j=0
|
||||
elif [[ "$list_num" = 0 ]];then
|
||||
printf "==== Execute Directed tests to improve functional coverage of isa, by hitting corners !!! ====\n\n"
|
||||
python3 cva6.py --testlist=$DIRECTED_TESTLIST --iss_yaml cva6.yaml --target $DV_TARGET --iss=vcs-uvm,spike --priv=m
|
||||
python3 cva6.py --testlist=$DIRECTED_TESTLIST --iss_yaml cva6.yaml --target $DV_TARGET --iss=vcs-uvm,spike --priv=m --linker=../../config/gen_from_riscv_config/$DV_TARGET/linker/link.ld
|
||||
fi
|
||||
cd -
|
||||
|
|
|
@ -49,22 +49,21 @@ if [[ "$DV_SIMULATORS" != *"uvm"* ]]; then
|
|||
python3 cva6.py --testlist=../tests/testlist_riscv-compliance-cv64a6_imafdc_sv39.yaml --test rv32i-I-ADD-01 --iss_yaml cva6.yaml --target cv64a6_imafdc_sv39 --iss=$DV_SIMULATORS $DV_OPTS
|
||||
python3 cva6.py --testlist=../tests/testlist_riscv-tests-cv64a6_imafdc_sv39-v.yaml --test rv64ui-v-add --iss_yaml cva6.yaml --target cv64a6_imafdc_sv39 --iss=$DV_SIMULATORS $DV_OPTS
|
||||
python3 cva6.py --testlist=../tests/testlist_riscv-tests-cv64a6_imafdc_sv39-p.yaml --test rv64ui-p-add --iss_yaml cva6.yaml --target cv64a6_imafdc_sv39 --iss=$DV_SIMULATORS $DV_OPTS
|
||||
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_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=../../config/gen_from_riscv_config/cv32a6_imac_sv32/linker/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 --c_tests ../tests/custom/hello_world/hello_world.c --iss_yaml cva6.yaml --target cv64a6_imafdc_sv39 --iss=$DV_SIMULATORS --gcc_opts="$CC_OPTS" $DV_OPTS --linker=../tests/custom/common/test.ld
|
||||
python3 cva6.py --c_tests ../tests/custom/hello_world/hello_world.c --iss_yaml cva6.yaml --target cv64a6_imafdc_sv39 --iss=$DV_SIMULATORS --gcc_opts="$CC_OPTS -nostdlib -lgcc" $DV_OPTS --linker=../../config/gen_from_riscv_config/cv64a6_imafdc_sv39/linker/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 cv32a6_imac_sv32 --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 cv32a6_imac_sv32 --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 cv32a6_imac_sv32 --iss=$DV_SIMULATORS $DV_OPTS --linker=../tests/riscv-arch-test/riscv-target/spike/link.ld
|
||||
python3 cva6.py --c_tests ../tests/custom/hello_world/hello_world.c --iss_yaml cva6.yaml --target cv32a6_imac_sv32 --iss=$DV_SIMULATORS --linker=../tests/custom/common/test.ld --gcc_opts="$CC_OPTS" $DV_OPTS
|
||||
python3 cva6.py --testlist=../tests/testlist_riscv-arch-test-cv32a60x.yaml --test rv32im-cadd-01 --iss_yaml cva6.yaml --target cv32a6_imac_sv32 --iss=$DV_SIMULATORS $DV_OPTS --linker=../../config/gen_from_riscv_config/cv32a6_imac_sv32/linker/link.ld
|
||||
python3 cva6.py --c_tests ../tests/custom/hello_world/hello_world.c --iss_yaml cva6.yaml --target cv32a6_imac_sv32 --iss=$DV_SIMULATORS --linker=../../config/gen_from_riscv_config/cv32a6_imac_sv32/linker/test.ld --gcc_opts="$CC_OPTS -nostdlib -lgcc" $DV_OPTS
|
||||
fi
|
||||
if [[ "$DV_SIMULATORS" == *"uvm"* ]]; then
|
||||
make -C ../.. clean
|
||||
make clean_all
|
||||
python3 cva6.py --c_tests ../tests/custom/hello_world/hello_world.c --iss_yaml cva6.yaml --target cv32a65x --iss=$DV_SIMULATORS --linker=../../config/gen_from_riscv_config/cv32a65x/linker/test.ld --gcc_opts="$CC_OPTS" $DV_OPTS
|
||||
fi
|
||||
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 cv32a65x --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 cv32a65x --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 cv32a65x --iss=$DV_SIMULATORS $DV_OPTS --linker=../tests/riscv-arch-test/riscv-target/spike/link.ld
|
||||
python3 cva6.py --c_tests ../tests/custom/hello_world/hello_world.c --iss_yaml cva6.yaml --target cv32a65x --iss=$DV_SIMULATORS --linker=../tests/custom/common/test.ld --gcc_opts="$CC_OPTS" $DV_OPTS
|
||||
make -C ../.. clean
|
||||
make clean_all
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ from dv.scripts.ovpsim_log_to_trace_csv import *
|
|||
from dv.scripts.whisper_log_trace_csv import *
|
||||
from dv.scripts.sail_log_to_trace_csv import *
|
||||
from dv.scripts.instr_trace_compare import *
|
||||
|
||||
from pathlib import Path
|
||||
from types import SimpleNamespace
|
||||
|
||||
LOGGER = logging.getLogger()
|
||||
|
@ -1016,7 +1016,11 @@ def load_config(args, cwd):
|
|||
args.simulator_yaml = cwd + "/cva6-simulator.yaml"
|
||||
|
||||
if not args.linker:
|
||||
args.linker = cwd + "/link.ld"
|
||||
my_link = Path(cwd + f"/../../config/gen_from_riscv_config/{args.target}/linker/link.ld")
|
||||
if my_link.is_file():
|
||||
args.linker = cwd + f"/../../config/gen_from_riscv_config/{args.target}/linker/link.ld"
|
||||
else:
|
||||
args.linker = cwd + f"/../../config/gen_from_riscv_config/linker/link.ld"
|
||||
|
||||
# Keep the core_setting_dir option to be backward compatible, suggest to use
|
||||
# --custom_target
|
||||
|
@ -1026,6 +1030,7 @@ def load_config(args, cwd):
|
|||
else:
|
||||
args.core_setting_dir = args.custom_target
|
||||
|
||||
base = ""
|
||||
if not args.custom_target:
|
||||
if not args.testlist:
|
||||
args.testlist = cwd + "/target/"+ args.target +"/testlist.yaml"
|
||||
|
@ -1035,6 +1040,8 @@ def load_config(args, cwd):
|
|||
output_file = "../../core/include/hwconfig_config_pkg.sv"
|
||||
user_config.derive_config(input_file, output_file, changes)
|
||||
args.hwconfig_opts = user_config.get_config(output_file)
|
||||
os.system("mkdir -p ../../config/gen_from_riscv_config/hwconfig/linker")
|
||||
os.system("cp ../../config/gen_from_riscv_config/%s/linker/*.ld ../../config/gen_from_riscv_config/hwconfig/linker/" % (base))
|
||||
else:
|
||||
base = args.target
|
||||
if base in ("cv64a6_imafdc_sv39", "cv64a6_imafdc_sv39_hpdcache", "cv64a6_imafdc_sv39_wb"):
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
common_test_config: &common_test_config
|
||||
path_var: TESTS_PATH
|
||||
gcc_opts: "-static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles ../tests/custom/common/syscalls.c ../tests/custom/common/crt.S -I../tests/custom/env -I../tests/custom/common -T ../tests/custom/common/test.ld -lgcc"
|
||||
gcc_opts: "-static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles ../tests/custom/common/syscalls.c ../tests/custom/common/crt.S -I../tests/custom/env -I../tests/custom/common -lgcc"
|
||||
|
||||
testlist:
|
||||
- test: csr_test
|
||||
|
|
|
@ -28,11 +28,11 @@
|
|||
|
||||
common_test_config: &common_test_config
|
||||
path_var: TESTS_PATH
|
||||
gcc_opts: "-static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles ../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 ../tests/custom/common/syscalls.c ../tests/custom/common/crt.S -I../tests/custom/env -I../tests/custom/common"
|
||||
|
||||
common_test_config_lgcc: &common_test_config_lgcc
|
||||
path_var: TESTS_PATH
|
||||
gcc_opts: "-static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles ../tests/custom/common/syscalls.c ../tests/custom/common/crt.S -I../tests/custom/env -I../tests/custom/common -T ../tests/custom/common/test.ld -lgcc"
|
||||
gcc_opts: "-static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles ../tests/custom/common/syscalls.c ../tests/custom/common/crt.S -I../tests/custom/env -I../tests/custom/common -lgcc"
|
||||
|
||||
testlist:
|
||||
- test: cvxif_add_nop
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
common_test_config: &common_test_config
|
||||
path_var: TESTS_PATH
|
||||
gcc_opts: "-static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles ../tests/custom/common/syscalls.c ../tests/custom/common/crt.S -I../tests/custom/env -I../tests/custom/common -T ../tests/custom/common/test.ld -lgcc"
|
||||
gcc_opts: "-static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles ../tests/custom/common/syscalls.c ../tests/custom/common/crt.S -I../tests/custom/env -I../tests/custom/common -lgcc"
|
||||
|
||||
testlist:
|
||||
- test: branch_test
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
# --------------------------------------------------------------------------------
|
||||
common_test_config: &common_test_config
|
||||
path_var: TESTS_PATH
|
||||
gcc_opts: "-static -misa-spec=2.2 -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles ../tests/custom/common/syscalls.c ../tests/custom/common/crt.S -I../tests/custom/env -I../tests/custom/common -T ../tests/custom/common/test.ld -lgcc"
|
||||
gcc_opts: "-static -misa-spec=2.2 -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles ../tests/custom/common/syscalls.c ../tests/custom/common/crt.S -I../tests/custom/env -I../tests/custom/common -T ../../config/gen_from_riscv_config/linker/link.ld -lgcc"
|
||||
|
||||
testlist:
|
||||
- test: compressed-fpreg-commits-rv64
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue