Welcome, Guest. Please login or register.

Author Topic: Coldfire AGAIN  (Read 9650 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline rkauerTopic starter

  • Hero Member
  • *****
  • Join Date: May 2006
  • Posts: 3263
    • Show only replies by rkauer
Coldfire AGAIN
« on: March 27, 2008, 11:33:12 PM »
 Yeah, I know this was discussed to the end of the world, but this time I found some feed for the kitty:

 Looking inside this PPC emulator, I think:

 If someone strip the emulation code down, and construct a table to emulate the calls from a real Amiga to the Coldfire accelerator, can it be used as a real Amiga upgrade?
 
 Critics, please.

 BTW: I know the translation process (and catch everything) is slow as hell. But even then a MPC54xx CPU can run circles around a 060@50MHz, maybe the slowdown (in certain instructions) made it comparable to a 040@40MHz (not bad at all!).
Goodbye people.

I\'ll pop on from time to time, RL is acting up.
 

Offline FrenchShark

  • Full Member
  • ***
  • Join Date: Jan 2004
  • Posts: 181
    • Show only replies by FrenchShark
    • http://www.arcaderetrogaming.com
Re: Coldfire AGAIN
« Reply #1 on: March 28, 2008, 12:51:34 AM »
Hello rkauer,

I wrote a similar emulator (not completely finished) :
Mine is targeted for CF with internal SRAM.
I run the emulation code from it, for two reasons :
- The code is a self-modifying code (I know it is bad but it is so efficient)
- The SRAM is located at address 0xFFFF8000 (the upper 2 GB cannot be used as memory on Amiga) -> the 1024-entry jump table is done with WORDs (move.w xxx,An does a sign extension :-D)

With all these tricks I can achieve an average of 20 instructions per emulated instructions.

Regards,

Frederic
 

Offline rkauerTopic starter

  • Hero Member
  • *****
  • Join Date: May 2006
  • Posts: 3263
    • Show only replies by rkauer
Re: Coldfire AGAIN
« Reply #2 on: March 29, 2008, 02:53:59 AM »
 Good job!

 That's an elegant solution for Coldfire's 68k emulation!

 Since it have a RAM controller, it's just a matter of using the upper "RAM" space to manage the table.

 Meh/ thinks we are coming to a solution!
Goodbye people.

I\'ll pop on from time to time, RL is acting up.
 

Offline RWO

  • Newbie
  • *
  • Join Date: Mar 2003
  • Posts: 30
    • Show only replies by RWO
    • http://www.rwo.dk
Re: Coldfire AGAIN
« Reply #3 on: March 29, 2008, 05:35:45 AM »
@rkauer

Whats the point?

I mean either you run it native on the Hardware or you emulate it.

If you accept some buggy opcodes (compaired to the m68k serie) you can use ColdFire... if you emulate, ColdFire isent really the smartest choice.

RWO
Debugging is a state of mind
 

Offline AmigaHeretic

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 821
    • Show only replies by AmigaHeretic
Re: Coldfire AGAIN
« Reply #4 on: March 29, 2008, 06:10:54 AM »
Quote

FrenchShark wrote:
Hello rkauer,

I wrote a similar emulator (not completely finished) :
Mine is targeted for CF with internal SRAM.
I run the emulation code from it, for two reasons :
- The code is a self-modifying code (I know it is bad but it is so efficient)
- The SRAM is located at address 0xFFFF8000 (the upper 2 GB cannot be used as memory on Amiga) -> the 1024-entry jump table is done with WORDs (move.w xxx,An does a sign extension :-D)

With all these tricks I can achieve an average of 20 instructions per emulated instructions.

Regards,

Frederic


Sounds very cool.  Are you saying you are emulating all 68k though or you are still just talking about emulating the missing op codes?

@rkauer
Quote

Whats the point?

I don't know much about how all this stuff works, but yeah I could see if you were just going to emulate "all" the 68k codes it seems like it would make more sense to just use a more widely available CPU like a CORE2Duo or something.  Seems like it would be 'as' difficult.  But I don't know.  Hard work either way it seems.
A3000D (16mhz, 2MB Chip, 4MB Fast, SCSI (300+MB), SuperGen Genlock, Kick 3.1)
Back in my day, we didn\'t have water. We only had Oxygen and Hydrogen, and we\'d just have to shove them together.
 

Offline biggun

  • Sr. Member
  • ****
  • Join Date: Apr 2006
  • Posts: 397
    • Show only replies by biggun
    • http://www.greyhound-data.com/gunnar/
Re: Coldfire AGAIN
« Reply #5 on: March 29, 2008, 06:49:19 AM »
@rkauer
Quote

Whats the point?

I don't know much about how all this stuff works, but yeah I could see if you were just going to emulate "all" the 68k codes it seems like it would make more sense to just use a more widely available CPU like a CORE2Duo or something.  Seems like it would be 'as' difficult.  But I don't know.  Hard work either way it seems.[/quote]

Hey, not so quick with your conclusions. :-)

Lets look at all PROS and CONS first!

There is a major advantage that the Coldfire has got.
You can buy the "source" of the Coldfire for an affordable sum. This means that you can "bake" your own Coldfire including AGA/SuperAGA in one Chip.

Continuing from FrenchSharks point:
You can bake a Coldfire including AGA => which is basicly then an AMIGA on a single chip.
You can get Coldfire including AGAChipset to 400/500 Mhz.

If you are into comparing numbers then:
- The resulting SuperAGA blitter can be about 200 times faster than the AMIGA AGA was.
- The CPU is net about 10 times faster than a 68060.
- More than about 100 times faster A1200/020

Even in FrenchSharks "68k emul mode" its still about 10 times faster than an A1200/020.

Nothing to sneeze about.

The key is having it in a the single chip.
Based on this you can create a 500MHz AMIGA of the size and price of a fat USB stick.



Offline rkauerTopic starter

  • Hero Member
  • *****
  • Join Date: May 2006
  • Posts: 3263
    • Show only replies by rkauer
Re: Coldfire AGAIN
« Reply #6 on: March 29, 2008, 06:57:52 AM »
 From my knowledge, the goal is emulate only the bad instructions, but even this way, you have to emulate the supervisor mode of the CPU.

 So here is the catch: construct a resident-hardware interpreter outside the Amiga memory space (a simple "mini" Spartan or other FPGA can do this) and, with the right code, forward to the CPU only the "good code" untouched. Almost the same approach as a table interpreter.
Goodbye people.

I\'ll pop on from time to time, RL is acting up.
 

Offline biggun

  • Sr. Member
  • ****
  • Join Date: Apr 2006
  • Posts: 397
    • Show only replies by biggun
    • http://www.greyhound-data.com/gunnar/
Re: Coldfire AGAIN
« Reply #7 on: March 29, 2008, 07:54:51 AM »
Quote

rkauer wrote:
 From my knowledge, the goal is emulate only the bad instructions, but even this way, you have to emulate the supervisor mode of the CPU.

 So here is the catch: construct a resident-hardware interpreter outside the Amiga memory space (a simple "mini" Spartan or other FPGA can do this) and, with the right code, forward to the CPU only the "good code" untouched. Almost the same approach as a table interpreter.


I see where you are coming from but I think this is not worth doing.

I'll try to explain why:

For the sake of easy discussion lets quickly compare the net
performance of the Coldfire and 68k.
Every application has of course different needs but lets just use one example for the sake of argument.

Lets say we have a piece of code (a loop) that uses:
4 register operations (ie: cmp, or add.l dx,dy)
2 memory operations (ie: add ,dx)
1 multiplication
2 index adressing modes (ie: move.l 2(a0,d0),d1)
1 branch (taken)

Now look how long (many clocks) a 68000 will need for this:
4 reg x 6
2 mem x 18
1 mul x 40
2 ind x 18
1 bra x 10
------
146 clocks

Now look how long (many clocks) a 68020 will need for this:
4 reg x 2
2 mem x 6
1 mul x 28
2 ind x 9
1 bra x 6
------
72

Now look how long (many clocks) a 68060 will need for this:
4 reg x 1
2 mem x 1
1 mul x 2
2 ind x 1
1 bra x 0
------
10 => 7 clocks

Yes, the 68060 can execute every instruction in one clock (the multiplication takes 2).
The 68060 can do loops for free (taken branch = 0 clocks)
And the 68060 has two instruction units. Allowing it to do two instructions per clock! Depending of your code structure the 10 instructions in the example loop could be folded down to 4.5 clocks in the best base.
For the sake of argument lets say the 68060 needs 7 clocks.


Looking at these numbers will give us a better feeling for the CPUs.

Now comparing the CPU based on their used clock rates:
68000 7.09 MHz =   48K
68020 14.2 Mhz =  196K
68060 50.0 Mhz = 7142K

In other words:
The A1200 (14Mhz 68020) is 4.0 times faster than a 68000
The (50MHz 68060) is 148 times faster than a 68000
The (50MHz 68060) is  36 times faster than a 68020


The above example is a realistic code sequence.
It show us the net CPU performance.


Now the behavior of Coldfire V5 is very much comparable to an 68060 but higher clocked.

In other words (our assumed) Coldfire 500 Mhz AMIGA has the CPU power to be 1480 times faster than a A500 (68000) with fastmem. Yes, thats over one thousand and four hundred times!

This single chip 500 Mhz AMIGA has as well the CPU power
to be 360 times faster than a A1200 (68020) with fastmem. Yes, thats over three hundred times!


Of course this is net CPU power.
Considering cache missed and memory latency the effective gained performance is of course a bit lower.

The point that we are trying to make here is:

If you was running an application on original Amiga then their speed was limited by the GFX subsystem (blitter) and by the CPU power.

As the SuperAGA Blitter is over 100 times faster - there is no GFX speed limit anymore!

The Coldfire is so much faster that even in full emulation mode you have many times the CPU power of the A1200.
Coldfire is net 360 times faster than A1200.
If FrenchSharks Code divides this by 20 its still over 10 times faster than A1200 was.


New applications with "coldfire" clean 68k code will be able to leverage the full performance of the Coldfire.
In other words this single Chip Amiga will then be 10 times faster than the fastest Cyberstorm was.


I don't know about you but for me this is enough!


If you would force me to add something to this chip then I would add a programmable DSP into the chipset.
Something like the AXE of the new e300 Freescale chip.
Such a SuperCopper could be used the decode MP4, MP3, DIVX etc for free.

Then this one Chip Amiga can do all that I need.

Offline alexh

  • Hero Member
  • *****
  • Join Date: Apr 2005
  • Posts: 3644
    • Show only replies by alexh
    • http://thalion.atari.org
Re: Coldfire AGAIN
« Reply #8 on: March 29, 2008, 10:54:57 AM »
Some of these "so called" technical discussions dont half make me laugh.
 

Offline biggun

  • Sr. Member
  • ****
  • Join Date: Apr 2006
  • Posts: 397
    • Show only replies by biggun
    • http://www.greyhound-data.com/gunnar/
Re: Coldfire AGAIN
« Reply #9 on: March 29, 2008, 11:50:28 AM »
If someone is serious about doing Coldfire development:

There is a limited number of sponsored (free) Coldfire V4 Development systems available on http://www.powerdeveloper.org/


If you propose a sensible project there is a good chance that you get a free board.

I assume that I'll get my board early next week. :-)



Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: Coldfire AGAIN
« Reply #10 on: March 29, 2008, 12:00:00 PM »
I really don't get the obsession with the Coldfire! if you want a small core to use for emulating a 68k... either design one yourself, I made a big post about this in a previous thread... or licence an ARM or MIPS, both of which are smaller, better supported and preferable to the hacked up mess of a CPU that the Coldfire is...

In fact I would go as far to say the MIPS is the better choice, since it has more registers than the 68k, which is a really good idea....

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: Coldfire AGAIN
« Reply #11 on: March 29, 2008, 12:13:18 PM »
Here is a good thread to read:

http://www.embeddedrelated.com/usenet/embedded/show/74090-1.php

Nice little quote:
Quote

Coldfire looks not so exciting, since it's based on the CISC m68k, though
I gather it's got a cleaned-up instruction set. The AVR32 looks really
cool, like it is designed to be a do-everything architecture... good code
density, DSP capabilities, SIMD capabilities, MMU, Java, wow. It looks
like Atmel is aiming to really shake up the 32-bit embedded market.

> Few these days will care about assembler level code, so choose the best
> uC for the task you have.
>
> Debug support, and tools, will start to matter in many design starts.

Yeah, the thing that's appealing about MIPS and ARM to me is that they are
extremely well-supported by Linux and the GCC toolchain. Also, MIPS is
even cooler cause there are free Verilog implementations to play around
with!


In summery, it would seem the MIPS core is ideal for our task... Verilog cores are free, it's well supported, its design is suited to Register based tasks like emulation... it's small...

Offline biggun

  • Sr. Member
  • ****
  • Join Date: Apr 2006
  • Posts: 397
    • Show only replies by biggun
    • http://www.greyhound-data.com/gunnar/
Re: Coldfire AGAIN
« Reply #12 on: March 29, 2008, 12:31:10 PM »
Quote

bloodline wrote:
I really don't get the obsession with the Coldfire! if you want a small core to use for emulating a 68k... either design one yourself, I made a big post about this in a previous thread... or licence an ARM or MIPS, both of which are smaller, better supported and preferable to the hacked up mess of a CPU that the Coldfire is...

In fact I would go as far to say the MIPS is the better choice, since it has more registers than the 68k, which is a really good idea....


Come on Bloodline,
you could create a higher quality post than this, can't you?


Quote
hacked up mess of a CPU that the Coldfire

WTF? The Coldfire is a very logic, clean design.


Quote
Design one yourself

Very thoughtless proposal.
How many people do you know that can design a fully fledged CPU like the Coldfire, and can do this cheaper than then core is at Freescale?


Quote
MIPS is the better choice

On what experience do you base your claim?
Gave you ever developed for mips?

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: Coldfire AGAIN
« Reply #13 on: March 29, 2008, 12:40:06 PM »
Quote

biggun wrote:
Quote

bloodline wrote:
I really don't get the obsession with the Coldfire! if you want a small core to use for emulating a 68k... either design one yourself, I made a big post about this in a previous thread... or licence an ARM or MIPS, both of which are smaller, better supported and preferable to the hacked up mess of a CPU that the Coldfire is...

In fact I would go as far to say the MIPS is the better choice, since it has more registers than the 68k, which is a really good idea....


Come on Bloodline,
you could create a higher quality post than this, can't you?


Apparently not... :-(

Quote


Quote
hacked up mess of a CPU that the Coldfire

WTF? The Coldfire is a very logic, clean design.


The Coldfire is an interesting design, for sure! But if we are talking about a small efficient CPU core for an ASIC/FPGA that is to be used for Emulating a 68k... then the Coldfire offers us nothing.... Unlike the other cores I suggested.

Quote


Quote
Design one yourself

Very thoughtless proposal.
How many people do you know that can design a fully fledged CPU like the Coldfire, and can do this cheaper than then core is at Freescale?


There are websites full of peoples CPU experiments, on FPGAs... If we want a CPU that is specifically for emulating a 68k, then we could probably design a much better one than the coldfire.

Quote

Quote
MIPS is the better choice

On what experience do you base your claim?


Only on what I've read... I am a big fan of the MIPS design, I love it's simplicity.

Quote

Gave you ever developed for mips?


That's true, I have never developed for MIPS... but I wrote a VM (as a DSP plugin engine) that ended up looking very much like a MIPS, which is what led me to read up about the architecture... and I like the design choices made.

Offline SamOS39

  • Sr. Member
  • ****
  • Join Date: Aug 2005
  • Posts: 357
    • Show only replies by SamOS39
    • http://amigaknight.tk
Re: Coldfire AGAIN
« Reply #14 on: March 29, 2008, 12:58:53 PM »
Some one better start stripping down that emulator then ..  :-)