I’m happy to report that hoglet and BigEd were able to confirm the validity of the 65816 test code.
After a few intercontinental bug-fixes of both the test code and the Logisim model, the 65816Test ran successfully on the
Beeb816 (a 65816 BBC Micro accelerator by BigEd and revaldinho), on the
PiTubeDirect 65816 (a 65816 emulation on a Raspberry PI/BBC Micro by hoglet) and on the Logisim model. hoglet used his clever
65816 decoder to validate the test results and reported the successful runs. Honestly, I had to give my head a shake ... this means we now have a reasonably accurate model of a pipelined 65816. Hooray!
(always nice to mark a milestone along the way).
The 65816Test runs through all 65816 opcodes testing various conditions as it goes. The tests are geared to exercise 65816 specific functionality in a fairly extreme configuration: Native Mode, with X=0 and M=0, Direct Page and Stack higher in bank 0, the DL register set to a non-zero value and DBR set to $F8. Indexing across page and bank boundaries is tested, as well long jumps and branches, 16-bit ALU operations and Native Mode BRK and COP interrupts.
This does not claim to be a comprehensive test (it assumes basic 6502 functionality is tested elsewhere, for example) but hoglet mentioned it nevertheless helped him uncover a couple of bugs in his ‘816 emulator. That’s good news, and suggests that the test may be of value to others as well. Kowalski Assembler source code for the test is attached below. (I will likely be making subsequent versions to test DL=0, X=1, M=1 variants and will post those as well).
Three cheers for hoglet and BigEd!
Thank you for the help gents.
Cheers for now,
Drass