FPGARelated.com
Forums

Combined Microprocessor and FPGA

Started by Oliver Mattos October 17, 2010
Hi,

I normally use a microcontrollers for my projects - I have used PIC's
and AVR's - I mainly use them for the quick and easy programming etc.
(Arduinos are great!)

I've come across a case where a microprocessor can't meet my
performance requirements though, but parts of my problem is very
parallel, so an FPGA would be good.  The entire thing is too complex
to do all in VHDL or something - I prefer C/C++ for the complex stuff.

The exact use case is doing some linear arithmetic, using that to
calculate a pointer, and outputting the data at that memory location
serially to an IO device.  Throughput needs to be around 3Mbits/sec,
where each bit will require the above operations, but no bit depends
on any other.

Does any company sell a microprocessor what has a few thousand logic
elements of FPGA "on the side", which can interface fast with the
microprocessor, for example through shared memory.  Ideally this would
be cheap (ie. tens of dollars rather than hundreds of dollars), and
easy to use (I don't want to have to be defining my own DMA controller
or something...)

I know one can implement a CPU on an FPGA, but all the CPU's I can
find seem to be small and slow, and they somehow don't seem to be the
same "point and click" ease of programming an Arduino - they also
require development kits costing thousands of dollars.  Also I need it
to be self contained - ie. a chip and maybe a crystal clock.  I don't
really want to have to give it 3 regulated power supplies, 2 clocks,
and an external program flash memory and controller.

Ideas welcome!

Thanks
Oliver
On Oct 17, 3:31=A0pm, Oliver Mattos <omat...@gmail.com> wrote:
> Hi, > > I normally use a microcontrollers for my projects - I have used PIC's > and AVR's - I mainly use them for the quick and easy programming etc. > (Arduinos are great!) > > I've come across a case where a microprocessor can't meet my > performance requirements though, but parts of my problem is very > parallel, so an FPGA would be good. =A0The entire thing is too complex > to do all in VHDL or something - I prefer C/C++ for the complex stuff. > > The exact use case is doing some linear arithmetic, using that to > calculate a pointer, and outputting the data at that memory location > serially to an IO device. =A0Throughput needs to be around 3Mbits/sec, > where each bit will require the above operations, but no bit depends > on any other. > > Does any company sell a microprocessor what has a few thousand logic > elements of FPGA "on the side", which can interface fast with the > microprocessor, for example through shared memory. =A0Ideally this would > be cheap (ie. tens of dollars rather than hundreds of dollars), and > easy to use (I don't want to have to be defining my own DMA controller > or something...) > > I know one can implement a CPU on an FPGA, but all the CPU's I can > find seem to be small and slow, and they somehow don't seem to be the > same "point and click" ease of programming an Arduino - they also > require development kits costing thousands of dollars. =A0Also I need it > to be self contained - ie. a chip and maybe a crystal clock. =A0I don't > really want to have to give it 3 regulated power supplies, 2 clocks, > and an external program flash memory and controller. > > Ideas welcome! > > Thanks > Oliver
Check out the Lattice XP and XP2 parts and their 32 or 8 bit micros. I don't know what "fast" means in engineering terms, so I can't say which will work for you, but I'm sure one will. I'm pretty sure both of these processors are "free" since they are supposed to be open source. Rick
> I don't know what "fast" means in engineering terms, so I can't say
"fast" probably isn't an issue, provided I can offload the hard work to fpga logic, which it looks like this will let me do.
> Check out the Lattice XP and XP2 parts and their 32 or 8 bit micros.
These look interesting. I've always built programmers from scratch for microcontrollers, - is that sort of thing possible with these, or would purchasing just one Lattice XP chip be no use without full development kit(s)? How steep is the learning curve? For example, If I wanted to write a "flashing LED" program in C, and want to get it running on that FPGA in a soft-CPU, how long would it take to figure out and get working?
> "fast" probably isn't an issue, provided I can...
By "fast" I mean memory mapped IO or DMA or something rather than an SPI link between an FPGA and a microcontroller...
"Oliver Mattos" <omattos@gmail.com> wrote in message 
news:11e5aa7b-def8-44a5-81b3-ab627929f61c@a36g2000yqc.googlegroups.com...
> >> "fast" probably isn't an issue, provided I can... > > By "fast" I mean memory mapped IO or DMA or something rather than an > SPI link between an FPGA and a microcontroller...
Any FPGA will have a fast set of I/O which will interface with virtually any micro. It just depends on the address and data widths you need, plus control signals.
> >These look interesting. I've always built programmers from scratch >for microcontrollers, - is that sort of thing possible with these, or >would purchasing just one Lattice XP chip be no use without full >development kit(s)? > >How steep is the learning curve? For example, If I wanted to write a >"flashing LED" program in C, and want to get it running on that FPGA >in a soft-CPU, how long would it take to figure out and get working? > >
As far as i know you dont need to use Lattice's free soft processor on a Lattice FPGA. You could buy a FPGA kit from Digilent and use lattice processor on it. You could also buy a kit from e-bay. I am sure you can find everythink you need for under 100 dollars incluiding some sort of download cable. But the how fast question was aimed on the processor. How much processing power you need? And learning FPGA is not difficult as long you have some basic logic design background. You just need to learn some HDL language. As you like C i would recomend you Verilog. Before trying to use the soft processor i would recomend you spend a week just with the FPGA. Make yourself some simple design. After that go for the processor. As far as i remember to use the Lattice processor you are going to use the Eclipse. But i dont think is much more complicated than any other processor. If you are a good C programmer you can program any processor in one day. Cya --------------------------------------- Posted through http://www.FPGARelated.com
On Oct 17, 5:48=A0pm, Oliver Mattos <omat...@gmail.com> wrote:
> > I don't know what "fast" means in engineering terms, so I can't say > > "fast" probably isn't an issue, provided I can offload the hard work > to fpga logic, which it looks like this will let me do. > > > Check out the Lattice XP and XP2 parts and their 32 or 8 bit micros. > > These look interesting. =A0I've always built programmers from scratch > for microcontrollers, - is that sort of thing possible with these, or > would purchasing just one Lattice XP chip be no use without full > development kit(s)? > > How steep is the learning curve? =A0For example, If I wanted to write a > "flashing LED" program in C, and want to get it running on that FPGA > in a soft-CPU, how long would it take to figure out and get working?
I gave advice to someone here once who was a programmer wanting to do FPGA work in VHDL. He basically did everything different from the way I would have done it and made it all work, so there is more than one way to skin a cat. For example, I would write a flashing LED program (as you are thinking). He wanted to write a "Hello World" program... and did. I can't say how hard it is to use the CPU core as I have not done that yet. I do know that you don't have to recompile the FPGA code to change the program in the CPU. You can update the bitstream with new data in the on chip RAM blocks using a utility. If your program is external, then you don't even need to do that. My LFXP3C device takes around 15 to 20 seconds to reload via USB JTAG cable. I haven't seen a development board that doesn't use JTAG to configure the FPGA. You can either load directly to the RAM or your can burn it into the Flash. Going to RAM might be noticeably faster, I haven't tried it. As to the development kit, you can typically get free ones from the FPGA companies, but without hardware tools. In the case of Lattice, it may be without a simulator but that may not be true anymore. I find a simulator essential, so I paid about $900 for the low end tool with a simulator, no complaints. You can buy tools from others, but they universally need the "back end" tools from the FPGA company, the place and route tool and bit stream generator. Most companies don't release full info on the internal tools so no one else can provide a full tool set without these parts from the manufacturer. BTW, in the vein of doing things differently from software folks, I would do most designs fully in the FPGA without a CPU unless I had to save space. A stored program CPU can save a lot of logic in an FPGA. But software is a lot harder to debug in my opinion. Rick
Oliver Mattos <omattos@gmail.com> writes:

> Does any company sell a microprocessor what has a few thousand logic > elements of FPGA "on the side", which can interface fast with the > microprocessor, for example through shared memory. Ideally this would > be cheap (ie. tens of dollars rather than hundreds of dollars), and > easy to use (I don't want to have to be defining my own DMA controller > or something...)
Yes, Actel Smartfusion. It's a hard ARM Cortex M3 with hard basic peripherals and some programmable logic around that. Also, single 3.3V power supply. SW tools are free from Actel or you can buy from IAR or Keil. Eval kit is $99. I had a visit from Actel recently, SmartFusion seems very interesting, but I've never designed anything with their FPGAs. It's also interesting to note that Xilinx is going to do the same thing in their 7 series, hard ARM with hard peripherals ready to go, programmable logic around it.
Another option would be an XMOS device:

http://www.xmos.com

They can replace FPGAs in many applications, and are much easier to
use.
On Oct 18, 7:13=A0am, Anssi Saari <a...@sci.fi> wrote:
> Oliver Mattos <omat...@gmail.com> writes: > > Does any company sell a microprocessor what has a few thousand logic > > elements of FPGA "on the side", which can interface fast with the > > microprocessor, for example through shared memory. =A0Ideally this woul=
d
> > be cheap (ie. tens of dollars rather than hundreds of dollars), and > > easy to use (I don't want to have to be defining my own DMA controller > > or something...) > > Yes, Actel Smartfusion. It's a hard ARM Cortex M3 with hard basic > peripherals and some programmable logic around that. Also, single 3.3V > power supply. SW tools are free from Actel or you can buy from IAR or > Keil. Eval kit is $99. > > I had a visit from Actel recently, SmartFusion seems very interesting, > but I've never designed anything with their FPGAs. > > It's also interesting to note that Xilinx is going to do the same > thing in their 7 series, hard ARM with hard peripherals ready to go, > programmable logic around it.
He is looking for something inexpensive and the SmartFusion devices are not that. Although the OP has only said he doesn't want to pay hundreds of dollars, which does leave the field pretty wide open. As a CPU with FPGA, I see the SmartFusion as an interesting device. But combined with the analog I see it as much more limited. The analog converters are not all that fast and don't have much resolution. The A<>D conversion world covers a very wide range speed/ resolution and a lot of apps won't be suitable to the limitations of SmartFusion capabilities. Rick