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

Fix for test program compilation failures due to lack of zicsr extension in -march=rvXX... #484

Merged
merged 1 commit into from
Jul 5, 2023

Conversation

TommyMurphyTM1234
Copy link
Contributor

Fix for:

Note that this fix means that the tests will probably fail to compile with a pre GCC 12 RISC-V toolchain which predates the separation of the zicsr (and zifencei) extension(s) out from the base integer ISA. But I didn't think that it was worthwhile complicating the script further by trying to cater for older toolchains in the script.

@timsifive
Copy link
Collaborator

Note the pylint failure is not your fault, and will be fixed by #483.

Copy link
Collaborator

@timsifive timsifive left a comment

Choose a reason for hiding this comment

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

Can you give the PR a title that someone can read without knowing github issue numbers by heart?

Change looks fine, but I'm a bit concerned about it not working with older GCC versions. Specifically, OpenOCD automatically runs these tests using https://github.com/riscv/riscv-openocd/blob/riscv/.github/workflows/spike-openocd-tests.yml.

Can you confirm that these new flags are supported by the toolchain referred to on line 10 of that file?

@TommyMurphyTM1234
Copy link
Contributor Author

Thanks @timsifive .

Can you give the PR a title that someone can read without knowing github issue numbers by heart?

Sorry - I thought that it was sufficient to link to the issue.
I will give it a more descriptive title and link to the issue in the description.

Change looks fine, but I'm a bit concerned about it not working with older GCC versions. Specifically, OpenOCD automatically runs these tests using https://github.com/riscv/riscv-openocd/blob/riscv/.github/workflows/spike-openocd-tests.yml.

Can you confirm that these new flags are supported by the toolchain referred to on line 10 of that file?

I'm pretty sure that any post GCC 12 toolchain will support -march=rvXX..._zicsr but I will check with this specific version to be sure:

@TommyMurphyTM1234 TommyMurphyTM1234 changed the title Fix for https://github.com/riscv-software-src/riscv-tests/issues/482 Fix for test program compilation failures due to lack of zicsr extension in -march=rvXX... Jul 2, 2023
@TommyMurphyTM1234
Copy link
Contributor Author

Change looks fine, but I'm a bit concerned about it not working with older GCC versions. Specifically, OpenOCD automatically runs these tests using https://github.com/riscv/riscv-openocd/blob/riscv/.github/workflows/spike-openocd-tests.yml.

Can you confirm that these new flags are supported by the toolchain referred to on line 10 of that file?

Hi @timsifive - I can confirm that those tests using the xPack toolchain in question still work fine with this PR's change.

echo $PATH
/home/user/Downloads/xpack-riscv-none-elf-gcc-12.2.0-1/bin:/home/user/Downloads/riscv-openocd/installed-tools/bin:/home/user/Downloads/riscv-isa-sim/installed-tools/bin:/usr/lib/ccache:/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

./gdbserver.py targets/RISC-V/spike32.py --print-failures --gcc riscv-none-elf-gcc --gdb riscv-none-elf-gdb 
Using $misa from hart definition: 0x4034112d
[CeaseMultiTest] Starting > logs/20230702-144023-spike32-CeaseMultiTest.log
[CeaseMultiTest] not_applicable in 0.00s
[CeaseRunTest] Starting > logs/20230702-144023-spike32-CeaseRunTest.log
[CeaseRunTest] not_applicable in 0.00s
[CeaseStepiTest] Starting > logs/20230702-144023-spike32-CeaseStepiTest.log
[CeaseStepiTest] not_applicable in 0.00s
[CheckMisa] Starting > logs/20230702-144023-spike32-CheckMisa.log
[CheckMisa] pass in 1.47s
[CustomRegisterTest] Starting > logs/20230702-144025-spike32-CustomRegisterTest.log
[CustomRegisterTest] pass in 9.89s
[DebugBreakpoint] Starting > logs/20230702-144035-spike32-DebugBreakpoint.log
[DebugBreakpoint] pass in 7.37s
[DebugChangeString] Starting > logs/20230702-144042-spike32-DebugChangeString.log
[DebugChangeString] pass in 6.82s
[DebugCompareSections] Starting > logs/20230702-144049-spike32-DebugCompareSections.log
[DebugCompareSections] pass in 4.97s
[DebugExit] Starting > logs/20230702-144054-spike32-DebugExit.log
[DebugExit] pass in 5.23s
[DebugFunctionCall] Starting > logs/20230702-144059-spike32-DebugFunctionCall.log
[DebugFunctionCall] pass in 8.06s
[DebugSymbols] Starting > logs/20230702-144107-spike32-DebugSymbols.log
[DebugSymbols] pass in 5.88s
[DebugTurbostep] Starting > logs/20230702-144113-spike32-DebugTurbostep.log
[DebugTurbostep] pass in 9.87s
[DisconnectTest] Starting > logs/20230702-144123-spike32-DisconnectTest.log
[DisconnectTest] pass in 6.33s
[DownloadTest] Starting > logs/20230702-144129-spike32-DownloadTest.log
[DownloadTest] pass in 22.99s
[EbreakTest] Starting > logs/20230702-144152-spike32-EbreakTest.log
[EbreakTest] pass in 4.86s
[EtriggerTest] Starting > logs/20230702-144157-spike32-EtriggerTest.log
[EtriggerTest] pass in 6.43s
[FreeRtosTest] Starting > logs/20230702-144203-spike32-FreeRtosTest.log
[FreeRtosTest] pass in 16.97s
[Hwbp1] Starting > logs/20230702-144220-spike32-Hwbp1.log
[Hwbp1] pass in 6.47s
[Hwbp2] Starting > logs/20230702-144227-spike32-Hwbp2.log
[Hwbp2] pass in 7.41s
[HwbpManual] Starting > logs/20230702-144234-spike32-HwbpManual.log
[HwbpManual] not_applicable in 7.04s
[IcountTest] Starting > logs/20230702-144241-spike32-IcountTest.log
[IcountTest] pass in 4.42s
[InfoTest] Starting > logs/20230702-144246-spike32-InfoTest.log
[InfoTest] pass in 1.50s
[InstantChangePc] Starting > logs/20230702-144247-spike32-InstantChangePc.log
[InstantChangePc] pass in 2.91s
[InstantHaltTest] Starting > logs/20230702-144250-spike32-InstantHaltTest.log
[InstantHaltTest] pass in 1.99s
[InterruptTest] Starting > logs/20230702-144252-spike32-InterruptTest.log
[InterruptTest] pass in 6.69s
[ItriggerTest] Starting > logs/20230702-144259-spike32-ItriggerTest.log
[ItriggerTest] pass in 4.68s
[JumpHbreak] Starting > logs/20230702-144303-spike32-JumpHbreak.log
[JumpHbreak] pass in 3.93s
[MemTest16] Starting > logs/20230702-144307-spike32-MemTest16.log
[MemTest16] pass in 1.88s
[MemTest32] Starting > logs/20230702-144309-spike32-MemTest32.log
[MemTest32] pass in 1.89s
[MemTest64] Starting > logs/20230702-144311-spike32-MemTest64.log
[MemTest64] pass in 2.02s
[MemTest8] Starting > logs/20230702-144313-spike32-MemTest8.log
[MemTest8] pass in 2.02s
[MemTestBlock0] Starting > logs/20230702-144315-spike32-MemTestBlock0.log
[MemTestBlock0] pass in 4.66s
[MemTestBlock1] Starting > logs/20230702-144320-spike32-MemTestBlock1.log
[MemTestBlock1] pass in 4.75s
[MemTestBlock2] Starting > logs/20230702-144325-spike32-MemTestBlock2.log
[MemTestBlock2] pass in 4.72s
[MemTestBlockReadInvalid] Starting > logs/20230702-144329-spike32-MemTestBlockReadInvalid.log
[MemTestBlockReadInvalid] not_applicable in 0.00s
[MemTestReadInvalid] Starting > logs/20230702-144329-spike32-MemTestReadInvalid.log
[MemTestReadInvalid] pass in 2.51s
[MemorySampleMixed] Starting > logs/20230702-144332-spike32-MemorySampleMixed.log
[MemorySampleMixed] not_applicable in 0.00s
[MemorySampleSingle] Starting > logs/20230702-144332-spike32-MemorySampleSingle.log
[MemorySampleSingle] not_applicable in 0.00s
[MulticoreRegTest] Starting > logs/20230702-144332-spike32-MulticoreRegTest.log
[MulticoreRegTest] not_applicable in 0.00s
[MulticoreRtosSwitchActiveHartTest] Starting > logs/20230702-144332-spike32-MulticoreRtosSwitchActiveHartTest.log
[MulticoreRtosSwitchActiveHartTest] not_applicable in 0.00s
[MulticoreRunAllHaltOne] Starting > logs/20230702-144332-spike32-MulticoreRunAllHaltOne.log
[MulticoreRunAllHaltOne] not_applicable in 0.00s
[PrivChange] Starting > logs/20230702-144332-spike32-PrivChange.log
[PrivChange] pass in 4.53s
[PrivRw] Starting > logs/20230702-144336-spike32-PrivRw.log
[PrivRw] pass in 5.40s
[ProgramHwWatchpoint] Starting > logs/20230702-144342-spike32-ProgramHwWatchpoint.log
[ProgramHwWatchpoint] pass in 8.39s
[ProgramSwWatchpoint] Starting > logs/20230702-144350-spike32-ProgramSwWatchpoint.log
[ProgramSwWatchpoint] pass in 16.75s
[Registers] Starting > logs/20230702-144407-spike32-Registers.log
[Registers] pass in 10.63s
[RepeatReadTest] Starting > logs/20230702-144418-spike32-RepeatReadTest.log
[RepeatReadTest] pass in 11.43s
[Semihosting] Starting > logs/20230702-144429-spike32-Semihosting.log
[Semihosting] pass in 7.50s
[SemihostingFileio] Starting > logs/20230702-144437-spike32-SemihostingFileio.log
[SemihostingFileio] pass in 7.60s
[SimpleF18Test] Starting > logs/20230702-144444-spike32-SimpleF18Test.log
[SimpleF18Test] pass in 4.02s
[SimpleNoExistTest] Starting > logs/20230702-144448-spike32-SimpleNoExistTest.log
[SimpleNoExistTest] pass in 1.42s
[SimpleS0Test] Starting > logs/20230702-144450-spike32-SimpleS0Test.log
[SimpleS0Test] pass in 3.38s
[SimpleS1Test] Starting > logs/20230702-144453-spike32-SimpleS1Test.log
[SimpleS1Test] pass in 3.36s
[SimpleT0Test] Starting > logs/20230702-144456-spike32-SimpleT0Test.log
[SimpleT0Test] pass in 3.36s
[SimpleT1Test] Starting > logs/20230702-144500-spike32-SimpleT1Test.log
[SimpleT1Test] pass in 3.38s
[SimpleV13Test] Starting > logs/20230702-144503-spike32-SimpleV13Test.log
[SimpleV13Test] pass in 11.91s
[SmpSimultaneousRunHalt] Starting > logs/20230702-144515-spike32-SmpSimultaneousRunHalt.log
[SmpSimultaneousRunHalt] not_applicable in 0.00s
[StepTest] Starting > logs/20230702-144515-spike32-StepTest.log
[StepTest] pass in 6.82s
[StepThread2Test] Starting > logs/20230702-144522-spike32-StepThread2Test.log
[StepThread2Test] not_applicable in 0.00s
[Sv32Test] Starting > logs/20230702-144522-spike32-Sv32Test.log
[Sv32Test] pass in 7.64s
[Sv39Test] Starting > logs/20230702-144529-spike32-Sv39Test.log
[Sv39Test] not_applicable in 0.00s
[Sv48Test] Starting > logs/20230702-144529-spike32-Sv48Test.log
[Sv48Test] not_applicable in 0.00s
[TooManyHwbp] Starting > logs/20230702-144529-spike32-TooManyHwbp.log
[TooManyHwbp] pass in 9.72s
[TriggerDmode] Starting > logs/20230702-144539-spike32-TriggerDmode.log
[TriggerDmode] pass in 7.06s
[TriggerExecuteInstant] Starting > logs/20230702-144546-spike32-TriggerExecuteInstant.log
[TriggerExecuteInstant] pass in 3.72s
[TriggerLoadAddressInstant] Starting > logs/20230702-144550-spike32-TriggerLoadAddressInstant.log
[TriggerLoadAddressInstant] pass in 5.61s
[TriggerStoreAddressInstant] Starting > logs/20230702-144556-spike32-TriggerStoreAddressInstant.log
[TriggerStoreAddressInstant] pass in 4.69s
[UserInterrupt] Starting > logs/20230702-144600-spike32-UserInterrupt.log
[UserInterrupt] pass in 8.16s
[VectorTest] Starting > logs/20230702-144608-spike32-VectorTest.log
[VectorTest] pass in 9.03s
[WriteCsrs] Starting > logs/20230702-144617-spike32-WriteCsrs.log
[WriteCsrs] pass in 5.12s
[WriteGprs] Starting > logs/20230702-144623-spike32-WriteGprs.log
[WriteGprs] pass in 11.36s
:::::::::::::::::::::::::::[ ran 71 tests in 371s ]:::::::::::::::::::::::::::
14 tests returned not_applicable
57 tests returned pass

./gdbserver.py targets/RISC-V/spike64.py --print-failures --gcc riscv-none-elf-gcc --gdb riscv-none-elf-gdb 
Using $misa from hart definition: 0x8000000000141125
[CeaseMultiTest] Starting > logs/20230702-144644-spike64-CeaseMultiTest.log
[CeaseMultiTest] not_applicable in 0.00s
[CeaseRunTest] Starting > logs/20230702-144644-spike64-CeaseRunTest.log
[CeaseRunTest] not_applicable in 0.00s
[CeaseStepiTest] Starting > logs/20230702-144644-spike64-CeaseStepiTest.log
[CeaseStepiTest] not_applicable in 0.00s
[CheckMisa] Starting > logs/20230702-144644-spike64-CheckMisa.log
[CheckMisa] pass in 1.59s
[CustomRegisterTest] Starting > logs/20230702-144645-spike64-CustomRegisterTest.log
[CustomRegisterTest] pass in 7.53s
[DebugBreakpoint] Starting > logs/20230702-144653-spike64-DebugBreakpoint.log
[DebugBreakpoint] pass in 5.04s
[DebugChangeString] Starting > logs/20230702-144658-spike64-DebugChangeString.log
[DebugChangeString] pass in 5.55s
[DebugCompareSections] Starting > logs/20230702-144703-spike64-DebugCompareSections.log
[DebugCompareSections] pass in 2.67s
[DebugExit] Starting > logs/20230702-144706-spike64-DebugExit.log
[DebugExit] pass in 3.05s
[DebugFunctionCall] Starting > logs/20230702-144709-spike64-DebugFunctionCall.log
[DebugFunctionCall] pass in 6.45s
[DebugSymbols] Starting > logs/20230702-144716-spike64-DebugSymbols.log
[DebugSymbols] pass in 3.81s
[DebugTurbostep] Starting > logs/20230702-144719-spike64-DebugTurbostep.log
[DebugTurbostep] pass in 8.02s
[DisconnectTest] Starting > logs/20230702-144727-spike64-DisconnectTest.log
[DisconnectTest] pass in 6.07s
[DownloadTest] Starting > logs/20230702-144733-spike64-DownloadTest.log
[DownloadTest] pass in 15.31s
[EbreakTest] Starting > logs/20230702-144749-spike64-EbreakTest.log
[EbreakTest] pass in 4.77s
[EtriggerTest] Starting > logs/20230702-144753-spike64-EtriggerTest.log
[EtriggerTest] pass in 4.40s
[FreeRtosTest] Starting > logs/20230702-144758-spike64-FreeRtosTest.log
[FreeRtosTest] pass in 16.57s
[Hwbp1] Starting > logs/20230702-144814-spike64-Hwbp1.log
[Hwbp1] pass in 4.99s
[Hwbp2] Starting > logs/20230702-144819-spike64-Hwbp2.log
[Hwbp2] pass in 5.81s
[HwbpManual] Starting > logs/20230702-144825-spike64-HwbpManual.log
[HwbpManual] not_applicable in 5.16s
[IcountTest] Starting > logs/20230702-144830-spike64-IcountTest.log
[IcountTest] pass in 5.13s
[InfoTest] Starting > logs/20230702-144836-spike64-InfoTest.log
[InfoTest] pass in 1.65s
[InstantChangePc] Starting > logs/20230702-144837-spike64-InstantChangePc.log
[InstantChangePc] pass in 3.42s
[InstantHaltTest] Starting > logs/20230702-144841-spike64-InstantHaltTest.log
[InstantHaltTest] pass in 2.28s
[InterruptTest] Starting > logs/20230702-144843-spike64-InterruptTest.log
[InterruptTest] pass in 6.50s
[ItriggerTest] Starting > logs/20230702-144849-spike64-ItriggerTest.log
[ItriggerTest] pass in 4.13s
[JumpHbreak] Starting > logs/20230702-144854-spike64-JumpHbreak.log
[JumpHbreak] pass in 3.82s
[MemTest16] Starting > logs/20230702-144857-spike64-MemTest16.log
[MemTest16] pass in 2.17s
[MemTest32] Starting > logs/20230702-144900-spike64-MemTest32.log
[MemTest32] pass in 2.10s
[MemTest64] Starting > logs/20230702-144902-spike64-MemTest64.log
[MemTest64] pass in 2.11s
[MemTest8] Starting > logs/20230702-144904-spike64-MemTest8.log
[MemTest8] pass in 2.13s
[MemTestBlock0] Starting > logs/20230702-144906-spike64-MemTestBlock0.log
[MemTestBlock0] pass in 3.74s
[MemTestBlock1] Starting > logs/20230702-144910-spike64-MemTestBlock1.log
[MemTestBlock1] pass in 3.71s
[MemTestBlock2] Starting > logs/20230702-144913-spike64-MemTestBlock2.log
[MemTestBlock2] pass in 3.72s
[MemTestBlockReadInvalid] Starting > logs/20230702-144917-spike64-MemTestBlockReadInvalid.log
[MemTestBlockReadInvalid] not_applicable in 0.00s
[MemTestReadInvalid] Starting > logs/20230702-144917-spike64-MemTestReadInvalid.log
[MemTestReadInvalid] pass in 2.80s
[MemorySampleMixed] Starting > logs/20230702-144920-spike64-MemorySampleMixed.log
[MemorySampleMixed] pass in 9.79s
[MemorySampleSingle] Starting > logs/20230702-144930-spike64-MemorySampleSingle.log
[MemorySampleSingle] pass in 9.44s
[MulticoreRegTest] Starting > logs/20230702-144939-spike64-MulticoreRegTest.log
[MulticoreRegTest] not_applicable in 0.00s
[MulticoreRtosSwitchActiveHartTest] Starting > logs/20230702-144939-spike64-MulticoreRtosSwitchActiveHartTest.log
[MulticoreRtosSwitchActiveHartTest] not_applicable in 0.00s
[MulticoreRunAllHaltOne] Starting > logs/20230702-144939-spike64-MulticoreRunAllHaltOne.log
[MulticoreRunAllHaltOne] not_applicable in 0.00s
[PrivChange] Starting > logs/20230702-144939-spike64-PrivChange.log
[PrivChange] pass in 4.53s
[PrivRw] Starting > logs/20230702-144944-spike64-PrivRw.log
[PrivRw] pass in 5.47s
[ProgramHwWatchpoint] Starting > logs/20230702-144949-spike64-ProgramHwWatchpoint.log
[ProgramHwWatchpoint] pass in 9.68s
[ProgramSwWatchpoint] Starting > logs/20230702-144959-spike64-ProgramSwWatchpoint.log
[ProgramSwWatchpoint] pass in 30.23s
[Registers] Starting > logs/20230702-145029-spike64-Registers.log
[Registers] pass in 7.61s
[RepeatReadTest] Starting > logs/20230702-145037-spike64-RepeatReadTest.log
[RepeatReadTest] pass in 3.43s
[Semihosting] Starting > logs/20230702-145040-spike64-Semihosting.log
[Semihosting] pass in 6.32s
[SemihostingFileio] Starting > logs/20230702-145046-spike64-SemihostingFileio.log
[SemihostingFileio] pass in 6.23s
[SimpleF18Test] Starting > logs/20230702-145053-spike64-SimpleF18Test.log
[SimpleF18Test] pass in 4.45s
[SimpleNoExistTest] Starting > logs/20230702-145057-spike64-SimpleNoExistTest.log
[SimpleNoExistTest] pass in 1.60s
[SimpleS0Test] Starting > logs/20230702-145059-spike64-SimpleS0Test.log
[SimpleS0Test] pass in 4.06s
[SimpleS1Test] Starting > logs/20230702-145103-spike64-SimpleS1Test.log
[SimpleS1Test] pass in 3.90s
[SimpleT0Test] Starting > logs/20230702-145107-spike64-SimpleT0Test.log
[SimpleT0Test] pass in 3.94s
[SimpleT1Test] Starting > logs/20230702-145111-spike64-SimpleT1Test.log
[SimpleT1Test] pass in 3.98s
[SimpleV13Test] Starting > logs/20230702-145115-spike64-SimpleV13Test.log
[SimpleV13Test] pass in 2.42s
[SmpSimultaneousRunHalt] Starting > logs/20230702-145117-spike64-SmpSimultaneousRunHalt.log
[SmpSimultaneousRunHalt] not_applicable in 0.00s
[StepTest] Starting > logs/20230702-145117-spike64-StepTest.log
[StepTest] pass in 7.47s
[StepThread2Test] Starting > logs/20230702-145124-spike64-StepThread2Test.log
[StepThread2Test] not_applicable in 0.00s
[Sv32Test] Starting > logs/20230702-145124-spike64-Sv32Test.log
[Sv32Test] not_applicable in 0.00s
[Sv39Test] Starting > logs/20230702-145124-spike64-Sv39Test.log
[Sv39Test] pass in 5.79s
[Sv48Test] Starting > logs/20230702-145130-spike64-Sv48Test.log
[Sv48Test] pass in 5.54s
[TooManyHwbp] Starting > logs/20230702-145136-spike64-TooManyHwbp.log
[TooManyHwbp] pass in 8.12s
[TriggerDmode] Starting > logs/20230702-145144-spike64-TriggerDmode.log
[TriggerDmode] pass in 6.83s
[TriggerExecuteInstant] Starting > logs/20230702-145151-spike64-TriggerExecuteInstant.log
[TriggerExecuteInstant] pass in 3.42s
[TriggerLoadAddressInstant] Starting > logs/20230702-145154-spike64-TriggerLoadAddressInstant.log
[TriggerLoadAddressInstant] pass in 5.70s
[TriggerStoreAddressInstant] Starting > logs/20230702-145200-spike64-TriggerStoreAddressInstant.log
[TriggerStoreAddressInstant] pass in 4.65s
[UserInterrupt] Starting > logs/20230702-145204-spike64-UserInterrupt.log
[UserInterrupt] pass in 6.51s
[VectorTest] Starting > logs/20230702-145211-spike64-VectorTest.log
[VectorTest] not_applicable in 0.00s
[WriteCsrs] Starting > logs/20230702-145211-spike64-WriteCsrs.log
[WriteCsrs] pass in 5.33s
[WriteGprs] Starting > logs/20230702-145216-spike64-WriteGprs.log
[WriteGprs] pass in 11.18s
:::::::::::::::::::::::::::[ ran 71 tests in 344s ]:::::::::::::::::::::::::::
12 tests returned not_applicable
59 tests returned pass

logs.tar.gz

@timsifive timsifive merged commit 1f7a4b4 into riscv-software-src:master Jul 5, 2023
1 check failed
@TommyMurphyTM1234
Copy link
Contributor Author

Thanks for merging @timsifive.

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