6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu May 16, 2024 12:25 pm

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Fri Aug 19, 2022 1:04 pm 
Offline
User avatar

Joined: Mon Oct 05, 2020 6:57 pm
Posts: 37
Location: Central VA, USA
Finally got some time to clean up the source for our RAM test/diagnostic ROM for the AIM-65:

https://github.com/glitchwrks/aim65_memtest/

Initial work was largely done by TangentDelta. This was written to help diagnose and repair some dead AIM-65s. The test will run on a minimally functional AIM-65 -- all you need is a working CPU, ROM socket, and display board. It performs the following tests:

  • ROM checksum
  • Stack page quick write presence
  • Zero page quick write presence
  • RIOT single-pass memory test
  • Full system memory test

The ROM checksum and stack page tests are accomplished with macros so that they can run with no RAM, since of course that might be faulty! Once the stack page passes, zero page is tested. With stack and ZP tested, the RIOT and exhaustive system memory tests are performed. These tests are more complete, since we have a minimally functional system by this point. The exhaustive test is based heavily on the routines from the OSI MEMORY TEST from OS-65D 2.0, published in OSI Small Systems Journal, Volume 1, Number 3, September 1977.


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 19, 2022 1:26 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3354
Location: Ontario, Canada
glitch wrote:
The ROM checksum and stack page tests are accomplished with macros so that they can run with no RAM, since of course that might be faulty!
Right! Can't rely on a faulty RAM to reliably test itself! :lol:

But I'm curious what sort of code is produced by the macros you mentioned. If RAM isn't trustworthy, then all your variables need to held in CPU registers, isn't that right? (And even self-modifying code is off limits.) Sounds like a fun challenge...

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 19, 2022 8:58 pm 
Offline
User avatar

Joined: Sat Jul 24, 2021 1:37 pm
Posts: 282
That is really cool! I've been thinking about implementing some self-diagnosis on my computer since I saw (here, maybe? can't remember) someone using the Emulation pin to report diagnosis results by blinking in several patterns. I might take inspiration from your project, I particularly like the ROM checksum idea :-)

_________________
BB816 Computer YouTube series


Top
 Profile  
Reply with quote  
PostPosted: Sat Aug 20, 2022 6:32 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10800
Location: England
Speaking of testing RAM without needing RAM reminded me of hoglet's project:
> A memory test for the Acorn Atom that doesn't need working RAM to function
https://github.com/hoglet67/AtomRAMTest


Top
 Profile  
Reply with quote  
PostPosted: Sat Aug 20, 2022 6:54 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8437
Location: Southern California
Unless it's intermittent (which I think would be rare), you could test just a few ZP locations without indexing or indirection, and when those are verified to be ok, go ahead and use them to test the rest of RAM. If they fail, there's no point in testing the rest.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Sat Aug 20, 2022 7:43 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10800
Location: England
One thing to look out for in this kind of phased approach is that some memory faults will alias the memory under test back to the zero page pointer(s). It's perhaps conceivable that a test could falsely pass - it would take effort to prove that it couldn't.


Top
 Profile  
Reply with quote  
PostPosted: Sat Aug 20, 2022 8:02 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8437
Location: Southern California
I haven't thought about it much, but one idea I've had about it is to store numbers in a sequence of 1 to some prime number, and repeat the sequence, then go back and read the whole set and see if you get the same thing back. Aliasing should make it fail. It would also fail if such a fault made it step on your ZP variables you're using for indirection.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 22, 2022 11:04 am 
Offline
User avatar

Joined: Sat Jul 24, 2021 1:37 pm
Posts: 282
Adrian Black had two episodes talking about making a diagnostic ROM for TRS-80s, coincidentally: https://www.youtube.com/watch?v=Hh8dRgtu1Jk and https://www.youtube.com/watch?v=4fuuyLiSgsE&t=955s. Some ideas could be taken from there. Specifically, he mentions the use of March tests to detect some SRAM failure modes such as two locations being linked, which might help solve for the zero page aliasing issue BigEd mentioned.

On my side, I'm working on a 16-bit checksum in 65C816 assembly. I initially looked at using something better like Fletcher that is more thorough than a sum, but the algorithm needs to add two variables, and I need a memory location for that. So I went back to a simple sum. Here is the code, assuming the ROM takes the high 32k of bank zero, and M=X=0. The ROM would have to work in the reset vector region and the checksum region for this code to execute fully, so the type of failure mode it detects is limited (not sure about common modes of failure for ROMs?)


Code:
  ldx # $7FFE
  lda # 0

- clc
  adc $8000, x
  dex
  dex
  bpl -

  cmp # 0
  beq checksum_ok
  ; put error handler here

_________________
BB816 Computer YouTube series


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 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: