There is just something about microprocessors (MPUs) and microcontrollers (MCUs) that's irresistible. I mean, everyone from the embedded world loves using their MCUs, which are the best things ever, right? Similarly, a lot of people working with FPGAs just can’t resist the idea of having a cool and funky processor as part of their design.
Well, Xilinx has a free 8-bit soft processor core called the PicoBlaze that may address this urge, but what is the PicoBlaze and can anything that's free really be any good?
The PicoBlaze is a tiny 8-bit processor core that's stripped down to the bare minimum to make it "mean and lean." This is a soft core, which means it's implemented using the FPGA's programmable fabric. (See: Ask Max: What's Inside a Simple FPGA? and Ask Max: More Sophisticated FPGA Architectures.)
Like a really rudimentary processor from the 70s, the PicoBlaze runs from 1K of ROM and has access to only 64 bytes of RAM. It also has sixteen 8-bit registers, a 31-word stack, and it can respond to an external interrupt. The arithmetic and logic unit (ALU) allows for adding and subtracting; logical operations like AND, OR, and XOR; and a few other operations like shifts and rotates. Looking at the internals of the PicoBlaze is just like looking inside a Zilog Z80 or a simple 8-bit PIC from Microchip.
Internal block diagram of the 8-bit PicoBlaze soft processor core.
On the one hand, it's hard to call the PicoBlaze a microcontroller because it has no hardware interfaces like a UART or a SPI. On the other hand, the PicoBlaze has a massive I/O interface, boasting 256 inputs and 256 outputs, which means you can hang a lot of stuff off the end of this little beauty. This design is not slow either, with Xilinx quoting 200MHz or 100MIPS when implemented in something like a Virtex-II Pro FPGA (the PicoBlaze will run in anything from a "cheap and cheerful" Spartan-3 FPGA and up. In fact, Xilinx even has a CPLD version available).
Xilinx offers token support for the PicoBlaze in the form of an assembler. That's right; you are going to have to code in assembly language! But this really is not a major issue, because programs don't get massive when you have only 1K of ROM available. Having said this, there are IDEs (integrated development environments) like OpenPICIDE that will color your code, check for errors, assemble, and even simulate your code, thereby making the whole process a lot easier.
One of the real selling points of the PicoBlaze is that the core consumes only 96 slices in the FPGA, which makes it extremely compact. Using a single-source file (available in Verilog or VHDL), you only need bolt on your ROM and you're ready to rock and roll. In most cases, the ROM will appear as -- and be compiled into your FPGA as -- a RAM block, but it is read only by the PicoBlaze and functions as a ROM to all intents and purposes. The ROM image will become part of your FPGA configuration file and is loaded at startup, so you don’t have to program the ROM after the FPGA is up and running.
I guess the real reasons for using the PicoBlaze are that it's simple to learn and use, it gives you that next step up from a state machine, and it acts as an entry-level soft processor core. Using a core like this may be slower than implementing an algorithm is pure FPGA logic, but it takes up less space, thereby providing more room for the "needs to be fast" logic around it. Moving up from this, you could go to a much more powerful core like the MicroBlaze, which is a 32-bit device. Personally, I like the fact that the PicoBlaze is such an easy-to-use open core that you can deploy in your designs without having to purchase special IP licences.
What do you think? Have you used the PicoBlaze, the MicroBlaze, or any other soft FPGA processor? Do you think microcontrollers have a place in FPGAs, or do you prefer to use an off-the-shelf MCU?