6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 21, 2024 6:11 pm

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Looking for test program
PostPosted: Thu Apr 08, 2010 2:32 pm 
Offline
User avatar

Joined: Fri Dec 12, 2003 7:22 am
Posts: 259
Location: Heerlen, NL
Hallo allemaal,

As you know I'm busy with my TTL-6502. I need a program to test my self build 6502. I can write it myself but then I thought that 6502 cores for FPGA's had to be tested too. So why invent the wheel twice?
Has anybody such a program? Many thanks in advance!

FYI: I'm writing an emulator as well. The routines in the emulator can also be used to fill the various Instruction Decoder ROMs with data. In this way I can start debugging everything before the real hardware is build.

_________________
Code:
    ___
   / __|__
  / /  |_/     Groetjes, Ruud
  \ \__|_\
   \___|       URL: www.baltissen.org



Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Apr 08, 2010 8:16 pm 
Online
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
Good news: viewtopic.php?p=10459&highlight=lorenz#10459

Edit: adding a tabulation from subsequent posts to help future adventurers. See also http://visual6502.org/wiki/index.php?ti ... stPrograms
- Wolfgang Lorenz' suite, somewhat C64-specific. See also here for notes on porting.
- Rob Finch's suite
- Kevin Horton's "The ultimate NES CPU test ROM" as linked on the nesdev wiki
- From the hmc-6502 project: AllSuiteA.asm for example. There's a corresponding rom nearby too.

More recently:
- Klaus Dormann's suite - good coverage, recently maintained, any 6502 system


Last edited by BigEd on Sat Jun 09, 2018 9:04 am, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Apr 10, 2010 9:42 am 
Offline
User avatar

Joined: Fri Dec 12, 2003 7:22 am
Posts: 259
Location: Heerlen, NL
BigEd wrote:

Thanks for your effort but I'm afraid I cannot use them. As I understand these programs are meant to test the C64. And the source codes I checked haven't any comment at all.

To give you an idea what I had in mind:

jmp L1 ; test JMP
nop
nop
L1 sec
bcc Error
bcs L2
nop
nop
L2 clc
bcs Error

The idea is to check all instructions step by step in the beginning. Once some instructions have been tested thoroughly, the rest of the instructions can be tested at full speed.

_________________
Code:
    ___
   / __|__
  / /  |_/     Groetjes, Ruud
  \ \__|_\
   \___|       URL: www.baltissen.org



Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Apr 10, 2010 10:33 am 
Online
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
Granted, there are few comments if any in Wolfgang's test suite - but it is the only attempt at a complete suite I've ever found. All the C64 calls are outside the test proper: can be ignored or stripped out. It isn't zero-cost, but a huge amount of work has been done (and placed in the public domain)

The jmpw.asm test has just 70 lines of specific test: the rest of the 300 line source are supporting code, and there's a lot of commonality between the tests. After initialisation, the test starts at the label 'next' which sets up the expected machine state, the label 'cmd' is the instruction under test and then the postamble up to 'jmpnext' is checking the machine state against expectations. The label 'nonext' concludes the test and chains the next test.

Wolfgang's suite isn't "progressive" (start with a minimal subset of instructions and build up) but I'm not sure that's a fatal flaw. If all tests pass, you could only be left with some collection of mutually supporting bugs. That's highly improbable. You could arguably have a similar flaw in a progressive testsuite. I think it would take monumental effort to construct a provable self-testing bootstrap.

Rob Finch's suite is more like your model: it's useful but far from exhaustive. See here


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Apr 11, 2010 1:58 pm 
Offline
User avatar

Joined: Fri Dec 12, 2003 7:22 am
Posts: 259
Location: Heerlen, NL
BigEd wrote:
Rob Finch's suite is more like your model: it's useful but far from exhaustive. See here

The first line of his program:
jsr putmsg
Not an instruction that I like to start any test program with. I will write my own program but I'll use his one at least to check if I didn't forget anything.

Thanks for your effort!

_________________
Code:
    ___
   / __|__
  / /  |_/     Groetjes, Ruud
  \ \__|_\
   \___|       URL: www.baltissen.org



Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Apr 11, 2010 2:15 pm 
Online
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
Just a couple more notes for future travellers down this road:

Here are some more notes applicable to Wolfgang's test suite, in this case ported to Commodore plus/4 - may help in understanding the suite, or in designing an alternative.

Similarly, on the nesdev wiki there's a link to Kevin Horton's "The ultimate NES CPU test ROM" described in detail here - there's a ROM for NES, but no source. Even the list of test failure codes tells us something about what's being tested. This suite seems to be a gold standard, although binary-only is even more limiting than uncommented sources.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Apr 11, 2010 3:20 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
Just to clarify-- Ruud, are you looking for something to test the actual processor, as opposed to a computer? I expect that a program designed to test a computer would assume that the processor design was proven long ago, and the individual processor itself was tested before being put in the computer; so the intent would be to run the completed computer through its paces, after the processor is already known to be good. I remember there being some conversation about that on the 65GZ32 forum.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Apr 11, 2010 5:22 pm 
Offline
User avatar

Joined: Fri Dec 12, 2003 7:22 am
Posts: 259
Location: Heerlen, NL
GARTHWILSON wrote:
are you looking for something to test the actual processor, as opposed to a computer?
Yes indeed, I need something to test the processor.

GARTHWILSON wrote:
I remember there being some conversation about that on the 65GZ32 forum.

Correct. But that only concerned the 32-bit instructions as 8-bit already worked fine.

_________________
Code:
    ___
   / __|__
  / /  |_/     Groetjes, Ruud
  \ \__|_\
   \___|       URL: www.baltissen.org



Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 26, 2010 9:39 pm 
Online
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
I know Ruud has now written his own test ROM, but I think this is a good thread to note another one, from the hcm-6502 project: AllSuiteA.asm for example. There's a corresponding rom nearby too. (That project is another verilog 6502, quiet since May 2008, seems to pass its own test suite but missing some functionality. Could be interesting as a reference.)
Cheers
Ed


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: