Not so common docs (?) (and interesting ones ?)

All 680x0 related coding posts in this section please.

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

danorf
Atari maniac
Atari maniac
Posts: 81
Joined: Tue Feb 12, 2013 1:18 pm
Location: Behind a computer

Not so common docs (?) (and interesting ones ?)

Postby danorf » Mon Mar 04, 2013 4:26 pm

As written a week ago in another post, I have some not so common docs (at least I think so) about how M68000 internaly operate.
These docs come from my former company and used to be some working tools, back in the good old days.

I've asked them if I can release these docs, now that M68000 is past history for them.
So far, as a co-writer of it, I've got a positive answer concerning an "extended" cycles table. :angel:

So you'll find it in attachement to this post.

Most of the technical things written in it have been proven to be right by years of practice on real hardware. But, as always, it can still have some errors in it.

Even after years spent to refining it, there's still some mysteries floating around (especially when talking about exceptions).

Evermore, this table never been written in english, until these days. As I've done the translation and as English is not my native language, the doc must surely be full of gramatical, syntaxical or spelling errors.

For all these reasons, one who is interested in this doc can freely correct it and would be welcomed to do so. :cheers:
You do not have the required permissions to view the files attached to this post.
Last edited by danorf on Mon Mar 25, 2013 1:45 am, edited 2 times in total.

User avatar
FedePede04
Atari God
Atari God
Posts: 1206
Joined: Fri Feb 04, 2011 12:14 am
Location: Denmark
Contact:

Re: Not so common docs (?) (and interesting ones ?)

Postby FedePede04 » Mon Mar 04, 2013 5:06 pm

thanks for releasing them, they may come in handy one day :)

and welcome on this forum.
Atari will rule the world, long after man has disappeared

sometime my English is a little weird, Google translate is my best friend :)

danorf
Atari maniac
Atari maniac
Posts: 81
Joined: Tue Feb 12, 2013 1:18 pm
Location: Behind a computer

Not so common docs (?) (and interesting ones ?)

Postby danorf » Mon Mar 04, 2013 5:21 pm

FedePede04 wrote:thanks for releasing them, they may come in handy one day :)

I hope so ! It could become a handy reference for cycles, pairing, prefetch and read and write order.

FedePede04 wrote:and welcome on this forum.

Thx.

User avatar
Steven Seagal
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2018
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: Not so common docs (?) (and interesting ones ?)

Postby Steven Seagal » Mon Mar 04, 2013 7:17 pm

Thx, very intersting, I will certainly use it to review CPU emu in Steem.
In the CIA we learned that ST ruled
Steem SSE: http://sourceforge.net/projects/steemsse

danorf
Atari maniac
Atari maniac
Posts: 81
Joined: Tue Feb 12, 2013 1:18 pm
Location: Behind a computer

Not so common docs (?) (and interesting ones ?)

Postby danorf » Mon Mar 04, 2013 7:45 pm

Steven Seagal wrote:Thx, very intersting, I will certainly use it to review CPU emu in Steem.

Feel free to come and discuss about it when needed or just for fun (there's a lot of fun hidden inside this txt file).

User avatar
npomarede
Atari God
Atari God
Posts: 1287
Joined: Sat Dec 01, 2007 7:38 pm
Location: France

Re: Not so common docs (?) (and interesting ones ?)

Postby npomarede » Thu Mar 14, 2013 11:37 pm

danorf wrote:Feel free to come and discuss about it when needed or just for fun (there's a lot of fun hidden inside this txt file).

Hello
the Amiga Emulator WinUAE already has a cycle exact 68000 mode that tries to accurately emulates the microcode / bus accesses in each cpu instruction (I guess it's based on the motorola patent as well as real life examples from many demos/games).
Have you already took a look at this to see if it matches your tables ? It could be interesting to compare them.

Nicolas

danorf
Atari maniac
Atari maniac
Posts: 81
Joined: Tue Feb 12, 2013 1:18 pm
Location: Behind a computer

Re: Not so common docs (?) (and interesting ones ?)

Postby danorf » Fri Mar 15, 2013 3:54 am

npomarede wrote:the Amiga Emulator WinUAE already has a cycle exact 68000 mode that tries to accurately emulates the microcode / bus accesses in each cpu instruction (I guess it's based on the motorola patent as well as real life examples from many demos/games).
Have you already took a look at this to see if it matches your tables ? It could be interesting to compare them.
Nicolas

I must admit than, until now, I was only a pure user of WinUAE. I never search to dig the code behind. Now you've stung my curiosity !
There is, from my point of view (but I can be wrong), only 3 possibilities to have a cycle accurate 68000 emulator bases on microcode/nanocode emulation :
1) it has been written by a former member of the team who developed the 68000 on the base of his notes and memories.
2) it was based on the motorola patents and docs.
3) it have been written after a total retro engineering of a real 68000 dice (not even sure if it's really possible).
Not sure that comparing will lead to no great surprise if the table I provided and winuae emulator engine come from the same docs, but it's interesting the dig a little.
Concerning the table it has been proven right against real hardware for many years. The only points where there's still doubts are order of writting words in some long operations, and execution/timing of the exceptions (we have a delta of 2 cylces for each one between 68000 user manual and what have been understood from the patents, perhaps wait-cycles). And, perhaps, typo errors when I've receated the txt file from the original document.

More docs to come : trascript (with some corrections and completions) of these motorola patents in nowaday open text formats.

User avatar
npomarede
Atari God
Atari God
Posts: 1287
Joined: Sat Dec 01, 2007 7:38 pm
Location: France

Re: Not so common docs (?) (and interesting ones ?)

Postby npomarede » Fri Mar 15, 2013 9:18 am

danorf wrote:
npomarede wrote:the Amiga Emulator WinUAE already has a cycle exact 68000 mode that tries to accurately emulates the microcode / bus accesses in each cpu instruction (I guess it's based on the motorola patent as well as real life examples from many demos/games).
Have you already took a look at this to see if it matches your tables ? It could be interesting to compare them.
Nicolas

I must admit than, until now, I was only a pure user of WinUAE. I never search to dig the code behind. Now you've stung my curiosity !
There is, from my point of view (but I can be wrong), only 3 possibilities to have a cycle accurate 68000 emulator bases on microcode/nanocode emulation :
1) it has been written by a former member of the team who developed the 68000 on the base of his notes and memories.
2) it was based on the motorola patents and docs.
3) it have been written after a total retro engineering of a real 68000 dice (not even sure if it's really possible).
Not sure that comparing will lead to no great surprise if the table I provided and winuae emulator engine come from the same docs, but it's interesting the dig a little.
Concerning the table it has been proven right against real hardware for many years. The only points where there's still doubts are order of writting words in some long operations, and execution/timing of the exceptions (we have a delta of 2 cylces for each one between 68000 user manual and what have been understood from the patents, perhaps wait-cycles). And, perhaps, typo errors when I've receated the txt file from the original document.

More docs to come : trascript (with some corrections and completions) of these motorola patents in nowaday open text formats.


I don't think Tony Wilen (WinUAE's author) used to work for motorola ; It's more an evolution of the UAE cpu core which was IMO completed with the motorola patents and validated against a high number of demos/games (since the bus is heavily shared between cpu and custom chips in the Amiga, I think there're a lot of cases that can be validated this way until the emulation gives the correct result).
Especially for the exceptions, some undocumented stack frames are correctly emulated (required for some games protection for example), and comparing your table with WinUAE could be interesting to fix some limitations not seen until now in WinUAE (and as the Hatari emulator (which I'm working on) is also using the WinUAE's cpu core, it would nice to have a validated cpu core in Hatari too :) )

Nicolas

danorf
Atari maniac
Atari maniac
Posts: 81
Joined: Tue Feb 12, 2013 1:18 pm
Location: Behind a computer

Re: Not so common docs (?) (and interesting ones ?)

Postby danorf » Fri Mar 15, 2013 9:46 am

As I said I'm very curious about it so, yes I think, I'll have a look.
But I don't know the exact amount of work it represents.

After a fast first look, I'll post here about what I think can be done and how we can share the work if needed.
If you have informations that can make the work easier (files to look at first, design of the emulation part of WinUAE feel free to post it here or send it to me by PM).

User avatar
npomarede
Atari God
Atari God
Posts: 1287
Joined: Sat Dec 01, 2007 7:38 pm
Location: France

Re: Not so common docs (?) (and interesting ones ?)

Postby npomarede » Fri Mar 15, 2013 10:06 am

danorf wrote:As I said I'm very curious about it so, yes I think, I'll have a look.
But I don't know the exact amount of work it represents.

After a fast first look, I'll post here about what I think can be done and how we can share the work if needed.
If you have informations that can make the work easier (files to look at first, design of the emulation part of WinUAE feel free to post it here or send it to me by PM).


As WinUAE supports multiple CPU model in the 680xx family, there can be quite a lot of files. But you will certainly want to have a look at gencpu.cpp to see how it builds the .c cpu files for each model.
Bascillay, function gen_opcode() will handle main classes of instructions, and genamode() / genastore() are used to build the code to read/write operands for the opcode.

Then you can have a look at the 68000 cycle exact mode (functions suffixed with "_ce"), there're functions for each opcodes (grouped by address modes and so on). To see these .c files for each cpu you need to compile the sources, as UAE/WinUAE use a 2-stage process where a .c file is generated for all possible cpu by gencpu, then those .c files are compiled too.

Or you can do it the other way around, send your table to Tony and wait for him to have a look :) (but looking at UAE cpu cores is not that hard once you get the process flow, it can be a little complicated at start, but it's reallty modular and extensible)

Nicolas

danorf
Atari maniac
Atari maniac
Posts: 81
Joined: Tue Feb 12, 2013 1:18 pm
Location: Behind a computer

Re: Not so common docs (?) (and interesting ones ?)

Postby danorf » Fri Mar 15, 2013 11:24 am

In order to satisfy my curiosity I will try to dig around the WinUAE source.

The table posted before belongs to anybody. So feel free to send it to who you want.
I think that it will be better if this table is forwarded by someone that the WinUAE author already knows.

EDIT : by the way thx for the advices on WINUAE srcs.

User avatar
Nemesis
Atarian
Atarian
Posts: 2
Joined: Mon May 20, 2013 11:18 pm

Re: Not so common docs (?) (and interesting ones ?)

Postby Nemesis » Tue May 21, 2013 10:17 am

Danorf, I wanted to say a massive thank you for posting that document! I'm heavily into the Mega Drive, and I've just recently released an emulator called Exodus that I've been working on for a very long time, which aims for complete cycle-level timing accuracy. One of the main barriers until now has been information on the order and timing at which the M68000 accesses the external bus. I've been analysing the M68000 die shots and trawling through the patent information trying to put this kind of information together ( http://gendev.spritesmind.net/forum/vie ... php?t=1091 ). I was thinking I might have to spend months with a logic analyser testing each opcode form on the real hardware to reverse this information, but your document lays it all out in black and white! I'm now starting on a new M68000 core which is built around microcycle execution steps rather than opcode steps, incorporating the timing outlined in your document. Thank you again, this is one of the most useful documents that I have ever seen for the M68000.

User avatar
Nemesis
Atarian
Atarian
Posts: 2
Joined: Mon May 20, 2013 11:18 pm

Re: Not so common docs (?) (and interesting ones ?)

Postby Nemesis » Thu May 23, 2013 11:29 pm

danorf wrote:More docs to come : trascript (with some corrections and completions) of these motorola patents in nowaday open text formats.

Hey, any chance of these documents being uploaded sometime soon? I'm working on my new M68000 core right now, and I could definitely make use of this documentation. Thanks.


Social Media

     

Return to “680x0”

Who is online

Users browsing this forum: No registered users and 2 guests