Emulation and Simulation

From Ninerpedia
Revision as of 17:34, 20 October 2011 by Mizapf (talk | contribs)
Jump to navigation Jump to search

MESS is an emulator, not a simulator

Both terms describe the concept of a system that behaves in the same way as the original system, but without being a copy. In most cases we speak about software emulation/simulation of computer hardware.

The difference between these seemingly similar terms is the strategy to make the systems behave equally:

  • A simulation is free to implement any kind of models of the original system which eventually creates a behavior that resembles the original system.
  • An emulation is designed to simulate basic functions of the original system, usually on the hardware layer.

Therefore, an emulator usually delivers a hardware simulation without the specific behavior. For a computer system this means that all the chips are simulated, but the behavior emerges from the execution of the memory contents. These memory contents are required to get the emulator running.

The goal of an emulation (which I also comply with) is that you see that all parts of the code have some corresponding part in the schematic of the real hardware. Eventually it should be possible to fully describe the hardware in a declarative way, e.g. by using an XML file, and not to require any more programming. This is already possible in MESS, at least for some simpler systems.

Can a physical system be adequately emulated?

Initially I thought that it is virtually impossible to fully emulate an electronic circuit, since in a program we do not have something like true parallelism. However, we do not need such a strict kind of concurrency, because

all computers are clock-driven devices.

This means that the emulated systems, including the TI, only make progress at discrete points in time. This allows us to evaluate the output of all circuits and to process them as if they appeared synchronously. This may be called "virtually synchronous" as it is not a really synchronous but it appears to be for the system. The only precondition is that the emulating system (the host) is fast enough to complete all evaluations before the clock tick or - equally important - that we care for an efficient code.