Re: [hatari-devel] Suggested patch to fix problem handling STOP when DSP is active

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


I don(t think trying to "stop" the DSP if it does nothing is a good idea.

In the real computer, the DSP is running, waiting for a reset, an interrupt, or anything else.

We'retrying to emulate the real machine.

So, we should not try to add some behaviour not existing into the real hardware if this can lead to wrong emulation results.

That's only my point of view.

Regards


Le 30/10/2020 à 20:20, Nicolas Pomarède a écrit :
Le 30/10/2020 à 19:12, Roger Burrows a écrit :
On 30 Oct 2020 at 14:13, Nicolas Pomarède wrote:

Patch applied, indeed it requires quite some cpu when DSP is updated
much more often (as DSP runs at twice the cpu freq and usually takes
less cycle per instruciton than the 68030, we can consider that the DSP
can run nearly 6-8 instructions while the CPU runs only one)

One issue is that once the DSP starts up, the DSP emulation continues even when nobody is using it.  So overall Falcon emulation speed is affected as soon as one DSP application runs.  On my system this is particularly noticeable when running EmuTOS, although it's also visible under TOS4 (once you know it's
there).

It would be useful to turn off the DSP emulation when not needed.  I have an idea about how to do that with some changes to EmuTOS, which I've tested (in a proof-of-concept form).  Basically EmuTOS will reset the DSP (via the PSG bit) when it's safe to do so, and that should set 'dsp_core.running' to zero.  It
works in my tests, and it's quite inexpensive in terms of ROM space.  Of
course, TOS4 will have to look after itself ;-).

Thanks for all your help,
Roger

There could be various way to detect if DSP is busy or not, but it can also lead to false positive. All in all, emulating a falcon is a really complex and cpu intensive task (especially if MMU emulation is enabled).

It could be an optimisation to detect the dsp is not used, but what matters to me is "does the pc handle the emulation when dsp is really running" (worst case regarding cpu usage). If not, I'm afraid turning dsp off automatically will only be a corner case and could add more code to maintain to the DSP core.

But patches are welcome in all cases :)

Nicolas





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/