Welcome, Guest. Please login or register.

Author Topic: MiniMig Development  (Read 5421 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: MiniMig Development
« Reply #29 on: February 27, 2008, 01:50:54 PM »
Quote

freqmax wrote:
3.3V core, most likely 3.3V I/O. One can proberbly make it that way anyway with an electrical hack.
So with CPU ok, RAM ok, only the AGA stuff is missing for an A1200 clone.

As for I/O an XC3S400 in PQ208 have 141 single ended i/o.
An XC3S500 in PQ208 have 158 single ended i/o.
Thus a gain of 17 i/o by just switching fpga.. ;-)


Really I think we should be trying to cut down the amount of IO on the FPGA, to reduce cost... losing the 68k would be a win there... hahahaha :-)

Offline freqmax

  • Hero Member
  • *****
  • Join Date: Mar 2006
  • Posts: 2179
    • Show only replies by freqmax
Re: MiniMig Development
« Reply #30 on: February 27, 2008, 02:04:03 PM »
Before the softcore m68k become stable, this might be a useful move.
 

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: MiniMig Development
« Reply #31 on: February 27, 2008, 02:14:38 PM »
Quote

freqmax wrote:

@bloodline:
Less chips also eliminates potential malfunction sources. As for softcore m68k, tobi has already something that works. I don't think a imperative software solution for the cpu will be responsive enough.
Large chip manufacturs use microcode for this if they have to. Anyway hardware will beat software in the speed game. Unless it's very complex logics.


Since we can engineer a very simple CPU for our own needs, which sole purpose is to emulate the 68k, then we could get something rather efficient... I'm also not suggesting that it be interpretive... no reason not to have a JIT on there. Also, we only need it to be as fast as the current 68k... If it can be made faster, then all the better :-)

Damn I wish I had more time to learn to program FPGAs this sounds like a raelly fun project :-)

Offline freqmax

  • Hero Member
  • *****
  • Join Date: Mar 2006
  • Posts: 2179
    • Show only replies by freqmax
Re: MiniMig Development
« Reply #32 on: February 27, 2008, 02:19:40 PM »
It has to be cycle exact, or else some demos and games will be very unhappy.
 

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: MiniMig Development
« Reply #33 on: February 27, 2008, 02:25:12 PM »
Quote

freqmax wrote:
It has to be cycle exact, or else some demos and games will be very unhappy.


I was thinking that we would run it at a much higher rate than the 7Mhz 68k... that way, it should be able to be ahead of the emulation, and thus use wait states to return results to memory within the correct cycle timings.

Offline alexh

  • Hero Member
  • *****
  • Join Date: Apr 2005
  • Posts: 3644
    • Show only replies by alexh
    • http://thalion.atari.org
Re: MiniMig Development
« Reply #34 on: February 27, 2008, 02:50:50 PM »
Bloodline

I think you are leaving the realms of reality and entering a software fuelled fantasy world ;-)

Phrases like "emulate the 68k", "small RISC core", "JIT" and "we could get something rather efficient" make a hardware engineer like myself shudder :-)
 

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: MiniMig Development
« Reply #35 on: February 27, 2008, 02:56:48 PM »
Quote

alexh wrote:
Bloodline

I think you are leaving the realms of reality and entering a software fuelled fantasy world ;-)

Phrases like "emulate the 68k", "small RISC core", "JIT" and "we could get something rather efficient" make a hardware engineer like myself shudder :-)


HaHaHahah, yeah!

But this idea has piqued my interest... I will spend a bit of time thinking about it and then post something, it will make an interesting discussion none the less :-)

Offline AeroMan

  • Sr. Member
  • ****
  • Join Date: Oct 2007
  • Posts: 342
    • Show only replies by AeroMan
Re: MiniMig Development
« Reply #36 on: February 27, 2008, 04:08:03 PM »
Hmmm.... how fast could TobiĀ“s core go with a full blown FPGA ? Does anybody have an idea ?

 

Offline alexh

  • Hero Member
  • *****
  • Join Date: Apr 2005
  • Posts: 3644
    • Show only replies by alexh
    • http://thalion.atari.org
Re: MiniMig Development
« Reply #37 on: February 27, 2008, 06:25:27 PM »
Depends on the type FPGA and what else (other than TG68) is inside of course.

Remember that when comparing CPU's more MHz doesn't always equate to more MIPS (i.e. a faster CPU). Caches and pipeline efficiency play a big part.

E.G. A 200MHz 68000 will almost certainly be many many times slower than a 50MHz 68060

The effects of caches can be somewhat negated by having a very fast RAM interface.

But we are leaving the realms of practical MiniMig development and going off to a fantasy world again :-)
 

Offline freqmax

  • Hero Member
  • *****
  • Join Date: Mar 2006
  • Posts: 2179
    • Show only replies by freqmax
Re: MiniMig Development
« Reply #38 on: February 28, 2008, 12:03:19 AM »
The tobi softcore m68k manages ~17MHz asfair.

The target after m68000 would be m68020 at least as far as I'm concerned. Maybe even less than m68020 if one can achive the same software compability for less code.

Emulate implies imperative operation unless it's something like the transmeta cpu. I think alexh point on RISC core is that it's kind of large logicwise..?
Something you could have look at is microcode.

Is there anything in these documents, that is of use enough to make AGA in FPGA happen?
 * http://www.mways.co.uk/amiga/howtocode/text/aga.php
 * http://www.kernel.org/../linux/../drivers/video/amifb.c
 * http://blog.frosties.org/public/amiga/RandyAGA.txt
 * http://mamedev.org/source/src/mame/machine/amiga.c.html
 

Offline FrenchShark

  • Full Member
  • ***
  • Join Date: Jan 2004
  • Posts: 181
    • Show only replies by FrenchShark
    • http://www.arcaderetrogaming.com
Re: MiniMig Development
« Reply #39 on: February 28, 2008, 03:44:20 AM »
Hello,

concerning the 68040V : you need more I/Os to interface it : 32 address lines + 32 data lines instead of 24 + 16.
One solution is to use the multiplexed bus mode of the 040.

I have been working on a RISC to emulate the 68k. I have the instruction fetch, decode and ALU working. To have a decent emulation speed the CCR/SR must behave EXACTLY like the 68k's. The instructions that are difficult to do in a RISC are the ROXL and ROXR, especially when B, W and L sizes are supported. To limit the resource usage, my barrel shifter only supports LSR, LSL, ASR, ASL, ROR and ROL with the L size (now I understand why Freescale has created the coldfire). Strangely, in an FPGA, the best way to create a fast and small barrel shifter is to use the multipliers :crazy:

Regards,

Frederic
 

Offline Belial6

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 568
    • Show only replies by Belial6
    • http://www.glasshead.net
DE-1
« Reply #40 on: February 28, 2008, 06:41:00 AM »
I think that one of the first things that needs to be done is to get MiniMig running on NTSC and modern monitors.

The other thing that I would be curious about is if the DE-1, which is already inexpensively running MiniMig, could have the video that is unacceptable to some, upgraded to an acceptable level.   (While working on NTSC and a modern monitor of course)
 

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: MiniMig Development
« Reply #41 on: February 28, 2008, 08:05:14 AM »
Quote

FrenchShark wrote:
Hello,

concerning the 68040V : you need more I/Os to interface it : 32 address lines + 32 data lines instead of 24 + 16.
One solution is to use the multiplexed bus mode of the 040.

I have been working on a RISC to emulate the 68k. I have the instruction fetch, decode and ALU working. To have a decent emulation speed the CCR/SR must behave EXACTLY like the 68k's. The instructions that are difficult to do in a RISC are the ROXL and ROXR, especially when B, W and L sizes are supported. To limit the resource usage, my barrel shifter only supports LSR, LSL, ASR, ASL, ROR and ROL with the L size (now I understand why Freescale has created the coldfire). Strangely, in an FPGA, the best way to create a fast and small barrel shifter is to use the multipliers :crazy:

Regards,

Frederic


Now this is the sort of thing that I'm talking about... I spent an hour yesterday thinking about how to do this... Are you able to give more details? I will post my thoughts when I have a chance to formalise them.

Offline alexh

  • Hero Member
  • *****
  • Join Date: Apr 2005
  • Posts: 3644
    • Show only replies by alexh
    • http://thalion.atari.org
Re: MiniMig Development
« Reply #42 on: February 28, 2008, 09:12:11 AM »
Quote

I have been working on a RISC to emulate the 68k. I have the instruction fetch, decode and ALU working.

Is this the RISC CPU's "fetch, decode and ALU" or the emulation software for the 68k's "fetch, decode and ALU"?

TobiFlex's TG68 is KINDA a emulation. He's implemented his 68k at the programmers model level. All opcodes are implemented in hardware. This is not how the original 68k worked. It had a different underlying CPU and ran microcode to produce what we see as a 68k.

But everyone knows that.

Quote

FrenchShark Wrote:
The instructions that are difficult to do in a RISC are the ROXL and ROXR, especially when B, W and L sizes are supported.

Eh? Why are they difficult in "RISC" (I hate that phrase). Surely it's something like a three input multiplexor for the X-Bit (B, W, L for select). Feeding into an AND/OR output mask (again made from the B,W,L sizes) for the regular Barrel shift ROL and ROR output?

Quote

Strangely, in an FPGA, the best way to create a fast and small barrel shifter is to use the multipliers :crazy:

Take care, some of the newer FPGA's have hardware barrel shifters on them. Best to try and write your code so that you infer the component/macro and let the synthesis tools do the rest.

I've seen you're posts in the past, I am sure you know what you're doing.
 

Offline alexh

  • Hero Member
  • *****
  • Join Date: Apr 2005
  • Posts: 3644
    • Show only replies by alexh
    • http://thalion.atari.org
Re: DE-1
« Reply #43 on: February 28, 2008, 09:36:05 AM »
Quote

Belial6 wrote:
I think that one of the first things that needs to be done is to get MiniMig running on NTSC and modern monitors.

I already posted details about how to make the changes. I dont have a MiniMig board so I cant test. No-one is interested. I made the posts months and months ago!

Quote

Belial6 wrote:
the DE-1 [snip] could the video that is unacceptable to some, upgraded to an acceptable level

Yes, I think there are enough free I/O on headers to wire in a 12-bit DAC (R2R ladder) and VGA connector.
 

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: MiniMig Development
« Reply #44 from previous page: February 28, 2008, 12:28:09 PM »
Quote

bloodline wrote:
Quote

FrenchShark wrote:
Hello,

concerning the 68040V : you need more I/Os to interface it : 32 address lines + 32 data lines instead of 24 + 16.
One solution is to use the multiplexed bus mode of the 040.

I have been working on a RISC to emulate the 68k. I have the instruction fetch, decode and ALU working. To have a decent emulation speed the CCR/SR must behave EXACTLY like the 68k's. The instructions that are difficult to do in a RISC are the ROXL and ROXR, especially when B, W and L sizes are supported. To limit the resource usage, my barrel shifter only supports LSR, LSL, ASR, ASL, ROR and ROL with the L size (now I understand why Freescale has created the coldfire). Strangely, in an FPGA, the best way to create a fast and small barrel shifter is to use the multipliers :crazy:

Regards,

Frederic


Now this is the sort of thing that I'm talking about... I spent an hour yesterday thinking about how to do this... Are you able to give more details? I will post my thoughts when I have a chance to formalise them.


Hmmm... I have spent a bit of time running it over on paper now...

My idea is to have a simple big endian, fixed instruction width, 32bit Load-Store CPU, with 32 General purpose registers (the last three of which are special purpose, PC, SP and CC/Status). The idea that only the Load and Store instructions would worry about operand size (obviously the three sizes supported by the 68k), and all logic/arithmetic instructions would operate only on registers and with a 32bit operand size. At the moment I won't think about a supervisor mode and certainly no interrupts or exceptions (though 3 bits of the Status register would be wired as interrupt request flags, the CPU would have manually poll them). I though this would give a nice simple basis for a CPU that could run a 68k emulator and wouldn't use up too much space on an FPGA (though I know nothing about FPGA programming, this might be the most inefficent design possible on an FPGA).

With that in mind, the first 20 registers would map directly to the architectural registers of the 68k. Which less the special purpose registers, would leave 9 registers for internal emulator working.

What becomes immediately obvious is the amount of code required just to emulate the CC flags of each 68k instruction... and that's before worrying about the 68k decode stage, addressing mode emulation and exceptions/interrupts etc... One 68k instruction would require something like 10 of my "RISC" instructions... this "RISC" CPU would have to run at a very high speed (and a decent cache would help) in order to work well... I will have to bow to Alex's intuition/experience that this idea isn't really doable, certainly not with current FPGA technology... :-)

Things could be improved with a JIT, but that would require my RISC CPU trapping illegal instructions, which means interrupts etc... which starts to get complex...

I did think I could have 3 CC registers, one for each of the 68k operand sizes (each one setting the result as if the the operation was 8bit, 16bit or 32bit.. despite all operations actually being 32bit)... then the emulator would not need to work out the correct CC for the operand size but simply check the correct CC register... that might work...

It certainly was fun working it through though :-) I doubt my solution was the best, anybody got a better idea? Perhaps some kind of hardware decoder (my assumption was based on using a large jump table for the emulator to match the 68k Opcode to the correct function), but then we are moving into Vertical microcode territory...