5 ms·
Hardware emulation can make the timings between multiple chips more accurate as processes actually can be done in parallel and in sync with a shared clock. This
by bebop 4y ago
Hardware emulation can make the timings between multiple chips more accurate as processes actually can be done in parallel and in sync with a shared clock. This is harder to get perfect with software emulation. In theory.
- klodolph 4y agoHardware emulation cannot actually make the emulation more accurate than software emulation. That doesn’t make any logical sense. If you know what the correct timing is, you can emulate it in hardware or software. It’s not harder to do in software. It’s just hard to get the timing correct, regardless of whether you are using software or hardware. There are certain cases where it’s hard to get good performance out of a software emulator, that’s really the main difference.
- bitwize 4y agoIt should be easier to do in software. What's hard is, modelling the hardware accurately, getting the timing correct, AND getting everything performant enough to run at the original hardware speeds. It takes a beefy system to accurately emulate even SNES hardware at full speed. An FPGA can be programmed with accurate hardware models and run them all in parallel at the same speeds the original hardware ran at (up to a limit, I believe today it's somewhere in the low hundreds of MHz for a CPU). This allows for a closer approximation of the original hardware running at usable speeds.
- klodolph 4y agoIt used to take a beefy system to emulate the SNES at full speed. Emulator performance has improved, CPU performance has improved, and nowadays, an outdated and low-spec x86 laptop will run BSNES. You will have problems running BSNES on a Raspberry Pi, though, although I've heard the RPi 4 can do it.
- anyfoo 4y agoMoreover, it can actually be at least "more straightforward" to reach accurate wall clock timings with an FPGA, than by trying to meet deadlines in a common OS environment, as the FPGA is "just" loaded with a bitstream that will it do more or less exactly what the original chip did and nothing else, spoken strictly in the digital domain. I'd also like to think that it's more efficient, since at least in theory it could be (cutting down on all the extremely superfluous software overhead for the task), but sadly I don't actually know how common FPGAs really perform in that specific case against reasonably efficient modern CPUs.
- klodolph 4y agoIn general, the hardware emulations are much less efficient because the cost of manufacture usually won't be recouped over the lifetime of the device.
- anyfoo 4y agoIt's not that simple. Yes, from the point of view of the emulated system, it does not matter if the emulation is software or "hardware" (i.e. an FPGA), as it will always observe correct relative timings. But if you want actually correct timings in the real world, i.e. to wall clock, a modern software environment will make it harder for you in practice. If you don't have an OS with any real-time capabilities, that's your first problem: You have no (good) guarantee when and for how long your threads are scheduled, how long allocation and system calls will take and block you, and generally whether you can reliably meet any of your deadlines. On Linux with VICE, I would not be shocked at all if I occasionally observed VICE stuttering for a millisecond. With baremetal (or an OS with sufficient real-time capabilities), you can make your deadlines meet with some care. You will still have some (possibly negligible) amount of jitter: Superscalar CPUs and caches are just some of the culprits. Does the jitter, or even the lack of deadline guarantees on plain Linux with VICE, matter in practice? Maybe not. With a fast enough machine you might not notice at all. Is it easier, and to some extent more efficient, to just sidestep those issue with an FPGA implementation that is guaranteed accurate to wall clock (not just emulated clock)? Probably. Comes at the cost of having FPGAs, though. On the other hand, a real NTSC/PAL output is going to be pretty real indeed! As said, not that simple. How hardcore you are on your wall clock accuracy requirements probably depends on how much of a "preservationist" you are.
- klodolph 4y agoIt sounds like you've rephrased and elaborated exactly what I just said, but the way you've phrased it makes it sound like you're disagreeing with me. So I'm unsure what, exactly, you disagree with.