As far as I understand, cross compilers, emulators, and simulators are all ways that one computer system to be able to behave like or run another computer system.

What is the difference between these concepts? Are some of them equivalent?

  • 2
    $\begingroup$ Cross compiler is in no way comparable to emulator or simulator, so asking for the difference makes no sense. What's the difference between a cigarette and a wheel barrow? $\endgroup$ – gnasher729 Aug 27 '20 at 19:39
  • $\begingroup$ (Common to those terms is they may come up developing software for a hardware you don't use during development.) $\endgroup$ – greybeard Aug 28 '20 at 6:57

Cross-development environment involve

  • a host computer (such as a PC) that runs the development tools,

  • a target computer (such as an embedded processor) that is where the code will eventually run.

A cross-compiler* generates the code that the target can understand, though compilation takes place on the host. The compiled code is sent to the target for execution.

An emulator is an ad-hoc piece of hardware that is able to mimic the behavior of the target, but is better suited for evaluation and testing.

A simulator is a software running on the host and able to mimic the behavior of the target without a physical target being present. Even though it runs on the host, it is able to execute the cross-compiled code.

A typical development scheme goes as follows:

  • cross-compile and debug with a simulator to obtain the correct functional behavior,

  • then cross-compile and debug with an emulator to check real-time performance and possibly interaction with real peripherals,

  • finalize the product on the real target.

*A compiler that compiles for the platform it runs on is called native.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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