Close
0%
0%

FPGA computer

I am building a (currently) 64k RAM computer with an FPGA. Now with lots of pipelining!

Similar projects worth following
My goal for speed is 133 MHz. It has a custom 16-bit processor architecture. Peripherals currenty are UART, SPI and 8 LEDs.

With my NGT20 I have VGA output working.

USB/PS2 keyboard is supported.

  • Overview


This FPGA computer, so far, has:

  1. 2 clock inputs
  2. UART input/output (for communication with graphics card)
  3. CPU, also work in progress
  4. a 31-bit timer
  5. very basic BIOS to load program from disk, will be improved
  6. PS2 Keyboard support

I am going to add:

  1. Operating system
  • Specs so far
  1. 16-bit CPU
  2. 50MHz (could probably run at 100MHz with even more pipelining)
  3. Only ROM for now since I'm still getting hardware going good
  • Documentation

I am working on a PDF detailing the CPU's architecture. I will create a separate PDF for the computer itself, including graphics card, keyboard controller, etc. for those who want to make a custom OS for one they build themself. an assembler is slowly coming together. As I will be using similar graphics card designs in the future for my other projects, so it really deserves its own separate project and documentation. I'll do that too.

  • Notes

This project is relatively new for its scope & size. Expect quirks & glitches in the early versions. Over time they will be fixed.

This computer works as the FPGA doing a large sum of the work, but is also designed to be expanded. An expansion system has been designed for graphics cards, disk drives, network cards, or anything really. This is how I prefer to acquire video output and non-volatile memory. UART is simple to interface with on a software level compared to other alternatives and it can be easily given a standard.

asm16.py

Latest assembler for the N016 CPU

plain - 14.27 kB - 10/02/2016 at 09:35

Download

helloworld.ASM

one of many possible hello world programs.

plain - 1.42 kB - 08/01/2016 at 05:00

Download

dev_ver.asm

Gets device major version from device zero.

plain - 1.05 kB - 08/01/2016 at 04:53

Download

  • 1 × Any FPGA board w/ VGA, UART, and PS2 keyboard Digilent spartan-3a stater board or better recommended.

  • New CPU design, mass storage problems

    Dylan Brophy04/02/2017 at 20:40 0 comments

    My old N-Series CPU design is an incredibly inefficient CISC architecture that is no doubt super slow just due to the number of clock cycles and unnecessary memory accesses per instruction. I'm going to create a new architecture that supports more memory and is hopefully much faster (133 Mhz???).

    The reason I haven't updated this project much in so long is because I ran into some mass storage problems. The FPGA board I'm using has 3 places to store non-volatile data. After an attempt at every. single. one, I needed a break. Its a bit frustrating when not even parallel NOR flash will work right, after trying SPI eeprom and the FPGA's own non-volatile storage. Any advice would be appreciated, by the way.

  • PS2 Keyboard interface working

    Dylan Brophy10/02/2016 at 09:34 0 comments

    I finally got the keyboard to work. PS2 interface working nicely and printed keystrokes on the screen. I was getting trouble when using my FIFO as a hardware keyboard buffer, needed to fix some timing. Also now working on a sort of datasheet for my CPU, I'll make docs for the entire system when it has disk support.

  • Video working, and new interface too!

    Dylan Brophy08/01/2016 at 01:32 0 comments

      I eventually decided that putting graphics on the FPGA would not be a good idea for two reasons:

      1. The CPU would be drawing the graphics
      2. I would only have enough memory for 8-color 256 x 256 pixel graphics

      This just wasn't going to be enough, so I brought in my Parallax Propeller chip. The propeller is perfect because it runs on 3.3v, has great ability to generate graphics, and will do the video processing for the main CPU. I set it up with UART at 115200 bps and connected it to my FPGA. It took some trial-and-error to get some signs of life from my Propeller saying that it was getting a transmission, then from there I got a Hello World program working.

      From here I decided that between the FPGA and the other devices there will be a standard protocol using UART. Don't worry, the UART won't be as slow because there are hardware FIFOs allowing a program to run without waiting for data to finish transmtting.

  • Redesigned layout in ISE

    Dylan Brophy08/01/2016 at 01:04 0 comments

    I decided things should work better if I broke my project into mini projects, tested them, and included them into the main project. This seems to have worked very well. I also made this change so that if I made another version of the design in another ISE project, It would be easy to make backwards compatible and\ work together.

View all 4 project logs

Enjoy this project?

Share

Discussions

f4hdk wrote 04/01/2017 at 08:42 point

Nice project. 

But why don't you use more ram? 64k for a 16bits computer, that's very little. 

Of course, it depends on what you want to do. But you are talking about OS and graphics, which both consume RAM space.

  Are you sure? yes | no

Dylan Brophy wrote 04/01/2017 at 15:13 point

That is a good thought. I will look into that.  I would probably change my CPU architecture to have some 32 bit registers, then connect more adress lines.

  Are you sure? yes | no

Marq Watkin wrote 04/01/2017 at 20:25 point

This project sounds quite like something I was planning, so I'm interested in what you come up with.

You could skip the need for 32bit registers by implementing a banking system.

For example, you have an 8bit (or even 16bit) "bank" register, and you alter the value by an opcode. This is then used as your higher address lines for RAM.

The only thing with this approach, is I'd recommend defining your banks as 32k, with the lower 32k is always fixed to a single block of RAM, and have the upper 32k be the switchable banks. This way, your application loop can run within the lower 32k loading in functions and data across the banked RAM so you can utilise it all.

If you use the 8bit bank register, you could support around 8MB RAM, which should be pretty useful.

I hope I explained it well, if not, have a look at how the Gameboy supports memory banks so you have have games over the tight restrictions in that

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates