Andre_P
Posts: 241
Joined: Sun Aug 28, 2011 7:57 am

Re: FPGA Stuff ?

Fri Jan 13, 2012 7:58 pm

Hi All,

I know the Raspberry Pi is aimed at getting Children to learn how to program, however here is a potential further extension to the idea.

What about using it to potentially teach kids about a Hardware Description language (Verilog/VHDL). It would possibly an 'A' Level (for those not from the UK this is the level of Secondary Education that occurs from 16 to 18) arena.

It would be interesting to see if the Raspberry Pi could run the Linux form of the free software that comes from various FPGA vendors. It probably would provide some very long compile times, but for some of the smallest devices an overnight run might be acceptable. Also not using the GUI form of the tools but the command line forms.

I remember that I was using a PC back in 1995 to largish CPLD's (anyone remember Warp ? ), and it has been said that Pi is roughly the same level of power of a machine of that era so it might not be a completely silly approach.

Just from writing scripts they would start to learn some Perl/Tcl, they would pick up a HDL and start to think about the intrinsic logic that the Pi has within it.

Also vendors do comparatively cheap small FPGA demo boards.

It would be a nice for an 'A' Level student to wander into a university interview and when asked what kind of hardware/embedded experience they have had they can talk about.

Only ONE stipulation, NO DRINK VENDING MACHINE State Machines, there has got to be something more interesting than that !

Anyway, your thoughts or am I the only HDL guy here .

TheEponymousBob
Posts: 205
Joined: Mon Jan 02, 2012 5:05 am
Contact: Website

Re: FPGA Stuff ?

Fri Jan 13, 2012 8:10 pm

Well my first thought is that I"ve never heard of it (I"m not a HW guy), so that makes at least one interested party, were someone to put together some introductory tutorials or the like

Andre_P
Posts: 241
Joined: Sun Aug 28, 2011 7:57 am

Re: FPGA Stuff ?

Fri Jan 13, 2012 8:19 pm

Hi Bob,

Barring the Analogue side of things and for those who really are pushing the edge a HDL is used to describe the logic that is used in a Chip.

If you are designing a 'Chip' or as is better known as an ASIC (Application Specific Integrated Circuit) then you use a HDL.

A FPGA (Field Programmable Gate Array) is effectively a chip which has lots of memories that allows you to program different designs in and if you wish reprogram them with a different design.

Not wishing to teach you how to suck eggs but the analogy I use is that an FPGA is like an Actor, you give him a script and he becomes a specific character. Take the script away and give him a new script and he can become a different character and you can carry on doing this ad infinitum. The script is your design written in a HDL.

Please feel free to ask questions

Hugh Reynolds
Posts: 61
Joined: Tue Sep 06, 2011 9:48 am

Re: FPGA Stuff ?

Fri Jan 13, 2012 8:29 pm

I have some hardware experience with Xilinx devices.  Since 1995...!!!

So between us we should be able to squeeze out a couple of educational shields.

There are freeware SPI and I2C interfaces in VHDL so it should be possible to make up a board with a Xilinx and some LEDs etc and get the Pi to talk via SPI or I2C to whatever VHDL gets loaded into the Xilinx.

Possible projects:

1. Using BRAM on the Xilinx would be a useful way of creating a bitmapped graphic LCD connection.

2. Anything you can think of.

3. NOT traffic lights.

PM me if you are interested in developing these ideas...

error404
Posts: 351
Joined: Wed Dec 21, 2011 11:49 pm

Re: FPGA Stuff ?

Fri Jan 13, 2012 8:31 pm

I don't think there are (m)any usable open-source HDL compilation/synthesis tools out there. Am I wrong?

drjohnsmith
Posts: 11
Joined: Sat Dec 31, 2011 7:33 pm

Re: FPGA Stuff ?

Fri Jan 13, 2012 8:35 pm

ghdl

liam collins
Posts: 17
Joined: Sat Oct 29, 2011 5:06 pm

Re: FPGA Stuff ?

Fri Jan 13, 2012 8:37 pm

I've been considering branching out from uC into FPGA but don't know enough about them - yet. If you do manage to put a relatively cheap FPGA shield with software and documentation together then I would be interested in buying one.

Andre_P
Posts: 241
Joined: Sun Aug 28, 2011 7:57 am

Re: FPGA Stuff ?

Fri Jan 13, 2012 8:41 pm

Yup GHDL is out there but I've only heard of it being used as a simulation tool.

However, the 'web' editions of the Xilinx and Altera tools are free to download, last forever and come with the Modelsim simulator.

No Support, but there are forums which you can ask questions that are pretty friendly.

The Modelsim simulator is slowed down but as I said earlier it might be an over night thing.

Andre_P
Posts: 241
Joined: Sun Aug 28, 2011 7:57 am

Re: FPGA Stuff ?

Fri Jan 13, 2012 8:47 pm

FatBuzz and Liam : I am now waving my hand up and admitting I have absolutely NO idea what a shield is, sorry just a humble ASIC/FPGA guy here, can you tell me more ?

Liam : have a look at the web sites for Altera and Xilinx. As to HDLs there are various good books out there. Most of mine are aimed at VHDL. There are some good providers of training if you want to have a formal course. I learnt by reading a book on holiday and then later went on a course that joined up a lot more of the dots and gave me the philosophy.

User avatar
Gert van Loo
Posts: 2482
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: FPGA Stuff ?

Fri Jan 13, 2012 8:55 pm

error404 said:


I don't think there are (m)any usable open-source HDL compilation/synthesis tools out there. Am I wrong?



No, but all FPGA vendors have synthesis tools. (But not running on the Raspberry-Pi). They also have HDL simulation tools but those are often performance reduced for bigger designs.

Andre_P
Posts: 241
Joined: Sun Aug 28, 2011 7:57 am

Re: FPGA Stuff ?

Fri Jan 13, 2012 9:08 pm

Gert : Rats hadn't thought of that (please do not worry as you hear hand slapping foreheard !)

Ok the tools would have to run on the PC, oh well gets the synth and sim time down

liam collins
Posts: 17
Joined: Sat Oct 29, 2011 5:06 pm

Re: FPGA Stuff ?

Fri Jan 13, 2012 9:43 pm

Andre_P said:


FatBuzz and Liam : I am now waving my hand up and admitting I have absolutely NO idea what a shield is, sorry just a humble ASIC/FPGA guy here, can you tell me more ?


Andre,

Thanks for the info, I'll go hunting...

A shield is the name Arduino community give to extender/daughter boards for the Arduino hardware.

User avatar
johnbeetem
Posts: 945
Joined: Mon Oct 17, 2011 11:18 pm
Location: The Mountains
Contact: Website

Re: FPGA Stuff ?

Fri Jan 13, 2012 9:55 pm

I do a lot of FPGA design, primarily for Xilinx Spartan-IIe/3A.  Xilinx and others provide free software tools (WebPack) for the smaller parts, but they only run on x86 PCs.  At least they now have GNU/Linux versions available.

Xilinx and other vendors have always been openly hostile towards open source software, not wanting to publish the details of their architecture and programming stream.  It's very sad, as IMO they would have made vastly more money over the decades if they had.

My own preference these days is Verilog over VHDL.  Verilog is similar to C (terse), while VHDL is similar to Ada (wordy).  Chacun a son goût.  Verilog and VHDL were both designed for modeling digital hardware using simulation, and neither was originally designed to be easy to synthesize.  It shows -- it's actually quite tricky to get the synthesizer to make the logic you really want.  You have to imagine what you want, and then enter Verilog/VHDL that the synthesizer's pattern matcher recognizes.  It's a real pain, and the nasty part is that the next version of the synthesizer may do something different.  Sigh.

I used ModelSim once.  This was for my first Xilinx Spartan-II design and I wanted to make sure I knew what I was doing before we made a PC board.  I discovered to my horror that logic simulation hadn't improved one whit since my uni days.  When I got the actual hardware, it worked quite nicely until I used it in a way that violated the simulator's assumptions, producing behavior that would have been impossible to simulate.  So that was the last time I used simulation.  Nowadays I synthesize to make sure the design will fit into the part with plenty of margin, and make sure the PC board has enough spare pins to view internal signals.  Much better than simulation, at least for me.  Simulation involves creating lots and lots of test input signals and expected output signals, something I don't have patience for.  I'd rather prototype it and run it real time.

Hugh Reynolds
Posts: 61
Joined: Tue Sep 06, 2011 9:48 am

Re: FPGA Stuff ?

Fri Jan 13, 2012 10:04 pm

Andre,

Xilinx tools use oodles and oodles of cpu clocks and memory.  But they are almost enirely free.  They like megafast CPUs and 2^3 Gigabytes of RAM or more.  So they will have to run on big, thirsty x86 machines.  They output a file that is eventually copied into the configuration SRAM of the FPGA or flash the CPLD.

Small designs compile fast.  Big designs compile slower.  My latest 'full build' is taking 42 minutes.  On a machine with a fast 4 core processor and 8 Gigs memory.

VHDL will last a long time though the syntax is incredibly dull (hindsight is great isn't it), with irrelevant syntactic differences for combitorial and synchronous machines. I'm hoping for more support for 'C' like input syntax will emerge but I'm not holding my breath.  VHDL is a cross between a declarative and a proceedural language.

My projects us both VHDL and the embedded C for the Xilinx base and use QT, Delphi, C and C# for the front ends.  So you can see that to teach and then implement VHDL would need a very 'mixed' computing environment.  But that is what it takes in the custom/embedded world of FPGA.

I think some simple educational tasks and tutorials could be developed.  There are many concepts to be learned.  This could easily become too complex a project for teaching staff to manage at A-level.

Perhaps a good place to start would be to contact the universities you feed students into and get a feel for what they give first year students and what they might like you to teach.

davidgoodenough
Posts: 74
Joined: Wed Sep 21, 2011 11:55 am

Re: FPGA Stuff ?

Fri Jan 13, 2012 11:04 pm

Gert said:


error404 said:


I don't think there are (m)any usable open-source HDL compilation/synthesis tools out there. Am I wrong?


No, but all FPGA vendors have synthesis tools. (But not running on the Raspberry-Pi). They also have HDL simulation tools but those are often performance reduced for bigger designs.


There are several VHDL and Verilog tools in the Debian package list.  Maybe not the tools that the vendors produce, but open and mostly available for whichever of armel and armhf Raspberry Pi requires.

BTW, does the Pi have hardware floating point - this determines which of armel and armhf (the second is for chips with hardware floating point) one should use.

error404
Posts: 351
Joined: Wed Dec 21, 2011 11:49 pm

Re: FPGA Stuff ?

Fri Jan 13, 2012 11:42 pm

There are lots of tools out there, but AFAIK there are critical steps missing, so you'd not be able to actually do complete development just using the Pi, which kind of defeats the purpose - may as well just get an FPGA dev board and plug it in to a regular PC, the Pi adds nothing.

I haven't actually worked with this stuff myself, so I'm wondering if some of the experts might comment on MyHDL and the like. Is this worthwhile for teaching FPGA stuff and perhaps advancing beyond the crustiness of current HDLs? It looks interesting to me.

tritonium
Posts: 79
Joined: Tue Jan 03, 2012 7:10 pm

Re: FPGA Stuff ?

Sat Jan 14, 2012 1:00 am

I have for a long time wanted to 'have a go' at programmable logic devices.
I started of with digital stuff back in the late '70's with an 8080 based computer, and as I started to build more complex circuits with more powerful processors 'interfacing' required a degree of expertise with gluelogic and the use of more complex I/O chips - video timing generators for display, and floppy disc controllersetc and of course e-proms and the ability to build circuitry to program them, and then dynamic memory usingthe propagation delays of gates to get the ras / cas / mpx timing etc. How nice it would be to do this withone chip instead of all the wirewrapping or even circuit board etching or whatever.
I understood the basic AND / OR / D type and other forms of latches and flip flops and logic, could rattle offall the numbers of the LS TTL devices I needed, latches, buffers, shift register, counters, tristate opencollector totem pole etc etc, without ever getting into bolean maths.
Then one day I read about programmable logic and excitedly purchased from RS a 16L8-25WC (stock no. 636-003).
I have that original device here in front of me , unopened! unused. a relic.
Sadly.
There was a conceptual hurdle I could not get over - and as these devices got more and more powerful / sophisticated so I became more envious.
Its odd - I love to program in assembler on a number of chips - but VHDL.....
Elektor brought out a board with programmable logic that was supposed to educate (I think) but was (I thought) expensive and so....
Over the years I've produced a number of designs that have been marketed but can think of useful new ideas that need a highish resolution colour display. A microcontroller is quite powerful enough for the computing side of things but the display side has always stumped me.
I would look enviously at the program guide displayed on my TV by a twenty pound set top box!
I though of converting ISA video cards and bought some (very expensive) (f)pga based display devices but they proved inadequate in all sorts of ways - but it did indicate to me that programmable logic might have the answer.
And now the Raspberry Pi - an answer to a dream (perhaps). It has plenty of power and good colour display abilities, good price - I can see this being used in industry - I have seen BBC micro motherboards used in industry because of the ability to drive a colour display; (when I've been called in to repair them because the supplier no longer exists). In fact in order to get that display if I remember correctly they used a Ferranti logic array (not field programmable in those days) getting an A4 board of discreet logic chips into one small (rather hot!) package.
Ah memories.
I also have in front of me a box in which a PC motherboard was delivered, one board about 4 inches square had a vortex86sx chip which I think is a programmable logic device with an '86 architecture microprocessor programmed into its logic; it also has VGA/USB/GPIO/128MB/LAN and runs on 5v at less than an amp. Its gotta be the way to go. (But it does cost £100 ish small quantities) - and so the excitement for the Pi.

So if there were an accessable package that enabled me to get my head around fpga's etc I for one would welcome it.
Dave

tntexplosivesltd
Posts: 72
Joined: Fri Sep 30, 2011 8:08 am
Contact: Website

Re: FPGA Stuff ?

Sat Jan 14, 2012 1:18 am

There aren't any FPGAs in the R-Pi though. How will this help with programming an FPGA?

User avatar
johnbeetem
Posts: 945
Joined: Mon Oct 17, 2011 11:18 pm
Location: The Mountains
Contact: Website

Re: FPGA Stuff ?

Sat Jan 14, 2012 2:21 am

tntexplosivesltd said:


There aren't any FPGAs in the R-Pi though. How will this help with programming an FPGA?


Well, RasPi would be a dandy computer for teaching logic design using diagrams and/or HDL, with simulation and display of simulation results shown on the RasPi.  You can teach all of this without needing a PC: there are open-source tools for all this.  When it comes time to program the logic into an FPGA, students can network to a shared PC and run the Xilinx or other software there.  You don't need a GUI for Xilinx synthesis, mapping, place&route, and program file generation -- the Xilinx GUI actually calls command-line tools.  You can then FTP the binary FPGA image back to the RasPi and download it to the actual FPGA over JTAG using RasPi's GPIO or a USB JTAG dongle.  The Xilinx JTAG programming interface is well-documented.

User avatar
johnbeetem
Posts: 945
Joined: Mon Oct 17, 2011 11:18 pm
Location: The Mountains
Contact: Website

Re: FPGA Stuff ?

Sat Jan 14, 2012 2:34 am

tritonium said:


I also have in front of me a box in which a PC motherboard was delivered, one board about 4 inches square had a vortex86sx chip which I think is a programmable logic device with an '86 architecture microprocessor programmed into its logic; it also has VGA/USB/GPIO/128MB/LAN and runs on 5v at less than an amp. Its gotta be the way to go. (But it does cost £100 ish small quantities) - and so the excitement for the Pi.

So if there were an accessable package that enabled me to get my head around fpga's etc I for one would welcome it.


According to wikipedia, Vortex86sx is an SoC (System on Chip) -- basically an x86 cousin of RasPi's Broadcom Soc.

There are a lot of FPGA development boards around.  Xilinx itself has quite a few, and Avnet has some less expensive Xilinx-based boards.  They used to have a USD49 Spartan-3A board, but that's no longer at their web site.  Avnet does have a Spartan-6 board for USD89 which looks pretty good.  You might be able to find these on eBay.

One way to get started is to get the free Xilinx tools and either a Verilog or VHDL book and just try the tools before before buying anything.  You can get the Xilinx DVD ROM for free if you don't mind slow shipping.  When you get tired of simulating and want to use real hardware, "go for it".

tntexplosivesltd
Posts: 72
Joined: Fri Sep 30, 2011 8:08 am
Contact: Website

Re: FPGA Stuff ?

Sat Jan 14, 2012 2:59 am

And if you have the coin, the tPad makes for a good full-blown multimedia FPGA development board. http://www.terasic.com.tw/cgi-.....038;No=550

Can be programmed in Handel-C too =D

Hammerheart
Posts: 1
Joined: Sat Jan 14, 2012 6:38 am

Re: FPGA Stuff ?

Sat Jan 14, 2012 6:44 am

Seeing as how you are looking at teaching FPGA stuff, have you looked at the Papilio at http://papilio.cc?  It seems like it would be more up the FPGA alley than the Raspberry Pi.  As much as I am looking forward to the R-Pi, I don't know if its the right platform for anything and everything in teaching computing.

Andre_P
Posts: 241
Joined: Sun Aug 28, 2011 7:57 am

Re: FPGA Stuff ?

Sat Jan 14, 2012 9:33 am

FatBuzz said:


Andre,

Xilinx tools use oodles and oodles of cpu clocks and memory.  But they are almost enirely free.  They like megafast CPUs and 2^3 Gigabytes of RAM or more.  So they will have to run on big, thirsty x86 machines.  They output a file that is eventually copied into the configuration SRAM of the FPGA or flash the CPLD.

Perhaps a good place to start would be to contact the universities you feed students into and get a feel for what they give first year students and what they might like you to teach.


Hi FatBuzz,

Yup perfectly aware of the FPGA flow, and the requirements, even as I type I have SmartXplore runninng over the weekend back at work on three large FPGAs.

The thing that kills idea of running the CLI for even small devices on the Raspberry PI is the point that was pointed out by Gert is the fact that there is no 'ARM' version of the tools even though there is a Linux version, a truly Homer Simpson "DOH Moment'. My only excuse is that it was a long and pretty awful day.

However if there was an ARM release then you could have let the synth run overnight or dare I say it the weekend. I seem to remember a PC back in 1995 could do reasonably well for small designs.

Interestingly though however there are some tools for simulation that could be looked into. Also dare I say it you can get a free polygon pushing package !

Hugh Reynolds
Posts: 61
Joined: Tue Sep 06, 2011 9:48 am

Re: FPGA Stuff ?

Sat Jan 14, 2012 10:14 am

Andre_P said:


FatBuzz said:


Andre,

Xilinx tools use oodles and oodles of cpu clocks and memory.  But they are almost enirely free.  They like megafast CPUs and 2^3 Gigabytes of RAM or more.  So they will have to run on big, thirsty x86 machines.  They output a file that is eventually copied into the configuration SRAM of the FPGA or flash the CPLD.

Perhaps a good place to start would be to contact the universities you feed students into and get a feel for what they give first year students and what they might like you to teach.


Hi FatBuzz,

Yup perfectly aware of the FPGA flow, and the requirements, even as I type I have SmartXplore runninng over the weekend back at work on three large FPGAs.

The thing that kills idea of running the CLI for even small devices on the Raspberry PI is the point that was pointed out by Gert is the fact that there is no "ARM" version of the tools even though there is a Linux version, a truly Homer Simpson "DOH Moment". My only excuse is that it was a long and pretty awful day.

However if there was an ARM release then you could have let the synth run overnight or dare I say it the weekend. I seem to remember a PC back in 1995 could do reasonably well for small designs.

Interestingly though however there are some tools for simulation that could be looked into. Also dare I say it you can get a free polygon pushing package !


My understanding is that there are lots of front end tools available but few if any free tools, other than those supplied by the silicon vendors, when it gets to the place & route phase.

If I am wrong please tell me I'd be interested in trying them out.

For Xilinx think of Spartan6 as the entry point.  The Avnet LX9 microboard is $89.  The one I used, as I moved on from Spartan3A, was the Atlys LX45 board $199 for acedemic students.

Andre_P
Posts: 241
Joined: Sun Aug 28, 2011 7:57 am

Re: FPGA Stuff ?

Sat Jan 14, 2012 10:27 am

WARNING GEEKY VHDL/Verilog/Sim type stuff, move along if not interested

John Beetem said:


I do a lot of FPGA design, primarily for Xilinx Spartan-IIe/3A.  Xilinx and others provide free software tools (WebPack) for the smaller parts, but they only run on x86 PCs.  At least they now have GNU/Linux versions available.

Xilinx and other vendors have always been openly hostile towards open source software, not wanting to publish the details of their architecture and programming stream.  It's very sad, as IMO they would have made vastly more money over the decades if they had.


Hi John,

I think we are going to have to agree to disagree on stuff there, but agree on a lot as well .

Personally I'd prefer to use simulation with a LOT of testing prior to hitting the synth button. That's not just because of my ASIC background but I've seen the pain and the number of iterations that a lot of people have gone through when a simple TestBench could have shown the issues. I've done a lot of stuff that has required software to get involved, getting an entire sim together with at least register accesses to simulate software clears up a lot of issues. That means when you get to present something to the software eng the likelyhood is that the system will work pretty quickly. I think the last block went through without any iteration and the previous one had one bug in the design (but that was down to the classic who will guard the guards problem).

Simulation/Verification has come a little way but with all things you have to take/be given the time to do the job. Philosophically you have to do the work twice, once for the actual block and again for the 'inverse' to test it. Getting PMs who have NO IDEA ABOUT THE FLOW to understand this can be frustrating at times.

You may wish to look at System Verilog, there are things like Formal Techniques in there I believe. Sadly I can't confirm, I was due to go on a course but had to give it up as a PM wanted something desperately so I had to fore go the course.

As to VHDL/Verilog, well it's like editors and stuff, whatever works for you . I personally prefer VHDL over Verilog for things such as types, enumerated types, records etc (SV now has that stuff ). I will have to see how hard it is to generate a tree in Verilog cleanly without records, but hey if all things work out I'll be writing a lot in Verilog soon !

As to writing code for synthesis, well I was always taught to envision the logic you want and then code for it. Things like resource sharing, pipelining etc.

However it is easier in an ASIC flow, you do actually get to see the gates at synth. FPGA yes you are VERY MUCH hostage to fortune withI revision levels of the tools. I have almost been driven to tears by the tools you speak of. I have seen them generate incorrect logic which is so VERY VERY scary. This is something I don't think I ever saw in the ASIC flows (bad cells, but not bad synthesis).

Always nice to chat with other ASIC/FPGA peeps, we are comparatively rare and it's nice to see that there are some of us here . Private message if you like

Return to “General discussion”