Home    Bloggers    Messages    Webinars    Resources   
Tw  |  Fb  |  In  |  Rss
William Murray

The U.C. Riverside VHDL 8051 Project

William Murray
Page 1 / 5   >   >>
rodney
rodney
2/7/2013 9:20:52 AM
User Rank
Beginner
Free processor cores
Like some of you, I implemented my own processor.

But what you implement depends on your design criteria.  If your design criteria is to implement an 8051 so that you can use the existing code base, then you wind up with an 8051 with its features and limitations.

I wanted someting suitable for FPGA housekeeping, so my criteria were to design something that was small and fast (so that timing is never a problem), that was in pure Verilog, that had a simple instruction set, and that could be easily used on either Linux or Windows boxes.  I also wanted to reduced some of the nuisance work required to implement a processor.

What I designed is a 9-bit opcode, 8-bit data, stack-based processor that uses about 60 slices in a Spartan 6 and synthesizes to 160 MHz.  A single command runs the Python scripts that construct the processor and its peripherals and runs the assembler.

If you're curious, this Small Stack-Based Computer Compiler is hosted at https://github.com/sinclairrf/SSBCC

50%
50%
William Murray
William Murray
2/7/2013 6:44:24 AM
User Rank
Blogger
Re: CPUs in FPGAs
@frisbee -- All good points for some commercial cores that do processors.  However , some of the DCD 8051 cores for example are quite small, have excellent commercial grade tools to work with, and are quite fast as well.   One of the big disadvantages I've found with doing my own CPU core, is lack of tools to support it for any really complex SW effort that requires a CPU. ( C compiler, JTAG ICE, etc.)  One is left with the options of modifying a version of SDCC, or some other compiler and doing "Burn and Learn" for debugging for the simple cores that one does one's self, or coding in machine code, and suffering the lack of maintainability that comes with hand rolled machine code.

50%
50%
rfrisbee
rfrisbee
2/7/2013 5:54:17 AM
User Rank
Clever Clogs
CPUs in FPGAs
The problem with implementing soft core implementations of classic CPUs in FPGAs is that they often come out HUGE and/or SLOW. In addition, many 8-bit cores (including the 8051) are hideous from a programming point of view. The main advantages some of the old cores have going for them are large pre-existing code bases and high level language support.

The 8-bit, 2 clocks/instruction Picoblaze architecture is a good place to start for anyone wanting to design a simple softcore processor. With some significant tweaking of the instruction encoding and adding relative jump instructions, the 1kWord program space can be extended to 8kWord. Adding pointer hardware and a couple of additional instructions allows large amounts of external data memory to accessed. My implementation has an fmax > 64MHz in the slowest speed grade Altera Cyclone and consumes fewer than 900LEs. The simplest versions come in at under 600LEs, a large fraction of which are consumed by the register file, since Altera Cyclone devices don't have the ability to use LEs as 16x1 RAMs as Xilinx FPGAs do.

I'm currently working on a 32-bit soft core based on a design by Wirth. My implementation runs at 4 clocks/instruction, has a barrel shifter, hardware signed and unsigned multiplication and division and 32 prioritized hardware interrupts. The core has an fmax > 64MHz and consumes about 2000LEs, including logic to boot from the FPGA configuration device.

For comparison, a 4 clock/instruction 8-bit megaAVR soft core with no peripherals that I've written consumes over 2000LEs.

Some may have noticed that all the cores I've written require multiple clock cycles to execute an instruction, whereas many modern processors are pipelined and can typically execute up to one instruction every clock cycle. The reasons I've gone down this route are:

1) If I need speed I've got FPGA hardware to perform or accelerate calculations. I'd rather not eat up logic and memory resources to implement a "fast" CPU to implement functionality that could be performed more efficiently with hardware.

2) Dealing with pipeline hazards requires significant amounts of extra logic and extensive testing to insure correct operation under all sequences of instructions and interrupts. Code with lots of branches in it somewhat negates the advantages of pipelining unless extra logic is added to perform branch prediction. The cores I've written only go as far as overlapping the fetching of the next instruction with the execution of the current instruction.

3a) The systems I design FPGAs for typically don't have the memory bandwidth to feed instruction words faster than about 20MIPS.

3b) Adding useful amounts of cache logic would significantly increase the size of the core, consume many valuable internal memory blocks and makes the execution time non-deterministic.

 

100%
0%
William Murray
William Murray
2/6/2013 1:28:43 PM
User Rank
Blogger
Re: my favourite
@Max  -- Print Your Own ASIC  -- not sure about a fully packaged Die, But possibly for trailing edge stuff, it might be possible to do a micro-FAB in some kind of shape or form for universities and research Labs that was in a small form-factor, and moveable -- The IC lab at my university was about the size of two large shipping containers for floor area, 30 years ago.  So it would not have to be terribly large now days  -- The supplier might be able to supply tubes of "Blank Die" in a cartridge or tube form that could be loaded into the machine, and the chemicals/materials could be in special sealed containers.  The lithography might be done with scanable lasers and possibly a special set of masks that are for just one prototype die at a time.   The device might have a longer time duration for each of the steps than a large FAB.  I see analog and RF / MixedSignal prototypes as the bigger users.

50%
50%
Max Maxfield
Max Maxfield
2/6/2013 11:19:54 AM
User Rank
Blogger
Re: my favourite
@William: So do you think there will ever come a day where designers have a photocopier-size maching in their office upon which they can "print" their own packaged ASICs/ASSPs/SoCs?

50%
50%
geekyasa
geekyasa
2/6/2013 10:39:25 AM
User Rank
Beginner
Re: my favourite
William: Ohh that is why I missed it. Thank you for the clarification.

50%
50%
William Murray
William Murray
2/5/2013 5:34:11 PM
User Rank
Blogger
Re: my favourite
The real key is most FPGA designs are a case of to make $1Million one must sell 1,000 $1000 items, where as most 8051 designs sales volume wise start in an FPGA, but are converted to an ASIC and are a case of selling 200K $5 items or even more at even less cost.

50%
50%
William Murray
William Murray
2/5/2013 5:07:44 PM
User Rank
Blogger
Re: my favourite
@Max -- The free tools for the 8051 (embedded compilers) vs the GNU compiler(also often Free for ARM) for the ARM also mean the 8051 image is many times smaller than the Flash/ROM image for an ARM -- this can be a significant cost edge as well. (Free or Low cost Core, Smaller ROM size, Less Power, Less Silicon Area -- all vital when doing a SIM, or USB stick like application that the selling price for the OEM is less than $1-5 for the product, and the performance is "Good Enough"  -- The real key is Good Enough for the right Price, In time for the market.

50%
50%
Max Maxfield
Max Maxfield
2/5/2013 4:58:51 PM
User Rank
Blogger
Re: my favourite
@William: I probably should write about putting FreeRTOS on an FPGA

That would be an interesting one -- you could start with one blog by talking about RTOSs in general and lead into FreeRTOS -- then have a follow-up blog describing the process of implementing the port.

50%
50%
William Murray
William Murray
2/5/2013 4:56:41 PM
User Rank
Blogger
Re: my favourite
@Max 8051-RTOS -- Actually it was a FreeRTOS port,  (author Richard Barry of the UK wrote FreeRTOS)  It is quite easy to get a port of it up and running (Less than a week)  I probably should write about putting FreeRTOS on an FPGA -- There are ports for Xilinx's CPU's already done even.  I just need a bit better FPGA Dev Board to do it.    (LX-9 Micro Board)  May have to look into one.  This would also run an 8051 Core, but quite a bit of work compared to uBlaze)

50%
50%
Page 1 / 5   >   >>
More Blogs from William Murray
Today's FPGAs already integrate a substantial amount of "stuff" (MCU cores, programmable fabric, on-chip memory, etc.), so what's left to integrate and why is this being left for the future?
When extreme thermal cycling causes circuit boards and chip packages and the silicon die in the packages to expand and contract at different rates, problems may ensue.
In order to simulate a design we need models that represent the functionality and timing characteristics of our design elements, but the timing aspects of these models may be based on uncertain data.
A large amount of skill is required to write custom test code for custom hardware. Even more skill is required to test a CPU, RAM, or ROM.
Designing high-temperature electronics can present many challenges for "down-hole" petroleum equipment, ovens and micro-waves, automotive, medical, aerospace, and other applications.
flash poll
follow us on twitter
follow Xilinx on twitter
like us on facebook
like Xilinx on facebook
All Programmable Planet     About Us     Contact Us     Help     Register     Twitter     Facebook     RSS