Code Monkey home page Code Monkey logo

fpga-experiments's Introduction

fpga-experiments

Some verilog designs for an icestick40

puck*: yet another 8-bit cpu on a small fpga

With fpgas becoming cheaper, more convenient and easier to program, I wanted to try my hand at designing an 8-bit cpu. For no particular reason, just out of curiosity :-)

There have been plenty of inspirational projects (swapforth, nopcpu to name a few) but I wanted to start from scratch and document my findings, especially those related to Verilog, the hardware description language I have chosen to define my CPU with.

*) Puck is named after one of our Pigmy goats because it is small and fun :-)

Status

All major components are implemented, both software and hardware, and available in the repository. Currently writing test programs and some documentation. Next steps will be about optimizing the current design and sharing lessons learned.

My development platform

  • yosys/icestorm on Ubuntu

I won't document the installation process. just check the Icestorm site and follow the instructions and the components will work out of the box.

  • a Lattice IceStick

The iCEstick is pretty powerful (should be able to run at clockspeeds well over 100 MHz), affordable and easy to use with its USB connector. it is not really large but big enough to implement an 8-bit processor, complete with ram, a serial interface (uart) and a small monitor mode to load/save data to memory and start a program

  • the IceBreaker board

i have also ordered an IceBreaker board which has more logic cells as well as dedicated DSP options (and having hardware multipliers is nice for a CPU)

Goals

  • an 8-bit cpu

This the main goal and for me the fun part: designing and implementing a decent instruction set. Not just an ALU but also branch instructions and a return stack so that we can write subroutines.

  • a monitor program

A monitor program is some hardware that allows you to inspect memory, upload bytes and run a program. you could of course create your hardware with a fixed program in rom but in my thinking a monitor program is essential for testing your designs quickly. That's why this component was actually the first I implemented.

It comes in two parts: hardware to load and dump memory contents, and a python program to make life a bit easier.

The hardware part is implemented in the toplevel puck.v file. The python front-end is in a folder of iets own along with some documentatiin.

The hardware is mainly about reusing an existing uart design and making our first steps into Verilog.

  • an assembler

Writing any kind of machine code by hand quickly becomes unwieldy and error prone. so an assembler, even a rather simplistic one, is a must have. Writing one in Python is straightforward so i'll certainly create one.

  • documentation

I mention this as a goal in itself because for me it is important to understand whatever I find out so that others (or myself at a later point) do not have to reinvent the wheel

  • and finally, a calculator program

It will read input lines, parse numbers and operators amd perform simple calculations

fpga-experiments's People

Contributors

varkenvarken avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.