Welcome, Guest. Please login or register.

Author Topic: FPGA for dummies  (Read 59602 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline billt

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 910
    • Show all replies
    • http://www.billtoner.net
Re: FPGA for dummies
« Reply #14 on: December 06, 2011, 09:22:28 PM »
Quote
Sure, but you can't point to any wiring, because it doesn't exist (except for the parts that make the FPGA work as an FPGA).


Sure I can. There's a LOT of wires in there which are not part of the FPGA configuration controls. They exist only to get a signal from an output over here to an input over there. When not configured, they are floating, not connected to anything. The FPGA place and rout tool knows exactly which bits of metal are conducting each and every signal in YOUR design. The PnR tool looks at teh gates netlist for your design, and decides which bits of metal real life to connect to each other to carry YOUR signals around. There are tools for humans to see these connections and stuff too, but they tend to live only inside FPGA companies for fear that a competitor will reverse engineer their FPGA silicon design with such knowledge. If I had that tool, then we could sit down with a microscope and point to each and every bit of metal on the die that carries each and ever signal you design into it. Very real wires, very real metal atoms, very real electrons moving around in them. There aren't any ghosts lurking around in these things... Do you think that the LUTS talk to each other by telepathy or something? They need wires, very very real-life wires.
Bill T
All Glory to the Hypnotoad!
 

Offline billt

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 910
    • Show all replies
    • http://www.billtoner.net
Re: FPGA for dummies
« Reply #15 on: December 06, 2011, 09:26:01 PM »
Quote
Yes, it does. Until the circuit is physically built using wires, like in CPUs, it can be said to be an imitation of that actual circuit.

How do you feel about breadboards, a pile of 74* logic chips, and a bag of wire?
Bill T
All Glory to the Hypnotoad!
 

Offline billt

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 910
    • Show all replies
    • http://www.billtoner.net
Re: FPGA for dummies
« Reply #16 on: December 06, 2011, 09:38:45 PM »
Quote
From what I've read in th thread, I've also noticed how the gate building blocks in an FPGA use more transistors than you'd actually need in a full, non-Asic, hard implementation, or am I wrong here? If I'm not, then that would mean that if you actually implemented a circuit the hard way, you'd end up using fewer transistors than then the FPGA equivalent.

There is a lot of overhead to make an FPGA be so versatile, yes. You might be able to fit 100 ASIC AND gates in the same space as one FPGA logic element takes. The LUT can do more complicated stuff than an AND gate though, and can serve as a handful of different combinatorial gates together, but ASIC would still be smaller.

I guess part of the debate here is "what does al that stuff actually do" in the FPGA when the design is running, and does or does not that define emulation. You and a couple others see the result as soemthing "pretending to be" X, while I and a coupel others see something "being X, but not pretending".
Bill T
All Glory to the Hypnotoad!
 

Offline billt

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 910
    • Show all replies
    • http://www.billtoner.net
Re: FPGA for dummies
« Reply #17 on: December 06, 2011, 09:49:35 PM »
Quote
Yes, but these wires are electronically connected and not directly, that's really what I meant, my bad.

Quote
Quote:
Originally Posted by billt View Post
When not configured, they are floating, not connected to anything.
Exactly. In a fixed circuit the wires go directly from one component to the next.

OK, how about this. All those wires do actually connect multiplexers and/or passgates together. wire to transistor to wire to transistor and so on.  The place and route tool chooses which metal wires to use for which signals in your design, and tells the passgates and multiplexers to make that path connection between the chosen bits of metal.

Now, consider the memory controller in an 8640 PPC processor, which is "fixed" enough for you, and I imagine that the memory chips are too. There are two memory channels. There are several banks (DIMM slots) per channel. When the processor wants to access a particular memory location, there are multiplexers to choose which channel it talks to, and passgates in the RAM chips to make sure only the correct one talks back on the bus. Passgates and multiplexers...

And, on a motherboard, you may have several PCI-Express slots. These are not connected to each other, they are a separate channel each. The Northbridge chip looks at the address the processor wants to read from, and demultiplexes the access down the corret channel to its peripheral destination. The response comes back, and the Northbridge now multiplexes this response onto the north bus to the CPU. Again, multiplexors, not some unshared, only this and nothing else goes there pathway segment. If I change which slots my different PCI-Express cards are plugged into, I have at he next powerup reconfigured my system design, the processor and northbridge need to use a different path to send the same request and get the same response. Is my PC emulating the idea of being a PC? Or is it simply just being a PC?
Bill T
All Glory to the Hypnotoad!
 

Offline billt

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 910
    • Show all replies
    • http://www.billtoner.net
Re: FPGA for dummies
« Reply #18 on: December 06, 2011, 09:55:02 PM »
Quote
In essence, the lookup tables could be said to tell the FPGA the connection points for the wires (so to speak). The FPGA then electronically connects the wires to those points (so to speak). With a breadboard the connection is completely mechanical, and that makes the big difference.

The LUT does not do that. The Configuration memories tell the muxes which connections to make. The LUT stores/implements your logic truth table , and has no knowledge of or influence on the wire connections or control of anything.
Bill T
All Glory to the Hypnotoad!
 

Offline billt

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 910
    • Show all replies
    • http://www.billtoner.net
Re: FPGA for dummies
« Reply #19 on: December 06, 2011, 10:04:29 PM »
Quote from: Thorham;670558
Exactly. In an emulation there's all kinds of things happening in the background to just to enable to make what is being emulated work. The real thing doesn't require any of this overhead at all.

It's like a software emulation: An emulated computer needs a computer and software, while the actual computer works fine by itself.

Hmmm. What do you think is "happening" in the background of an FPGA design? Once it's configured, all that is fixed. Configuration 1's stay 1's, and configuration 0's stay 0's. The configuration memories to not change. There is no controller going down the address bus doing read or write accesses, not changing any values. The multiplexer settings which control the signal routing are fixed, they do not change and move wire connections around while the system is on. There's overhead stuff "present" and taking up space, but it's not "doing anything", or "nothing is happening there". It's "just there" at that point.

In an ASIC, does it make a difference if I use a library cell carrying the name D flipflop which serves the function of a D flipflop, or if I do an ECO design change, have no empty spaces to put another "real" D flipflop library cell that I somehow forgot, and have to combine a handful of NAND gates that I do have room for here and there, in order to effect a D flipflop function instead? Or, oh crap, that NAND gate should have been an AND gate. The AND (6 transistors) is too big to directly replace the NAND gate (4 transistors), but I have room over there for an inverter. Do a NAND plus an inverter emulate an AND gate, or implement it in an ASIC?

Quote
It's like a software emulation: An emulated computer needs a computer and software, while the actual computer works fine by itself.

An emulated computer needs software. Some group of instructions that are continuously fetched from one of several types/levels of storage somewhere, decoded, ALUed, reading values from parameters and writing values to register or memory destinations, in order to effect the target opcode format, ALU, instruction decode, registers, memory map, etc. In what way do you think this activity is continuously occurring in the FPGA underneath your logic circuit?


And another thought about "fixing" an FPGA. We'd once looked into but never sold a metal mask fixation option for our FPGAs, which would replace the configuration SRAMS and the LUT memory with metal hardwired 1's and 0's, should a security concerned customer want to do that to get a fixed die design instead of going through the effort of ASIC conversion. If I had a Minimig core designed to work well in my FPGA, and I did this metal mask replecement, most of the die is the same as the reprogammable FPGA, all those multiplexors are still there exactly the same way, but I can no longer change their controls, have I de-emulaterified this metal hardwired thing?
« Last Edit: December 06, 2011, 10:17:12 PM by billt »
Bill T
All Glory to the Hypnotoad!
 

Offline billt

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 910
    • Show all replies
    • http://www.billtoner.net
Re: FPGA for dummies
« Reply #20 on: December 07, 2011, 01:58:36 AM »
Quote from: Thorham;670562
Sorry for being an obvious layman here. It should still be true that you store data in the FPGA that configures the wiring, though?

The point is that you don't have, say, two transistors which are directly, mechanically connected (such as using a printed circuit board that's custom made, which the components are soldered onto). In an FPGA you have configurable components in between the wires (or am I missing something again?).


The LUT is a connection point to a route. It has an output that goes to some other LUT's input. (Or to an IO pin outside the chip) The LUT input is a connection point routed to some other LUT's output, or coming into a chip IO pin. Every wire has a contact (same purpose as a via, but specific name for a connection between metal and poly (transistor gate) or metal and active (transistor source or drain) or likely several contacts to various transistors at each end.

Every wire touches a transistor at each end. At least two on each end (a PFET and an NFET, maybe more than one of each). Every wire has to connect to SOMETHING, or there's no reason for it to be there. (Not completely true, but I won't go into the reasons for planarization fill metal, it has nothing to do with routing or functionality of any kind of chip, it's a manufacturing reliability thing)

The passgates and multiplexers may come from the sale cell library that an ASIC uses. When I started doing this for FPGAs as my daily job 13 years ago (will be in a few weeks), we had a full custom library especially for the FPGAs, in order to pack everything as small and tight together as possible. The last few FPGA chips we designed we moved to using the standard ASIC library, instead of anything custom. We were then using ASIC passgates and ASIC muxes at the ends of our routing wires. The FPGA itself, for all intents and purposes, was an ASIC chip.
Bill T
All Glory to the Hypnotoad!
 

Offline billt

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 910
    • Show all replies
    • http://www.billtoner.net
Re: FPGA for dummies
« Reply #21 on: December 07, 2011, 02:02:26 AM »
Quote from: Thorham;670576
Don't have a clue, ...

Don't ask me how it does work, ...

Don't know about CPLDs,

...

Sorry for being an obvious layman here....



Thanks for trying to correct those of who do the topic of this thread every day for over a decade. :)
Bill T
All Glory to the Hypnotoad!
 

Offline billt

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 910
    • Show all replies
    • http://www.billtoner.net
Re: FPGA for dummies
« Reply #22 on: December 07, 2011, 04:47:30 AM »
Well, it is interesting to see that some people do see this as a gray area for definition, or that the way an FPGA does what it does is something other than a genuine method of "implementation". I've been fixed on how I see this for a long time for very technical reasons. People on the other side I imagine have felt their way for a long time too. Both sides are having trouble grasping way people on the other feel the way they do, for whatever reasons that is. It's interesting to try and see this through someone else's eyes who have a different experience with it all.
Bill T
All Glory to the Hypnotoad!
 

Offline billt

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 910
    • Show all replies
    • http://www.billtoner.net
Re: FPGA for dummies
« Reply #23 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 all replies
    • http://www.billtoner.net
Re: FPGA for dummies
« Reply #24 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 all replies
    • http://www.billtoner.net
Re: FPGA for dummies
« Reply #25 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 billt

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 910
    • Show all replies
    • http://www.billtoner.net
Re: FPGA for dummies
« Reply #26 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 billt

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 910
    • Show all replies
    • http://www.billtoner.net
Re: FPGA for dummies
« Reply #27 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 billt

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 910
    • Show all replies
    • http://www.billtoner.net
Re: FPGA for dummies
« Reply #28 on: December 08, 2011, 01:21:23 PM »
Quote from: ferrellsl;670716
As far as classic Amigas are concerned, it is.  


As far as the guy who designed it, Id be surprised if Mikej comes over and tells us that, ues, his primary intention for doing the board was so he could make a Classic Amiga, and that anything else people use it for is just bonus. I'm sure he's happy that so many of us Amigans are excited about his product, but I can't imagine this was the purpose for making it.
Bill T
All Glory to the Hypnotoad!
 

Offline billt

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 910
    • Show all replies
    • http://www.billtoner.net
Re: FPGA for dummies
« Reply #29 from previous page: December 09, 2011, 03:58:23 PM »
There's a post at aw.net about reconfiguring the FPGA on the SAM boards.
Quote
It takes around 13-17 secs to reprogram the FPGA on a Sam440ep.


http://amigaworld.net/modules/newbb/viewtopic.php?topic_id=34723&start=0&post_id=641977&order=0&viewmode=flat&pid=641594&forum=33#641902

I'd mentioned that reconfiguration is a significant event. You don't want to do it very often, as can be seen above. I'm sure other system designs can do it faster than that, but it's always going to be a significant "context switch" to swap out your hardware with something different. Even if only a partial reconfig.
Bill T
All Glory to the Hypnotoad!