This tutorial is a work in progress

If you are interested in learning Verilog, there are already many tutorials online. Asic-world’s tutorial is perhaps the most complete on-line Verilog tutorial I know of. Nandland has an exceptional beginner’s tutorial as well. FPGA 4 Fun’s web site doesn’t really start at the bare basics, although it discusses how to build several basic peripherals. None of these tutorials, however, couple together all the tools needed to do design in one place.

The digital design student should be introduced immediately not only to the HDL language, but also to the tools necessary to debug his code. This includes not only Verilog (or SystemVerilog), but also a simulator (we’ll use Verilator, augmented at times with ncurses), waveform discumentation (wavedrom or even tikztiming), waveform display (gtkwave), and (my favorite) Formal Verification using SymbiYosys.

This beginners Verilog tutorial attempts therefore to fill some of the missing piecees in this void. My goal is to take a beginner from knowing C and a little C++, all the way to a serial port example, such as the ones in this repository. On second thought, I may go further and discuss getting a first debugging bus up and running, perhaps even to motivating AutoFPGA. Once you get that far, though, the rest of the ZipCPU blog should start to make sense.

I’m also hoping to keep this tutorial fairly hardware generic. Hardware specific topics will be placed as bonus chapters between the lesson chapters.

Lessons include:

  1. Preface
  2. Wires, and combinatorial logic
    • Thruwire example code [TGZ, ZIP]
    • Maskbus example code [TGZ, ZIP]
  3. Registers and blinky
    • Blinky example code [TGZ, ZIP]
    • PPS-I and PPS-II example code [TGZ, ZIP]
    • Dimmer example code [TGZ, ZIP]
  4. Finite state machines
    • LED Walker example [TGZ, ZIP]
  5. Building a Wishbone Slave
    • LED Walking upon request example [TGZ, ZIP]
  6. Building hello world, using a serial port transmitter
  7. Transmitting 32-bit data over the serial port
  8. Buttons: 2FF synchronizers, and debouncing
  9. Using FPGA block RAM
  10. Building the serial port receiver
  11. (Not yet written:) Using a FIFO with this serial port. Potential examples to be discussed include:

Watch this page! If the Lord wills, there will be more to come!

Likewise, if you would like to help fund this effort, please consider becoming a Patron of the blog, and then telling me your thoughts on how this project should move forward.

Now that these first ten chapters are nearing completion, I’m considering writing a second tutorial discussing bus interactions and how to create working peripherals for a CPU.