FX68K Cycle accurate 68000 core

Latest news in the Atari world

Moderators: Mug UK, Silver Surfer, Moderator Team

ijor
Hardware Guru
Hardware Guru
Posts: 3627
Joined: Sat May 29, 2004 7:52 pm
Contact:

FX68K Cycle accurate 68000 core

Postby ijor » Wed Nov 14, 2018 11:50 am

FX68K

Copyright (c) 2018 by Jorge Cwik
fx68k@fxatari.com

FX68K is a 68000 cycle exact compatible core. At least in theory, it should be impossible to distinguish functionally from a real 68K processor.

On Cyclone families it uses just over 5,100 LEs and about 5KB internal ram, reaching a max effective clock frequency close to 40MHz. Some optimizations are still possible to implement and increase the performance.

The core is fully synchronous. Considerable effort was made to avoid any asynchronous logic.

Written in SystemVerilog.

The timing of the external bus signals is exactly as the original processor. The only feature that is not implemented yet is bus retry using the external HALT input signal.

It was designed to replace an actual chip on a real board. This wasn't yet tested however and not all necessary output enable control signals are fully implemented.
Fx Cast: Atari St cycle accurate fpga core

ijor
Hardware Guru
Hardware Guru
Posts: 3627
Joined: Sat May 29, 2004 7:52 pm
Contact:

Re: FX68K Cycle accurate 68000 core

Postby ijor » Wed Nov 14, 2018 11:53 am

SystemVerilog sources:

http://fx68k.fxatari.com/fx68k-Source.zip

FX68K is released under the GPL open source license.
More material including notes, tables and charts, that I need yet to finish or polish, should be available at some later time.
Fx Cast: Atari St cycle accurate fpga core

User avatar
shoggoth
Nature
Nature
Posts: 952
Joined: Tue Aug 01, 2006 9:21 am
Location: Halmstad, Sweden
Contact:

Re: FX68K Cycle accurate 68000 core

Postby shoggoth » Wed Nov 14, 2018 12:07 pm

Awesome!
Ain't no space like PeP-space.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3161
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: FX68K Cycle accurate 68000 core

Postby Sorgelig » Wed Nov 14, 2018 12:50 pm

Congratulations and big thanks!

BlankVector
Captain Atari
Captain Atari
Posts: 461
Joined: Wed Oct 24, 2007 7:52 pm
Location: France
Contact:

Re: FX68K Cycle accurate 68000 core

Postby BlankVector » Wed Nov 14, 2018 1:17 pm

Congratulations :cheers:
Subscribe to my Vretrocomputing channel on YouTube and Facebook.

OzOnE
Atarian
Atarian
Posts: 7
Joined: Mon Oct 22, 2018 5:28 pm

Re: FX68K Cycle accurate 68000 core

Postby OzOnE » Wed Nov 14, 2018 1:25 pm

Fantastic work, Ijor. :)

And many thanks for the sources, as well.

You don't know how important this is for MiSTer, and FPGA retro stuff as a whole.

The 68000 is obviously a super-important chip for lots of machines, and even the Quantel Paintbox might now benefit from your core. hehe

I'll definitely be trying this core out on various MiSTer stuff in the next few days. Perfect timing for Capcom CPS, too.

PhantombrainM
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 110
Joined: Fri Mar 16, 2018 9:10 am

Re: FX68K Cycle accurate 68000 core

Postby PhantombrainM » Wed Nov 14, 2018 1:45 pm

Thank you very much! The world will benefit from it forever now!
Even If you're gone one day you have left something great in this world and it will make people and kids happy.
For me as a musician it's one of my life goals to give people something that lasts longer than I will live so it will make myself immortal and I'm not forgotten. Congratulations on that!

Out of pure curiosity, how long did it take you to complete it?
Two beer or not two beer? - Shakesbeer.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3161
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: FX68K Cycle accurate 68000 core

Postby Sorgelig » Wed Nov 14, 2018 2:18 pm

ijor wrote:SystemVerilog sources:

http://fx68k.fxatari.com/fx68k-Source.zip

FX68K is released under the GPL open source license.
More material including notes, tables and charts, that I need yet to finish or polish, should be available at some later time.


can you release it on github? Then there will be a central development repo for this IP, so you can get some pull requests if you don't mind.

ijor
Hardware Guru
Hardware Guru
Posts: 3627
Joined: Sat May 29, 2004 7:52 pm
Contact:

Re: FX68K Cycle accurate 68000 core

Postby ijor » Wed Nov 14, 2018 5:28 pm

PhantombrainM wrote:Out of pure curiosity, how long did it take you to complete it?


Well, it depends on when you consider I really started :) ...

I started research and reverse engineering of the 68000 many years ago. I decrypted (so to speak, they are not encrypted, but they are barely readable) the patents, and study them long ago. Some time later I even implemented partial simulation models based on the patents.

I also performed tests and traces on real hardware. Some time ago I also analyzed the layout from decapped micro photographies.

If you mean when I actually started writing the core, well, that was just a few months ago. But that's the easy part when you have all the information.
Fx Cast: Atari St cycle accurate fpga core

BitsNStuff
Atariator
Atariator
Posts: 17
Joined: Tue Oct 16, 2018 7:55 am
Contact:

Re: FX68K Cycle accurate 68000 core

Postby BitsNStuff » Wed Nov 14, 2018 7:00 pm

Incredible work, so important for the preservation of chipsets. There is no easy way of creating soft chips but I just can't imagine the amount of work that goes into doing it this way.

On a slightly more selfish note, I'm sure people will forgive me...with time it really should benefit so many different FPGA implementations to have this soft chip available. I can't wait to see how this develops.

Thanks @ijor.

ijor
Hardware Guru
Hardware Guru
Posts: 3627
Joined: Sat May 29, 2004 7:52 pm
Contact:

Re: FX68K Cycle accurate 68000 core

Postby ijor » Thu Nov 15, 2018 1:51 am

I moved all the posts specific to adapting Genesis core to the following thread: viewtopic.php?f=117&t=34736
Fx Cast: Atari St cycle accurate fpga core

User avatar
alien
Atari maniac
Atari maniac
Posts: 95
Joined: Sat May 01, 2004 4:01 am
Location: USA
Contact:

Re: FX68K Cycle accurate 68000 core

Postby alien » Thu Nov 15, 2018 3:06 am

This is really cool :)

I'm curious, are the ROMs (mem files) taken from the decapping you did?

Or, if they're custom, do you have some tool to generate them rather than typing them in in binary? (in the dark ages before I had an assembler, I used Hex...)
Alien / ST-Connexion

User avatar
fury23
Atari User
Atari User
Posts: 38
Joined: Sun Jan 10, 2016 2:08 pm

Re: FX68K Cycle accurate 68000 core

Postby fury23 » Thu Nov 15, 2018 9:13 am

Thank you so much :cheers:

vanfanel
Atari freak
Atari freak
Posts: 53
Joined: Tue Oct 09, 2018 10:19 pm

Re: FX68K Cycle accurate 68000 core

Postby vanfanel » Thu Nov 15, 2018 9:52 am

Thanks for all your work on this, Ijor, and the giant step it means regarding hardware recreation! This is historic...

ijor
Hardware Guru
Hardware Guru
Posts: 3627
Joined: Sat May 29, 2004 7:52 pm
Contact:

Re: FX68K Cycle accurate 68000 core

Postby ijor » Thu Nov 15, 2018 1:53 pm

Sorgelig wrote:can you release it on github? Then there will be a central development repo for this IP, so you can get some pull requests if you don't mind.


Done:
https://github.com/ijor/fx68k
Fx Cast: Atari St cycle accurate fpga core

ijor
Hardware Guru
Hardware Guru
Posts: 3627
Joined: Sat May 29, 2004 7:52 pm
Contact:

Re: FX68K Cycle accurate 68000 core

Postby ijor » Thu Nov 15, 2018 2:03 pm

alien wrote:I'm curious, are the ROMs (mem files) taken from the decapping you did?
Or, if they're custom, do you have some tool to generate them rather than typing them in in binary? (in the dark ages before I had an assembler, I used Hex...)


They are based on the die. I don't really have a clean automatic tool chain. Nor I really have a source at the language level you see at the patent. I have notes, tables and even some kind of spreadsheet, that as I said, I need to clean up before release.

The microcode at the die is coded at a lower level than what you see at the patent. Implementing a tool to translate from such kind of source would require some kind of smart compiler.
Fx Cast: Atari St cycle accurate fpga core

User avatar
jotego
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 139
Joined: Wed May 04, 2016 10:02 am
Location: Valencia (Spain)
Contact:

Re: FX68K Cycle accurate 68000 core

Postby jotego » Thu Nov 15, 2018 2:17 pm

I assume that a cycle-accurate core was not available before this. Thank you for releasing it!

From the size point of view, it is a bit larger than TG68k.C but it should still fit in MiST without problems.

I'm glad you move it to github too.

Thanks a lot!

ijor
Hardware Guru
Hardware Guru
Posts: 3627
Joined: Sat May 29, 2004 7:52 pm
Contact:

Re: FX68K Cycle accurate 68000 core

Postby ijor » Thu Nov 15, 2018 6:43 pm

jotego wrote:From the size point of view, it is a bit larger than TG68k.


It is expected to be larger. In first place because cycle accuracy takes a price, both in terms of size and performance. It requires quite some extra logic.

In second place there are several 68K features that are not implemented by TG68k, or implemented only partially. AFAIK:

- No DMA? (surprised that this seems to be not implemented!)
- No 6800 sync control (VPA/E/VMA)
- No support for signaling autovector interrupts
- AS not generated
- Originally no support at all for bus error
Fx Cast: Atari St cycle accurate fpga core

User avatar
jotego
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 139
Joined: Wed May 04, 2016 10:02 am
Location: Valencia (Spain)
Contact:

Re: FX68K Cycle accurate 68000 core

Postby jotego » Fri Nov 16, 2018 11:35 am

Adding all these features is also of great value.

slingshot
Captain Atari
Captain Atari
Posts: 350
Joined: Mon Aug 06, 2018 3:05 pm

Re: FX68K Cycle accurate 68000 core

Postby slingshot » Fri Nov 16, 2018 11:40 am

While it's bigger than the TG68k a bit (not much), it compiles faster. And didn't found any compatibility issues so far. So great CPU, I already like it.

User avatar
MasterOfGizmo
Atari God
Atari God
Posts: 1215
Joined: Fri Feb 08, 2013 12:15 pm
Contact:

Re: FX68K Cycle accurate 68000 core

Postby MasterOfGizmo » Fri Nov 16, 2018 1:13 pm

ijor wrote:- No DMA? (surprised that this seems to be not implemented!)


What do you mean by DMA? Or do you mean the bus arbitration? Yes that's missing in tg68k and requires us to just stall the CPU by brute force. But of course that prevents a few things like a proper tas instruction. But it's interesting how close you can get by just stopping the CPU clock externally :-)
MIST board, FPGA based Atari STE and more: https://github.com/mist-devel/mist-board/wiki

ijor
Hardware Guru
Hardware Guru
Posts: 3627
Joined: Sat May 29, 2004 7:52 pm
Contact:

Re: FX68K Cycle accurate 68000 core

Postby ijor » Fri Nov 16, 2018 1:51 pm

MasterOfGizmo wrote:What do you mean by DMA? Or do you mean the bus arbitration? Yes that's missing in tg68k and requires us to just stall the CPU by brute force.


Yes, I meant bus arbitration. I found it surprising that's missing in TG68K because (I understand) all the other missing features are not used by the Amiga. And I thought TG68K was developed for porting Minimig, hence they didn't bother to implement those features that they didn't need. Or the Amiga doesn't use bus arbitration either?

But it's interesting how close you can get by just stopping the CPU clock externally :-)


Yes, there are several alternatives that can used on a FPGA system because you don't really have a shared tristatable bus. The timing would be different though. Can be quite different in some cases. But you probably don't care too much if the CPU core is not cycle accurate in the first place.
Fx Cast: Atari St cycle accurate fpga core

User avatar
MasterOfGizmo
Atari God
Atari God
Posts: 1215
Joined: Fri Feb 08, 2013 12:15 pm
Contact:

Re: FX68K Cycle accurate 68000 core

Postby MasterOfGizmo » Sun Nov 18, 2018 8:48 am

This core is only a few percent bigger than tg68k and it just runs nicely. That's so cool ...

If you read my replies a few year ago when people were asking for totally accelerated 68k CPU cores i always replied that I am much more interested in a cycle exact core. And now it's there :-)
MIST board, FPGA based Atari STE and more: https://github.com/mist-devel/mist-board/wiki

User avatar
LaurentS
Captain Atari
Captain Atari
Posts: 274
Joined: Mon Jan 05, 2009 5:41 pm

Re: FX68K Cycle accurate 68000 core

Postby LaurentS » Sun Nov 18, 2018 5:39 pm

Hi all,

I've got a Myst, but I'm not a FPGA coder.
I'm just asking myself : does this core work better than the current ST 68000 core in the myst ?
If yes, does anyone plan to make a new ST emulation with this new core ?

Best regards
Laurent

ijor
Hardware Guru
Hardware Guru
Posts: 3627
Joined: Sat May 29, 2004 7:52 pm
Contact:

Re: FX68K Cycle accurate 68000 core

Postby ijor » Mon Nov 19, 2018 1:50 am

MasterOfGizmo wrote:This core is only a few percent bigger than tg68k and it just runs nicely. That's so cool ...


Yeah. But to be fair to TK68K, I forgot that it can also be a 68020, and mine does not. TG68K would probably be smaller than it is if you remove all the 020 stuff.

LaurentS wrote:I've got a Myst, but I'm not a FPGA coder.
I'm just asking myself : does this core work better than the current ST 68000 core in the myst ?
If yes, does anyone plan to make a new ST emulation with this new core ?


I plan to port FX CAST (see viewtopic.php?f=117&t=34555&start=75) to the MiST. And, of course, MasterOfGizmo is more than welcome to use FX68K on his own ST core if he wants. But there is a trade off, TG68K might be better for STeroids mode.
Fx Cast: Atari St cycle accurate fpga core


Social Media

     

Return to “News & Announcements”

Who is online

Users browsing this forum: No registered users and 4 guests