Hybrid AO486 core?

User avatar
Caldor
Top Contributor
Posts: 930
Joined: Sat Jul 25, 2020 11:20 am
Has thanked: 112 times
Been thanked: 111 times

Hybrid AO486 core?

Unread post by Caldor »

The Minimig Amiga core is getting closer and closer to a stable and usable hybrid Amiga core. The idea is the same as the PiStorm for the Amiga 500 and soon A1200 as well. Its an adapter and some software for the Raspberri Pi that makes it fit into the CPU slot of the Amiga 500 and some other Amigas and then the Pi emulates the Amigas CPU, and only the CPU.

The advantage to get from this, is that it should not give the latency and timing problems emulation often has because those problems come from being unable to run everything in parallel like an FPGA can. But when its only the CPU that is being emulated, then the Amiga is capable of using the Pi and its emulated CPU in real time with the correct timings and the PiStorm now has enough power to rival the Vampire cards in speed and performance, while still running original Amiga CPUs like the 68000, 020, and 040. But also it adds FPU and RTG features to the Amiga. It gets all of its power from the Amiga CPU slot as well, so no need to add power for the Pi externally.

One downside it has is the CHIP RAM and its timings. That issue is being worked on, but not sure how that will be solved or if it will, but it seems like a minor issue really.

But the point of this post is that now something similar has been done for the Minimig core. It uses one of the MiSTer ARM CPU cores to emulate an 020 CPU with FPU. It seems to be testing as more than twice as fast as the Minimig 020 core, but I think what might be more relevant is that it also has FPU.

On the Amiga I would argue FPU never really got to be much of a thing, very few apps used it and native Amiga games did not use it either, it was mainly after Commodore was gone that we began seeing demos and ports of games that used FPU, but still awesome if we could get that to work. But on PC, it would make a HUGE difference if this solution could be implemented as I think it would enable us to get up to a 486DX with 66mhz instead of the current 486SX with 33mhz. The FPU would help get it to the DX part. A LOT of games has the 486DX with 66mhz as their minimum specs.

Problem is a developer is needed to make it happen. Not sure who would have the skills, time and enthusiasm for this to make this happen. Anyone have some ideas? I am a software developer myself, but I do not code hardware level stuff. I have tried a bit, and have not gotten even simple things to work yet when it comes to doing FPGA stuff. I do love help testing cores and such though and sometimes I make some software that can help with things, like converting files and maybe organizing stuff. I found a way to f.ex. search through DOS games that used DOS4GW to know if they might need DOS32A to help them run and what file to run DOS32A on.
User avatar
Chris23235
Top Contributor
Posts: 857
Joined: Sun May 24, 2020 8:45 pm
Has thanked: 112 times
Been thanked: 176 times

Re: Hybrid AO486 core?

Unread post by Chris23235 »

x86 emulation is much more demanding then 680x0 emulation. I am not sure if you would bet better results from the rather slow ARM CPU of the DE10 then you get from running the CPU on the FPGA.
User avatar
jlancaster86
Posts: 147
Joined: Sat Jun 27, 2020 1:33 pm
Has thanked: 129 times
Been thanked: 35 times

Re: Hybrid AO486 core?

Unread post by jlancaster86 »

Would it be possible to have a Raspberry Pi emulate just the CPU in software and have the MiSTer emulate everything else in hardware? I'm assuming there are I/O limitations preventing such a thing.
User avatar
Caldor
Top Contributor
Posts: 930
Joined: Sat Jul 25, 2020 11:20 am
Has thanked: 112 times
Been thanked: 111 times

Re: Hybrid AO486 core?

Unread post by Caldor »

jlancaster86 wrote: Mon Jan 17, 2022 10:54 am Would it be possible to have a Raspberry Pi emulate just the CPU in software and have the MiSTer emulate everything else in hardware? I'm assuming there are I/O limitations preventing such a thing.
This is a good point. Only with the Raspberry Pi 4, overclocked to... I think it was 2.2ghz, was I able to get it to emulate a PC that could run Windows 95, run Starcraft, Diablo 1 and such, and it was not at full speed either. But that was emulating the full PC and not just the CPU. So I am thinking much would be gained if it only emulates the CPU and hopefully also with JIT, if that is even a thing for x86 emulation. But that was using Bochs and there is also Box86, which might be a more relevant option here:
https://github.com/ptitSeb/box86
Chris23235 wrote: Mon Jan 17, 2022 9:10 am x86 emulation is much more demanding then 680x0 emulation. I am not sure if you would bet better results from the rather slow ARM CPU of the DE10 then you get from running the CPU on the FPGA.
I have been thinking about this myself. I am thinking it might even be possible to use something like the PiStorm adapter, but just directly from the Pi into the socket used for SD RAM or the analog IO expansion board. But there is a good chance the bandwidth will not be enough.

I recently again replaced my analog IO board with a 128MB SD RAM module to run the PSX core and test its audio. Yesterday even. And pins is this compared to the connection a Pi uses for the GPIO?

From what I can tell, the MiSTer has 40 pins and considered the two SD RAM options, that must be what adds up to two GPIOs? On the Pi there is also 40 pin GPIO. But I am guessing its not as simple as the number of pins.

Maybe a Pi attacked to the GPIOs could be used, having several different partitions on it and the MiSTer could make it boot different partitions depending on what cores and options it would run. The Pi could probably also do PiMidi stuff more directly that way. One problem I am seeing is that I do not think the DE10 Nano could actually power the Pi through the GPIO alone, like the PiStorm powers the Pi f.ex.
softtest9
Posts: 158
Joined: Thu May 28, 2020 7:13 pm
Has thanked: 3 times
Been thanked: 21 times

Re: Hybrid AO486 core?

Unread post by softtest9 »

x86 emulation is still quite flaky. PCem will fluctuate between 30% and 100% speed regularly, even when emulating CPUs that are seemingly not so demanding. QEMU will try to emulate the CPU as fast as possible at all times and you can't limit the speed at all, which also isn't great.

The emulator that has the most stable performance is probably DOSBox-X, but the CPU emulation there isn't particularly accurate. It may or may not work.
User avatar
Caldor
Top Contributor
Posts: 930
Joined: Sat Jul 25, 2020 11:20 am
Has thanked: 112 times
Been thanked: 111 times

Re: Hybrid AO486 core?

Unread post by Caldor »

softtest9 wrote: Mon Jan 17, 2022 2:31 pm x86 emulation is still quite flaky. PCem will fluctuate between 30% and 100% speed regularly, even when emulating CPUs that are seemingly not so demanding. QEMU will try to emulate the CPU as fast as possible at all times and you can't limit the speed at all, which also isn't great.

The emulator that has the most stable performance is probably DOSBox-X, but the CPU emulation there isn't particularly accurate. It may or may not work.
Yeah, and this is a real problem... and also part of why I hope to see this being worked on. Box86 might help I think. Box86 is a wrapper instead of an emulator, or maybe its both. So its a bit like Wine, but instead of making Windows stuff run on Linux, it makes x86 stuff run on ARM. It maps calls directly from x86 to ARM if I understand it correctly.

But... I am guessing it wont just work for this purpose though. But if Box86 could be used to make the ARM CPU act as an x86 CPU for the AO486 core, it seems like a lot could be gained from it. I do agree that the options do not seem great. Currently QEMU is what has had the best result so far for the hybrid Amiga core.
foft
Posts: 334
Joined: Thu Dec 03, 2020 11:05 am
Has thanked: 29 times
Been thanked: 120 times

Re: Hybrid AO486 core?

Unread post by foft »

Regarding connecting a pi:
36 pins/header on the DE10 nano
https://rocketboards.org/foswiki/pub/Do ... 1486406248
With 36 pins, say 32 bits data at 100MHz: 400MB/s shouldn't be an issues from the DE10 side, or 800MB/s if using both edges.
This might be little trickier to achieve on the pi end, I read some comments on getting >50MHz but not sure how many bits!
akeley
Top Contributor
Posts: 1309
Joined: Mon May 25, 2020 7:54 pm
Has thanked: 423 times
Been thanked: 409 times

Re: Hybrid AO486 core?

Unread post by akeley »

Personally I'd rather see efforts being directed inward than outward, meaning improving the compatibility and functionality for the 286/386/486SX era. The core is great as it is but far from perfect.
Neocaron
Posts: 350
Joined: Sun Sep 27, 2020 10:16 am
Has thanked: 189 times
Been thanked: 71 times

Re: Hybrid AO486 core?

Unread post by Neocaron »

I hope this happened! I'd be ok with an overcharge A0486 with FPU and sound on the FPGA and the MAin CPU on the ARM. ^^
If this pans out, we would have more knowledge about what's possible next. The Amiga hybrid emulation is not close to the finish line, but it proves that it works, we just need to see how far it can be pushed. Can the Arm chip in the DE-10 be overclocked by the way?
User avatar
kathleen
Top Contributor
Posts: 414
Joined: Fri Jun 26, 2020 4:23 am
Location: Belgium
Has thanked: 226 times
Been thanked: 134 times

Re: Hybrid AO486 core?

Unread post by kathleen »

akeley wrote: Mon Jan 17, 2022 3:53 pm Personally I'd rather see efforts being directed inward than outward, meaning improving the compatibility and functionality for the 286/386/486SX era. The core is great as it is but far from perfect.
This is also something more important from my point of view, I mean, improve the compatibility with what the current core can achieve, to me a perfect world would be a 8088-4.77Mhz till 486SX (assuming this is the maximum achievable w/o an hybrid solution). With CGA, EGA, Hercules, MDA & VGA of course. Maybe split in several cores one for XT era, one for AT 286, one for AT 386 & 486. I'd prefer for instance to have a XT8088 capable of running apps and games which were designed for before increasing the speed of the existing 486.

I have another vision for the Minimig core because, to me, this one is much more mature and now it makes sense to look at speed improvement but for the AO486 it is a bit to early.

But this also depends of what the users want to do with the system simulated.

かすりん

cursedverses
Posts: 156
Joined: Sun May 24, 2020 9:13 pm
Has thanked: 155 times
Been thanked: 21 times

Re: Hybrid AO486 core?

Unread post by cursedverses »

I personally wonder if hybrid could be used to say, emulate an FPU for the existing on-FPGA processor.
HarborSeal
Posts: 42
Joined: Sun Jul 12, 2020 6:54 am
Has thanked: 34 times
Been thanked: 14 times

Re: Hybrid AO486 core?

Unread post by HarborSeal »

I'd rather have improved compatibility and functionality. 486 bridges the gap between games from the 80's to games from the mid-90's. There are plenty of DOS games that don't function properly with the current core.

That being said, if anybody is considering a hybrid solution to emulate the CPU, I suggest taking a look at the Rock Pi X. Unlike the Raspberry Pi, it's an x86 based SoC. So it may be possible to use PCEm. It also has a 40 pin GPIO connector.
kalach.x
Posts: 54
Joined: Thu Dec 02, 2021 3:12 pm
Has thanked: 17 times
Been thanked: 22 times

Re: Hybrid AO486 core?

Unread post by kalach.x »

@Caldor
To know if the idea of running X86 emulation on Mister's ARM is even viable or not it would be helpful if we had benchmarks numbers from available emulation solutions like QEMU running on Mister's ARM CPU vs Ao486 with fastest settings.

Can you execute such tests?
User avatar
Caldor
Top Contributor
Posts: 930
Joined: Sat Jul 25, 2020 11:20 am
Has thanked: 112 times
Been thanked: 111 times

Re: Hybrid AO486 core?

Unread post by Caldor »

HarborSeal wrote: Mon Jan 17, 2022 4:38 pm I'd rather have improved compatibility and functionality. 486 bridges the gap between games from the 80's to games from the mid-90's. There are plenty of DOS games that don't function properly with the current core.

That being said, if anybody is considering a hybrid solution to emulate the CPU, I suggest taking a look at the Rock Pi X. Unlike the Raspberry Pi, it's an x86 based SoC. So it may be possible to use PCEm. It also has a 40 pin GPIO connector.
So far DOS games in general seem to work great with this core. Generally the problem is DOS4GW which is often fixed by switching to DOS32A. What games do you have trouble with?
kalach.x wrote: Mon Jan 17, 2022 5:22 pm @Caldor
To know if the idea of running X86 emulation on Mister's ARM is even viable or not it would be helpful if we had benchmarks numbers from available emulation solutions like QEMU running on Mister's ARM CPU vs Ao486 with fastest settings.

Can you execute such tests?
That is a good idea... maybe I could do that. Well, not sure I could do tests that could match the two, but I think the most relevant is to see what performance it could get in a test. If it could emulate an x86 CPU without also doing GPU, sound and such, then that should give a pretty good indication of what it could do.

I will read up some more on the QEMU documentation. I might also be able to use that knowledge to make some alternative Amiga CPUs for the Hybrid core.
User avatar
Caldor
Top Contributor
Posts: 930
Joined: Sat Jul 25, 2020 11:20 am
Has thanked: 112 times
Been thanked: 111 times

Re: Hybrid AO486 core?

Unread post by Caldor »

akeley wrote: Mon Jan 17, 2022 3:53 pm Personally I'd rather see efforts being directed inward than outward, meaning improving the compatibility and functionality for the 286/386/486SX era. The core is great as it is but far from perfect.
Sure, but one does not stop the other. I also do think it would be nice to see different CPU types supported. There are also a lot of memory issues, more than just the "game did not expect there to ever be more than 16MB RAM". But often they are solved by using DOS32A instead of DOS4GW in my experience.
cursedverses wrote: Mon Jan 17, 2022 4:20 pm I personally wonder if hybrid could be used to say, emulate an FPU for the existing on-FPGA processor.
I have been considering this as well. But I think it might cause latency issues or something. The CPU being done on the FPGA and then having to communicate with the ARM to do FPU stuff that would normally be integrated into the CPU. I think that might be a problem as it was something that expected minimal latency and response time. Another thing is that the FPU with the current speed would not make much sense. Would be nice, but generally the software the wants FPU also wants something more like a 66mhz 486 or better instead of a 33mhz.
HarborSeal
Posts: 42
Joined: Sun Jul 12, 2020 6:54 am
Has thanked: 34 times
Been thanked: 14 times

Re: Hybrid AO486 core?

Unread post by HarborSeal »

Caldor wrote: Mon Jan 17, 2022 5:46 pm So far DOS games in general seem to work great with this core. Generally the problem is DOS4GW which is often fixed by switching to DOS32A. What games do you have trouble with?
A short list.

Secret of Monkey Island and Monkey Island 2 Ultimate talkie editions - Forum member user7182 was able to fix this, but so far there hasn't been a pull request.
The Lost Files of Sherlock Holmes: The Case of the Serrated Scalpel - Mouse and keyboard don't work when the game starts.
Gateway - MT-32 Pi doesn't work correctly.
Full Throttle - The version included in the Top 300, mouse cursor is too slow with my mouse. The mouse throttling feature in the MiSTer INI only slows down mouse speed. It doesn't speed it up.

If you parse through the Top 300 pack you'll see red markers next to games that have issues.

I agree, in general, that DOS games seem to work well, but compatibility is not nearly as good as DosBox. In contrast, compatibility of the SNES, Genesis, NES, and other console cores tends to be as good if not better than software emulators.
kalach.x
Posts: 54
Joined: Thu Dec 02, 2021 3:12 pm
Has thanked: 17 times
Been thanked: 22 times

Re: Hybrid AO486 core?

Unread post by kalach.x »

Caldor wrote: Mon Jan 17, 2022 5:46 pmIf it could emulate an x86 CPU without also doing GPU, sound and such, then that should give a pretty good indication of what it could do.
Sound is irrelevant because it is not needed to emulate sound. Well, except PC beeper. Only with PC Bleeping Bleeper we are talking IBM PC :lol:
VGA is pretty much simple framebuffer with few counters, also not very taxing and not relevant. We are talking simple computers here and not Amiga.

You need excess of processing power to make up for all the waiting high latency of solutions like hybrid CPU bring to the table. If it can run say 10x faster than Ao486 runs currently at 90/100MHz then it might be doable to use such emulation and even benefit from it. Though it would need to be made much better than what Hybrid CPU POC for Amiga shows so far. To be fair, it is amazing it works at all but sounds like it is far from being done correctly.
kalach.x
Posts: 54
Joined: Thu Dec 02, 2021 3:12 pm
Has thanked: 17 times
Been thanked: 22 times

Re: Hybrid AO486 core?

Unread post by kalach.x »

Caldor wrote: Mon Jan 17, 2022 5:54 pm instead of a 33mhz.
Where did you get this "33MHz" figure from? :shock:
User avatar
Caldor
Top Contributor
Posts: 930
Joined: Sat Jul 25, 2020 11:20 am
Has thanked: 112 times
Been thanked: 111 times

Re: Hybrid AO486 core?

Unread post by Caldor »

kalach.x wrote: Mon Jan 17, 2022 7:19 pm
Caldor wrote: Mon Jan 17, 2022 5:54 pm instead of a 33mhz.
Where did you get this "33MHz" figure from? :shock:
That is what the AO486 core performs as, a 486SX with 33mhz. In some tests it performs a bit better, but looking at actual performance, the games and such, and overall performance tests, the core now runs as a 33mhz 486, which it does thanks to the 2 layers of CPU cache that got added to the core over a year ago. Before that it could not even run Doom at more than 5 fps, and it was probably less.
kalach.x wrote: Mon Jan 17, 2022 7:17 pm
Caldor wrote: Mon Jan 17, 2022 5:46 pmIf it could emulate an x86 CPU without also doing GPU, sound and such, then that should give a pretty good indication of what it could do.
Sound is irrelevant because it is not needed to emulate sound. Well, except PC beeper. Only with PC Bleeping Bleeper we are talking IBM PC :lol:
VGA is pretty much simple framebuffer with few counters, also not very taxing and not relevant. We are talking simple computers here and not Amiga.

You need excess of processing power to make up for all the waiting high latency of solutions like hybrid CPU bring to the table. If it can run say 10x faster than Ao486 runs currently at 90/100MHz then it might be doable to use such emulation and even benefit from it. Though it would need to be made much better than what Hybrid CPU POC for Amiga shows so far. To be fair, it is amazing it works at all but sounds like it is far from being done correctly.
That is the whole point... its not always possible to emulate less than the full system, so having it emulate sound and such would make for a bad test.

Also the AO486 does not run at 90/100mhz as I just explained. That is what it shows.. not exactly sure why they call it 90 or 100mhz, I guess that is how the core sees it. But it said that before it was even able to run Doom. Only after it got level 1 and 2 cache added to the CPU was it able to reach its current performance.
softtest9
Posts: 158
Joined: Thu May 28, 2020 7:13 pm
Has thanked: 3 times
Been thanked: 21 times

Re: Hybrid AO486 core?

Unread post by softtest9 »

Caldor wrote: Mon Jan 17, 2022 3:35 pm Yeah, and this is a real problem... and also part of why I hope to see this being worked on. Box86 might help I think. Box86 is a wrapper instead of an emulator, or maybe its both. So its a bit like Wine, but instead of making Windows stuff run on Linux, it makes x86 stuff run on ARM. It maps calls directly from x86 to ARM if I understand it correctly.
What Box86 does to try to make games fast, is it detects and substitutes Linux userspace libraries, including SDL and OpenGL, with native ARM versions. So basically, faster "emulation speed" by avoiding emulation altogether. It's a pretty cool project, but I don't see how it could help ao486 at all. You would have to rewrite whatever libraries that DOS games use, into native ARM versions, and also port DOS to ARM.
kalach.x
Posts: 54
Joined: Thu Dec 02, 2021 3:12 pm
Has thanked: 17 times
Been thanked: 22 times

Re: Hybrid AO486 core?

Unread post by kalach.x »

According to this result page https://docs.google.com/spreadsheets/d/ ... edit#gid=0 Ao486's results of 43.8 in 3dbench2 and 3565 real-ticks in Doom put its performance on par with 486DX2 66MHz
On top of that Doom runs pretty much the same as in this video https://youtu.be/cKwnuwDcfcI?t=486 and not like on 486SX 33MHz

Personally I am not convinced hybrid emulation could even get to this level of performance. Maybe with good emulators. With actually good implementation of hybrid CPU it should be faster (though how much I am not sure) but we are not talking about good implementation if we are talking about replacing low latency CPU with high latency emulated CPU : )

Why they say it is 90/100MHz?
Didn't it occur to you that Ao486 CPU in Ao486 core runs at actual real genuine 90MHz?
dmckean
Posts: 307
Joined: Sat Jan 16, 2021 7:03 am
Has thanked: 388 times
Been thanked: 95 times

Re: Hybrid AO486 core?

Unread post by dmckean »

The Bochs IA-32 implementation that ao486 uses will never achieve the performance or compatibility of genuine Intel hardware. It suffers from the same incompatibilities that clone hardware of the time (Cyrix, Transmeta, etc) suffered from.

Performance of ao486 is all over the place depending on what you're running. I'm also pretty sure the Top 300 pack is using fastdoom to achieve decent performance.
ToothbrushThreepwood
Posts: 89
Joined: Sun May 24, 2020 8:39 pm
Has thanked: 30 times
Been thanked: 32 times

Re: Hybrid AO486 core?

Unread post by ToothbrushThreepwood »

kalach.x wrote: Mon Jan 17, 2022 10:39 pm According to this result page https://docs.google.com/spreadsheets/d/ ... edit#gid=0 Ao486's results of 43.8 in 3dbench2 and 3565 real-ticks in Doom put its performance on par with 486DX2 66MHz
On top of that Doom runs pretty much the same as in this video https://youtu.be/cKwnuwDcfcI?t=486 and not like on 486SX 33MHz

Personally I am not convinced hybrid emulation could even get to this level of performance. Maybe with good emulators. With actually good implementation of hybrid CPU it should be faster (though how much I am not sure) but we are not talking about good implementation if we are talking about replacing low latency CPU with high latency emulated CPU : )

Why they say it is 90/100MHz?
Didn't it occur to you that Ao486 CPU in Ao486 core runs at actual real genuine 90MHz?
The FPGA CPU runs at that clock frequency, but the Bochs cpu is not cycle-accurate or optimized at all, and some instructions may take several times as many cycles to execute compared to original hardware, so it makes little sense to compare that clock speed to that of real x86 hardware.
In addition to the funky CPU, the performance of the ao486 core is also inconsistent compared to real hardware, because it’s cache and memory is so different from what was available back in the day.
bbond007
Top Contributor
Posts: 521
Joined: Tue May 26, 2020 5:06 am
Has thanked: 86 times
Been thanked: 204 times

Re: Hybrid AO486 core?

Unread post by bbond007 »

kalach.x wrote: Mon Jan 17, 2022 7:19 pm
Caldor wrote: Mon Jan 17, 2022 5:54 pm instead of a 33mhz.
Where did you get this "33MHz" figure from? :shock:
I think the actual performance is closer to a i486SX2 @ 50mhz - although the VGA speed is extremely fast.

I would agree its not as fast as a 90mhz 486 would perform.

A few years ago I did compile DosBox for the MiSTer HPS. I did not enable JIT as my goal was to run a few games in Tandy gfx mode and the speed without JIT was good enough for my purpose.

Perhaps this gives a rough estimation of what kind of CPU performance one would expect with they hybrid approach?

Landmark - this one fluctuates a little between 46-47mhz - occasionally up to 50. I if these results are true the FPU shows promise at least.
DosBOX-MiSTer-Landmark.png
DosBOX-MiSTer-Landmark.png (372.57 KiB) Viewed 17826 times
Norton SI - nothing to see here - pretty slow...
DosBOX-MiSTer-SI.png
DosBOX-MiSTer-SI.png (337.27 KiB) Viewed 17838 times
Topbench - This one is erratic as it bounces around between a 33mhz system up to 66mhz.
DosBOX-MiSTer-TopBench.png
DosBOX-MiSTer-TopBench.png (379.63 KiB) Viewed 17838 times
Superscape is probably totally irrelevant(as its more a video test), but I included it anyway :) runs smooth at least...
DosBOX-MiSTer-Superscape.png
DosBOX-MiSTer-Superscape.png (353.12 KiB) Viewed 17838 times
H6rdc0re
Posts: 52
Joined: Sat Feb 06, 2021 11:35 pm
Has thanked: 1 time
Been thanked: 9 times

Re: Hybrid AO486 core?

Unread post by H6rdc0re »

Would it be possible to connect a Raspberry Pi Zero 2 W to the Mister in order to do all the CPU emulation? The Raspberry Pi Zero 2 W is very cheap ($15) and a quad core A53 @1GHz should be able to run CPU code very quickly allowing for Pentium era emulation. Leaving the Cyclone V for GPU + Sound emulation alone. Imagine a Pentium MMX + Voodoo 1 + SB16 core.
User avatar
Caldor
Top Contributor
Posts: 930
Joined: Sat Jul 25, 2020 11:20 am
Has thanked: 112 times
Been thanked: 111 times

Re: Hybrid AO486 core?

Unread post by Caldor »

softtest9 wrote: Mon Jan 17, 2022 10:28 pm
Caldor wrote: Mon Jan 17, 2022 3:35 pm Yeah, and this is a real problem... and also part of why I hope to see this being worked on. Box86 might help I think. Box86 is a wrapper instead of an emulator, or maybe its both. So its a bit like Wine, but instead of making Windows stuff run on Linux, it makes x86 stuff run on ARM. It maps calls directly from x86 to ARM if I understand it correctly.
What Box86 does to try to make games fast, is it detects and substitutes Linux userspace libraries, including SDL and OpenGL, with native ARM versions. So basically, faster "emulation speed" by avoiding emulation altogether. It's a pretty cool project, but I don't see how it could help ao486 at all. You would have to rewrite whatever libraries that DOS games use, into native ARM versions, and also port DOS to ARM.
Yes, that makes sense. I am thinking there must be some overlap, but I had not really considered the DOS library calls would have to be replaced for Box86 to make sense. QEMU already does something similar to Box86, it does try to translate x86 to ARM and back, but just not with as many libraries and such as Box86, that seems to be the main difference. There is a version of Qemu though that also translates 3DFx, which is interesting I think.
bbond007 wrote: Tue Jan 18, 2022 2:14 amI think the actual performance is closer to a i486SX2 @ 50mhz - although the VGA speed is extremely fast.

I would agree its not as fast as a 90mhz 486 would perform.

A few years ago I did compile DosBox for the MiSTer HPS. I did not enable JIT as my goal was to run a few games in Tandy gfx mode and the speed without JIT was good enough for my purpose.
When it comes to games performance, I was surprised how good Descent 1 runs, but then I found it does have a recommended spec of 486SX 33mhz. I guess maybe Duke Nukem 3D is one game that shows it performs better than a regular 33mhz.

But from these DOSBox benchmarks, it seems that even without JIT it can perform at 50mhz? Seems like a good chance of getting it to perform even better, so 66mhz might very well be within reach... although as Kalach.X points out, there might be other bottlenecks when it comes to hybrid emulation.
H6rdc0re wrote: Tue Jan 18, 2022 2:28 am Would it be possible to connect a Raspberry Pi Zero 2 W to the Mister in order to do all the CPU emulation? The Raspberry Pi Zero 2 W is very cheap ($15) and a quad core A53 @1GHz should be able to run CPU code very quickly allowing for Pentium era emulation. Leaving the Cyclone V for GPU + Sound emulation alone. Imagine a Pentium MMX + Voodoo 1 + SB16 core.
I have begun looking into this a bit... and the DE10-Nano does have two GPIO connectors with 40 pints, which the Pi generally has one of, the Pi Zero 2 also has those. If there could be made support, a bit similar to how PiStorm works, but between the MiSTer and a Raspberry Pi, then I think this could work. But would require a lot of work I think. Also it would replace either the SD RAM or the IO board. Pretty sure the full 40 pins would be needed to make this work. Also there might be a bandwidth issue as I think the two GPIO on the MiSTer might share the same BUS and therefore the same bandwidth. I am not that knowledgeable about the hardware specifics though.

A big benefit with the Pi is that many of these emulation projects have already been designed for the Pi so that part should require less work, on the other hand, its only the Emu68 / PiStorm project that is making the Pi use the GPIO and an adapter to connect as a CPU, so that would have to be done with QEMU, Box86, Bochs or some other x86 emulation solution.

If first this is possible to do, I am thinking it might open the door to many things though, having extra processing power in the Pi, extra IO and so on. But overall, it would probably be simpler to go the way of the Hybrid Amiga, and do it on the MiSTer itself. I guess it has to be taken into account that BBonds DOSBox tests were done using both ARM CPU cores without them doing anything else, like they currently are for MiSTer cores in general.

On the MiSTer hybrid core, it even makes a difference whether high USB polling is enabled or not on the performance, so the second CPU core is already being used to some extend.
kalach.x
Posts: 54
Joined: Thu Dec 02, 2021 3:12 pm
Has thanked: 17 times
Been thanked: 22 times

Re: Hybrid AO486 core?

Unread post by kalach.x »

We need better x86 CPU in FPGA and not some flaky hybrid CPU solutions
Connecting Pi to Mi? Why not connect monitor and input devices to Pi directly and enjoy superior performance right away?
ToothbrushThreepwood
Posts: 89
Joined: Sun May 24, 2020 8:39 pm
Has thanked: 30 times
Been thanked: 32 times

Re: Hybrid AO486 core?

Unread post by ToothbrushThreepwood »

kalach.x wrote: Tue Jan 18, 2022 10:55 am We need better x86 CPU in FPGA and not some flaky hybrid CPU solutions
Connecting Pi to Mi? Why not connect monitor and input devices to Pi directly and enjoy superior performance right away?
It would take a masochist and genius of epic scale (hello Sorg and FPGAzumSpaß!) or an open release from Intel to implement a cycle-accurate x86 from even the earliest generations, nevermind a 486.
There has been some FPGA implementations of x86 in academia, either from people interning at Intel or getting hired by Intel straight after their PhD. None of the code is public though, but Henry Wong does describe his design in some detail, so go ahead:
Paper: https://www.eecg.utoronto.ca/~jayar/pub ... rets16.pdf
Youtube: https://www.youtube.com/watch?v=vhHR6fNHyG8
Slideshow: https://web.stanford.edu/class/ee380/Ab ... slides.pdf
Thesis: https://tspace.library.utoronto.ca/bits ... thesis.pdf
User avatar
Caldor
Top Contributor
Posts: 930
Joined: Sat Jul 25, 2020 11:20 am
Has thanked: 112 times
Been thanked: 111 times

Re: Hybrid AO486 core?

Unread post by Caldor »

kalach.x wrote: Tue Jan 18, 2022 10:55 am We need better x86 CPU in FPGA and not some flaky hybrid CPU solutions
Connecting Pi to Mi? Why not connect monitor and input devices to Pi directly and enjoy superior performance right away?
You keep claiming they would be flaky... have you seen what PiStorm can do? Its not exactly flaky. Why not use the Pi directly? Again, look at PiStorm. Best of both worlds. The Pi gets to focus on one task, the MiSTer on the rest. The problem with emulation in general is that it does not run in parallel, so having to emulate several different chips, the CPU, GPU, sound card, motherboard and so on, is why emulation often has timing issues. But if the emulation only focuses on the CPU and the FPGA based chipset then uses that CPU, it should all be "cycle exact" because the rest of the chipset communicates with that Pi or ARM core emulated x86 CPU.

Not sure why you think a hybrid CPU would somehow stop better FPGA CPUs. Its not one or the other. At any rate, it does not seem especially productive that you come with arguments against it overall. Its not like there is an alternative where we get a faster CPU done in FPGA as it is now. Everything points to the AO486 core having reached its limit. You can keep using the 33mhz CPU for as long as you want, it wont be replaced by this if it ever happens.
Bas
Top Contributor
Posts: 547
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 69 times
Been thanked: 251 times

Re: Hybrid AO486 core?

Unread post by Bas »

Is something like a 286 so much more complex than an 68000 that it'd take an epic genius to implement? I'd guess it would be mostly pointless to create an exact clone of such a CPU in FPGA because hardly any software would rely on exact instruction timing for these platforms anyway. This is quite different from things like the 6502 where entire software ecosystems were built around one exact version of a CPU. In PC-land that simply didn't happen past the XT era.
Post Reply