Lets actually try Hybrid Emulation

foft
Posts: 334
Joined: Thu Dec 03, 2020 11:05 am
Has thanked: 29 times
Been thanked: 120 times

Re: Lets actually try Hybrid Emulation

Unread post by foft »

Interesting. This is an advantage we have in the fpga, we can snoop Amiga dma writes.

On Amiga it sounds like data cache is disabled on chip ram - according to Gunnar here: http://www.apollo-core.com/knowledge.ph ... 5&z=-AGF3K

We already effectively have instruction cache since qemu compiles the instructions and caches them.

So.... back to the other questions, why is disk access slow? Interrupt latency? More data and code sharing pages?
Oh and what did I do wrong with rtg...
foft
Posts: 334
Joined: Thu Dec 03, 2020 11:05 am
Has thanked: 29 times
Been thanked: 120 times

Re: Lets actually try Hybrid Emulation

Unread post by foft »

So rtg... With the official 20210305 it works. With my own unmodified build it failed. So perhaps the git code was bad for a few days, trying a clean version.
foft
Posts: 334
Joined: Thu Dec 03, 2020 11:05 am
Has thanked: 29 times
Been thanked: 120 times

Re: Lets actually try Hybrid Emulation

Unread post by foft »

foft wrote: Sat May 22, 2021 12:19 pm So rtg... With the official 20210305 it works. With my own unmodified build it failed. So perhaps the git code was bad for a few days, trying a clean version.
Confirmed that RTG doesn't work on a clean checkout. Perhaps because I'm using Quartus 20.1.1. So something else to look into before I try the hybrid one.

Actually I realize that I have 17.0 installed too, so will check with that!
User avatar
Caldor
Top Contributor
Posts: 930
Joined: Sat Jul 25, 2020 11:20 am
Has thanked: 112 times
Been thanked: 111 times

Re: Lets actually try Hybrid Emulation

Unread post by Caldor »

I have Quartus installed as well, so I can help compile a core if needed, but I will have to check what version of Quartus it is I have installed. I think it might be 17.
foft
Posts: 334
Joined: Thu Dec 03, 2020 11:05 am
Has thanked: 29 times
Been thanked: 120 times

Re: Lets actually try Hybrid Emulation

Unread post by foft »

I built it with Quartus 17 and ... it didn't work. Then I went back to the core that worked before and it stopped working! So not sure what is going on, perhaps related to using VGA instead of HDMI. I'll plug in my HDMI monitor next time I take a look (probably a couple of weeks, busy with other stuff...).
User avatar
Caldor
Top Contributor
Posts: 930
Joined: Sat Jul 25, 2020 11:20 am
Has thanked: 112 times
Been thanked: 111 times

Re: Lets actually try Hybrid Emulation

Unread post by Caldor »

I have been playing around with the Test 9 of this and it does seem more stable. Still cannot boot SysInfo 4.3 or 4.4 directly but I tried booting into AmigaOS 3.1.4 using the HDF you shared earlier, which I suppose has a better supported 040 library, and from there I could run SysInfo 4.4 directly. Shows the same score as Sysinfo 3.24, except now it shows MMU and FPU as being in use.

The speed also seems to be pretty much the same as the regular Minimig running with the 020 core. I tried running some games. I ran Dungeon Master, and it had some audio errors, but it ran at a pretty good speed, but eventually it crashed. Froze I think. I tried Scorched Earth 1.8 and it shows some of the first screens, then before reaching the main game screen it encounters an IO error. I tried Eye of the Beholder AGA, and the intro was pretty slow. The music and audio overall seemed to work well though. No missing sounds like in Castle Master. When the game was fully loaded it seemed to work. I could even load a game and save the game, I suspected maybe it had issues writing data to disk. But before I could exit the game it froze.

Given the Amiga system has pretty good performance in tests, but sometimes runs very slowly compared to even an Amiga 500, I suspect it has a bottleneck somewhere, possibly when sending data between QEMU and the MiSTer core on the FPGA? I hope its something that can be helped by increasing a cache somewhere or something.

But I am thinking maybe its best to first focus on an 020 CPU which seems less likely to run into FPU and MMU problems, and problems with being a 040 CPU needing 040 libraries when the core otherwise seems to expect an 020 CPU? The ultimate goal, would be to get support for MMU and FPU of course, but I think it would probably be easier to debug this solution and its performance and stability, with an 020 CPU, which would make it more directly comparable with the regular MiSTer core as well. Also if its the PiStorm QEMU software that is being used here, I hear they have only gotten a stable 020 core there as well.

Oh yeah, I also tried AmigaOS 3.2, it has a special disk with generic CPU libraries, but it did not seem to work. I have not tried the 040 libraries from the 3.1.4 HDF that can boot, but I figured I might as well wait and see if what the next release of this has to offer.
kolla
Posts: 188
Joined: Sat Jun 13, 2020 7:56 am
Has thanked: 17 times
Been thanked: 33 times

Re: Lets actually try Hybrid Emulation

Unread post by kolla »

I read in PiStorm updates about improved Musashi (20-30%)
I suspect the improvements are only in the pistorm git repo, and not gone upstream.

https://github.com/captain-amygdala/pis ... mmits/main

Did anyone build for Minimig_hybrid yet? :)
foft
Posts: 334
Joined: Thu Dec 03, 2020 11:05 am
Has thanked: 29 times
Been thanked: 120 times

Re: Lets actually try Hybrid Emulation

Unread post by foft »

I did try the musashi from pistorm earlier in the thread, are there are more recent changes?

I should upload my last changes to the kernel module and stuff.

While I've been doing other projects, has anyone been trying to improve this? I'll be back to it in a few weeks I reckon.
kolla
Posts: 188
Joined: Sat Jun 13, 2020 7:56 am
Has thanked: 17 times
Been thanked: 33 times

Re: Lets actually try Hybrid Emulation

Unread post by kolla »

We’re all eagerly awaiting your return, hehe ;)
User avatar
LamerDeluxe
Top Contributor
Posts: 1160
Joined: Sun May 24, 2020 10:25 pm
Has thanked: 798 times
Been thanked: 257 times

Re: Lets actually try Hybrid Emulation

Unread post by LamerDeluxe »

Yes, what a cliffhanger :)
lordoftime79
Posts: 97
Joined: Sun Feb 14, 2021 6:29 pm
Has thanked: 1 time
Been thanked: 2 times

Re: Lets actually try Hybrid Emulation

Unread post by lordoftime79 »

I am using the pistorm configured as 040 and its pretty fast - really would love to see this on mister too
Neocaron
Posts: 341
Joined: Sun Sep 27, 2020 10:16 am
Has thanked: 187 times
Been thanked: 66 times

Re: Lets actually try Hybrid Emulation

Unread post by Neocaron »

foft wrote: Fri Jun 25, 2021 12:04 pm I did try the musashi from pistorm earlier in the thread, are there are more recent changes?

I should upload my last changes to the kernel module and stuff.

While I've been doing other projects, has anyone been trying to improve this? I'll be back to it in a few weeks I reckon.
You're the one holding the keys to that fort I reckon. Can't wait to see you back at it! :D
User avatar
LamerDeluxe
Top Contributor
Posts: 1160
Joined: Sun May 24, 2020 10:25 pm
Has thanked: 798 times
Been thanked: 257 times

Re: Lets actually try Hybrid Emulation

Unread post by LamerDeluxe »

Same. I really liked following the progression on this.
lordoftime79
Posts: 97
Joined: Sun Feb 14, 2021 6:29 pm
Has thanked: 1 time
Been thanked: 2 times

Re: Lets actually try Hybrid Emulation

Unread post by lordoftime79 »

Has any progress been made on this? All seems quiet :(
User avatar
Caldor
Top Contributor
Posts: 930
Joined: Sat Jul 25, 2020 11:20 am
Has thanked: 112 times
Been thanked: 111 times

Re: Lets actually try Hybrid Emulation

Unread post by Caldor »

Some PiStorm news, which is probably relevant for this project as PiStorm was the inspiriation:
https://www.patreon.com/posts/54448728

Turns out only patreons can see the post, I thought it was public.

Part of the article:
I have updated CMake file to include the PiStorm variant, hacked some of my sources here and there, removed MMU map of the RAM at the lowest 16 megabytes. Then I have adjusted page fault handler to catch this accesses and pass them through to the CPLD. I have put my RasPi4 on the PiStorm, started first bits and pieces of code, and nothing happened. Not a single sign of life.

Well, lesson learned was, PiStorm is not ready for RasPi4 yet. It will be, but right now the suggested hardware is Pi3. I took it then, double-checked everything and powered the A500 again. This time a bit more happened, but the serial console was not really readable. Pure trash. Well, my fault. I forgot how to talk with amiga hardware on low level. I was reading the SERDAT register but I was not allowed to. Instead, for all serial port shifter status I should have read SERDATR instead. Once I have fixed it, Emu68 started to talk! Think about it. Emu68, 64-bit big endian AARCH64 code running on RasPi3, talking through CPLD and writing to my Minicom terminal through A500 serial port. Isn't that cool? Isn't that mind-blowing? For me it was. Especially since the serial port transmission occurs at 115200 bps. On A500 board :)
So overall there should be a lot of promising progress with Emu68 and when its ready for PiStorm I am thinking it would work for the Hybrid Core as well.
sardine
Posts: 23
Joined: Thu Apr 29, 2021 9:41 pm
Has thanked: 1 time
Been thanked: 2 times

Re: Lets actually try Hybrid Emulation

Unread post by sardine »

Caldor wrote: Wed Aug 04, 2021 3:44 pm Some PiStorm news, which is probably relevant for this project as PiStorm was the inspiriation:
https://www.patreon.com/posts/54448728
which you can only read if you become a patreon,, is this an advert for soliciting funds ?
User avatar
SuperBabyHix
Posts: 152
Joined: Sun May 24, 2020 8:26 pm
Has thanked: 43 times
Been thanked: 34 times

Re: Lets actually try Hybrid Emulation

Unread post by SuperBabyHix »

Sounds more to me like they were simply citing a source that is behind a paywall, and explaining that it was behind a paywall.
User avatar
Caldor
Top Contributor
Posts: 930
Joined: Sat Jul 25, 2020 11:20 am
Has thanked: 112 times
Been thanked: 111 times

Re: Lets actually try Hybrid Emulation

Unread post by Caldor »

sardine wrote: Wed Aug 04, 2021 3:53 pm
Caldor wrote: Wed Aug 04, 2021 3:44 pm Some PiStorm news, which is probably relevant for this project as PiStorm was the inspiriation:
https://www.patreon.com/posts/54448728
which you can only read if you become a patreon,, is this an advert for soliciting funds ?
Yes, sorry, I updated the post when I found it was not an overall open to post. I was not even sure I had supported this Patreon, but turns out I had.
User avatar
alexh
Posts: 2
Joined: Tue Sep 15, 2020 8:20 am

Re: Lets actually try Hybrid Emulation

Unread post by alexh »

Is this project still being worked on? The results that PiSTorm's new Emu68K ARM JIT is getting is very interesting (166Mips on RPI3 using 25% of single thread CPU). If software 68k emulation from PiSTorm evolves into Hybrid minimig for MiSTer it would be very cool.
kolla
Posts: 188
Joined: Sat Jun 13, 2020 7:56 am
Has thanked: 17 times
Been thanked: 33 times

Re: Lets actually try Hybrid Emulation

Unread post by kolla »

Emu68k runs on “bare metal” pi, how fit is it to become a process under Linux? The “ordinary” PiStorm emulator Musashi has also improved a lot, just updating the current variant for MiSTer could also be interesting. What was the git repo to this hybrid musashi again?
User avatar
LamerDeluxe
Top Contributor
Posts: 1160
Joined: Sun May 24, 2020 10:25 pm
Has thanked: 798 times
Been thanked: 257 times

Re: Lets actually try Hybrid Emulation

Unread post by LamerDeluxe »

Would be great if this project could get to a stable state, especially with those nice speed improvements.
User avatar
Caldor
Top Contributor
Posts: 930
Joined: Sat Jul 25, 2020 11:20 am
Has thanked: 112 times
Been thanked: 111 times

Re: Lets actually try Hybrid Emulation

Unread post by Caldor »

kolla wrote: Fri Sep 24, 2021 4:17 pm Emu68k runs on “bare metal” pi, how fit is it to become a process under Linux? The “ordinary” PiStorm emulator Musashi has also improved a lot, just updating the current variant for MiSTer could also be interesting. What was the git repo to this hybrid musashi again?
Is it even using a special version? I think with the latest builds shared, you only need the source code for Mushashi, you used to need the compiled version, or at least it was just one file. I think that was to make it easier to test. I figured out how to get it to run, but I am a but unsure if it even works now, with how much the MiSTer got updated. The Linux part and such, and this uses a special version of the Minimig core, and... not sure if it also uses a special version of the MiSTer core itself? If that is the case, I guess you can still use it and you just have to use this special version of it, and other cores might not work while its being tested.

Its pretty fidgety though. Pretty sure you have to run the Mushashi emulation through a remote console while running the Amiga core on the MiSTer and it has to be done in the right order or something.
kolla
Posts: 188
Joined: Sat Jun 13, 2020 7:56 am
Has thanked: 17 times
Been thanked: 33 times

Re: Lets actually try Hybrid Emulation

Unread post by kolla »

All the cumbersome is ok for me, just asking for the source repo of musashi used by pistorm… because I doubt it is the upstream repo - https://github.com/kstenerud/Musashi
Fularu
Posts: 29
Joined: Sat Jun 13, 2020 3:25 am

Re: Lets actually try Hybrid Emulation

Unread post by Fularu »

PiStorm is switching to Emu68k though
kolla
Posts: 188
Joined: Sat Jun 13, 2020 7:56 am
Has thanked: 17 times
Been thanked: 33 times

Re: Lets actually try Hybrid Emulation

Unread post by kolla »

Fularu wrote: Sat Oct 02, 2021 3:32 am PiStorm is switching to Emu68k though
And wave good bye to virtual scsi, RTG, networking etc?
Fularu
Posts: 29
Joined: Sat Jun 13, 2020 3:25 am

Re: Lets actually try Hybrid Emulation

Unread post by Fularu »

kolla wrote: Sat Oct 02, 2021 7:31 am
Fularu wrote: Sat Oct 02, 2021 3:32 am PiStorm is switching to Emu68k though
And wave good bye to virtual scsi, RTG, networking etc?
No? They're just switching the 68k core.
kolla
Posts: 188
Joined: Sat Jun 13, 2020 7:56 am
Has thanked: 17 times
Been thanked: 33 times

Re: Lets actually try Hybrid Emulation

Unread post by kolla »

Core? It’s software emulation, not FPGA with soft cores. musashi runs as a process under Linux and there’s other software on the Linux side that offers services like virtual scsi, networking and framebuffer for RTG. Emu68 is a different beast, it is a bare metal emulator, so no Linux and everything Linux offers. Instead everything must be done from within the emulator, meaning that hardware drivers and various support code needs to be written. For AmigaOS.
Fularu
Posts: 29
Joined: Sat Jun 13, 2020 3:25 am

Re: Lets actually try Hybrid Emulation

Unread post by Fularu »

kolla wrote: Mon Oct 04, 2021 7:28 pm Core? It’s software emulation, not FPGA with soft cores. musashi runs as a process under Linux and there’s other software on the Linux side that offers services like virtual scsi, networking and framebuffer for RTG. Emu68 is a different beast, it is a bare metal emulator, so no Linux and everything Linux offers. Instead everything must be done from within the emulator, meaning that hardware drivers and various support code needs to be written. For AmigaOS.
Again they're just replacing Musashi's 68k implementation with Emu68k's

Everything else stays the same.
kolla
Posts: 188
Joined: Sat Jun 13, 2020 7:56 am
Has thanked: 17 times
Been thanked: 33 times

Re: Lets actually try Hybrid Emulation

Unread post by kolla »

And with "they" you mean Michal and Claude?

You’d think I knew what I have "patreon" for over the years… but I guess not.

“A key point which I’ve made before is that this is a bare metal emulator as opposed to a Linux based one. Which means that all the extra goodies such as SCSI and RTG will need to be re-written to use the hardware.”

https://linuxjedi.co.uk/2021/09/26/this ... 021-09-26/

https://www.patreon.com/posts/boot-time-55019666
https://amigaworld.net/modules/newbb/vi ... =25#844885
User avatar
Caldor
Top Contributor
Posts: 930
Joined: Sat Jul 25, 2020 11:20 am
Has thanked: 112 times
Been thanked: 111 times

Re: Lets actually try Hybrid Emulation

Unread post by Caldor »

kolla wrote: Fri Oct 01, 2021 9:35 pm All the cumbersome is ok for me, just asking for the source repo of musashi used by pistorm… because I doubt it is the upstream repo - https://github.com/kstenerud/Musashi
You are asking which repo was used to get it working with the MiSTer? I am not sure how it was compiled, but pretty sure it was an official release. I think I still have a few builds somewhere I can share, but I also think they are already in this thread. So far it has all been pretty unstable though. It can run SysInfo, but it cannot be trusted much since its not stable I think. It has several issues, crashes when trying to access drives a certain way, I do not think it can run any games without crashing and other things.

I have not tried it for a long time. It uses a special build of the Main core for the MiSTer, or at least it can do so, and I am not sure it is compatible anymore, with the newest version of the Main core, the special Minimig core designed to be used with Mushashi.
Post Reply