VOGONS


First post, by Rav

User metadata
Rank Member
Rank
Member

I worked some code to detect the size of the cache on my 486.

For now I have been using the ctc timer to measure the amount of time it take to read X amount of memory but I have some issue on where the tick interrupt to update the RTC (when the ctc complete it's loop) seam to lag and so the RTC tick is not necessarily updated when I do a reading
So to get an appropriate measurement I have to loop the "read the memory" like 125 times to get a reliable results.

Is there a better way than using the CTC to get the proper cache size value
Else I will have to add some calibration code to check how much time I have to read the memory (lowest amount, 32KB) to get a reliable measurement instead of using the fix value of 125 (because while it work fine on my Cyrix 5x86, it will take too much time on slower machine and for them, a lower value would be fine)

Current test

cachetest.jpeg
Filename
cachetest.jpeg
File size
148.79 KiB
Views
130 views
File license
Public domain
Last edited by Rav on 2024-02-11, 02:34. Edited 1 time in total.

Reply 1 of 1, by Rav

User metadata
Rank Member
Rank
Member

I think I got something working now. Still using ctc timer channel 0 mode 2, but made a few change in the technique I was using to time that.
The time in the follow screenshot is the average time to read a 4KB block.

It should scale down with all other machines considering I have one of the fastest "486" option", I think (I assume it won't get slower than the 54.9254 ms limit of my timer accuracy (I don't use the RTC ticks anymore).

And it's a LOT faster now that I only do each test 5 times instead of... 125 times.

Edit : There is an error in the screenshot, theses are uS, not nS.
Edit 2 : Test was made with QEMM and a ton of TSR, when used with Himem instead (without EMS), it's quite more precise, like 124,125,125,125,164,169,169.

Test 2

cachetest2.jpeg
Filename
cachetest2.jpeg
File size
108.41 KiB
Views
102 views
File license
CC-BY-4.0