off topic... simulator vs emulator terminology musings

This is kind of meta. I am just wondering if anybody else here shares my definitions for these terms, and finds the prior discussion regarding CIQ simulation a bit off-putting. I wonder if this is more of a culture/dialect issue between different regions, generations, or sub fields, or...?

To me, the words simulator vs emulator do not not mean distinct levels of accuracy. They mean different purposes.  Accuracy is a different axis of choices for either one.

A "simulator" models or predicts the function of a system or subsystem. The simulator's purpose is to forecast. It predicts output responses and other quantifiable characteristics in response to inputs and other simulation parameters. These can be extremely accurate, e.g. down to simulating charges and RF characteristics of nanoscale semiconductors. Or they can be abstract simulations of digital processes, e.g. how a computer will respond to certain network traffic.

An "emulator" also replicates input/output for a system or subsystem. But, conversely, the emulator's purpose is to reproduce/replay. You don't use an emulator to predict the behavior of a new design. It is constructed to reproduce desired/known behaviors, usually to embed in a larger system that is being tested.

There is a subcategory of "in-circuit emulators" meant to replicate electrical characteristics well enough to embed in a test circuit. There is also a category of "real-time simulator" meant to interact with partner systems. E.g. a flight simulator can predict how an aircraft will behave under the live control of a real human pilot who feels like they're flying it.

Where it gets confusing is that these things can also be combined in practice. It becomes a judgement, in the eye of the beholder, whether you are simulating or emulating. I'd say a basic flight simulator, e.g. at a training or recreational center, might emulate an airspeed sensor connected to physical cockpit instruments. It sends signals based on simulated aircraft dynamics and some textbook definition of how the airspeed should indicate in that scenario. A more first-principles flight simulator, e.g. at a design center, might model the aerodynamic flow around an actual pitot tube design, to predict airspeed sensor response to extreme conditions and maneuvers. Such simulation results might be used to make a more accurate emulator.

This is similarly vague when it comes to software execution.The software is really just data, i.e. part of the inputs/parameters. Is a modern paravirtualized machine on a general purpose computer a simulator or an emulator? It is faithfully reproducing the known execution system like a good emulator. But, due to the huge input/parameter space, it may also be predicting the response to a novel input like a good simulator!

My personal bias is that an emulator would strive to run programs according to the published instruction set rules, and a simulator might reveal bugs in an actual processor design where it deviates from the rules for a given instruction sequence.

Edit to add: I do recognize that some may have other biases. E,g. they could expect an emulator to reproduce the errata of a given processor, while their simulator is for the abstract instruction set rules. This difference is the core of what I'm wondering... is it taught differently in different regions of the world, or different generations of teachers, or something else?

  • For me, the term "emulation" generally has a specific meaning in computer science, and "simulation" has a.different connotation. I don't think the words directly refer to distinct levels of accuracy, but differing accuracy is a byproduct of fundamental differences between emulation and simulation. 

    Loosely speaking:

    - Emulation: the emulator mimics the hardware of the device that is being emulated. Examples outside of Connect IQ would include various video game console emulators. These emulators are able to run the firmware of the device that's being emulated, and as far as any game software is concerned, they are indistinguishable from the real hardware. (Ofc there are vary degrees of accuracy when it comes to emulation.)

    - Simulation: the simulator mimics the behaviour of the device (or system) that is being simulated. For me, an example outside of Connect IQ would include the responsive design mode in Firefox, which allows Firefox to mimic a mobile device. A flight simulator or driving simulator are other good examples.

    In the case of Connect IQ, (in my mind), a hypothetical emulator would (or could) run the actual firmware of the device that is being emulated. This is *clearly* not the case with the actual CIQ simulator (for many obvious reasons, such as the fact the sim has bugs/behaviour not present in a real device and vice versa, and the sim has a subset of a real device's functionality). To me, this is why the CIQ simulator is *not* an emulator. Maybe we could say that it emulates the CIQ VM, but not the device itself.

    Ofc there are no hard and fast rules, as "emulation" is often used for some things which might better fit the definition of "simulation" above. e.g. There is an extension for Firefox called "Mobile Device Emulator", and it's arguable that this is closer to simulation than emulation. Then again, if the "mobile device emulator" successfully mimics a mobile device from the POV of a website that's accessed with Firefox, maybe it's "emulation" after all?

    As far as CIQ is concerned, I think the loose definitions above are fairly useful. If we had a CIQ device emulator (rather than a simulator), then there would hypothetically be no need to test apps on a real device (unless you wanted to see what the display looks like irl). But CIQ devs know very well that it's almost mandatory to test your app on at least one real device.

    I will say that:

    - nobody would call a video game console emulator a "video game console simulator"

    - and nobody would call a flight simulator a "flight emulator"

    Idk if that's enough to draw a sharp line between the two terms, though.