2
\$\begingroup\$

What is difference between a simulator and emulator?

I have tried to google but I see there responses on SO that are much close to CS.

How can I understand the difference between a simulator and emulator in the context of EE? Does it means that an emulator is hardware just like a DSP kit or micro controller or FPGA kit and simulator is software like MATLAB or PSpice?

\$\endgroup\$
5
  • 1
    \$\begingroup\$ I would say that an emulator strives to reproduce a system exactly, while a simulator gives the results of a system without reproducing the system's internal. \$\endgroup\$
    – awjlogan
    Commented Jun 22, 2020 at 9:29
  • \$\begingroup\$ @awjlogan that wouldn't align with the usage of "emulator" in the software world, nor with the "processor emulator" in the hardware world. \$\endgroup\$ Commented Jun 22, 2020 at 9:31
  • \$\begingroup\$ @MarcusMüller Hmm - I'm not sure I agree - an emulator does try to recreate all the ops from the native system, such that you couldn't tell from the outside if you were running on the real thing, or a hosted system. At what point one describes it as simulating the ops is up for debate, however :) \$\endgroup\$
    – awjlogan
    Commented Jun 22, 2020 at 9:35
  • \$\begingroup\$ @awjlogan there's some truth to that, indeed. But then again, there are, especially for retro-computing, software that calls itself "emulator", but really tries to accurately model things down to bus accesses.. interesting angle you're introducing there. \$\endgroup\$ Commented Jun 22, 2020 at 9:38
  • 1
    \$\begingroup\$ Who really cares? What's the motivation here? \$\endgroup\$
    – Andy aka
    Commented Jun 22, 2020 at 11:20

3 Answers 3

3
\$\begingroup\$

I disagree that the terminology is used inconsistently.

The key is what you are trying to achieve. A simulator tries to simulate (in electrical engineering this is usually based on our mathematical and physical understanding of underlying physics) how a certain device, code, machine, etc will behave. It uses the internal structure of a model to give us an estimate of what that model will do based on the inputs provided to the simulator\$^1\$.

An emulator doesn't model the inside (necessarily, you can do hardware emulation by simulating the hardware, with something like Cadence's Palladium series of emulators). What an emulator seeks to do is to model to the outside world what we think/know the inside of a black box will do. A processor emulator will not necessarily simulate every transistor inside to see how it behaves. It takes a known behavior and emulates it for the outside world to interact with. A software emulator might emulate all the responses of a different operating system or architecture, so you can a program compiled for OS A or architecture B on a different OS or architecture.

A CPU such as seen in hardware design will model how the outputs and inputs of a CPU/micro controller might behave, without having to simulate the insides.

\$^1\$ note that these inputs must not be inputs in the classical sense of 'current flows in here' or 'a force is applied this way'. You can also do things like eigenmode analysis in a lot of types of simulations to study the resonances of a device, without requiring an external input.

\$\endgroup\$
2
\$\begingroup\$

The terminology is used a bit inconsistently:

  • When you talk to software people, an emulator is software that offers you a simulated system. For example, there are many "Gameboy emulators", with which you can play Gameboy games on your PC.
  • When you talk to processor designer people, an emulator is hardware that you can plug into a system instead of a real processor, and that simulates the processor hardwarewise (and is typically controlled by an external computer)
  • A simulator can pretty much be anything from a physical simulation of thermal properties to a software stub.
\$\endgroup\$
0
\$\begingroup\$

In a context of the two previous answers' explanation of what are simulators and emulators and how these are used for modeling, I'd like to add an example of the intertwined use of both.

A modeling system can include both simulating and emulating capabilities. The NS family of discreet-event network simulators was primarily conceived to be able to simulate behavior of packets in networks, both wired and wireless. Using simulators of this kind, students and researchers can study packet propagation, queues, routing etc. with existing protocols and develop new protocols.

A NS-3 simulator is special in that it most closely combines the two modeling flavors, simulation and emulation. In a simulator code, a file descriptor FdNetDevice represents a net device; it can also be used to provide emulation capabilities when it becomes programmatically associated with an underlying packet socket and receives a capability to send data on a "real" network. Another net device, a TapBridge NetDevice, allows a "real" host to participate in an ns-3 simulation as if it were one of the simulated nodes.

An ns-3 simulation can be constructed with any combination of simulated or emulated devices.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.