MiSTer-devel / ao486_MiSTer

ao486 port for MiSTer
Other
262 stars 69 forks source link

preset cpu speed option #123

Closed spark2k06 closed 1 year ago

spark2k06 commented 1 year ago

User @Newsdee has compiled a table of typical performance of different CPU models, based on the different CPU configurations and caches available on ao486:

https://misterfpga.org/viewtopic.php?p=65620#p65620

image

Lower speeds would already be better covered by the PCXT core, as it is a cycle-accurate core:

image

I think it would make it much easier for the ordinary user to select CPU speed using these presets, which is why I have made this pull request for your consideration.

Note that the selection of any preset will override any other setting, including syscfg. To keep them if it makes sense for advanced users, "CPU & Cache CFG" is set as the first option.

spark2k06 commented 1 year ago

Note that this is not intended to be an exact speed of these systems, as they depend on other factors, such as HDD speed among others... but rather, a reference for a basic user.

sorgelig commented 1 year ago

While from some point of view it may look good, i think it gives more obfuscation. 486 CPU core is not cycle exact, so i don't think it corresponds to named PCs. It may equal by some test bench, but in real apps it may vary quite a lot. Cache disabling greatly change the way CPU works with data. SX/DX names are not so applicable to this core as it always uses 32bit. So, overall, i don't think it's fair to put such CPU/PC names as presets don't really reflect them.

spark2k06 commented 1 year ago

It can be relabelled to somewhat more precise names, or put as "as ...", referring to the fact that it has similar performance (at the level of dhrystones at least).

In any case, the fact is that the way we have it now, CPU at 15,30, 45... MHz, doesn't reflect accuracy with anything either, the same as L1, L2 cache. At a basic user level this means nothing, it just makes it go slower/faster, it lacks a reference, even if it is approximate.

But obviously, the decision is yours :-)

sorgelig commented 1 year ago

first line in table: why 21427Dhr considered as slower than 486DX33 (16170Dhr)? I remember in Sysinfo speed was like DX50 or something like that.

spark2k06 commented 1 year ago

That table I think needs to be adjusted a bit better, it was prepared by @newsdee...I mention it to him to see if he can do a quick review of it.

sorgelig commented 1 year ago

it's still untrue.. Some instructions may run much faster than others. For example mul/div may be out of order. So depending on application instructions it may run either much faster than advertised rating or slower.

spark2k06 commented 1 year ago

And approximate? In a real environment, such instructions will be given intermittently - not continuously.

Newsdee commented 1 year ago

The top line has a mistake, I mixed up a line when checking reference benchmarks. I will fix it.

The approach here was to use a common benchmark tool (Checkit 3.0 Dhrystones) as a base for comparison. Many people have used this tool on real machines (and emulators) and posted results online, which were used to determine the closest match.

For sure this measurement does not capture all variables, but it is an objective and repeatable measurement using an existing tool.

Aitor's change is to allow users to select their desired performance more easily. It is often said that ao486 can cover many 286 and 386 setups with EGA and VGA, but it is not obvious what settings should be used for that.

Newsdee commented 1 year ago

Updated table consolidating PCXT results, the overclock mode, and added scores from TOPBENCH.

In some cases both TOPBENCH and CHECKIT agree (e.g. PS/2 386 SX 20) so that is a useful label to use. In other cases it's not that clear (e.g. slower modes reported as 486 DX/2 66Mhz) but I tried to give labels that give an approximate indication of relative performance between modes.

Overclock mode seems only useful in two cases, so I labeled them simply (386 and 486 overlock).

perf_ao486_v2

spark2k06 commented 1 year ago

Thank you for the update. The 100Mhz core case would only leave it for enabled caches, as it is now, and clearly indicating that it can be unstable...now it is set as "Unstable 100Mhz", and we can't exceed about 15 characters to fit on the OSD line.

Newsdee commented 1 year ago

The main issue we're trying to solve is this: often people talk about how ao486 is enough to run PC games from the AT era on-wards, but the settings we need to use are not obvious at all.

I've been testing with more benchmark tools (e.g. MIPS) and see that L1 and L2 cache can make a huge difference in performance, sometimes in non-intuitive ways. Also, it seems that disabling both caches is generally not to be recommended at all (we should use PCXT instead).

The choice of approximate machine could be reduced to the few cases that we think is consistent and make sense given all results we have.

Newsdee commented 1 year ago

perf_ao486_v4 More results using Chips & Technologies MIPS. Results vary wildly between cache options, and there even seems to be a bug where running 56Mhz with L1 on and L2 off gives similar results to an overclocked mode.

Newsdee commented 1 year ago

Some explanqtion for the latest change:

I tweaked settings to cover a wider area of performance, and relabeled items to show they are all the ao486 CPU with some rough equivalence to original setup.

I have been playing on the core with these and they are very useful to find the right speed for a game (since they are in order).

For example "Bouncing Babies" works only with the ao486 XT 7 setup, and "Bubble Ghost" with ao486 AT 8. A game like "Nicky Boom" is too fast at max speed but some of the intermediate choices work well.

I should add that indeed, there are some subtle differences in behavior between these so this is not a simple linear performance. But I picked entries that had the most solid results across various bench progtams, so users should be able to find one setting that suits them for all cases.

New menu is "CPU Preset":

User Defined (i.e. old style in Hardware menu) ao486 XT 7 ao486 AT 8 ao486 AT 10 ao486 AT 20 ao486 PS/2 20 ao486 3SX 25 ao486 3DX 33 ao486 3DX 40 ao486 4SX 33 ao486 MAX (stable) ao486 MAX (unstable)

sorgelig commented 1 year ago

what 3SX, 3DX ... means? do your mean SX3, DX3.. ? I think i can accept it in general. Please remove rbf from PR. I will add some changes as well.

spark2k06 commented 1 year ago

rbf removed

Newsdee commented 1 year ago

3SX is a shortcut for 386 sx, 3dx for 386 dx, etc The intention is to suggest the speed but without promising exact behavior (or exact speed) of the real CPU. I added "ao486" to also highlight we are using a clone CPU and not an exact 386/486 replica.

sorgelig commented 1 year ago

I've changed it to "386 SX" as 3SX is too cryptic to understand. I've added ~ in the front to give a hint of approximation.