Lets actually try Hybrid Emulation

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 »

Where is the Sysinfo screenshot! :)
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 »

foft wrote: Wed Apr 14, 2021 9:20 pm Tomorrow I’m going to try out Michal Schulz’s Emu68
https://github.com/michalsc/Emu68
Wish me luck!
Good luck!
You're creating history here, a lot of cores impossible now because of the lack of space (or frequencies too low) on the FPGA chip would become possible in this hybrid approach.
Some would call that heresy, I call that pushing boudaries and being smart! Congrats!

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

User avatar
allyourbasekris
Posts: 79
Joined: Wed Sep 23, 2020 11:47 pm
Has thanked: 31 times
Been thanked: 45 times

Re: Lets actually try Hybrid Emulation

Unread post by allyourbasekris »

kolla wrote: Wed Apr 14, 2021 9:25 pm Where is the Sysinfo screenshot! :)
I just tried it out and got to Workbench and took you a nice screenshot.
Screenshot (4).png
Screenshot (4).png (580.41 KiB) Viewed 8688 times
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 »

allyourbasekris wrote: Wed Apr 14, 2021 10:18 pm
kolla wrote: Wed Apr 14, 2021 9:25 pm Where is the Sysinfo screenshot! :)
I just tried it out and got to Workbench and took you a nice screenshot.Screenshot (4).png
:shock: :shock: :shock: :shock: :shock:

BEAUTIFUL :mrgreen:

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

lordoftime79
Posts: 111
Joined: Sun Feb 14, 2021 6:29 pm
Has thanked: 1 time
Been thanked: 5 times

Re: Lets actually try Hybrid Emulation

Unread post by lordoftime79 »

how do i start musashi_68020_mister?
lordoftime79
Posts: 111
Joined: Sun Feb 14, 2021 6:29 pm
Has thanked: 1 time
Been thanked: 5 times

Re: Lets actually try Hybrid Emulation

Unread post by lordoftime79 »

Can you please tell me how to use this - I dont know anything about ssh so where does the file go and how do I run it?
jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: Lets actually try Hybrid Emulation

Unread post by jca »

lordoftime79 wrote: Wed Apr 14, 2021 11:15 pm Can you please tell me how to use this - I dont know anything about ssh so where does the file go and how do I run it?
I think it is better for you to wait until something more usable is posted. Right now it is a proof of concept, which is a huge step, but my guess is that you will be frustrated in no time.
lordoftime79
Posts: 111
Joined: Sun Feb 14, 2021 6:29 pm
Has thanked: 1 time
Been thanked: 5 times

Re: Lets actually try Hybrid Emulation

Unread post by lordoftime79 »

i just want to look i am excited if I had some instuctions i cud follow them.
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 »

Download 7-zip
Extract the tar to get the two files

Download winscp
Connect to mister with winscp
- drag the musashi_68020_mister to /media/fat
- drag the core to /media/fat/_computer/ (with the other cores, I might have the name wrong)

Download putty or mobaxterm
Connect to mister with putty
cd /media/fat (then enter)
./musashi_68020_mister (then enter)

Worth a read:
https://www.jamesfmackenzie.com/2021/01 ... ing-files/

This will all be made simpler
User avatar
allyourbasekris
Posts: 79
Joined: Wed Sep 23, 2020 11:47 pm
Has thanked: 31 times
Been thanked: 45 times

Re: Lets actually try Hybrid Emulation

Unread post by allyourbasekris »

lordoftime79 wrote: Wed Apr 14, 2021 11:20 pm i just want to look i am excited if I had some instuctions i cud follow them.
https://schh.medium.com/ssh-for-dummies-ea168e6ff547
SpacemanX
Posts: 2
Joined: Mon May 25, 2020 1:19 pm
Has thanked: 1 time

Re: Lets actually try Hybrid Emulation

Unread post by SpacemanX »

Absolutely amazing progress! It's hard to fathom that you have got this working in such a short time.

To me Buffee looks similar to this approach on ground level. They are claiming close to 100x performance target to what is achieved here currently. I do understand that it's still very very early days, but it got me wondering what is the theoretical performance level achievable with de10-nano cpu/fpga combo?
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 »

Question for people who know Amiga JIT options... Which is best to try:
Aranym uat_cpu: https://github.com/aranym/aranym/tree/m ... rc/uae_cpu
Emu68: https://github.com/michalsc/Emu68
TomB's Pandora uae4arm: https://github.com/PandTomB/uae4arm

None of them are as well documented as musashi, but I'll have a go at figuring out how to use them.

I'm thinking the last one is the best option, since the gp32/gp2x/openpandora devs were super at doing arm optimisation.
I remember this one was used a lot, though its interpreted iirc and only 68000.
https://github.com/notaz/cyclone68000

One complication in all this is that the hps-fpga bridge is little endian, at least in how it automatically handles misaligned accesses. If all the accesses are aligned then I could put big endian format through it to avoid the conversion arm side (fpga side is basically 'free').
lordoftime79
Posts: 111
Joined: Sun Feb 14, 2021 6:29 pm
Has thanked: 1 time
Been thanked: 5 times

Re: Lets actually try Hybrid Emulation

Unread post by lordoftime79 »

nice work. unfortunately even following your insturctions it wouldnt work for me, just got a blue and purple garbled screen.
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 »

lordoftime79 wrote: Thu Apr 15, 2021 9:34 am nice work. unfortunately even following your insturctions it wouldnt work for me, just got a blue and purple garbled screen.
Yeah you need to start it in the right order.
e.g. set to 8MB fast ram, reset on the core. THEN start the cpu process.
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 »

SpacemanX wrote: Thu Apr 15, 2021 6:40 am Absolutely amazing progress! It's hard to fathom that you have got this working in such a short time.

To me Buffee looks similar to this approach on ground level. They are claiming close to 100x performance target to what is achieved here currently. I do understand that it's still very very early days, but it got me wondering what is the theoretical performance level achievable with de10-nano cpu/fpga combo?
Their work is open so we'll be able to use their pjit when its working. Actually I think they expect their approach to be slower than standard jit, just with fewer 'jitters'.

Not sure how the Buffee CPU compares to the ARM Cortex A9 @800MHz here.
Edit: Looked it up: Octavo OSD335x-SM with ARM Cortex A8 AM335x @ 1GHz.

Should be pretty comparable I'd have thought, the A9 has a shorter pipeline.
SpacemanX
Posts: 2
Joined: Mon May 25, 2020 1:19 pm
Has thanked: 1 time

Re: Lets actually try Hybrid Emulation

Unread post by SpacemanX »

foft wrote: Thu Apr 15, 2021 9:38 am ...
Not sure how the Buffee CPU compares to the ARM9 @800MHz here.
800MHz Arm A8 vs A9, so DE10-Nano should be faster in that regard.

https://octavosystems.com/octavo_products/osd335x-sm/
petarku
Posts: 29
Joined: Mon May 25, 2020 8:59 am
Has thanked: 3 times
Been thanked: 3 times

Re: Lets actually try Hybrid Emulation

Unread post by petarku »

@foft This is amazing work! Do you take any donations ? if you do how I can donate ?
lordoftime79
Posts: 111
Joined: Sun Feb 14, 2021 6:29 pm
Has thanked: 1 time
Been thanked: 5 times

Re: Lets actually try Hybrid Emulation

Unread post by lordoftime79 »

Finally got it working but I cant seem to get it to load hardrive images - I get a bus error?
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 »

lordoftime79 wrote: Thu Apr 15, 2021 10:12 am Finally got it working but I cant seem to get it to load hardrive images - I get a bus error?
Thanks, good to know. I'll try one out just need to work out how to make one.
User avatar
allyourbasekris
Posts: 79
Joined: Wed Sep 23, 2020 11:47 pm
Has thanked: 31 times
Been thanked: 45 times

Re: Lets actually try Hybrid Emulation

Unread post by allyourbasekris »

foft wrote: Thu Apr 15, 2021 10:58 am
lordoftime79 wrote: Thu Apr 15, 2021 10:12 am Finally got it working but I cant seem to get it to load hardrive images - I get a bus error?
Thanks, good to know. I'll try one out just need to work out how to make one.
I've had HD images load with no issues. It was a 3.14 installation, stock.
lordoftime79
Posts: 111
Joined: Sun Feb 14, 2021 6:29 pm
Has thanked: 1 time
Been thanked: 5 times

Re: Lets actually try Hybrid Emulation

Unread post by lordoftime79 »

I tried a Coffin image and hst install thats from my CD32 both usually work on the minimig core.
I was able to boot from floppy to workbench but I dont have all the adfs so cant really test much more than that as all my stuff is on HDFS
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 »

The bus error is 16-bit aligned 32-bit writes (at least the one I see)
Cortex a9 is supposed to support these.
https://developer.arm.com/documentation ... rt?lang=en
Perhaps this flag is set wrong.
Bas
Top Contributor
Posts: 623
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 80 times
Been thanked: 324 times

Re: Lets actually try Hybrid Emulation

Unread post by Bas »

Such progress so quickly, very interesting!! Thanks for your efforts.
User avatar
allyourbasekris
Posts: 79
Joined: Wed Sep 23, 2020 11:47 pm
Has thanked: 31 times
Been thanked: 45 times

Re: Lets actually try Hybrid Emulation

Unread post by allyourbasekris »

If you try to enable RTG then you also get a bus error. I'm not really surprised it didn't work with it being very early days. Exciting times. thanks Foft for the effort you're putting in, it's much appreciated.
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 spent the evening trying to figure out how to use one of these JITs.

I tried the uae4arm one. It was non-obvious how to rip it out. Since it seemed to be based on aranym anyway I decided to go direct to that.

Onto aranym: I managed to cross compile the whole thing fine. Then I tried to find the CPU interface - and couldn't! So I decided to rip out everything bit by bit until I got to just the CPU. I got pretty much there but am not confident I managed to remove everything + its still not obvious how to plumb in the memory. It has funky custom SIGSEGV handling and memory offsets. So now I have something that might be pretty close to ... the raw 68k jit ... but not sure. It seems that aranym has really nice clean code, but then bits and pieces of custom stuff leaked into the cpu jit part. I've just signed up to their mailing list to see if one of their developers can give me a hand a ripping it out.

Which leaves Emu68. I checked it out from git and didn't really see how to use it standalone.

So... little bit stuck here. Hoping the aranym devs can help me out.

Help!
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 »

Regarding bus errors: try this cpu.

It only fixed up 16-bit misaligned 32-bit writes, but that sorted a bunch of stuff.
Attachments
musashi_68020_mister.gz
(1.23 MiB) Downloaded 192 times
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 »

Another option for the cpu is qemu.

It has had 68k support for a few years now and ... has documentation and a load store and memory api.

Might give that a try.

Edit: another advantage of qemu: It also has powerpc support.

Edit2: https://stackoverflow.com/questions/370 ... emory-maps

edit3: + I can try a native 68k dhrystones on the existing machines first to see how fast it is
robinsonb5
Posts: 130
Joined: Fri Jun 19, 2020 8:54 pm
Has thanked: 13 times
Been thanked: 58 times

Re: Lets actually try Hybrid Emulation

Unread post by robinsonb5 »

foft wrote: Fri Apr 16, 2021 7:54 am edit3: + I can try a native 68k dhrystones on the existing machines first to see how fast it is
That would be a good idea. Also yet another option is Cyclone 68000 - https://notaz.gp2x.de/cyclone.php - apparently not JIT-based, but the Buffee blog described it as one of the fastest interpretive 68000 emulators. I think only covers the base 68000 instruction set though.

PPC is an interesting Pandora's Box to open, though. It's also occurred to me a number of times that with so many different ARM-based solutions appearing, some kind of PowerUP / WarpOS solution for running native ARM code from within AmigaOS would be very interesting, much like how Amiga PPC applications were handled back in the day.
xolod79
Core Developer
Posts: 39
Joined: Wed May 27, 2020 8:13 pm
Has thanked: 6 times
Been thanked: 41 times

Re: Lets actually try Hybrid Emulation

Unread post by xolod79 »

PPC will allow you to see the Amiga PPC demoscene, we already have RTG.
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 »

m68k:
/media/fat# LD_LIBRARY_PATH=./libs/lib/arm-linux-gnueabihf/ ./libs/lib/ld-linux-armhf.so.3 ./qemu-m68k ./dhrystone_m68k -l 10
duration: 0 seconds
number of threads: 1
number of loops: 10000000
delay between starting threads: 0 seconds

Dhrystone(1.1) time for 10000000 passes = 19.0
This machine benchmarks at 526624 dhrystones/second
300 DMIPS

Total dhrystone run time: 19.020809 seconds.
---
ppc:
Run failed. Did not crash but results printed out are garbage.
Took 16 seconds.

---
arm (native):
/media/fat# ./dhrystone_arm -l 10
duration: 0 seconds
number of threads: 1
number of loops: 10000000
delay between starting threads: 0 seconds

Dhrystone(1.1) time for 10000000 passes = 2.3
This machine benchmarks at 4442697 dhrystones/second
2529 DMIPS

Total dhrystone run time: 2.252560 seconds.
Post Reply