Lets actually try Hybrid Emulation
Re: Lets actually try Hybrid Emulation
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?
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?
Re: Lets actually try Hybrid Emulation
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').
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').
-
- Posts: 97
- Joined: Sun Feb 14, 2021 6:29 pm
- Has thanked: 1 time
- Been thanked: 2 times
Re: Lets actually try Hybrid Emulation
nice work. unfortunately even following your insturctions it wouldnt work for me, just got a blue and purple garbled screen.
Re: Lets actually try Hybrid Emulation
Yeah you need to start it in the right order.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.
e.g. set to 8MB fast ram, reset on the core. THEN start the cpu process.
Re: Lets actually try Hybrid Emulation
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'.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?
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.
Re: Lets actually try Hybrid Emulation
800MHz Arm A8 vs A9, so DE10-Nano should be faster in that regard.
https://octavosystems.com/octavo_products/osd335x-sm/
-
- Posts: 97
- Joined: Sun Feb 14, 2021 6:29 pm
- Has thanked: 1 time
- Been thanked: 2 times
Re: Lets actually try Hybrid Emulation
Finally got it working but I cant seem to get it to load hardrive images - I get a bus error?
Re: Lets actually try Hybrid Emulation
Thanks, good to know. I'll try one out just need to work out how to make one.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?
- 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
I've had HD images load with no issues. It was a 3.14 installation, stock.foft wrote: ↑Thu Apr 15, 2021 10:58 amThanks, good to know. I'll try one out just need to work out how to make one.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?
-
- Posts: 97
- Joined: Sun Feb 14, 2021 6:29 pm
- Has thanked: 1 time
- Been thanked: 2 times
Re: Lets actually try Hybrid Emulation
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
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
Re: Lets actually try Hybrid Emulation
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.
Cortex a9 is supposed to support these.
https://developer.arm.com/documentation ... rt?lang=en
Perhaps this flag is set wrong.
- 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
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.
Re: Lets actually try Hybrid Emulation
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!
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!
Re: Lets actually try Hybrid Emulation
Regarding bus errors: try this cpu.
It only fixed up 16-bit misaligned 32-bit writes, but that sorted a bunch of stuff.
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 161 times
Re: Lets actually try Hybrid Emulation
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
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
-
- Posts: 129
- Joined: Fri Jun 19, 2020 8:54 pm
- Has thanked: 13 times
- Been thanked: 57 times
Re: Lets actually try Hybrid Emulation
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.
Re: Lets actually try Hybrid Emulation
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.
/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.
-
- Top Contributor
- Posts: 547
- Joined: Fri Jan 22, 2021 4:36 pm
- Has thanked: 70 times
- Been thanked: 251 times
Re: Lets actually try Hybrid Emulation
Just ran a few quick tests and it works like a charm mostly. Feels like a reset leaves the CPU or some other components in a wonky state sometimes. Makes me curious as to what the reset menu item in the core actually does and to what extent it really resets the whole system and brings them back in line together.
Re: Lets actually try Hybrid Emulation
I have a new qemu m68k 'machine' that points to the chip ram (hps fpga bridge) and some fast ram. It has a single device that polls the irqs.
Will it work, won't it work. Lets try!
Will it work, won't it work. Lets try!
Re: Lets actually try Hybrid Emulation
Yeah I didn't tie reset of the 'software cpu' to the hardware reset yet. So currently need to stop the process, reset on the core, then start the process.Bas wrote: ↑Fri Apr 16, 2021 7:20 pm Just ran a few quick tests and it works like a charm mostly. Feels like a reset leaves the CPU or some other components in a wonky state sometimes. Makes me curious as to what the reset menu item in the core actually does and to what extent it really resets the whole system and brings them back in line together.
-
- Posts: 129
- Joined: Fri Jun 19, 2020 8:54 pm
- Has thanked: 13 times
- Been thanked: 57 times
Re: Lets actually try Hybrid Emulation
OK, interrupts work.
Here is a binary if anyone wants to play. Its like the other one though (fixed 8MB fast, no reset plumbing etc) - except worse since only Diagrom runs
http://www.64kib.com/qemu_system_test.tar.xz
Extract in /media/fat then run ./qemu_system_test/go
Perhaps someone smart can run it in trace mode and see why it gets stuck on workbench?
Here is a binary if anyone wants to play. Its like the other one though (fixed 8MB fast, no reset plumbing etc) - except worse since only Diagrom runs
http://www.64kib.com/qemu_system_test.tar.xz
Extract in /media/fat then run ./qemu_system_test/go
Perhaps someone smart can run it in trace mode and see why it gets stuck on workbench?
-
- Top Contributor
- Posts: 521
- Joined: Tue May 26, 2020 5:06 am
- Has thanked: 86 times
- Been thanked: 204 times
Re: Lets actually try Hybrid Emulation
I was successful at running the following programs:
- Deluxe Paint 5
- Photon Paint 2.0
- Cloanto Personal Paint
- NewTek DigiPaint 3.0
- Brilliance
- Monkey Island 2
- GODs
While testing, manually starting/restarting the CPU with SSH was slowing me down so I did this hack to main:
https://github.com/bbond007/Main_MiSTer ... 42a5d8cc8b
This will kill and start the 68000 CPU when reset is selected. You still must first (set RAM) and reset initially on cold boot.
68000.sh should go in your Minimig home dir - Typically /media/fat/Amiga unless using USB
68000.sh will look for musashi_68020_mister in /media/fat/Amiga, but this can be changed by editing the script.
This MiSTer (most likely) won't adversely effect other cores (including standard Minimig) if you cold boot after using it.
Remember to turn off FSynth or MUNT if enabled in the UART menu. Even sitting idle they will slow down your software CPU somewhat.
*** The core .rbf filename must contain "_Hybrid" for this hack to work. ***
Thanks for working on this project foft! This is very cool and unique.
Re: Lets actually try Hybrid Emulation
Awesome, thanks for testing though and the MiSTer patch.
Its still a PoC, but it'll be a usable PoC once I get qemu working. I also got some help from TomB of uae4arm, so will try that one too.
Its still a PoC, but it'll be a usable PoC once I get qemu working. I also got some help from TomB of uae4arm, so will try that one too.