Page 1 of 1

RAM test

Posted: Sun May 24, 2020 9:48 pm
by Dan Moos
This is probably a feature of dubious utility but I'll ask anyway.

How would one implement a power on RAM test, that is capable of determining how much actual RAM is available?

My first idea was to go through every address, first writing all 1's, and verifying, and then doing the same with zeroes. This would test the RAM for functionality but...

I have I/O directly after the SRAM If I try to write to that, currently my UART will get some sort of garbage activity!

My likely compromise will be to have the test stop before I/O space.

I know that this is a silly idea. More of a "satisfy curiosity" kinda thing.

Re: RAM test

Posted: Sun May 24, 2020 10:02 pm
by GARTHWILSON
Make sure mirrored areas of the memory map can't give deceptive results, making it look like there's more RAM there when really you're just testing the same RAM again.

I've had this in the back of my mind for decades and never done anything about it; but since once the RAM is in there and working, it's not likely to ever go bad, especially without taking the whole system down such that software to test RAM won't run anyway; so if a system can have different amounts of RAM installed, I kind of like the idea of either having jumpers to read, or a value you put in flash or EEPROM to tell the system how much RAM is installed.

Re: RAM test

Posted: Sun May 24, 2020 11:36 pm
by Dr Jefyll
Dan Moos wrote:
I have I/O directly after the SRAM If I try to write to that, currently my UART will get some sort of garbage activity!
Instead of having the initial memory test work upward, can't you just start immediately below the I/O and work downward?

As for mirrored (aliased) regions, maybe you can detect those by writing the address which you intend to test to that address. Move down by 8K (or whatever granularity seems suitable) and repeat until there's no more space (actual or aliased). When you read the values back any aliased locations will be apparent.

Finally, if desired, you can move on to exhaustive functional testing.

-- Jeff

Re: RAM test

Posted: Mon May 25, 2020 3:00 am
by barrym95838

Re: RAM test

Posted: Mon May 25, 2020 10:32 am
by cjb
Something I've done was to calculate checksums of each page of memory, twice, and see if they were equal. This was viable on the particular hardware (a VIC-20 with a homebrew RAM, EPROM, and two-VIA expansion), where unconnected addresses returned semi-random values on a read, and the VIAs didn't get confused from when just reading their registers, but had timer regs that changed.)