AVR8 Softcore on differnt FPGA?


Guest brentbxr

Recommended Posts

Guest brentbxr

Hey Jack,

First off; I love your FPGA work. Although I do not own a papilio, I do own an OBLS and think its hands down the best LA for the price and its a very beautiful board (almost want to frame it).

Anyways; I want to get into FPGA's really bad so I was super close to getting myself a papilio when a friend who uses FPGA's quite often just finished his own small FPGA development board (seems to have all the same core devices as your papilio; but a XC3S200A Spartin-3A FPGA on it, with 500 gates) anyways I ended up getting one of his prototypes at cost, so I couldnt turn it down (he has one left, one with 20k (maybe 200?) gates i think he said).

Anyways; I want to learn FPGA's really bad and I think a good way to start would be to play with the your softcore to get the hardware aspect down before I try building my own FPGA sources in VHDL (its confusing as hell to me).

So I was wondering; what would it take to get it to work on my FPGA?

Link to comment
Share on other sites

Hello brentbxr,

No problem, I don't mind helping out. There are basically two things you need to do to get it working on your board:

1) You need to change the clock so it runs off whatever speed oscillator you have on your board. If you use a 32Mhz oscillator you are fine. But if you use the more standard 50Mhz oscillator then you need to modify the DCM32to16 module and change is so it does 50Mhz to 16Mhz. It is a wizard so you should be able to just double click on the wizard and change the input to whatever speed your clock is.

2) You need to modify the ucf file to change the pins to work on the type of chip you have.

Finally, if you have a XC3S200A you might need to disable some peripherals to get it to fit.

Jack.

Link to comment
Share on other sites

Guest brentbxr

It feels like a waste to cut the Mhz down so far... You have this super powerful FPGA and your dumbing it down per-say to make it more AVRish.

Im a big AVR fan (dont care for arduino; but if I can generate files from GCC that great).

So one question I have is; Can I use a DCM to generate super high Mhz such as 200Mhz and still utilize the AVR8 softcore? to basically make a super charged AVR :D

My other question is you said I may need to cut out some peripherals to get it to fit; the FPGA board I have as a Spartan-3a (XC3S200A) its a 500k gate FPGA. Is that not suffecent for the AVR8 w/ all peripherals?

Link to comment
Share on other sites

So one question I have is; Can I use a DCM to generate super high Mhz  such as 200Mhz and still utilize the AVR8 softcore? to basically make a  super charged AVR

Unfortunately no, when I did testing several years ago I was not able to get the AVR8 above 25Mhz. The AVR8 design was not designed for high speed. It is a small and flexible soft processor whose strength is its compatibility with the AVR chips which were never intended to run at high speeds either. If you want an Arduino compatible soft processor that can run at higher speeds then you are better off with something like the ZPUino that was designed from the beginning to be 32 bit and 100Mhz.

With FPGA's you really have to change the way you think, its no longer about trying to make a faster Soft Processor. Where the true power comes is leaving the AVR8 running at 16Mhz and using it for simple "control" logic that ties everything together. Then you identify the functions that you need to be ultra fast and you implement them in VHDL or Verilog and have the AVR8 "control" them. The VHDL functions can be faster then anything else out there because they are true hardware solutions that work in parallel. If the AVR8 is not fast enough for your simple control logic or you just want a more sophisticated design then use the ZPUino, it really is a great soft processor and the features that Alvaro has added are very impressive.

Remember, an FPGA's power is that it is completely parallel. So to really tap into that power take advantage of that aspect of an FPGA, trying to increase the speed of a soft processor goes in the opposite direction and has a lower ceiling. The very nature of a soft processor is sequential instead of parallel... A soft processor on an FPGA is never going to compete with a hard processor like an ARM running at 800Mhz. But if used correctly, an FPGA solution can outperform the 800Mhz processor if the functions that NEED to be fast are implemented as dedicated hardware running in parallel and defined with HDL.

As a simple guideline the vendors soft processor is probably going to be the fastest you will ever reasonably see a soft processor running on the chip. They are the ones who are most familiar with the internals and are able to make very optimized solutions. From what I remember off the top of my head for the Spartan 3E the microblaze soft processor runs at 75-100Mhz and with the Spartan 6 it runs at 100-125Mhz. For a gcc capable processor I wouldn't expect to see anything else run any faster then that.

My other question is you said I may need to cut out some peripherals to  get it to fit; the FPGA board I have as a Spartan-3a (XC3S200A) its a  500k gate FPGA. Is that not suffecent for the AVR8 w/ all peripherals?

Well, unfortunately the XC3S200A is a 200k gate FPGA, not a 500k gate FPGA... It can be tempting to say the differences between the Spartan 3E and Spartan 3A make the 200K 3A design equivalent to the 500K 3E. (BTW, Spartan 3A's are later generation chips then the Spartan 3E's) But that simply does not hold true, you have to ignore all the market speak and go with what actually synthesizes on the hardware. Its very simple to test out. Take any design you have, preferably one that almost fills the chip, and synthesize if for both chips in question. (Comment out all I/O statements in the ucf and let them be autoplaced) You can then compare device utilization. From what I remember when I was testing my Spartan 3A design, which used the same XC3S200A chip, the AVR8 "Shifty" branch utilized 99% of the Spartan 3E 250K chip but did not fit into the Spartan 3A 200 chip...

Jack.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.