6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 22, 2024 9:15 am

All times are UTC




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 45 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: Fri Jun 06, 2014 6:19 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
In order to try to keep this perpetual debate from messing up every new thread in which someone uses the term "emulator", let's have a single endless thread.

If you were active in the field in the 1970's, you might have come across a hardware device called an ICE, or in-circuit emulator. It was an expensive box of digital electronics with an umbilical to a header, which would plug into the microprocessor's socket, replacing it, to allow you to diagnose your design.

These days we very rarely come across ICEs, and the term "emulator" is widely and unambiguously used to refer to software which simulates a microprocessor or a system for the purpose of running or debugging code. Sometimes the term "software emulator" will be used, probably only to forestall commentary that the emulator should properly be called a simulator. Very few people prefer the term "simulator" for this kind of software, and that term is not widely used and does not help communication.

It's relatively common for a hobbyist to decide to write a new emulator, for fun or as a learning experience or to emulate an uncommon processor or platform.

Please, just say "emulator" - no-one will misunderstand you, and only a very few people will be perturbed.

Cheers
Ed

(Sometimes we make use of software which simulates digital designs or analogue circuits, and we might call that software a logic simulator, an HDL simulator, or a circuit simulator. It's general purpose, reading a description at runtime of the circuit to be simulated. It's feasible to write your own, but it's rather uncommon to do so. No confusion arises from this terminology, and there's no debate.)


Top
 Profile  
 
PostPosted: Fri Jun 06, 2014 6:41 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
From the other topic:
Quote:
Beware - this is not at all a settled point!

Agreed.

Quote:
There are such things as (hardware) emulators, also known as in-circuit emulators,

I've only heard the term "in-circuit emulator" (ICE) used of ones that plug into a socket, usually the microprocessor socket, to troubleshoot your board, not just your software; although ROM emulators are generally called that— "ROM emulators."  An emulator that's not an ICE might be like a Commodore 64 emulator that lets you plug in actual hardware C64 cartridges and accessories and test them, because the signals and voltages and timings are correct for that; but it's still an emulator even if you use it without joining it to other circuits.

An emulator is one computer that takes the place of another.  In the case of banking, office, or game applications, there may be little difference between a simulator and an emulator (same with emulating or simulating most calculators, since their only I/O is the keyboard and display); but to take the place of a computer that has ports that are not standard like USB is, and especially for non-human I/O, a software-only product absolutely does not qualify as an emulator.  The concept of emulating my workbench computer emphasizes the point all the more, because it has almost no human I/O, but nearly a hundred bits of I/O, plus analog-to-digital and digital-to-analog converters, RS-232 line drivers & receivers, and more.

I don't really care what we call them except that there needs to be a way to specify the ones that include hardware even if they're not specifically ICEs.

In any case, even most of the software 6502 imitators are not cycle-accurate, so they would not qualify as emulators by anyone's definition.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
 
PostPosted: Fri Jun 06, 2014 7:58 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
I think I take the position that usage trumps definition, but my attempt at definition would be something like:

- The purpose of a simulator is to debug or investigate an implementation. It has an internal structure related to the internal structure of the implementation in question. In this way, it has an external behaviour rather like the implementation in question.

- The purpose of an emulator is to debug or investigate the behaviour of the system surrounding an implementation. The internal structure is whatever is appropriate, such that the external behaviour is rather like the implementation being investigated.

When we emulate a C64 or PET, we replace the real device with some software and we investigate the interactions with a human (or a filesystem)

When we simulate the 6502 with visual6502 or HSPICE, we assemble a data structure like the internal transistors and connections on the chip, and we investigate how they work together to produce the high-level behaviour of a CPU.

Cheers
Ed


Top
 Profile  
 
PostPosted: Fri Jun 06, 2014 8:54 am 
Offline

Joined: Sun Apr 10, 2011 8:29 am
Posts: 597
Location: Norway/Japan
My way of thinking: When I wrote my minicomputer emulator I emulated the CPU, but I simulate the operating system. My CPU emulator can execute all (user) programs. But those programs are constantly calling operating system services, and my CPU emulator does not execute the operating system. Instead I simulate the operating system so that it looks to the executing applications that there's actually an OS there. But my simulation only maps *nix files etc. via various tricks and configuration files so that the application is satisfied. When the application thinks it's manipulating directory entries, for example, nothing of that really happens.

There is another person writing an emulator for the same minicomputer though. His emulator is intended to be able to execute the actual operating system too. So no operating system simulation. Peripherals will be simulated though (to start with, at least).

In some ways this way of thinking is the exact opposite of some definitions I have read (also in this forum), where a 'simulator' is supposed to be more 'accurate' than an 'emulator'. In may way of thinking, however, for software I think of emulators as doing the right thing as much as possible, while simulators are just going through the motions to simulate (but not actually do) what it looks like it's doing from the outside. Smoke screens and handwaving.. as my OS simulator.

That doesn't mean that my definition is 'correct', but at least enough other people are thinking the same way to make us able to communicate! :-)

(I imagine this way of thinking about 'simulation' came out of e.g. when someone drafted to military service tried to simulate being insane, ill or blind, but it doesn't hold up to scrutiny)

-Tor


Top
 Profile  
 
PostPosted: Fri Jun 06, 2014 9:25 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
You're right, there is that other meaning of "simulate" and it does lead to an opposite pair of definitions!

Cheers
Ed


Top
 Profile  
 
PostPosted: Fri Jun 06, 2014 1:31 pm 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
According to the English Oxford Dictionary:

simulate: Produce a computer model of
emulate: Reproduce the function or action of (a different computer, software system, etc.)
simultor: A program enabling a computer to execute programs written for a different operating system.

Sadly no emulator in the OED.

Personally I think the difference is a bit fuzzy.

IMHO if you are trying to reproduce function or action against physical hardware then you must have an emulator but if the scope of the reproduction is limited (e.g. just the CPU) or against virtual hardware then you could call it either a simulator or an emulator.

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
 
PostPosted: Fri Jun 06, 2014 3:59 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8505
Location: Midwestern USA
I learned it as: you emulate hardware by using other hardware. You simulate hardware by using software running on other hardware. For what it's worth, commercial airline pilots train on simulators, not emulators.

The general basis for this distinction seems to lie in that emulation promotes an exact (ideally one-for-one) behavior, where as simulation is usually a "close enough" activity. To me, at least, the distinction has always been clear.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Last edited by BigDumbDinosaur on Wed Feb 05, 2020 6:14 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Fri Jun 06, 2014 4:12 pm 
Offline

Joined: Sat Jul 28, 2012 11:41 am
Posts: 442
Location: Wiesbaden, Germany
A simulator is a tool for logic or program development and allows you to verify a logic design or program, before it is actually put in use in its real environment. So it is never part of the final product. Typical candidates are the simulations inside IDEs or a logic simulator like SPICE. Even a reverse engineering model like visual6502 is a simulator as it only serves the purpose of understanding or learning the concepts applied in the actual CPU. In this case the final product (CPU) already exists.

An emulator is a replacement for the real thing. As such it is or is part of the final product. An emulator can serve the purpose of a simulator if it provides the verification needed for another product.

_________________
6502 sources on GitHub: https://github.com/Klaus2m5


Top
 Profile  
 
PostPosted: Fri Jun 06, 2014 8:14 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
BigDumbDinosaur wrote:
I learned it as: you emulate hardware by using other hardware. You simulate hardware by using software running on other hardware. For what it's worth, commercial airline pilots train on simulators, not emulators

which is good, since we don't want all our pilots to die in training, using other aircraft that emulate the one they're supposed to be learning.  In a related note, someone told me of visiting a military installation many years ago where their training simulators were extremely sophisticated for the day.  He was given a demonstration (completely safe, since it was a simulation, not an emulation), and as he approached the aircraft carrier for a landing, he was way too low, and actually hit the water and flew under the carrier, and he said you could see the hull of the ship go over, and he pulled up and flew back out into the air on the other side. :lol:

I remember reading of the development process for my HP-71 hand-held computer.  Before there were any actual HP-71's, they hand-built and used an emulator to test things on—not just software, but hardware modules that would be made for it, including the bar-code wand and the main HPIL interface module that would enable it to communicate with not just mass storage and printers and video, but all kinds of lab instrumentation.  The emulator had to present all the signals and voltages and timings that would be at each of the port connectors on the real HP-71.

BigEd wrote:
usage trumps definition

No, usage does not trump definition, any more than so many people saying "supposably" or "Valentimes Day" make them correct.  They are not correct, no matter how many times people say them.  They are incorrect.  The same goes for using "who's" (short for "who is," or less often, "who has") if you mean "whose" (meaning relating to or belonging to someone or something), or "your" (meaning belonging to you) if you mean "you're" (a contraction of "you are").  Common error does not make them correct.  It's like a squatter living on land that's no his for so long he thinks it's automatically his somehow.  An emulator always involves hardware.  If you can download it, it's not an emulator.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
 
PostPosted: Sat Jun 07, 2014 2:09 pm 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
Time to get hip with the new lingo people.

http://en.wikipedia.org/wiki/Emulator#Emulation_versus_simulation

Emulation is the new simulation (and has been for over 30 years). Time to stop living in the past.

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
 
PostPosted: Sat Jun 07, 2014 5:14 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
BitWise wrote:
Time to get hip with the new lingo people.

http://en.wikipedia.org/wiki/Emulator#Emulation_versus_simulation

Emulation is the new simulation (and has been for over 30 years). Time to stop living in the past.

I don't see that the article helps your point. it says,
Quote:
but currently the term "emulation" often means the complete imitation of a machine [which has to include hardware if it attaches to other things -GW] executing binary code while "simulation" often refers to computer simulation, where a computer program is used to simulate an abstract model.

Thinking that it can completely imitate a machine, with only software, is a very limited idea of computing, held by those who think a computer has to have a keyboard and monitor and exists for human I/O. That's not what I'm into 6502 for.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
 
PostPosted: Sun Jun 08, 2014 6:23 am 
Offline

Joined: Sat Jul 28, 2012 11:41 am
Posts: 442
Location: Wiesbaden, Germany
Oh my god, it is Wikipedia so it must be the truth!

Further down at Functional_simulators
Quote:
Functional simulation is the use of a computer program to simulate the execution of a second computer program written in symbolic assembly language or compiler language, rather than in binary machine code. By using a functional simulator, programmers can execute and trace selected sections of source code to search for programming errors (bugs), without generating binary code. This is distinct from simulating execution of binary code, which is software emulation.
Oh come on! Everything eating binaries is an emulator? That is a bit too simplified for my taste.

_________________
6502 sources on GitHub: https://github.com/Klaus2m5


Top
 Profile  
 
PostPosted: Sun Jun 08, 2014 10:05 am 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
Language evolves. Words like 'emulate' are adopted into new uses. As Wiki points out in the section I linked:
Quote:
It has recently become common to use the word "emulate" in the context of software. However, before 1980, "emulation" referred only to emulation with a hardware or microcode assist, while "simulation" referred to pure software emulation. For example, a computer specially built for running programs designed for another architecture is an emulator. In contrast, a simulator could be a program which runs on a PC, so that old Atari games can be simulated on it. Purists continue to insist on this distinction, but currently the term "emulation" often means the complete imitation of a machine executing binary code while "simulation" often refers to computer simulation, where a computer program is used to simulate an abstract model.

The last time I worked on a simulator it was modelling the movement of oil and gas in a reservoir. I'd class that as pretty abstract.

Other examples of simulators on Google include ones for flight, weather, goats (http://www.goat-simulator.com/), farming, cameras, railways and whole plethora of things that aren't computers. On the other hand the list of things emulated contains arcade machine, games consoles, mobile phones, terminals. All pretty much programs that pretend to be other computers.

The simple fact is, like it or not, that the word has moved on. It now has a broader interpretation than it once did.

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
 
PostPosted: Sun Jun 08, 2014 10:16 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
Quite so!


Top
 Profile  
 
PostPosted: Sun Jun 08, 2014 10:37 am 
Offline

Joined: Sat Jul 28, 2012 11:41 am
Posts: 442
Location: Wiesbaden, Germany
BitWise wrote:
Other examples of simulators on Google include ones for flight, weather, goats (http://www.goat-simulator.com/), farming, cameras, railways and whole plethora of things that aren't computers. On the other hand the list of things emulated contains arcade machine, games consoles, mobile phones, terminals. All pretty much programs that pretend to be other computers.
I agree with you for the above cases. However, there is none of the disputable uses there. How about visual6502?. How about a debugging tool using binaries? I think those are simulators because there is no use for them, if you are not interested in specific aspects of the CPU (program debugging, understanding CPU architecture). They cannot simply run a program for the end user like emulators can.

Emulators need to be able to run at the speed and provide the same interface as the replaced machine. Everything else is a simulator. It is not an emulator just because it can run binaries!

_________________
6502 sources on GitHub: https://github.com/Klaus2m5


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 45 posts ]  Go to page 1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: