nxdk_low_level_nv2a_tests ==== Various tests for very low level operation of the nv2a GPU. * ptimer_alarm_test - tests the operation of NV_PTIMER_ALARM_0 and the associated interrupt. * pfifo_cache1_test - tests submission and execution of pushbuffer commands via DMA and the CACHE1 registers. ## Headless Execution & Automated Testing To facilitate automated test runs in tools like `xemu-test`, each test suite checks for an optional configuration file at `c:\test_suite_config.ini` upon startup. The configuration file supports flat `KEY=VALUE` pairs (lines starting with `#` or `;` are ignored): * `log_path`: Overrides the exact output path of the log file (e.g., `log_path = c:\test_output.txt` or `log_path = e:\custom_dir\log.txt`). The target drive partition is mounted automatically based on the drive letter. * `shutdown`: Enables headless termination (`shutdown = true` or `1`/`yes`/`on`). When set, the system will flush test logs and immediately power down. If no configuration file is present or keys are omitted, suites write to their default log paths and wait for controller input (`Black` button / Right Shoulder / Start) to exit. ## CLion ### Building Under Settings > Build, Execution, Deployment > CMake - Provide the path to the nxdk toolchain file under CMake Options `-DCMAKE_TOOLCHAIN_FILE=$CMakeProjectDir$/third_party/nxdk/share/toolchain-nxdk.cmake` - Optionally modify the `PATH` variable to make sure the path to your chosen version of Clang comes first. ### Debugging #### Using [xemu](xemu.app) 1. Create a new `Embedded GDB Server` target 1. Set the Target to the `_xiso` target 1. Set the Executable to the `` binary (it should be the only thing in the dropdown) 1. Set `Upload executable` to `Never` 1. Set `'target remote' args` to `127.0.0.1:1234` 1. Set `GDB Server` to the path to the xemu binary 1. Set `GDB Server args` to `-s -S -dvd_path "$CMakeCurrentBuildDir$/xiso/_xiso/_xiso.iso"` (the `-S` is optional and will cause xemu to wait for the debugger to connnect) 1. Under `Advanced GDB Server Options` 1. Set "Working directory" to `$ProjectFileDir$` 1. On macOS, set "Environment variables" to `DYLD_FALLBACK_LIBRARY_PATH=//Contents/Libraries/` 1. Set "Reset command" to `Never` #### Using [xbdm_gdb_bridge](https://github.com/abaire/xbdm_gdb_bridge) and a devkit/XBDM-enabled Xbox 1. Create a new `Embedded GDB Server` target 1. Set the Target to the `_xiso` target 1. Set the Executable to the `` binary (it should be the only thing in the dropdown) 1. Set `Upload executable` to `Never` 1. Set `'target remote' args` to `127.0.0.1:1999` 1. Set `GDB Server` to the path to the xbdm_gdb_bridge binary (e.g., `/xbdm_gdb_bridge`) 1. Set `GDB Server args` to ` -v3 -s -- gdb :1999 e:\$CMakeCurrentTargetName$` 1. Under `Advanced GDB Server Options`, set `Reset command` to `Never` To perform automatic deployment after builds: 1. Under the `Before launch` section, click the `+` button and add a new `Run external tool` entry. 1. Set the `Description` field to something like `Sync program and resources to the XBOX` 1. Set the `Program` field to the path to the xbdm_gdb_bridge binary (same as above) 1. Set `Arguments` to ` -- mkdir e:\$CMakeCurrentTargetName$ && %syncdir $CMakeCurrentBuildDir$/xbe/xbe_file e:\$CMakeCurrentTargetName$ -f` 1. Set `Working directory` to `$ProjectFileDir$`