Welcome, Guest. Please login or register.

Author Topic: FPGA for dummies  (Read 31685 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Everblue

  • Hero Member
  • *****
  • Join Date: Dec 2004
  • Posts: 584
    • Show only replies by Everblue
Re: FPGA for dummies
« Reply #14 on: December 05, 2011, 08:51:02 PM »
Ummm you can't? You just buy an FPGA motherboard with all the parts populated. Put the kickstarts on the SDCard and more or less you are good to go. Maybe, technically, you could dump your own Kickstart from real Amiga HW :)
 

Offline persia

  • Hero Member
  • *****
  • Join Date: Sep 2006
  • Posts: 3753
    • Show only replies by persia
Re: FPGA for dummies
« Reply #15 on: December 05, 2011, 08:53:59 PM »
My question is since this is emulation in hardware how is it closer to or further way from Amiga hardware than UAE?
[SIGPIC][/SIGPIC]

What we\'re witnessing is the sad, lonely crowing of that last, doomed cock.
 

Offline Everblue

  • Hero Member
  • *****
  • Join Date: Dec 2004
  • Posts: 584
    • Show only replies by Everblue
Re: FPGA for dummies
« Reply #16 on: December 05, 2011, 08:55:27 PM »
Is it emulation in hardware? I'm confused =)

A common question I see (not sure what it means) when it regards to FPGA is "is it cycle-exact?"
 

Offline _ThEcRoW

  • Hero Member
  • *****
  • Join Date: Jul 2005
  • Posts: 753
  • Country: 00
    • Show only replies by _ThEcRoW
Re: FPGA for dummies
« Reply #17 on: December 05, 2011, 09:04:15 PM »
FPGA is not emulation. It's the recreation of the physical chips under a reconfigurable chip.
Amiga 1200 desktop. Apollo 030/50 Mhz 8mb ram + ClassicWB + Wb 3.1
Amiga 500 + ACA500Plus + 16gb CF | ECS Power!!!
C64 DTV + Keyboard mod. Waiting for a 1541 disk ve...
Mac Mini G4 1.42Ghz 1gb OSX(tiger)/Morphos 3.7 Registered
C64mini + usb drive with loads of games...
 

Offline billt

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 910
    • Show only replies by billt
    • http://www.billtoner.net
Re: FPGA for dummies
« Reply #18 on: December 05, 2011, 09:20:01 PM »
Quote from: Nostromo;670343
Is it emulation in hardware? I'm confused =)

A common question I see (not sure what it means) when it regards to FPGA is "is it cycle-exact?"

I do not consider FPGA implementations to be "emulation".

When you load the FPGA bitstream file, you are opening or closing routing connections, you are selecting inputs to multiplexors, you are telling each LUT which logic circuit it is to be (for this input value give that output value). When configuration is done, the FPGA is nto "processing" anything, it is not running software to do any of what the bitstream said. When configuration is done, the FPGA now "is" the defined circuit. All those passgates and multiplexors are now really just wires to the defined circuit. The LUTs are logic circuits. The flipflops are flipflops. There is no "emulation" which is "running" There only is a logic circuit which "is".

And the only thing that is happening is whatever your circuit is defined to do. Flipflops are flopflopping. Logic circuits are giving outputs appropriate to their inputs. Routes are wires. That's it. And there's no software or anything else operating above, below, or beside that.

If you have defined a 680x0 processor, then the 68000 processor is running 68000 software or waiting to do so. If you have defined a Zorro to PCI bus bridge, then it is converting bus cycles. If you have defined a SCSI controller, then it is controlling SCSI peripherals according to commands it receives from the host bus. If you've defined a DDR memory controller, then it is controlling DDR memory according to the host bus. That's it. If you have defined it to be an Amiga 500 with 68000 and PCI and DDR2, then it is running 68000 software, talking to PCI cards, and talking to DDR2 memory chips. Wires will clear flipflops the same way that wires clear flip-flops in custom ASIC chips. Clock signals tell flipflops to take in new values from their inputs the same way as they do in Custom ASIC chips. And gates give 1 when all inputs are 1 and otherwise 0 the same way that AND gates do in Custom ASIC chips. OR gates give a 1 output when any input is 1 value otherwise 0, same as in an ASIC. Wires conduct signals the same way as wires do in Custom ASIC chips. A 32bit CPU register is made up of 32 FPGA silicon flipflops, same as in an ASIC. Multiplexors to select datapaths in an ALU are made up of FPGA silicon multiplexors. This is hardware being routed to wire up silicon, same as logic gates are wired up in an ASIC.

It's just that the FPGA lets you change your wiring around, while an ASIC is fixed. FPGA provides a flipflop on silicon in every section. Maybe two. But it lets you skip over them if you don't want them. An FPGA can have this particular NOR gate here, or reroute and put it over there, etc. by changing which passgates are closed and which way multiplexors go. An ASIC wire is fixed by the production masks.

That's it.

In an ASIC, to connect the output of an OR gate to an inverter, you draw a wire. All silicon. In an FPGA, there are things to be OR gates and inverters on the silicon, and there's a lot of wires all over the place, which can potentially connect just about anything to anything, or disconnect anything from anything. The bitstream is read into static memory elements which control the connect or disconnect at each point, and are used to connect the various bits of silicon-level wire between your OR gate and your inverter. All hardware, all silicon.

That's it. And maybe the best way I've said it so far in this last bit.
« Last Edit: December 05, 2011, 09:25:43 PM by billt »
Bill T
All Glory to the Hypnotoad!
 

Offline Thorham

  • Hero Member
  • *****
  • Join Date: Oct 2009
  • Posts: 1149
    • Show only replies by Thorham
Re: FPGA for dummies
« Reply #19 on: December 05, 2011, 10:25:21 PM »
Quote from: ShapeShifter;670329
And this is NOT emulation, it is done in real silicon, thanks to the FPGA chip!
It is an emulation in the purest sense of the word because it's not done in silicon but simply by using instructions that are of a lower level than machine language instructions. An FPGA is just a programmable chip just like a CPU, it only serves a different purpose than a CPU.
 

Offline ShapeShifter

  • Newbie
  • *
  • Join Date: Dec 2011
  • Posts: 45
    • Show only replies by ShapeShifter
Re: FPGA for dummies
« Reply #20 on: December 05, 2011, 10:35:32 PM »
It is not emulation as we've come to understand that term because there is no software playing 'translator' between the Amiga software designed for one architecture (68K+AGA), and the radically different host hardware (Intel+Nvidia) it must function under.  Software emulation involves on-the-fly translation from one architecture to another.  The FPGA on the Replay, OTOH, simply 'becomes' the hardware of a real Amiga.  There's no translation.  The FPGA 'becomes' the 68K CPU, the Lisa chip, and so on.

The hardware on the Replay, when functioning with the Minimig AGA soft core, is the hardware equivalent of a real AGA chipset with a 68K CPU.  You won't physically see a 68K CPU and Lisa chip inside the system, but they're there - implemented within the FPGA itself.

This is why the Replay's motto is, very appropriately enough, "No Emulation. No Compromise." :)

Of course, the FPGA core is not based on original Commodore code because that's not available to us.  But the Minimig AGA soft core on the FPGA is designed to respond to the same instructions in as similar a way as possible to a 'real' Amiga, and so it has a high degree of compatibility.

Quote from: Thorham;670361
It is an emulation in the purest sense of the word because it's not done in silicon but simply by using instructions that are of a lower level than machine language instructions. An FPGA is just a programmable chip just like a CPU, it only serves a different purpose than a CPU.
When most people think of emulation, they think of something akin to a real-life translator, sitting in the middle of the 'Amiga' and the host hardware.  I think if I were to search for an appropriate word to describe what the Replay is doing, I would go for the word 'cloning' over emulation.  It's kind of like how the original IBM PC was cloned - or how the AMD functions the same as an Intel CPU.  Yes, in a technical sense they may be 'emulating' the hardware they're designed to copy/replace.  But I don't think we'd use the word emulation to describe what they're doing.  The Replay is only 'emulating' an Amiga to the same extent an AMD 'emulates' an Intel CPU.
« Last Edit: December 05, 2011, 10:54:04 PM by ShapeShifter »
 

Offline hairy

  • Newbie
  • *
  • Join Date: Nov 2003
  • Posts: 34
    • Show only replies by hairy
Re: FPGA for dummies
« Reply #21 on: December 05, 2011, 10:56:13 PM »
Quote from: Thorham;670361
It is an emulation in the purest sense of the word because it's not done in silicon but simply by using instructions that are of a lower level than machine language instructions. An FPGA is just a programmable chip just like a CPU, it only serves a different purpose than a CPU.


This is a common misconception due to the fact that you use a "language" to define the circuit. It's really an "hardware description language", not a "programming language".
The program is not executed, it is synthesized. VHDL is inherently parallel (unless you tell it to do otherwise), up to the point you could use most of the chip resources at the same time, in the same clock cycle.
Which is not unusual for massively dataflow designs: consider an array of FIR filters, then you have combinatiorial and sequential logic (and an internal state), but not necessarily a state machine, a sequencer, or a microcode ROM. Hence no CPU.

The short answer was: "what billt said". :)
 

Offline persia

  • Hero Member
  • *****
  • Join Date: Sep 2006
  • Posts: 3753
    • Show only replies by persia
Re: FPGA for dummies
« Reply #22 on: December 05, 2011, 11:05:09 PM »
Interesting, so it is or isn't emulation depending on how you define emulation, sort of emulation in a cheshire cat or perhaps a Schrödinger's cat sort of way.
[SIGPIC][/SIGPIC]

What we\'re witnessing is the sad, lonely crowing of that last, doomed cock.
 

Offline ShapeShifter

  • Newbie
  • *
  • Join Date: Dec 2011
  • Posts: 45
    • Show only replies by ShapeShifter
Re: FPGA for dummies
« Reply #23 on: December 05, 2011, 11:11:47 PM »
Quote from: persia;670365
Interesting, so it is or isn't emulation depending on how you define emulation, sort of emulation in a cheshire cat or perhaps a Schrödinger's cat sort of way.
Exactly! :)

The English language can often be fuzzy, but what's not fuzzy is what we tech-heads typically mean when we refer to emulation.  We're referring to software which has been written to enable programs written for a completely different architecture to operate under an alien host system, via an on-the-fly translation process.

Which has absolutely nothing to do with what the Replay and other FPGA devices are doing.  They no more 'emulate' an Amiga chipset /CPU than an AMD CPU 'emulates' an Intel CPU.  We're simply talking about a different way of implementing the Amiga chipset and CPU in hardware.  In that sense, these FPGA systems are more like Amiga clones.
« Last Edit: December 05, 2011, 11:14:37 PM by ShapeShifter »
 

Offline billt

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 910
    • Show only replies by billt
    • http://www.billtoner.net
Re: FPGA for dummies
« Reply #24 on: December 05, 2011, 11:21:09 PM »
Quote from: Thorham;670361
It is an emulation in the purest sense of the word because it's not done in silicon but simply by using instructions that are of a lower level than machine language instructions. An FPGA is just a programmable chip just like a CPU, it only serves a different purpose than a CPU.

No, it is not like a CPU. It is silicon. If I want a flipflop, that flipflop is a silicon flipflop, not a software or firmware running on some kind of processor to pretend to be a flipflop. There are not zillions of little processors laying around running some kind of code telling them how to be And gates, OR gates, Inverters or whatever. It's all silicon. I've done silicon layout of FPGA chips, I know what they look like inside, how things connect to each other, and how it all works.



Now, to decide you want an AND gate, you are not necessarily connecting to a 4-set of transistors that are exactly an AND gate and nothing else. You're connecting to a LUT, which is a small memory. The address bits of this memory are the inputs to whatever logic gate you do want, and the output of the memory is the desired output for each input set. This still is not emulation, as there is no code running. You decide what your logic truth table for this gate is, and program the output values of that truth table into this memory. Then your logic inputs select which output bit your logic demands for the current input. There's no processing there, only multiplexing to select the desired value. And after configuration, each bit is fixed. Everywhere. Back in the day it was one method of doing hardware design to use a ROM chip for a complex logic gate with lots of inputs. A ROM chip does not have a processor in it to do any emulation, it's just one way for something to "be" some logic circuit. The FPGA uses an SRAM or a fuse instead of a ROM, but it's the same principle. The LUT is a progammable logic gate, and it acts as a logic gate, and once programmed it is fixed as that logic gate until it is reprogrammed as something else or loses power. It does not have something looping on the inputs, considering what they are, and going somewhere else to look up how to respond. The LUT knows what the LUT needs to do, and it IS that. It IS logic, and it IS silicon.

Calling an FPGA an emulator is like calling a ROM chip an emulation of a ROM chip. Sounds weird huh? It makes more sense to say that a ROM chip IS a ROM chip, no? Someone might come up with a very nitpicky debate about AMD emulating an Intel chip. (going into what is x86 and what does microcode mean or do, but that also means that Intel itself makes x86 emulators, not x86 chips, and you could make an FPGA implementation of x86 that is less "emulation" than a Core i7 is)
« Last Edit: December 05, 2011, 11:37:56 PM by billt »
Bill T
All Glory to the Hypnotoad!
 

Offline Thorham

  • Hero Member
  • *****
  • Join Date: Oct 2009
  • Posts: 1149
    • Show only replies by Thorham
Re: FPGA for dummies
« Reply #25 on: December 05, 2011, 11:56:24 PM »
Quote from: billt;670368
If I want a flipflop, that flipflop is a silicon flipflop, not a software or firmware running on some kind of processor to pretend to be a flipflop.
Of course, because that flipflop is a low level entity similar to a machine code instruction. The opcode is simply of a higher level than a flipflop.
Quote from: billt;670368
I've done silicon layout of FPGA chips
Which is similar to a CPU program, only on a lower level than machine code.

The principle is the same:

With a CPU you describe your functions using high level instructions which are executed serially, while with an FPGA you describe your functions by telling the FPGA how it's gates have to be wired up, which operate in parallel, because you're describing an electronic component.

No hardwiring=emulation.
 

Offline ShapeShifter

  • Newbie
  • *
  • Join Date: Dec 2011
  • Posts: 45
    • Show only replies by ShapeShifter
Re: FPGA for dummies
« Reply #26 on: December 06, 2011, 12:27:42 AM »
Quote from: billt;670368
Calling an FPGA an emulator is like calling a ROM chip an emulation of a ROM chip. Sounds weird huh? It makes more sense to say that a ROM chip IS a ROM chip, no?

It's funny you bring up ROMs.  I was trying to come up with a similar analogy - that FPGAs are to fixed-code chips like Lisa, what RAM is to ROM.

Both these pairs can hold programming, it's just that one pair is empty at boot-up and capable of being rewritten (RAM/FPGA); whilst the other (ROM/Lisa) has programming which is fixed and read-only, but is immediately accessible on power-up (ROM/Lisa).

If I have a 1.3 ROM machine, and I boot up and then soft-kick it with Kickstart 3.1 (into RAM), am I now 'emulating' 3.1, or actually running the real thing? Of course, I am running the real thing; it's no different to an Amiga with a 3.1 soldered to the circuit board (except I've used up a little RAM).  It's immaterial whether the kernel is present in ROM or RAM to the Amiga.  The operation is pretty identical either way, and the speed and performance is much the same however it's loaded.

If it helps people to understand the concept, just think of using FPGAs to implement AGA as being like the equivalent of using RAM to soft-load a Kickstart (much as the A1000 did). Except instead of putting Kickstart into RAM, we're loading AGA chips into FPGAs.  FPGAs, like RAM, lose their contents upon power-down, but they have the advantage they can be programmed. That doesn't make it any less a 'real Amiga' than one with fixed AGA chips, any more than a machine soft-kicked into 3.1 isn't really running Kickstart 3.1.
« Last Edit: December 06, 2011, 12:41:07 AM by ShapeShifter »
 

Offline JimS

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 1155
    • Show only replies by JimS
Re: FPGA for dummies
« Reply #27 on: December 06, 2011, 01:45:40 AM »
When I try to explain this to non-tech types, I mention the 100 in one project board I had as a kid. It was a pile of components mounted on a masonite board with springs on the leads. It also had a pile of wires.... put the wires in the right places and you could make all kinds of stuff... Multipliy by about a billion and you have an FPGA. ;-)
Obsolescence is futile. You will be emulated. - Amigus of Borg
 

Offline persia

  • Hero Member
  • *****
  • Join Date: Sep 2006
  • Posts: 3753
    • Show only replies by persia
Re: FPGA for dummies
« Reply #28 on: December 06, 2011, 03:47:17 AM »
In the end UAE or FPGA, you are still running on silicon and silicon that is different to the original hardware.  I have no problem with that, it's all Amiga to me, I was just wondering how you justify one over the other.
[SIGPIC][/SIGPIC]

What we\'re witnessing is the sad, lonely crowing of that last, doomed cock.
 

Offline freqmax

  • Hero Member
  • *****
  • Join Date: Mar 2006
  • Posts: 2179
    • Show only replies by freqmax
Re: FPGA for dummies
« Reply #29 from previous page: December 06, 2011, 06:44:51 AM »
Most chips digital chips consists of a bunch of transistors wired in a way that makes them used in a way where they are either fully on or off. Wires can't be changed inside a chip. But a bigger bunch of transistors can be wired to give the same function where the function is dependent on transistor states instead of wires. This makes the ground for FPGAs.
The penalty is that transistor configurations that depend on more transistors is slower but will still be fast enough to respond properly. The other penalties are the configuration complexity and heat.

So in essence a few transistors with wiring is replaced with more transistors and wiring but where the function depends on the state of some transistors used as memory instead of hard wired cables.

These FPGA Amigas are essentially a clone just like AMD CPU is a Intel clone. Or an implementation of the original schematic.
Information sources are UAE, and testing of real hardware to get the function.

The devices you need can either be implemented with the FPGA provided there's enough "free" configuration transistors or via USB. The original hardware gets broken by time and there's no replacement for the original chips.