Emulation and Simulation

From Ninerpedia
Jump to: navigation, search

This wiki is maintained by the principal maintainer of the MESS emulation of the TI99/4a family and you will find a great deal of technical informaiton here relating to that emulation.

The maintainers of MESS itself have made several major and emulation-breaking changes causing the maintainers of the actual emulations much work some of which you can read about on this wiki. If an emulation had no maintainer, MESS simply stopped supporting it.

The first big break came after MESS 0.97, with a further major change at 0.145 - yes 0.145 is a later release than 0.97...

There are other emulators of the TI99/4a family all of which are worthy. See the page Emulators. The general discussion of emulators / simulators below applies to them all even though MESS is headlined.

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.