Hacker News new | past | comments | ask | show | jobs | submit login

It'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.




It 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.


I'm not sure. I'm saying it's easier to get accurate wall clock timing via hardware than via software. You said they are the same.


It sounds like you just rephrased & elaborated on part of what I originally said, again. I'm not sure what you're disagreeing with.


> 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.

I am disagreeing with this.


The statement is about relative timings, to be clear, and you agreed with that.

I'm not trying to be clever here to win an argument, I really just think that good relative timing is implied by "accuracy", and good wall-clock timing is not--that's "performance". It makes sense to me that these terms are separate, so I can say something like "I have a cycle-accurate emulator that runs at 25x realtime".

For stuff like game systems, you generally don't need a ton of wall-clock accuracy anyway. You're going to be plugged into some kind of LCD panel, and you just need to make sure that it gets fed with the correct data every 16 ms or whatever the correct update rate is. The fact that your input controller isn't getting probed at the exact right time relative to the screen update is kind of a non-issue.


Yeah, we agree on relative timings, and I guess I'm okay with using "accuracy" without qualification for that, i.e. what the machine observes. It wasn't clear to me that "timing" meant cycle-accuracy, so I guess we do agree after all.

As for how much wall-clock accuracy you need... Eh, as said, it depends on how much of a preservationist you are. If you plan to actually generate an NTSC or PAL signal on a low level (including actually performing the quadrature amplitude modulation), it can well become relevant, and phase noise affects color.

Otherwise maybe not, though again I'm not surprised if some standard Linux on some RPi actually shows visible glitches from time to time. Irrelevant for most users, but then again most users may also just want to play the game on a rudimentary emulator, or even a more modern version of the game. This is all either for fun or for preservation, after all.

If you do need (video signal) or want (anal retentiveness) high wall-clock accuracy, an FPGA then also has the advantage that whatever ARM core or whatever you have next to it can implement UI and control in whatever is most convenient, on any non-RT run of the mill OS, without any risk to negatively affect the rock-solid, cycle-locked emulation in the FPGA. On an overall weaker overall SoC at lower frequency, even.

An FPGA does make things easier, is my point.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: