REMINDER - Stay logged in for at least 2 hours a week to get whitelisted.
Also it helps build a picture where our "good traffic" is coming from for detection scripts.
:o)

PiStorm Chat

General discussions or ideas about hardware.
ijor
Posts: 828
Joined: 30 Nov 2018 20:45

Re: PiStorm Chat

Post by ijor »

Badwolf wrote: 13 Jan 2026 10:25 That's an excellent point and one I hadn't thought about: generate the BERR in the emulator. Imperfect, but probably good enough for 99% of use cases.
Why imperfect? You can make it perfect and work in all the cases, if you want. I said it might not be worth to bother with the complicated cases, and just generate BERR internally for RAM and ROM accesses. But you can emulate BERR in every I/O if you want, as emulators already do. There is a (minor) problem that the exact behavior depends on the chipset version. You can try to detect the current chipset, if you insist. Or just use the most common chipset behavior. Nothing too bad would happen if your BERR emulation doesn't match the actual hardware exactly. You are not cycle accurate anyway.
Is that the command that produces the RMW cycle? I don't think my inital port handled it originally, no.
Yes. I would need to think about this better, but I think it is harmless as long as the emulator is aware about this. TAS was designed to be atomic even in multi processor systems. But in our case, the only thing that can interrupt a read modify instruction is DMA. So, it should probably be ok as long as the emulator makes sure not to grant the bus in the middle of the RMC bus cycle.
Compiling in the bus error handling into the emulator does have quite an impact on performance ...
I'm not sure I understand why Bus Error handling should significantly affect performance. A bus cycle takes half a microsecond in the best case. This should be the dominant timing for bus cycles, by far. But may be I am missing something?
(we're just talking about memory speeds here, remember)
Wait a minute. You are saying that the above performance numbers are only for memory access. But that, in general, processing is way much faster?
The 'write through cache' was actually implemented quite early in development ... And yes, it improved things *considerably*.
Ah, nice. May be the key is to implement a smart "write back" cache, not write through. It is probably complicated, might need to be running in a separate thread to be really efficient. But if you are using local storage (which means no real DMA), and video emulation, you might never need to read or write to RAM at all. Even if not using video emulation, as long as you are not running a game that changes the video address frequently, a smart write back cache might reduce writes to the minimum.

I was thinking that if you optimize memory access, you might reach a point that the dominant time might be the I/O access to process the VBI and the timer C (200 Hz) interrupts. At that point it might pay to implement a custom driver to generate the interrupts locally. Of course, you might say that this kind of "optimizations" makes the PiStorm more an emulator than an accelerator. Guess the PiStorm fans wouldn't care, and the purists won't use a PiStorm anyway :)
... but that really demonstrated how broken the interrupt logic was on both ends of the interface. I'm fairly confident that brokenness was inherited rather than introduced by the Atari chaps.
May be this need to be investigated thoroughly, and fixed if necessary.
SteveBagley wrote: 13 Jan 2026 13:18 Given, IIRC, GLUE in the ST generates BERR if it hasn't seen DTACK for a certain time period (500ns?), is there any reason you couldn't just implement the same logic in software on the PI to generate BERR synthetically? (i.e. effectively if you timeout on waiting for DTACK, then it must be a bus error).
That's not a bad idea at all. But I'm not sure it is worth the complication. It is probably simpler and more efficient just to emulate the complete BERR behavior internally. If you know that the bus cycle is going to generate BERR, don't bother performing the bus cycle at all. If you know it will not, then you don't need to check.
http://github.com/ijor/fx68k 68000 cycle exact FPGA core
FX CAST Cycle Accurate Atari ST core
http://pasti.fxatari.com
User avatar
Badwolf
Site sponsor
Site sponsor
Posts: 3049
Joined: 19 Nov 2019 12:09

Re: PiStorm Chat

Post by Badwolf »

ijor wrote: 14 Jan 2026 03:30
Badwolf wrote: 13 Jan 2026 10:25 That's an excellent point and one I hadn't thought about: generate the BERR in the emulator. Imperfect, but probably good enough for 99% of use cases.
Why imperfect?
Imperfect only in the sense that it's not actually taking its cue from the hardware any more. I, and I suspect a few other folks who'd use PiStorm, are likely to have other mods in their machines.
Compiling in the bus error handling into the emulator does have quite an impact on performance ...
I'm not sure I understand why Bus Error handling should significantly affect performance. A bus cycle takes half a microsecond in the best case. This should be the dominant timing for bus cycles, by far. But may be I am missing something?
It's a build-time option in the Musashi library. As is FCx support, IIRC. Turning it on makes the library run noticably slower. I didn't write the library or the emulator built on it, I'm afraid, so I can't explain the details of why.
(we're just talking about memory speeds here, remember)
Wait a minute. You are saying that the above performance numbers are only for memory access. But that, in general, processing is way much faster?
Bus error support in the library account for about a 30-40% hit on the Integer Div scores in Gembench, from memory. Going from something like 25x stock STE to ~15x.

'Fast' memory access was of the order 4x normal speed. That could almost certainly be optimised further, but is not really an issue yet.

BW
DFB1 Open source 50MHz 030 and TT-RAM accelerator for the Falcon
Smalliermouse ST-optimised USB mouse adapter based on SmallyMouse2
FrontBench The Frontier: Elite 2 intro as a benchmark
ijor
Posts: 828
Joined: 30 Nov 2018 20:45

Re: PiStorm Chat

Post by ijor »

Badwolf wrote: 14 Jan 2026 13:14 Imperfect only in the sense that it's not actually taking its cue from the hardware any more. I, and I suspect a few other folks who'd use PiStorm, are likely to have other mods in their machines.
Well, that could definitely be a problem.
It's a build-time option in the Musashi library. As is FCx support, IIRC. Turning it on makes the library run noticably slower. I didn't write the library or the emulator built on it, I'm afraid, so I can't explain the details of why.
I see. May be @dad664npc has an idea about why this happens?
Bus error support in the library account for about a 30-40% hit on the Integer Div scores in Gembench, from memory. Going from something like 25x stock STE to ~15x.
And this is with cache, right? Which probably means that the emulator hardly performs any bus cycles when running the DIV benchmark. May be the emulator still performs bus error checking even when accessing the cache?
http://github.com/ijor/fx68k 68000 cycle exact FPGA core
FX CAST Cycle Accurate Atari ST core
http://pasti.fxatari.com
User avatar
Badwolf
Site sponsor
Site sponsor
Posts: 3049
Joined: 19 Nov 2019 12:09

Re: PiStorm Chat

Post by Badwolf »

ijor wrote: 15 Jan 2026 17:04
Badwolf wrote: Bus error support in the library account for about a 30-40% hit on the Integer Div scores in Gembench, from memory. Going from something like 25x stock STE to ~15x.
And this is with cache, right? Which probably means that the emulator hardly performs any bus cycles when running the DIV benchmark. May be the emulator still performs bus error checking even when accessing the cache?
That was probably pre-cache as it would have been very early in the bring-up when I went from the original Musashi build with a custom no-BERR generating EmUTOS to the BERR-enabled build and first real OS boot.

I'm not sure what effect RAM speeds have on the Int Division score, though. From my other uses it seems to remain pretty stable despite all sorts of terrible hardware thrown at it.

BW
DFB1 Open source 50MHz 030 and TT-RAM accelerator for the Falcon
Smalliermouse ST-optimised USB mouse adapter based on SmallyMouse2
FrontBench The Frontier: Elite 2 intro as a benchmark
User avatar
JezC
Posts: 2799
Joined: 28 Aug 2017 23:44

Re: PiStorm Chat

Post by JezC »

I'm hoping to try a PiStorm in one of my H5 or H4 boards soon...the adapter is due tomorrow (hopefully).

I already have a Pi 3A plus some 3B+ and Zero 2W but will probably get a Pi 4 as well at some point (as that seems to be the reference working board at the moment)

I think the 3A and Zero 2W boards I have already have the GPIO headers fitted but not the 3B (and the Pi 4s I can see don't have them fitted either) so I'm wondering if anyone can recommend a push fit GPIO header to use?

TIA
User avatar
mrbombermillzy
Moderator
Moderator
Posts: 2318
Joined: 03 Jun 2018 19:37

Re: PiStorm Chat

Post by mrbombermillzy »

Good move @JezC :dualthumbup:

I will keep a close eye on how you fare with this and if all goes well, I will have a go too. (Although I will have to concoct a +5v GPIO header mod, as my Rpi 3B MicroUSB slots are a bit loose! :roll: )

Where (and what type) of Pistorm did you buy?
User avatar
JezC
Posts: 2799
Joined: 28 Aug 2017 23:44

Re: PiStorm Chat

Post by JezC »

mrbombermillzy wrote: 09 Jul 2026 18:11 Good move @JezC :dualthumbup:

I will keep a close eye on how you fare with this and if all goes well, I will have a go too. (Although I will have to concoct a +5v GPIO header mod, as my Rpi 3B MicroUSB slots are a bit loose! :roll: )

Where (and what type) of Pistorm did you buy?
Will let you know when it arrives (supposedly in the post for delivery today....but not had any post all week...).
I'm going to check my setup in an Amiga first (to prove everything works together) & then try it in the ST...

However, I don't think it's been tested on the Pi boards I already have (3A/3B+/Zero 2W) in an ST yet, hence the plan to get a Pi 4 & push fit header...then I should have the components that are known to work as a reference.

Might be an interesting and long journey!
;) :roll:
Steve
Posts: 3312
Joined: 15 Sep 2017 11:49

Re: PiStorm Chat

Post by Steve »

I dunno if you guys are in the Atari Pistorm Discord channel, but recently @dad664npc has been demonstrating a new build using a JIT version which is achieving some insane results! It can even output STe DMA sound over the HDMI now too.
User avatar
JezC
Posts: 2799
Joined: 28 Aug 2017 23:44

Re: PiStorm Chat

Post by JezC »

Steve wrote: 10 Jul 2026 08:44 I dunno if you guys are in the Atari Pistorm Discord channel, but recently @dad664npc has been demonstrating a new build using a JIT version which is achieving some insane results! It can even output STe DMA sound over the HDMI now too.
I've recently joined that channel & am keen to see how it works out for one of my H4/H5 boards....but I don't use discord much & it's often not so easy (for me) to find the info in older posts...

Just looking to choose a suitable push-fit header & then order a 1G Pi 4 plus header to baseline a working setup & then try lower spec (and smaller form factor) Pi boards...

Maybe I should ask on the discord channel?... :lol: :roll:
peters
Posts: 227
Joined: 25 Feb 2023 20:44

Re: PiStorm Chat

Post by peters »

The performance that he has achieved is well beyond anything I thought possible after the earlier struggles.Coremark 458.

Return to “HARDWARE DISCUSSIONS”

Who is online

Users browsing this forum: ClaudeBot and 10 guests