Subject: Re: TI emulator for Andriod tablet

From: "Michael Zapf" <[email-masked]>
Date: Wed, 23 Jan 2013 08:39:09 -0000

Hi, 

> So, you're running a TI emulator on a PC emulator an an Android tablet? And
> yet, someone here suggested that a tablet wouldn't be powerful enough to
> emulate a TI natively? I thought that sounded wrong, now I know it is. I
> was running V9t9 on a 286 back in the day.

me someone.

I said that it depends on the kind of program, whether it is a simulator or an emulator. If you can run v9t9 on a tablet this is an indication that v9t9 is rather a simulator than an emulator. Or, it is simulating more than it is emulating (you can have both).

The difference is that a simulator does everything to make it look and feel like the real system, exploiting optimizations and shortcuts in the architecture. An emulator is a simulator, but on a very low level: it is simulating the discrete circuits on the board. 

MESS is an emulator, and it requires a lot of computing power. In particular, just recently I re-implemented the TMS9900 CPU to execute microprograms at the precise clock cycles. If it were a simulation, we would just write some code to achieve the desired effect.

I don't say that emulation is better than simulation, especially in the eyes of the user. It just has different objectives.

Michael

---

From: "Tursi" <[email-masked]>
Date: Wed, 23 Jan 2013 01:09:40 -0800

The line between simulation and emulation in general usage is ridiculously 
blurred. It's not helped at all that the embeded definitions are practically 
reversed (where emulation means hardware hooks and simulation means a 
software reproduction).

MESS, V9T9, and many others were called emulators long before any hope of 
cycle accurate reproduction was possible. It's reasonable, in fact, to say 
that the word emulation applies to simulators as well, as that any 
discussion of a difference borders on nitpicking.

For example, although you may have cycle accurate 9900 microcode emulation 
in MESS, the video chip and the 9901 are simulated at a much higher level. 
The memory selection chips, the multiplexer circuit, the display itself, 
these are not even emulated, they are bypassed completely (leaving only 
their end effect, in most cases). The speech synthesizer directly accesses 
speech ROMs, rather than handling addressing and fetch cycles, and cartridge 
bank switching is performed by copying data over the same location in RAM --  
hardly an accurate reproduction of an address line to a ROM. MESS is still 
very much a simulator by your own definition. It will be some time yet 
before desktop PCs are powerful enough to emulate every circuit in even a 
classic home computer in real time.

MESS has an architecture that has more indirection than many dedicated 
emulators. This is a large part of why it can do so many things. But it also 
means that even if you were "simulating" all parts of the system -- which is 
exactly how MESS worked before you did your CPU rework and how most of the 
other CPU cores work -- it still tends to require more horsepower than a 
dedicated emulator might.

Ultimately, I think trying to distinguish between the two concepts is just 
too early. When we finally have fully accurate chip reproductions in 
software that can link together into working machines that run at speed, we 
really need a new name for it. ;)

All that said, I'm curious now, since you have it working at the microcode 
level, does that mean you implemented a 4-phase clock system? How did you 
deal with that? That seems really cool to me. :)

-----Original Message----- 
From: Michael Zapf
Sent: Wednesday, January 23, 2013 12:39 AM
To: [email-masked]
Subject: [TI994A] Re: TI emulator for Andriod tablet

Hi,

me someone.

I said that it depends on the kind of program, whether it is a simulator or 
an emulator. If you can run v9t9 on a tablet this is an indication that v9t9 
is rather a simulator than an emulator. Or, it is simulating more than it is 
emulating (you can have both).

The difference is that a simulator does everything to make it look and feel 
like the real system, exploiting optimizations and shortcuts in the 
architecture. An emulator is a simulator, but on a very low level: it is 
simulating the discrete circuits on the board.

MESS is an emulator, and it requires a lot of computing power. In 
particular, just recently I re-implemented the TMS9900 CPU to execute 
microprograms at the precise clock cycles. If it were a simulation, we would 
just write some code to achieve the desired effect.

I don't say that emulation is better than simulation, especially in the eyes 
of the user. It just has different objectives.

Michael

------------------------------------

Yahoo! Groups Links

---

From: "Michael Zapf" <[email-masked]>
Date: Wed, 23 Jan 2013 11:23:50 -0000

Hi Tursi,

of course, the line is a bit difficult to draw ... as you explained, at what low level of simulation do we call the whole thing an emulation? 

The TMS9900 is sim/emulated at the level that I got the documentation for. Before the rework, the operations were performed according to the expected result, and there was a table of operation cycles for each command, so after doing the effect, the CPU was idled for that time. With the rewrite, the cycles result from the microoperations that are executed. 

I had to rewrite this in this way because I wanted a proper wait state emulation. For instance, the GROMs are known as slow devices, and before, they called a magic function on the emulated CPU to increase the wait cycles. Now I made them explicitly lower the READY line, but this also entailed that I have a more fine-grained execution inside the CPU.

Currently there is one thing still missing: The TMS5200 speech synthesizer introduces another issue - it lowers the READY line as soon as it is addressed via the address bus. However, the MESS core implements memory accesses as a function call with return value. This is obviously a simulation, not an emulation, and in this case not even a good simulation - because I cannot insert wait states while the memory access function is called and before it returns. This is something I will add to the core in short term (more or less short).

As for the four phase clock - this is not emulated. What I do is to emulate the 333 ns cycles as two clock ticks. The four phases would be required for a complete memory access emulation where you wait for the address to settle on the lines and so on. These are physical effects that are beyond anything that we can emulate; accordingly, doing it or not will not have any visible effect. From the point of documentation, of course, it might be desirable to have it; on the other hand, I'd risk to increase the host CPU load so far to violate the remaining timing constraints. This can be seen when stopping the emulator and getting a running speed of less than 100%.

Interestingly, another developer now implemented a new floppy emulation where the floppy surface with its magnetic flux is emulated. That is, you get a sequence of 0 and 1 magnetic levels, and first have to decode that according to FM or MFM by the controller chip before you get the proper bytes. Until now we just had the disk images (dsk) as a sector dump or track dump. (If I understood that correctly, the image file would be expanded in-memory to this flux level; but it would also allow new disk image formats directly storing these fluxes.)

Using these terms of simulation and emulation, I try find some (maybe overly simplified, but not uncommon) way of putting a label on two different directions in the way you get to a simulation of a system. As I said, I don't want to say which direction is better - you can head towards best user experience, or towards a detailed, precise mapping of technical components. Only because I'm working on something I'd call an emulator does not imply that I think the rest is not worthy. I'd just claim that there will be no future of MAME/MESS on small, handheld devices, and I'd like to have some handy way to explain it.

On the MAME/MESS mailing list we recently had discussions on stories we heard about people who port MAME on a pretty dated version (something like 0.36, current version is 0.148) to other platforms, one of the reasons being that the earlier versions are running much faster on mobile devices. This is something we seem to be unable/unwilling/undecided to do anything about. 

So my question would be if it does not make sense after all to use these terms to qualify the different objectives, but, as I already said, in a gradual way, like "more/less emulation/simulation features".

Michael

(BTW, our lecture period is approaching its end, with the exams coming end of this week, which explains why I can afford to write messages of this size during my work hours :-) )

---

From: "Tursi" <[email-masked]>
Date: Wed, 23 Jan 2013 10:04:14 -0800

>(BTW, our lecture period is approaching its end, with the exams coming end 
>of this week, which explains why I can afford to write >messages of this 
>size during my work hours :-) )

Thanks for the rundown! :)

>So my question would be if it does not make sense after all to use these 
>terms to qualify the different objectives, but, as I already >said, in a 
>gradual way, like "more/less emulation/simulation features".

Well, yes, but when you talk about objectives, now you are implying intent 
of others. To claim that V9T9 never intended accurate reproduction of the 
processors is doing the author a disservice -- he reproduced as much as was 
possible on the hardware that he targeted. To my knowledge the only TI 
emulator today whose /goal/ remains simulation rather than accurate 
reproduction is Win994A.

So yeah? Where do you draw the line? At the system? At the IC? At the bus? 
At the transistor? There's always going to be another step. It's not 
inconceivable that in 30-40 years someone will argue that it's not an 
emulator unless the atomic interactions within the transistor are emulated. 
;)

Mind you, that level of emulation will be awesome to see visualized. ;)

---

From: Jeff White <[email-masked]>
Date: Wed, 23 Jan 2013 20:26:07 -0500

Wonder if the Java version of v9t9 -- http://eswartz.github.com/emul/ -- could run on the Android or other tablet OS.

As for the debate on emulator versus simulator, I would distinguish as follows:

An emulator is a "black box" that for any given input reproduces the same indistinguishable output as the original.  Complete emulation would be all allowed inputs produce same outputs.  

A simulator does not necessarily produce indistinguishable outputs.  E.g., versions of v9t9 use the co-processor (FPU) for math operations.

Except for PC99 disk format, which stores track data, there is no support of interlace, skew, or some special protection schemes.

Replicator could be borrowed.  Or maybe reproduction?  Clone?

Jeff White

---

From: Gregory McGill <[email-masked]>
Date: Wed, 23 Jan 2013 17:28:19 -0800

It can't be loaded from either android or ios as it's designed as a
"webstart" app..

On Wed, Jan 23, 2013 at 5:26 PM, Jeff White <[email-masked]> wrote:

> **
>
>
> Wonder if the Java version of v9t9 -- http://eswartz.github.com/emul/ --
> could run on the Android or other tablet OS.
>
> An emulator is a "black box" that for any given input reproduces the same
> indistinguishable output as the original.  Complete emulation would be all
> allowed inputs produce same outputs.
>
> A simulator does not necessarily produce indistinguishable outputs.  E.g.,
> versions of v9t9 use the co-processor (FPU) for math operations.
>
> Except for PC99 disk format, which stores track data, there is no support
> of interlace, skew, or some special protection schemes.
>

---

From: tursi <[email-masked]>
Date: Wed, 23 Jan 2013 17:40:12 -0800 (PST)

> Replicator could be borrowed.  Or maybe reproduction?  Clone?

I've seen 'clone' used sometimes, but people tend to reserve it for a 
hardware reproduction (which may or may not be accurate ;) ). I think the 
term 'emulator' has served us well for over 30 years, there's no need to 
redefine it. :)

Maybe for the emerging breed of lower-level accurate emulators, we could 
coin a new term - something like Quantum Emulation...? ;)