Pleas explain -

Hi all

I am new to embedded and I would like to really understand the following debugging terms : 1> SIMULATOR 2> EMULATOR 3> IN CIRCUIT EMULATOR

What are the differences between them ? What are the basics of the functionality of each ?

Thanks elico

An emulator allows using somethingA on somethingB that is not specifically designed/intended for SomethingB, the emulator 'emulates' the functionality of SomethingA

A simulator will try and create/predict some kind of scenario/behaviour based on constants and variables that define an environment/working paramaters.

An in circuit emulator I dunno much about so I read this

A "simulator" is usually a software-only thing that pretends to be some other device. An "arduino simulator" might run as a windows app, throw up a picture of an Arduino on your screen, let you attach simulated "devices" to the simulated "pins", load a sketch, and somehow see what it was doing and whether it worked.

An "in circuit emulator" is usually a mixed hardware/software device that somehow communicates with an actual circuit built around some chip, and creates all of the hardware signals that the actual chip would create, allowing you the same sort of visibility insider the operation of your program as a simulator, but with "live" hardware instead of simulated hardware.

IMO, "emulator" is ambiguous, and might be used to mean either one of the above.

The only slight meaning difference between emulator and simulator is that emulator implies real-time performance - you can plug in an emulator to replace the thing it emulates. A simulator might not be fast enough - used for testing logical behaviour but not "live"...

For instance SPICE is a circuit simulator, but it doesn't run in real time or anything like. An in-circuit emulator obviously isn't useful if it doesn't work live in real time in the circuit in question...

So basically an emulator can be used as a replacement - its a functional imitation, a simulator might not be up for that.

So when people talk about pilots training in "flight simulators" should they say "flight emulators"?? Discuss!

There is a thread on stack overflow that asks the same question. The answer there was:

You want to duplicate the behavior of an old HP calculator, there are two options:

You write new program that draws the calculator's display and keys, and when the user clicks on the keys, your program does what the old calculator did. This is a Simulator

You get a dump of the calculator's firmware, then write a program that loads the firmware and interprets it the same way as the microprocessor in the calculator did. This is an Emulator

The Simulator tries to duplicate the behavior of the device. The Emulator tries to duplicate the inner workings of the device.

Which, I believe, also answers the 'Flight Simulator' question.

I like the HP calculator definition for simulator, but I would say that an emulator can replace the object being emulated. However, it doesn't need to do it in the same way - you could put an arduino inside the calculator case instead of its existing processor, and as long as it makes the calculator behave the same it's an emulator - it doesn't need to execute the old firmware. Similarly, you could emulate a mechanical greenhouse window opener. The old school device is a cylinder full of something that expands when the temp rises, pushing a piston. You could emulate the same thing with an arduino, a DS18B20 and a linear actuator.

As to in-circuit, it implies that the emulator can be used instead of the component being emulated - i.e. it has the right pinout so that you can plug it into the same place on the circuit board that the original occupied and use it in the same way. With my greenhouse opener example, an in-circuit equivalent would have to connect to the same two points the wax version did, although it might will not have the same overall dimensions.