Welcome, Guest. Please login or register.

Author Topic: FPGA for dummies  (Read 59540 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline alexh

  • Hero Member
  • *****
  • Join Date: Apr 2005
  • Posts: 3644
    • Show only replies by alexh
    • http://thalion.atari.org
Re: FPGA for dummies
« Reply #89 on: December 07, 2011, 10:58:44 AM »
FPGA's are nothing like CPU's. And certainly nothing like software emulation using a CPU.

Software emulation is a re-creation of the hardware in an abstract model. Whereas FPGA's can re-create the logic of the original 1:1 (if the original logic definitions are available).

The similarities between what has been done with FPGA's and what has been done with software emulation stems from in both cases the original logic definitions were NOT available and so had to be reverse engineered and re-created (often with mistakes due to largely undocumented features.)
 

Offline psxphill

Re: FPGA for dummies
« Reply #90 on: December 07, 2011, 02:16:34 PM »
Quote from: alexh;670629
FPGA's are nothing like CPU's. And certainly nothing like software emulation using a CPU.
 
Software emulation is a re-creation of the hardware in an abstract model. Whereas FPGA's can re-create the logic of the original 1:1 (if the original logic definitions are available).

An FPGA and a CPU are more similar than you suggest (you specify 0% similarity). How similar would depend on what CPU, or GPGPU etc that you pick.
 
They both take a program, although VHDL/Verilog have more in common with with functional programming languages than older langues like C.
 
Think http://en.wikipedia.org/wiki/Concurrent_computing with a couple of million cpu's.
 
It's not really possible to do a 1:1 mapping of a custom chip to VHDL. You're going to end up doing some things slightly differently.
 
What it comes down to though, simulation and emulation is about recreating something. If you took a VHDL 68000 simulator and put it on a DIP carrier so it could plug into an Amiga then what would it be:
 
1. A 68000.
2. A simulation of a 68000.
 
This thread isn't the only place where simulation/emulation in hardware is mentioned. It has been common to use the terms even in fixed purpose hardware that behaves similar to other hardware.
 

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: FPGA for dummies
« Reply #91 on: December 07, 2011, 02:28:36 PM »
Quote from: psxphill;670638

 
What it comes down to though, simulation and emulation is about recreating something. If you took a VHDL 68000 simulator and put it on a DIP carrier so it could plug into an Amiga then what would it be:
 
1. A 68000.
2. A simulation of a 68000.
 
This thread isn't the only place where simulation/emulation in hardware is mentioned. It has been common to use the terms even in fixed purpose hardware that behaves similar to other hardware.


It actually wouldn't matter... You could call it a purple teapot and claim that it orbits the sun somewhere between mars and Jupiter...

I fact how would you know if Freescale sold you a 68k, which worked fine in your A500... Was either an ASIC or an FPGA?

Offline billt

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 910
    • Show only replies by billt
    • http://www.billtoner.net
Re: FPGA for dummies
« Reply #92 on: December 07, 2011, 03:35:06 PM »
Quote from: Thorham;670608

If it's not the original chipset, then yes.


Is Super Buster rev 11 then an emulation of Super Buster rev 1 because it wasn't the first? Is 6582 an emulator of the 6581? Is 68060 mask 1e41j an emulator of 68060 mask 1F43G?

If Tramiel's Commodore had put the C64 into a single chip, would it be less of an emulator than Jeri's single chip?
Bill T
All Glory to the Hypnotoad!
 

Offline billt

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 910
    • Show only replies by billt
    • http://www.billtoner.net
Re: FPGA for dummies
« Reply #93 on: December 07, 2011, 03:39:26 PM »
Quote from: psxphill;670619
The 68000 uses microcode, therefore to emulate it you would have to use the microcode. If you don't use the microcode you are only simulating it. Just because the microcode is in mask rom is irrelevant.


Freecale, if they wanted to, could make a 68000 chip, hardwired on silicon, that does not use microcode to implement the 68000 instruction set. Motorola chose to use the microcode method, they did not have to. If they had chosen not to back in the 1970's, would their product running out Amiga 1000, 500, 2000, etc. computers have only been a simulator of a processor, not a real processor?
Bill T
All Glory to the Hypnotoad!
 

Offline billt

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 910
    • Show only replies by billt
    • http://www.billtoner.net
Re: FPGA for dummies
« Reply #94 on: December 07, 2011, 03:43:44 PM »
Quote from: psxphill;670621
I didn't say FPGA's were essentially CPU's, just that they have alot in common.


I very strongly disagree with that.

Quote
An FPGA and a CPU are more similar than you suggest (you specify 0% similarity). How similar would depend on what CPU, or GPGPU etc that you pick.


OK, pick the most similar FPGA and CPU pair out there, and describe the details that make them so similar.

Quote
They both take a program, although VHDL/Verilog have more in common with with functional programming languages than older langues like C.


An FPGA does NOT take a program. The bitstream data is essentially a netlist. A software executable is absolutely not essentially a netlist.

In Verilog:
assign mux_out = mux_select ? input_1 : input 0;

Is one way to write a multiplexor gate. This is the same as connecting three wires to a mux symbol in a schematic drawing. no difference whatsoever, and the synthesis tool will give you a mux gate from teh cell library, just like it would from a schematic. This verilog code needs about four transistors, two input wires, and one output wire to exist in the real world.
   
In C:
mux_out = mux_select ? input_1 : input_0;

let's say I compiled that on my XE, which is a 32bit CPU. mux_out, mux_select, input_1, and input_0 a re each a 32bit value. If they are all in CPU registers, that is 32 * 4 = 128 flipflops, and each flipflop is maybe a dozen transistors. Then we need a 32bit comparator to choose which of the inputs goes into our result, and a 32 2:1 muxes (can be done in transistors each) to bring the correct input value back to the result register. We need an opcode to tell the thing that we want to do a comparison, we need opcodes to load in the instruction opcode and to load in the input_1 and input_0 values, we need a decoder to determine that the instruction opcode we fetched says to do a comparison, we need a clock to drive the state machines and to latch values into the register flipflops.

Call me goofy if you like, but I do find it difficult to equate those two situations to each other.

Quote
Think http://en.wikipedia.org/wiki/Concurrent_computing with a couple of million cpu's.


That implies that there is a couple of million processing entities, each continuously running through sequences of commands telling it what to do, after the program is loaded. Each proccessing entity is doing fetches, decodes, ALUs, register reads and writes, etc. In an FPGA, after you load the design, the stuff that makes up the FPGA itself goes static, it is fixed until you turn it off. There are no fetches, decodes, ALUs, registers being read and written to, etc. (Reconfiguration while the system is running is a significant operation, takes significant time, and really should only be used to INFREQUENTLY swap between very different modes that do not have any dependencies on each other, and it really is a recent phenomena. FPGAs that could do it long ago weren't used that way, or very very rarely.)

Quote
It's not really possible to do a 1:1 mapping of a custom chip to VHDL. You're going to end up doing some things slightly differently.

The guy that made the custom chip can, and most likely already did, as that's how you design chips these days in the first place. We use Verilog where I work, but same thing. If someone were to make a TG68 ASIC, the VHDL we already know about is synthesized into a gates netlist, and the ASIC place/route tool uses silicon cells from a library and puts them together to draw the die. It's pretty uncommon to design digital chips any other way than VHDL or Verilog today. Schematics are antiquated for digital, though they are still relevant for analog silicon. There's analog extensions to VHDL and Verilog though, and they'll take over at some point.

You can also license the VHDL or Verilog. That's what ARM does for example. They license their HDL code. TI, ST, Atmel, and all the others are using the same HDL code written by ARM. They add different peripherals to it, choose the fab tech they want to build it in, to try and make their product uniquely useful for a certain market, but a CoretexM4 is a CoretexM4 is a CoretexM4... AppliedMciro licenses the PowerPC core from IBM, that's IBM's VHDL code (or Verilog, whichever is the case). PA Semi did make their own new implementation of the PowerPC instruction set, and had no intention of trying to clone any existing PPC processor core, they worked from the instruction set spec with a different philosophy (minimize power consumption at the target performance level, compared to IBM's really freakin hot G5 design), the same doc an assembly programmer would learn assembly language programming from. Is the X1000 a PowerPC computer, or a simulation or emulation of a PowerPC computer?
« Last Edit: December 07, 2011, 04:36:52 PM by billt »
Bill T
All Glory to the Hypnotoad!
 

Offline psxphill

Re: FPGA for dummies
« Reply #95 on: December 07, 2011, 04:15:27 PM »
Quote from: billt;670649
Freecale, if they wanted to, could make a 68000 chip, hardwired on silicon, that does not use microcode to implement the 68000 instruction set. Motorola chose to use the microcode method, they did not have to. If they had chosen not to back in the 1970's, would their product running out Amiga 1000, 500, 2000, etc. computers have only been a simulator of a processor, not a real processor?

It's unlikely that freescale would do that and still call it a 68000, they have managed to avoid reusing the same number up until now at least.
 
As for the second part, you can't rewrite history. However if in 1970 the 68000 didn't use microcode then the 68000's would still be real 68000's. If you made one that worked differently (i.e. used microcode) then it would be a simulation.
 
Quote from: billt;670649
An FPGA does NOT take a program. The bitstream data is essentially a netlist. A software executable is absolutely not essentially a netlist.

I didn't say software was a netlist, but VHDL is a programming language. It even mentions it on http://en.wikipedia.org/wiki/Concurrent_computing
 
and here http://www.mlab.ice.uec.ac.jp/mit/text/JyoTsuEnsyu/VHDL_Language_Reference.pdf
 
If VHDL is a programming language then what you write is a program.
 
An FPGA is more efficient than using software on a CPU, but it's essentially doing the same thing.
 
Quote from: billt;670650
The guy that made the custom chip can, and most likely already did, as that's how you design chips these days in the first place.

We're talking Amiga custom chips here, which predate VHDL by a long shot.
« Last Edit: December 07, 2011, 04:49:48 PM by psxphill »
 

Offline Thorham

  • Hero Member
  • *****
  • Join Date: Oct 2009
  • Posts: 1150
    • Show only replies by Thorham
Re: FPGA for dummies
« Reply #96 on: December 07, 2011, 04:58:52 PM »
Quote from: billt;670648
Is Super Buster rev 11 then an emulation of Super Buster rev 1 because it wasn't the first? Is 6582 an emulator of the 6581? Is 68060 mask 1e41j an emulator of 68060 mask 1F43G?

If Tramiel's Commodore had put the C64 into a single chip, would it be less of an emulator than Jeri's single chip?
That's a good point. Perhaps that is pushing it, but this is a gray area, as you said.
 

Offline Thorham

  • Hero Member
  • *****
  • Join Date: Oct 2009
  • Posts: 1150
    • Show only replies by Thorham
Re: FPGA for dummies
« Reply #97 on: December 07, 2011, 05:07:06 PM »
Quote from: psxphill;670657
I didn't say software was a netlist, but VHDL is a programming language. It even mentions it on http://en.wikipedia.org/wiki/Concurrent_computing
 
and here http://www.mlab.ice.uec.ac.jp/mit/text/JyoTsuEnsyu/VHDL_Language_Reference.pdf
 
If VHDL is a programming language then what you write is a program.
 
An FPGA is more efficient than using software on a CPU, but it's essentially doing the same thing.
From what I've learned from my arguing, this is not the case at all.

As you know, when writing a program in a higher level language than assembly language, you compile the program to an assembler program, and this is assembled into a binary containing the machine code instructions.

With VHDL, the program isn't translated into something like machine code at all. There is no program of any kind running on the FPGA, and although the VHDL has to be translated, it's translated into something completely different than what an assembler program would be translated into to.

While it's true that the basic idea is the same, namely programmability, FPGAs and CPUs achieve this is fundamentally entirely different ways. The word 'programmable' doesn't necessarily imply 'program'.
 

Offline billt

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 910
    • Show only replies by billt
    • http://www.billtoner.net
Re: FPGA for dummies
« Reply #98 on: December 07, 2011, 05:08:10 PM »
Quote
I didn't say software was a netlist, but VHDL is a programming language. It even mentions it on ...

If VHDL is a programming language then what you write is a program.


But VHDL is NOT a "programming language". It IS a "hardware description language". VHDL is an acronym for VHSIC Hardware Description Language. (VHSIC is an acronym for Very High Speed Integrated Circuit)

When you are coding in VHDL or Verilog, you are not writing a program. You are writing a circuit. You do not "call" a module, you "connect to it". Modules and leaf/library cells connected in your code ARE A NETLIST.
 
Quote
An FPGA is more efficient than using software on a CPU, but it's essentially doing the same thing.


No, they are not essentially doing the same thing. I say that as someone who knows how they both work on a highly technical level, and thus how they both do things, and how those two ways are not comparable. If you believe that FPGA architecture is so similar to microprocessor architecture that they essentially do the same thing, and you are not willing to learn the technical stuff about them, how they are made, or what is happening inside them, then this debate is highly flawed.
 
Quote
We're talking Amiga custom chips here, which predate VHDL by a long shot.

VHDL was defined in 1981. It's evolved since then, but... I remember seeing something about the Amiga chip guys using an HDL named M, I think from Mentor Graphics (a leading vendor in chip design tools for a very long time). If we had the M code, then same thing. Maybe this was regarding Hombre, I don't remember for sure.

And we're not talking Amiga custom chips to the exclusion of anything else here. This thread talks about a lot of different kinds of chips.
Bill T
All Glory to the Hypnotoad!
 

Offline psxphill

Re: FPGA for dummies
« Reply #99 on: December 07, 2011, 05:13:47 PM »
Quote from: billt;670668
But VHDL is NOT a "programming language". It IS a "hardware description language". VHDL is an acronym for VHSIC Hardware Description Language. (VHSIC is an acronym for Very High Speed Integrated Circuit)

It is a programming language (released in 1987, way after the Amiga).
 
Even IEEE call it a program, http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?arnumber=386221
 
Plus books http://users.ece.gatech.edu/~sudha/book/starters-guide/
 
It might not be like other programming languages you've used, but it was based on ADA & there are other concurrent languages that are similar.
 
Not sure about any of the Amiga chips, but definately the C64 cannot be 1:1 mapped to an FPGA because of analogue components used in SID & VIC.
« Last Edit: December 07, 2011, 05:16:55 PM by psxphill »
 

Offline billt

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 910
    • Show only replies by billt
    • http://www.billtoner.net
Re: FPGA for dummies
« Reply #100 on: December 07, 2011, 05:54:05 PM »
http://en.wikipedia.org/wiki/Hardware_description_language

Quote from: psxphill;670669
Not sure about any of the Amiga chips, but definately the C64 cannot be 1:1 mapped to an FPGA because of analogue components used in SID & VIC.


Well, the C64 was likely a schematic diagram design. That schematic diagram surely had digital logic gates all over the place. Those schematic gate symbols and the wires drawn between them CAH indeed be directly mapped to VHDL or Verilog, as both of these languages, as a subset of their features, are netlist languages. (They are of course a lot more than simply netlist languages, but that is one capability amongst those many others)

For that analog componetns, surely there re schematics with those as well. verilog-A and -AMS is the "Analog Verilog" (AMS is both analog and digital Mixed together), and VHDL-AMS is the analog VHDL. Someone knows how those analog schematic symbols behave, which is why those particular symbols and characteristics are there instead of other ones. This knowledge means that yes, someone can write those analog schematics in Verilog-AMS or VHDL-AMS. So yes, it is possible to make an exact 1:1 implementation of the Commodore64 (or any other schematics) in these HDL languages.

If the analog components are not available on an FPGA, and they likely are not, then, yea, a 1:1 in FPGA isn't what you'll get. I can imagine a programmable analog chip, I'm not sure if such a thing exists for sale or not. Combine such a thing with an FPGA on the same die, then there you go. But I don't know that this is anything more than a hypothetical device.
« Last Edit: December 07, 2011, 07:36:11 PM by billt »
Bill T
All Glory to the Hypnotoad!
 

Offline persia

  • Hero Member
  • *****
  • Join Date: Sep 2006
  • Posts: 3753
    • Show only replies by persia
Re: FPGA for dummies
« Reply #101 on: December 07, 2011, 08:14:11 PM »
So why is this important again?  

As I understand it an FPGA is a simulation or mock up of hardware, there is both a hardware and software component whilst with UAE is a pure software solution.  Further FPGA could easily be made into a hardware solution (but not at all likely in this case).  They represent opposite ends of the emulation spectrum.
[SIGPIC][/SIGPIC]

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

Offline Thorham

  • Hero Member
  • *****
  • Join Date: Oct 2009
  • Posts: 1150
    • Show only replies by Thorham
Re: FPGA for dummies
« Reply #102 on: December 07, 2011, 08:31:24 PM »
Quote from: persia;670689
As I understand it an FPGA is a simulation or mock up of hardware, there is both a hardware and software component
The software part is actually the design software, such as a VHDL system. There's no actual software running on the FPGA at all. There is a 'soft' side on FPGAs, but it's not a program. FPGA programming can't be compared to CPU programming at all.
 

Offline JimS

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 1155
    • Show only replies by JimS
Re: FPGA for dummies
« Reply #103 on: December 07, 2011, 09:18:24 PM »
thread:
So lets build a x86pc core for the Replay, then run UAE on it. What's that... simulation or emulation. ;-)
Obsolescence is futile. You will be emulated. - Amigus of Borg
 

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: FPGA for dummies
« Reply #104 from previous page: December 07, 2011, 10:08:50 PM »
Quote from: JimS;670697
thread:
So lets build a x86pc core for the Replay, then run UAE on it. What's that... simulation or emulation. ;-)
You know, I rather think that's a fun idea :)