Simulator vs Emulator
Simulators and emulators are often confused with each other. This post explains what each one is, with examples.
What is a simulator?
A simulator is an effort to replicate the real behavior of a system that we are interested in understanding. A simulator can be a software simulator or a hardware one.
Software simulators
We don’t completely understand the climate. Had we understood it completely, we would have been able to accurately predict it for any future time, and there wouldn’t have been any need for forecasts. However, since we don’t understand the climate fully, our next best shot at it is to create a simulation of it and use that simulation for forecast. Climatologists build software simulations of climate models.
In robotics, the behavior of robots in an environment and robot dynamics in that environment are usually simulated in software. MuJoCo and Genesis World are popular robotics simulation platforms.
Hardware simulators
Hardware simulators do exist for certain applications. Flight simulators, which simulate cockpit controls, displays, and aircraft motion, are examples of hardware simulators.
What is an emulator?
An emulator closely reproduces the behavior of the system it imitates, so it can be used in place of the real thing for testing. Emulators exist for both software and hardware.
Software emulators
The recently released Amazon Web Services (AWS) emulator is an example of a software emulator. Developers can run it on their own system or infrastructure for services such as:
- S3 (Simple Storage Service)
- SQS (Simple Queue Service)
- DynamoDB
- Lambda, and more
This lets them test their applications without actually using the corresponding AWS cloud services. If everything works fine with the emulator, they can be confident that it will also work as intended with the cloud-provided AWS APIs.
Hardware emulators
One of the applications where hardware emulators are used is chip development. Chip development is a complex process that takes significant amount of time and costs millions.
A chip contains millions (sometimes billions) of electronic parts such as logic gates, registers, and wires. The standard process when designing a new chip is to write RTL (register-transfer level) code in a hardware description language (HDL) such as Verilog. Verilog provides higher-level abstractions that allow chip designers to test functionality without needing actual gates or wires. The chip’s design (RTL) is then loaded into a hardware emulator such as the Cadence Palladium Platform, which has thousands of parallel processors.
For a chip to work properly, its CPU, memory, caches, and I/O blocks must work together seamlessly. Testing these by running the design in a software simulation is extremely slow. Emulators take orders of magnitude less time than software simulation to perform the tests that help verify the chip design.
If bugs are found after fabrication, fixing them is very expensive. Therefore, designers test the chip design in emulators before fabrication, and the chips are fabricated only after successful verification. Emulators help ensure that the chip’s logic works as intended before fabrication.
References