foss-for-synopsys-dwc-arc-processors / arc-gnu-toolchain

Scripting for building ARC toolchain
5 stars 3 forks source link

Added configuration option for Simulator #22

Closed luismgsilva closed 1 year ago

luismgsilva commented 1 year ago

Summary

Added new configuration option --with-sim=SIM used to determine the simulator for testing purposes. To run the desired tests, utilize the following command: make check-newlib for bare-metal, make check-linux for Linux, or make report for a test run culminating in a final report.

Simulator Option
QEMU --with-sim=qemu (default)
nSIM --with-sim=nsim

When conducting tests for newlib and opting to use nSIM as the simulator, the tool must be in the environment variable $PATH to proceed.

Note: It should be noted that selecting nSIM is not possible if building the Linux Toolchain since it does not support user mode.

Test Result

ARC64

GCCG++
| | QEMU | nSIM | |--------------------------|---------:|---------:| | of expected passes | 129317 | 129317 | | of unexpected failures | 19 | 19 | | of unexpected successes | 2 | 2 | | of expected failures | 864 | 864 | | of unresolved testcases | 14 | 14 | | of unsupported tests | 5451 | 5451 | | | QEMU | nSIM | |--------------------------|---------:|---------:| | of expected passes | 192300 | 192300 | | of unexpected failures | 11 | 11 | | of unexpected successes | 11 | 11 | | of expected failures | 1051 | 1051 | | of unresolved testcases | - | - | | of unsupported tests | 11039 | 11039 |

ARCv2

GCCG++
| | QEMU | nSIM | |--------------------------|---------:|---------:| | of expected passes | 124966 | 126837 | | of unexpected failures | 1871 | 40 | | of unexpected successes | 4 | 4 | | of expected failures | 839 | 840 | | of unresolved testcases | 22 | 18 | | of unsupported tests | 3496 | 3496 | | | QEMU | nSIM | |--------------------------|---------:|---------:| | of expected passes | 188816 | 189295 | | of unexpected failures | 483 | 19 | | of unexpected successes | 11 | 11 | | of expected failures | 1035 | 1035 | | of unresolved testcases | - | - | | of unsupported tests | 11029 | 11029 |

The significant difference in test results for ARCv2 between QEMU and nSIM is due to the absence of the floating point implementation, which is currently being reviewed in the pull request https://github.com/foss-for-synopsys-dwc-arc-processors/qemu/pull/168 .

If using the bruno_fpu_v2 branch, the results are the following:

GCCG++
| | QEMU | nSIM | |--------------------------|---------:|---------:| | of expected passes | 126834 | 126837 | | of unexpected failures | 41 | 40 | | of unexpected successes | 4 | 4 | | of expected failures | 840 | 840 | | of unresolved testcases | 20 | 18 | | of unsupported tests | 3496 | 3496 | | | QEMU | nSIM | |--------------------------|---------:|---------:| | of expected passes | 189295 | 189295 | | of unexpected failures | 19 | 19 | | of unexpected successes | 11 | 11 | | of expected failures | 1035 | 1035 | | of unresolved testcases | - | - | | of unsupported tests | 11029 | 11029 |

Disclaimer

When using the nSIM simulator, missing configurations, such as enabling STD instructions with sim_isa_ll64_option=1, can result in aborts. This will cause an abort with an error message similar to: 13:00:27.894801 ERROR:[CPU0] Encountered 'InstructionError' exception while this exception is disabled in nSIM - halting. PC:0x000002c4 EFA:0x000002c4 ECR:0x00020000. Interestingly, this abort is perceived as a PASS by dejagnu which is evident from the following message:

spawn arc-elf32-run strrchr.x3 
ERROR:[CPU0] Encountered 'InstructionError' exception while this exception is disabled in nSIM - halting. PC:0x00000130 EFA:0x00000130 ERC:0x00020000 
PASS: gcc.c-torture/execute/buildins/strrchr.c execution, -O3 -g. 

Therefore, there could be an issue with how dejagnu interprets the abort exception from nSIM.