Author |
Message |
mosc
Site Admin

Joined: Jan 31, 2003 Posts: 18235 Location: Durham, NC
Audio files: 222
G2 patch files: 60
|
Posted: Tue Feb 21, 2006 11:21 am Post subject:
FPGA designs |
 |
|
On another topic, http://electro-music.com/forum/topic-10153.html& , Doc Justice posted some very interesting stuff about FPGA devices. I thought I'd start a new thread here in case anyone was interested.
DrJustice wrote: | mosc wrote: | Don't you need to invest a good bit of money just to get started on an FPGA project? Do you have to do your design in something like VHDL, or can you use logic symbols? |
FPGA design has become very accessible. Everybody can do it for nothing. It's great!
There are some open source tools, but perhaps more significantly (ATM) some of the FPGA vendors offer free "Web edition" tools. These are fully fledged CAD packages with design, verification, synthesis and implemenation. I'm using the Xilinx package and it supports VHDL, Verliog and schematic entry.
What IMO is more interesting about the open source side of things is the many HDL designs that are open and free. You can get lots of useful modules, anything from all kinds of serial ports etc., and right up to PCI bridges, CPUs and DSPs and more. Have a look at OPENCORES.ORG.
As an example of the current state of things, check out Xilinx Spartan 3. Thats a mid-range FPGA, with up to 5 million "system gates" and lots of goodies. You get a nice development board (for this class of FPGA from most vendors) for around 100 dollars. There's a lot that can be done with "only" a couple of hundred thousand gates, like building a synthesizer...
Think about it mosc - fancy designing a DSP?
Edit: just adding fpga4fun.com.
DJ
-- |
_________________ --Howard
my music and other stuff |
|
Back to top
|
|
 |
mosc
Site Admin

Joined: Jan 31, 2003 Posts: 18235 Location: Durham, NC
Audio files: 222
G2 patch files: 60
|
Posted: Tue Feb 21, 2006 11:23 am Post subject:
|
 |
|
DrJustice wrote: |
FPGA design has become very accessible. Everybody can do it for nothing. It's great! |
Thanks for the information. That sounds superb. That's the way to go if your are building a sophisticated device like a step sequencer. You can make changes and improvements without touching the circuit boards, just reprogram the chip and replace it. Makes the final project much more reliable to, or at least much easire to maintain.
Quote: | Think about it mosc - fancy designing a DSP? |
Cool. I personally don't have the interest in such a project, but if I was making a sound processor project it would be a good way to go.
Great post, Dr. J. - thanks... _________________ --Howard
my music and other stuff |
|
Back to top
|
|
 |
jksuperstar

Joined: Aug 20, 2004 Posts: 2503 Location: Denver
Audio files: 1
G2 patch files: 18
|
Posted: Tue Feb 21, 2006 12:01 pm Post subject:
|
 |
|
I guess it's a good time to give a little history/lesson about FPGAs. The first programmable devices wre based on EEPROM like technology, connecting logic gates (AND, OR, Flip-Flops) with each other through fuses. This was very limiting because you only had the gates that where in the chip, but was nice because you could burn & reburn new a "image" into the device at will.
This technology is still available, though it's gone through transformations through Flash based technologies. They are called a CPLD today, and many can be had for less than $1, and with one of these one could easily replace a whole handful of typical logic devices such as 74x04, etc. The tools needed to program a CPLD can be found for free at any one of the chip vendors taht seels these (see below).
Next came the BIG BOYS. These are known as FPGAs, and use SRAM as their technology. They are geared more for the large systems: for example, I have designs that are PCI based, with high speed serial (>100MHz) and an embedded RISC microprocessor (that was compiled from verilog!) running at 80MHz. These are no joke. By using RAM technology, logic is boiled down to look-up tables rather than actual logic gates. This allows large complex logic schemes to be built without significant timing impact due to the latency inherent in each gate. If you have 6 inputs and 2 outputs, the typical latency is ~200ps, really.
To design big things like this, there are two main "languages" used, much like one would program in C or Pascal. Whereas designing in schematics is more like writing assembly or machine code. Tools then synthesize these languages into either gates or look-up table values. This intrun is run through another tool that automatically places the tables inside the FPGA, and routes the interconnect needed. Much like an autorouter does for PCBs, but these are on much more caffeine and alot of steroids. Oh, and these tools can be found for free from the chip vendors (Xilinx, Altera, Lattice, etc). In terms of number of gates, Xilinx has many for under $10 that report 5million+ gates, but in reality this relates to something more of about 500,000. But that's ALOT of gates for that price.
The only drawback to FPGAs is the power on time: they require a couple milliseconds to "boot-up", which also requires an external programming chip to do this (like loading your program out of flash and into RAM). That is to say: the FPGAs need to be programmed each time they are turned on. But this can happen an infinite number of times without any harm to the device.
www.xilinx.com
www.altera.com
www.latticesemi.com |
|
Back to top
|
|
 |
DrJustice

Joined: Sep 13, 2004 Posts: 2114 Location: Morokulien
Audio files: 4
|
Posted: Tue Feb 21, 2006 2:00 pm Post subject:
|
 |
|
mosc, good of you to move the FPGA talk over here!
And jksuperstar, nice history rundown! For those who don't know, jk is a logic design professional.
From the NM forum:
jksuperstar wrote: | ... I don't understand why music companies haven't taken advantage of the power in FPGAs (programmable hardware). They'd be far more powerful, upgradable, & worthwhile than most current solutions.
Makes me want to start a very large open hardware project. Any interest? |
Even if the big companies aren't doing it, FPGAs are indeed a fantastic enabler for the rest of us. Some kind of community project would be interesting. Are you brewing on anything in particular, jk?
DJ
Edit: typo
-- Last edited by DrJustice on Tue Feb 21, 2006 3:46 pm; edited 1 time in total |
|
Back to top
|
|
 |
blue hell
Site Admin

Joined: Apr 03, 2004 Posts: 24391 Location: The Netherlands, Enschede
Audio files: 296
G2 patch files: 320
|
Posted: Tue Feb 21, 2006 2:45 pm Post subject:
|
 |
|
Hey, cool thread. Got some reading up to do now, or read upping. _________________ Jan
also .. could someone please turn down the thermostat a bit.
 |
|
Back to top
|
|
 |
jksuperstar

Joined: Aug 20, 2004 Posts: 2503 Location: Denver
Audio files: 1
G2 patch files: 18
|
Posted: Tue Feb 21, 2006 10:13 pm Post subject:
|
 |
|
Quote: | Are you brewing on anything in particular, jk? |
Honestly, the other day I helped a friend build a new computer (not with FPGAs, but motherboards and other standard parts ). It got me thinking about PCI-e, the new fast serial interface showing on all the video cards & motherboards. It's FAST & expandable. Unlike the now archaic PCI bus, which can bearly chug along at 100MB/sec. Which is alot of data, but not for shuffling in & out of audio cards with multiple channels, AND having some audio DSP out there as well. Networked on Gig-ehernet? Forget it.
I'm working on a test setup (at my job) for an Servo system in an ASIC, and to get the bandwidth throughput in & out of a PC, PCI is the only way currently. So in developing these cards, I find IP (chunks of code you buy to put in your design) for a PCI-e interface for current FPGAs. So, I started thinking about a modular system (DSPs) attached to a PC with very high bandwidth via a simple PCI-e bus. That's how it's all related.
So I think it'd be alot of fun to have a very flexible system that extends the PC architecture tod o audio rendering. Add some form of SLI (a link that allows multiple video cards to render in parallel), and your talking some serious power. Make it open-source and affordable, and it could be the next thing after VSTs. Oh, and convolutional algorythms might actually become a true reality. Well, that was the dream I woke up to. |
|
Back to top
|
|
 |
deknow

Joined: Sep 15, 2004 Posts: 1307 Location: Leominster, MA (USA)
G2 patch files: 15
|
Posted: Tue Feb 21, 2006 10:24 pm Post subject:
|
 |
|
....i also have some reading to do...thanks!
i really would like to port my "electroflute noise filter" to a platform where it is harder for others to see what i'm doing than it is on the g2. the g2 proves it works...i've ported it to synthedit (not refined, but works well enough to know it wouldn't take to long to tweak it), but i want it in a stompbox that i can sell to flutists (haha, both of them that are interested in electric flute playing).
deknow |
|
Back to top
|
|
 |
DrJustice

Joined: Sep 13, 2004 Posts: 2114 Location: Morokulien
Audio files: 4
|
Posted: Wed Feb 22, 2006 4:56 am Post subject:
|
 |
|
One thing I've been pondering is the possibility of making a really powerful additive synthesizer voice without latency. This might imply the use of an oscillator bank. It would have high resolution amplitude and phase profiles for each harmonic. So a phase vocoder++ in hardware, more or less. There would have to be a rather fancy control system for introducing performer induced dynamics in the sound. In conjunction with an analysis part there could be support for resynthesis, even in real time. It could hopefully be made using an off the shelf evaluation board, or several of them for polyphony.
Just ponderings for now though...
DJ
-- |
|
Back to top
|
|
 |
DrJustice

Joined: Sep 13, 2004 Posts: 2114 Location: Morokulien
Audio files: 4
|
Posted: Wed Feb 22, 2006 12:23 pm Post subject:
FPGA learning resources |
 |
|
For those that would like to read more, here are some useful FPGA links:
An FPGA FAQ.
Several VHDL and Verilog tutorials (the Aldec interactive one is fun).
A couple of other Verilog tutorials can also be found here and here.
I use Verilog personally. The syntax is reminiscent of C. VHDL is more like Pascal, Ada and PL/SQL, and is often viewed as more "industrial grade". For starting out I'd strongly recommend Verilog, it is known to be quite a bit easier to get going with. The two languages can usually be mixed at the module level and you can even mix HDL and schematic entry in some tools.
If you want to get going with actual coding and simulation I recommend ModelSim. It will compile your code and simulate it with waveform display - very nice tool. You get ModelSim with the Xilinx Webpack. It is available as a separate download. The seeming Xilinx bias is because thats's what I know...
I'm sure jksuperstar will have something more to say on the subject.
Happy studying
DJ
-- |
|
Back to top
|
|
 |
jksuperstar

Joined: Aug 20, 2004 Posts: 2503 Location: Denver
Audio files: 1
G2 patch files: 18
|
Posted: Wed Feb 22, 2006 2:53 pm Post subject:
|
 |
|
You hit all my favorite links already Mainly I refer to opencores.org alot, great set of examples that go from simple communication protocols like SPI all the way up to full on RISC processors with set-associative cache.
http://www.verilog.net
and don't forget your emacs "verilog-mode" lisp!!!
http://www.verilog.com/verilog-mode.html
Getting off-the-shelf FPGA boards is usually over $100 per board, typically closer to the $400 range. That's partly why I'd like to make a board (maybe through Olimex or someone), since it could be made for $30-$50 (I think), and have some audio specifics  |
|
Back to top
|
|
 |
DrJustice

Joined: Sep 13, 2004 Posts: 2114 Location: Morokulien
Audio files: 4
|
Posted: Wed Feb 22, 2006 5:14 pm Post subject:
|
 |
|
I guess you mean PCI or PCI-express when you mention $400? That's probably on the mark, but there are some exceptions. Enterpoints PCI based (and stand alone) Raggedstone is a rather nice offering in this segment.
But, yes - a cheap'ish board geared towards audio would be very nice. Perhaps with RS232, MIDI, IIS and a TDM bus for hooking up several cards? What more would we want on such a board? Some kind of community project would be way cool!
DJ
-- |
|
Back to top
|
|
 |
blue hell
Site Admin

Joined: Apr 03, 2004 Posts: 24391 Location: The Netherlands, Enschede
Audio files: 296
G2 patch files: 320
|
Posted: Wed Feb 22, 2006 5:42 pm Post subject:
|
 |
|
Well if ever you want to know any details about me, just ask Xilinx, they now know.
But I got their stuff, including the simulater, installed & licensed & runnable, so I'm all ready now I gues to try and make an and gate or something similar in complexity :-)
Meanwhile I can't quite keep up following the links posted here, but I'll try harder, and soon it will be weekend ! _________________ Jan
also .. could someone please turn down the thermostat a bit.
 |
|
Back to top
|
|
 |
blue hell
Site Admin

Joined: Apr 03, 2004 Posts: 24391 Location: The Netherlands, Enschede
Audio files: 296
G2 patch files: 320
|
Posted: Wed Feb 22, 2006 5:44 pm Post subject:
|
 |
|
DrJustice wrote: | Perhaps with RS232, MIDI, IIS and a TDM bus for hooking up several cards? |
How about ethernet ? Or is that naive ? _________________ Jan
also .. could someone please turn down the thermostat a bit.
 |
|
Back to top
|
|
 |
DrJustice

Joined: Sep 13, 2004 Posts: 2114 Location: Morokulien
Audio files: 4
|
Posted: Wed Feb 22, 2006 6:03 pm Post subject:
|
 |
|
Blue Hell wrote: | How about ethernet ? Or is that naive ? |
Not at all naive. It's pretty standard fare these days. Have a look at the fpga4fun site to see how simply it can be done. Also, plunking down a small CPU (e.g. PicoBlaze) is fine for soft processing of MIDI and ethernet packets if one wants that. An 8 bit CPU takes up almost no space in a modern FPGA.
So you grabbed the WebPack then - you're in for some of the best geek fun Blue Hell!
DJ
-- |
|
Back to top
|
|
 |
blue hell
Site Admin

Joined: Apr 03, 2004 Posts: 24391 Location: The Netherlands, Enschede
Audio files: 296
G2 patch files: 320
|
Posted: Wed Feb 22, 2006 6:11 pm Post subject:
|
 |
|
DrJustice wrote: |
So you grabbed the WebPack then - you're in for some of the best geek fun Blue Hell!  |
And that picoblaze thingy as well, couldn't resist it  _________________ Jan
also .. could someone please turn down the thermostat a bit.
 |
|
Back to top
|
|
 |
Oval
Joined: Feb 22, 2006 Posts: 5 Location: Russia
|
|
Back to top
|
|
 |
jksuperstar

Joined: Aug 20, 2004 Posts: 2503 Location: Denver
Audio files: 1
G2 patch files: 18
|
Posted: Wed Feb 22, 2006 9:46 pm Post subject:
|
 |
|
Wow, that Ragged Stone IS cheap. $90us, cool!
Great Link!! |
|
Back to top
|
|
 |
DrJustice

Joined: Sep 13, 2004 Posts: 2114 Location: Morokulien
Audio files: 4
|
Posted: Thu Feb 23, 2006 5:17 am Post subject:
|
 |
|
Oval!
Thanks for joining us!
Those boards you mention are wicked cool, and good value thinking of the Virtex 4 and all the other bits that are on them.
I'm adding a link straight to the Virtex 4. This is the big slammer, look at the FX folks.
DJ
-- Last edited by DrJustice on Fri Feb 24, 2006 2:12 pm; edited 1 time in total |
|
Back to top
|
|
 |
Oval
Joined: Feb 22, 2006 Posts: 5 Location: Russia
|
Posted: Fri Feb 24, 2006 12:22 pm Post subject:
|
 |
|
From the NM forum:
jksuperstar wrote: | ... I don't understand why music companies haven't taken advantage of the power in FPGAs (programmable hardware). They'd be far more powerful, upgradable, & worthwhile than most current solutions.
Makes me want to start a very large open hardware project. Any interest? |
EMU have used Altera FPGA alot (like 4 chips in one - don't remember) in 16-channel fx module for EMU samplers |
|
Back to top
|
|
 |
Oval
Joined: Feb 22, 2006 Posts: 5 Location: Russia
|
Posted: Fri Feb 24, 2006 12:31 pm Post subject:
|
 |
|
Oval wrote: | From the NM forum:
jksuperstar wrote: | ... I don't understand why music companies haven't taken advantage of the power in FPGAs (programmable hardware). They'd be far more powerful, upgradable, & worthwhile than most current solutions.
Makes me want to start a very large open hardware project. Any interest? |
EMU have used Altera FPGA alot (like 4 chips in one - don't remember) in 16-channel fx module for EMU samplers |
It hase even downoadable plugin feature as i remember from reading manual of it. |
|
Back to top
|
|
 |
JovianPyx

Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 224
|
Posted: Tue Jan 29, 2008 6:48 am Post subject:
|
 |
|
DrJustice wrote: | One thing I've been pondering is the possibility of making a really powerful additive synthesizer voice without latency. This might imply the use of an oscillator bank. It would have high resolution amplitude and phase profiles for each harmonic. So a phase vocoder++ in hardware, more or less. There would have to be a rather fancy control system for introducing performer induced dynamics in the sound. In conjunction with an analysis part there could be support for resynthesis, even in real time. It could hopefully be made using an off the shelf evaluation board, or several of them for polyphony.
Just ponderings for now though...
DJ
-- |
I did almost exactly what you're writing about (the multioscillator synth part), in an FPGA and using an "eval" board. My board is the Xilinx Spartan-3E Starter Kit and sells for about $150. My project design is a bank of 32 oscillators all sinewave. In my case, I wanted to use a heavily filtered noise stream to modulate the amplitude of each NCO. Each NCO has an integer frequency multiplier to define an NCO as a harmonic. I left the phase locked, but I could have easily added the ability to control the phase of each oscillator. My design is MIDI controlled and the controller is an embedded microcontroller (PicoBlaze) which is free. The output of all of the oscillators is summed and then presented to a digital state variable filter and then to an NCA. Both the filter and the NCA are controlled by ADSRs. The first tests of the design gave me some very bell-like sounds. You can browse through the sound files I've posted, those files are all output from this synth design.
Something that has become clear to me doing FPGA synth design is that I take a very "modular" approach to design, that is, I think in terms of a modular synth while constructing my logic. In my view, this is very fertile ground because you're limited only by your imagination, not how many dual transistors you have in the drawer. I've found that once I designed my first monosynth, it became a sort of chassis for other designs that use similar components, kind of like repatching a modular, except that in an FPGA, you can make new modules or copies of modules appear as if by magic. |
|
Back to top
|
|
 |
DrJustice

Joined: Sep 13, 2004 Posts: 2114 Location: Morokulien
Audio files: 4
|
Posted: Tue Jan 29, 2008 10:23 am Post subject:
|
 |
|
That's really cool Scott! I suppose the 'organically' varying sound in some of those samples ar due to the noise modulation you mentioned? What are you using for audio output? Any plans to make the project available?
A modular approach is indeed a good idea. I wonder if a standarized module interface could be cooked up, to allow community projects with reusable modules...
DJ
-- |
|
Back to top
|
|
 |
JovianPyx

Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 224
|
Posted: Tue Jan 29, 2008 10:39 am Post subject:
|
 |
|
DrJustice wrote: | That's really cool Scott! |
Thanks!
DrJustice wrote: | I suppose the 'organically' varying sound in some of those samples ar due to the noise modulation you mentioned? What are you using for audio output? Any plans to make the project available? |
Yes, the system varies each NCO amplitude slowly, but independantly and with the harmonic selection helps to create the bell-like effect.
As for audio, the board has a 12 bit 4 channel DAC (pretty amazing for only 12 bits...) I just connected channel A to a coupling cap (1 uF I believe) and then 10K to ground.
DrJustice wrote: | A modular approach is indeed a good idea. I wonder if a standarized module interface could be cooked up, to allow community projects with reusable modules...
DJ
-- |
I keep thinking about a standardized system to allow basic connectivity, and I dream of developing a preprocessor that would take very high level statements to make connections between modules very obvious. Then that would be preprocessed tp produce a project in HDL. First, a standard would have to be developed and that is where the (ahem) fun begins. What I've learned through developing a few of these things is that (for example) a filter isn't a filter isn't a filter... For example, when I designed the noise LFO portion of this, I took what I thought was a generic filter and discovered that it worked poorly - the output was so attenutated that it was only using a few of the lower bits and the upper bits remained zeroes. To fix that I had to expand the filter's bit width and use a wider bit width noise generator. Because the input numbers were bigger, so was the output. This is different from using an analog modular to do the same kind of work, but with a modular, you just amplify the filtered noise - and you don't need to redesign the filter. So you can see that there are problems with trying to design a ubiquitous standard - however, I'd love to hear about ideas that could take care of this. This sort of thing could potentially allow community projects and code sharing. As it is, I reuse code where I can, but far too often I discover that I need to modify things to optimize them for the specific purpose in mind.
EDIT ADD: I missed one question, yes I do plan to make this available for others. Right now, I've got a VB contract to fulfill... The VB code I use to control the synth isn't finished and it's sort of useless without it. Note that the patch editor communicates with the synth over a serial connection (115.2 Kbaud) and could be rewritten in whatever works for you if you don't use Windows. |
|
Back to top
|
|
 |
DrJustice

Joined: Sep 13, 2004 Posts: 2114 Location: Morokulien
Audio files: 4
|
Posted: Tue Jan 29, 2008 1:47 pm Post subject:
|
 |
|
ScottG wrote: | So you can see that there are problems with trying to design a ubiquitous standard - however, I'd love to hear about ideas that could take care of this. |
Not proposing to flesh out a standard here, but lets just play around for fun. What would it take?
A system clock and sample/frame clocks?
A signal standard - parallel or serial?
A module should be able to have several signal inputs and outputs.
Signals can always be scaled to reach a nominal level.
How many bits? Headroom?
Perhaps 16 bits + 4 guard bits, or thereabout?
A control bus - straight up 8 bit data + N bits address + CE + R/~W?
What more? Or different?
DJ
-- |
|
Back to top
|
|
 |
JovianPyx

Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 224
|
Posted: Tue Jan 29, 2008 2:27 pm Post subject:
|
 |
|
DrJustice wrote: | ScottG wrote: | So you can see that there are problems with trying to design a ubiquitous standard - however, I'd love to hear about ideas that could take care of this. |
Not proposing to flesh out a standard here, but lets just play around for fun. What would it take?
A system clock and sample/frame clocks?
A signal standard - parallel or serial?
A module should be able to have several signal inputs and outputs.
Signals can always be scaled to reach a nominal level.
How many bits? Headroom?
Perhaps 16 bits + 4 guard bits, or thereabout?
A control bus - straight up 8 bit data + N bits address + CE + R/~W?
What more? Or different?
DJ
-- |
I think much of that is constrained by the platform...
One thing about an FPGA is that while it's big, it's also finite. If you want 512 NCOs, you can do it, but not very fast OR not very feature robust. Depending on how you design, you use either real estate (area) or you use clock cycles in a state machine. Parallelling uses more real estate but does more per clock. When you make something as large as a synth, you're already dealing with tradeoff decisions regarding things like bit width of busses or calculations or RAM... My synth designs use 55% - 65% of the chip I have. They are a 4 NCO multi waveform monosynth, a 32 NCO sine only monosynth and an 8 voice Karplus-Strong one dimensional string physical model polysynth. There were many tradeoff decisions that had to be decided.
I think the things you listed above have to be decided on a per project basis. However, in a world years from now where 50 MegaGate FPGAs are common, I think you could make a standard fat enough that it could work nearly ubiquitously. Because of the size of the FPGA I use, I have to design an instrument for a specific purpose. EG: I did the GateMan to get a tonal noise sound, like the one used on Switched On Bach. But it takes up most of the chip and takes several minutes to compile. It runs at a sample rate of 1 MHz, that's one reason why it's big.
Ok, I'm done babbling now.  |
|
Back to top
|
|
 |
|