Lets actually try Hybrid Emulation

Neocaron
Top Contributor
Posts: 375
Joined: Sun Sep 27, 2020 10:16 am
Has thanked: 209 times
Been thanked: 87 times

Re: Lets actually try Hybrid Emulation

Unread post by Neocaron »

What are the OC capability of the arm chip on the DE-10? Anyone tried to give it an OC? Is that even possible?
(I actually asked in the wrong topic, but that's relevant here as well I guess) :mrgreen:

Remastering Classic Game Cinematics: My new Youtube fun, check it out :D
https://www.youtube.com/@neocaron87

raparici
Posts: 8
Joined: Mon May 25, 2020 6:53 pm
Has thanked: 2 times
Been thanked: 3 times

Re: Lets actually try Hybrid Emulation

Unread post by raparici »

Caldor wrote:Updated the script I made inspired by raparici. So now its one script that checks if MiSTerHybrid is running (I rename it to MiSTerHybrid instead of just MiSTer) and then kills the MiSTer main that is running and runs the other main, hybrid or non-hybrid.
This switching script is really convenient, thank you. Yes the . after MiSTer binary sets the home folder.
raparici
Posts: 8
Joined: Mon May 25, 2020 6:53 pm
Has thanked: 2 times
Been thanked: 3 times

Re: Lets actually try Hybrid Emulation

Unread post by raparici »

foft wrote: Wed Jan 19, 2022 8:53 am The hdf's work fine for me if I turn off the fast IDE stuff. Are you seeing issues with that disabled?
Your are right I was missing turning Fast IDE off. While Fast IDE is off I just had one hd type crash by repeatedly triggering the sysinfo disk speed test. But even that I couldnt reproduce again. Without Fast IDE it seems solid enough but slow.

The largest issue I come across now is launching whdloads, they all crash very early before the window pops up.

Would it be very complicated to isolate the FPU and just emulate the FPU along with TG68K? I am curious about doing an FPU alone test.

cheers
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 »

raparici wrote: Fri Jan 21, 2022 1:23 am
foft wrote: Wed Jan 19, 2022 8:53 am The hdf's work fine for me if I turn off the fast IDE stuff. Are you seeing issues with that disabled?
Your are right I was missing turning Fast IDE off. While Fast IDE is off I just had one hd type crash by repeatedly triggering the sysinfo disk speed test. But even that I couldnt reproduce again. Without Fast IDE it seems solid enough but slow.

The largest issue I come across now is launching whdloads, they all crash very early before the window pops up.

Would it be very complicated to isolate the FPU and just emulate the PFU along with TG68K? I am curious about doing an FPU aline test.

cheers
Would be an interesting option. The current QEMU CPU already does the FPU expansion emulation type, the 060 CPUs I think it was, had FPU built into them when they had FPU. But I think at least 020 and 030 used this external FPU and just to be able to use that would be nice to have. I think at least it would make a few demos possible that could not run before.
foft
Posts: 344
Joined: Thu Dec 03, 2020 11:05 am
Has thanked: 29 times
Been thanked: 125 times

Re: Lets actually try Hybrid Emulation

Unread post by foft »

Good question, I have no idea...

Edit: Digs out M68020 book and looks at section 7: COPROCESSOR INTERFACE DESCRIPTION!
foft
Posts: 344
Joined: Thu Dec 03, 2020 11:05 am
Has thanked: 29 times
Been thanked: 125 times

Re: Lets actually try Hybrid Emulation

Unread post by foft »

So I ran the uaearm binary I posted before (i.e. emulation of cpu AND chipset - no core stuff except fbdev). This is running with MiSTer still in the background. This is with JIT enabled.

So, sysinfo looks much better, particularly FPU. Real dhrystones is pretty close to qemu.

Anyway seems worth trying (again!) to rip out the emulation side of it and trying it with the core as a backend.
IMG_9557.JPG
IMG_9557.JPG (3.96 MiB) Viewed 15562 times
IMG_9558.JPG
IMG_9558.JPG (4.39 MiB) Viewed 15562 times
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 »

foft wrote: Fri Jan 21, 2022 4:35 pm So I ran the uaearm binary I posted before (i.e. emulation of cpu AND chipset - no core stuff except fbdev). This is running with MiSTer still in the background. This is with JIT enabled.

So, sysinfo looks much better, particularly FPU. Real dhrystones is pretty close to qemu.
This looks pretty amazing. Also... might make sense to have pure emulation as an option even, like we have ScummVM as a core, and just be able to also run the emulator. Then it should become possible to also see the benefits of hybrid... or if there are benefits, compared to doing emulation or the core each on their own.

Could you share the uaearm binary maybe?
kolla
Posts: 191
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 »

Two years ago when RTG solution was emerging, I suggested just running UAE, and was told that the ARM on the MiSTer is no way fast enough. Hm.
werpu
Posts: 89
Joined: Sun May 24, 2020 7:37 pm
Has thanked: 12 times
Been thanked: 16 times

Re: Lets actually try Hybrid Emulation

Unread post by werpu »

First of all, thanks for all the efforts you are trying here.
This looks pretty amazing. Also... might make sense to have pure emulation as an option even, like we have ScummVM as a core.
Just a small sidemark to clear things up, ScummVM is not really an emulation it does not emulate actual hardware, it is more a games engine which basically mutated into a multi games engine.
The closest you get to emulation on ScummVM is the z-machine which is a VM running the lisp derivate in a vm, in which Infocom games were written. They used VM just like Java any many other languages do to port their games easily to other systems.
(quite an achievement in the 8 bit 32/64byte era)
I know this is slightly off topic but I wanted simply to correct this. Sorry for interrupting this really interesting thread with this.
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 »

werpu wrote: Mon Jan 24, 2022 8:37 pm First of all, thanks for all the efforts you are trying here.
This looks pretty amazing. Also... might make sense to have pure emulation as an option even, like we have ScummVM as a core.
Just a small sidemark to clear things up, ScummVM is not really an emulation it does not emulate actual hardware, it is more a games engine which basically mutated into a multi games engine.
The closest you get to emulation on ScummVM is the z-machine which is a VM running the lisp derivate in a vm, in which Infocom games were written. They used VM just like Java any many other languages do to port their games easily to other systems.
(quite an achievement in the 8 bit 32/64byte era)
I know this is slightly off topic but I wanted simply to correct this. Sorry for interrupting this really interesting thread with this.
True, that is what makes ScummVM so great. They remade every engine and changed the source code so it can be compiled for any system. Whatever you run ScummVM on is having it run natively on that hardware. My point though is just that its ARM based and not FPGA based... although I am a bit unsure about the MiSTer core for ScummVM. Not sure if maybe it does some parts of it in FPGA logic, which would make it a hybrid core. The hybrid part is not whether the ARM does emulation, but just that it handles some of the work.
kolla wrote: Sat Jan 22, 2022 11:35 am Two years ago when RTG solution was emerging, I suggested just running UAE, and was told that the ARM on the MiSTer is no way fast enough. Hm.
Well, lets see how it tests out. With emulation its not always as reliable so the performance in the benchmarks might look better than it is practically.
FPGA64
Top Contributor
Posts: 939
Joined: Mon Mar 01, 2021 3:10 pm
Has thanked: 49 times
Been thanked: 375 times

Re: Lets actually try Hybrid Emulation

Unread post by FPGA64 »

Scumm Vm on the Mister is purely running on the Arm. It doesnt touch the FPGA at all.
foft
Posts: 344
Joined: Thu Dec 03, 2020 11:05 am
Has thanked: 29 times
Been thanked: 125 times

Re: Lets actually try Hybrid Emulation

Unread post by foft »

FPGA64 wrote: Tue Jan 25, 2022 10:37 am Scumm Vm on the Mister is purely running on the Arm. It doesnt touch the FPGA at all.
Isn't the FPGA doing video + scaler?
User avatar
pgimeno
Top Contributor
Posts: 710
Joined: Thu Jun 11, 2020 9:44 am
Has thanked: 277 times
Been thanked: 226 times

Re: Lets actually try Hybrid Emulation

Unread post by pgimeno »

It's doing video, for sure. The menu core serves as framebuffer for Linux in general; whatever runs in the Linux console (including everything under the Scripts menu), uses the menu core as a display. I'm not so sure about the scaler; I don't think the scaler is active when doing Linux video (but I might be wrong).
FPGA64
Top Contributor
Posts: 939
Joined: Mon Mar 01, 2021 3:10 pm
Has thanked: 49 times
Been thanked: 375 times

Re: Lets actually try Hybrid Emulation

Unread post by FPGA64 »

I dont consider the output hardware as part of the program. As far as Scumm VM is concerned its running on an Arm linux. How the Arm chip outputs is irrelevent to the program.
Neocaron
Top Contributor
Posts: 375
Joined: Sun Sep 27, 2020 10:16 am
Has thanked: 209 times
Been thanked: 87 times

Re: Lets actually try Hybrid Emulation

Unread post by Neocaron »

It's a bit off topic, but I hav 2 problems with ScummVm currently. The fact that there isn't any vsync option, I just can't bear tearing to this degree and the fact we don't have access to crt scanline and filters in general. I wish someone would do something about those 2 things. Because otherwise it's an awesome experience, accurate and super fast!.

Remastering Classic Game Cinematics: My new Youtube fun, check it out :D
https://www.youtube.com/@neocaron87

User avatar
pgimeno
Top Contributor
Posts: 710
Joined: Thu Jun 11, 2020 9:44 am
Has thanked: 277 times
Been thanked: 226 times

Re: Lets actually try Hybrid Emulation

Unread post by pgimeno »

Neocaron wrote: Tue Jan 25, 2022 2:30 pm It's a bit off topic, but I hav 2 problems with ScummVm currently. The fact that there isn't any vsync option, I just can't bear tearing to this degree and the fact we don't have access to crt scanline and filters in general. I wish someone would do something about those 2 things. Because otherwise it's an awesome experience, accurate and super fast!.
Check this thread, and maybe ask there: viewtopic.php?f=14&t=673
werpu
Posts: 89
Joined: Sun May 24, 2020 7:37 pm
Has thanked: 12 times
Been thanked: 16 times

Re: Lets actually try Hybrid Emulation

Unread post by werpu »

Upps somehow i accidentally posted a quote... wanted to delete it no way, so lets make something meaningful out of it...
But yes there is a dedicated Scummvm section in the forum, everything scummvm related question should go there.

But to go back on topic, what is the status now? I have been digging a little bit back... seems a poc works but not well enough, but is it any meaningful aproach for the Amiga or for future systems maybe which do not fit into the MiSTer anymore like the N64, which can do some parts fpga and some parts on arm emulation then?
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 »

foft wrote: Tue Jan 25, 2022 10:59 am
FPGA64 wrote: Tue Jan 25, 2022 10:37 am Scumm Vm on the Mister is purely running on the Arm. It doesnt touch the FPGA at all.
Isn't the FPGA doing video + scaler?
Could you share the binary of that UAE you build for the MiSTer? What type of Linux do you need to build for to make it run on the MiSTer Linux? I want to try out some different emulators, but especially that UAE one with JIT you got working, that could be an interesting option to have on the MiSTer I think. Makes it more versatile if we could try some Amiga stuff on it that way.

Given the MiSTer Linux has no package manager, its difficult to install stuff onto it. I suspect its possible to copy a package manager to it, but then you need everything that package manager needs as well, and I suspect it might add some boot time to the MiSTer, and I do think it is nice that it boots so fast. But Sorg really scraped the Linux side to a bare minimum.
foft
Posts: 344
Joined: Thu Dec 03, 2020 11:05 am
Has thanked: 29 times
Been thanked: 125 times

Re: Lets actually try Hybrid Emulation

Unread post by foft »

Here is the uae4arm.sh emulator binary. Again I built it on ubuntu armhf so its a non-compatible lib stack so comes complete with libs and a script to start like qemu.
http://www.64kib.com/mister_hybrid_file ... dir.tar.gz
Extract it then cd into the folder and run uae4arm.sh
Best to do it on the mister video screen after pressing F9 on menu.

It seems to run ok, though the file selector crashes for some reason. So I was just editing the config file to point it at disks!
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 »

foft wrote: Tue Jan 25, 2022 8:34 pm Here is the uae4arm.sh emulator binary. Again I built it on ubuntu armhf so its a non-compatible lib stack so comes complete with libs and a script to start like qemu.
http://www.64kib.com/mister_hybrid_file ... dir.tar.gz
Extract it then cd into the folder and run uae4arm.sh
Best to do it on the mister video screen after pressing F9 on menu.

It seems to run ok, though the file selector crashes for some reason. So I was just editing the config file to point it at disks!
Ahh, good to know. I was thinking if maybe stuff I installed on that LXDE desktop might be possible to run on the MiSTer Linux directly if I copied all the libraries and such, I guess this means it should. Although I do think that DOSBox and the FS-USE are both SDL based, and that might mean they require a whole GUI to run. Which I would rather avoid so I think I will try your method if I can make it work.
kolla
Posts: 191
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 »

The MiSTer comes with busybox that includes chroot. I have a line in /etc/inittab that runs a script which loopback mounts a few disk images before exec into chroot openrc, so I maintain a full gentoo Linux userland on my MiSTer. Various services for the Amiga side (web proxy, telnetd, rshd etc) run inside this chroot, even ssh on port 22 is. On shutdown, all processes inside the chroot are terminated and filesystems unmounted.
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 »

foft wrote: Tue Jan 25, 2022 8:34 pm Here is the uae4arm.sh emulator binary. Again I built it on ubuntu armhf so its a non-compatible lib stack so comes complete with libs and a script to start like qemu.
http://www.64kib.com/mister_hybrid_file ... dir.tar.gz
Extract it then cd into the folder and run uae4arm.sh
Best to do it on the mister video screen after pressing F9 on menu.

It seems to run ok, though the file selector crashes for some reason. So I was just editing the config file to point it at disks!
I have been trying to run this. First I got an error that it was unable to find libraries. Seems to have helped that I moved all the files to the root folder instead. Well, the uae4arm_dir folder I moved to the root. But now I am getting an ALSA lib error saying "underrun occurred". This error shows 16 times I think, and then returns to the command line. Exact error:
image_2022-01-28_161212.png
image_2022-01-28_161212.png (572.44 KiB) Viewed 14685 times
There is a chance that it might be the way I decompressed it though, so I will experiment some more.

kolla wrote: Thu Jan 27, 2022 12:08 am The MiSTer comes with busybox that includes chroot. I have a line in /etc/inittab that runs a script which loopback mounts a few disk images before exec into chroot openrc, so I maintain a full gentoo Linux userland on my MiSTer. Various services for the Amiga side (web proxy, telnetd, rshd etc) run inside this chroot, even ssh on port 22 is. On shutdown, all processes inside the chroot are terminated and filesystems unmounted.
Nice :)
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 debugging uae4arm. Cannot figure out why I am getting the ALSA underrun occurred error. Seems it might have to do with a too small buffer. I tried changing the cache, but I then read that the cache setting has something to do with the JIT and might not even be used anymore.

So I guess it has something to do with my MiSTer setup somehow. I have looked through my MiSTer settings but cannot find anything. I tried disabling the sound, but that did not seem to work either. I am guessing it might have to do with having used MidiLink at one point.
foft
Posts: 344
Joined: Thu Dec 03, 2020 11:05 am
Has thanked: 29 times
Been thanked: 125 times

Re: Lets actually try Hybrid Emulation

Unread post by foft »

I got the audio underrun error too. I didn’t look into this or the file select crash since it was enough to get a quick benchmark.
User avatar
xFlesk
Posts: 80
Joined: Wed Jun 30, 2021 7:37 pm
Has thanked: 30 times
Been thanked: 11 times

Re: Lets actually try Hybrid Emulation

Unread post by xFlesk »

so i came across this:

IMG_5262.jpg
IMG_5262.jpg (245.61 KiB) Viewed 14001 times

a minimig board with motorola soc ;) and it works with pistorm
so we have entire amiga on fpga and emulated arm motorola, just like you trying to do here (at least similar).
maybe we could find some more info about it what could help to better understand everything.
TheCompany.pl - Amiga EXE Games
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 »

foft wrote: Sun Jan 30, 2022 8:21 am I got the audio underrun error too. I didn’t look into this or the file select crash since it was enough to get a quick benchmark.
Ahh, I guess there might be other issues as well. I just never got far enough to do any benchmark. I tried booting floppy disks, but it never even tries to boot any Amiga graphics. So all I see is the underun errors.
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 »

xFlesk wrote: Sun Jan 30, 2022 11:13 am so i came across this:
a minimig board with motorola soc ;) and it works with pistorm
so we have entire amiga on fpga and emulated arm motorola, just like you trying to do here (at least similar).
maybe we could find some more info about it what could help to better understand everything.
Does look interesting, but it does still lack support for most of the IO. No floppy or serial port f.ex.

Still, FPGA that supports a CPU chip is nice. It is also something I have hoped to see as possible with the MiSTer. Just not enough bandwidth to do this I guess. But this is why I find custom boards interesting, because I hope to see a custom board that might somehow allow for stuff like maybe supporting an Amiga expansion card, a PCI port for the AO486 core, reading actual cartridges and CDs for consoles, and done in some modular way that you can replace some expansion and it becomes another system.

But it needs a general way of doing it, and often I think it would require replacing both the SD RAM and the current IO board and then have some way of having SD RAM on the expansion board instead and some option to only use it for the cores that needs it. But every core would then need to support such an expansion.

So it probably wont happen. If it first happened with just one core that then got support for more of the original IO, I am guessing it could happen for other cores as well. But as it is now, it still needs a special version of those cores to support such custom hardware.
kolla
Posts: 191
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 »

The minimig board above is essentially an original Minimig with a socket for 68000 instead of the 68SEC000 used on minimig. It also only supports OCS/ECS and no AGA. Its primary function is to be a testbed for the Buffee, but it has successfully also been used with PiStorm. PiStorm either runs Musashi, which has also been tested on MiSTer and is discussed in this very thread, or it can run Emu68, which is dedicated to the Raspberry pi hardware and doesn’t work with MiSTer (since MiSTer relies on Linux). There are several options for emulating the 68k in software, in addition to Musashi, there is Qemu which is being tested here, and of course the cpu emulation in various UAE and Aranym incarnations. And probably others too.
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 begun testing how to compile software for the MiSTer. The easiest way to test things is put to a different Linux on the MiSTer, but then we wont be able to test with MiSTer running in the background. But if the full stack of libs is needed anyway, I have been looking at Debian where it seems they have an archive where each binary on there also has the full lib stack that it needs. I hope I can download all of that and make that run. Otherwise I have found a way to compile MiSTer Main, and using that same method I am guessing I might be able to compile other binaries. But that would probably still rely on those libraries already being on the MiSTer.
kolla
Posts: 191
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 »

You can run any 32bit pi linux distro you want inside a chroot, and leave original MiSTer distro as it is.
Post Reply