GitXplorerGitXplorer
j

sap-1-verilog

public
7 stars
1 forks
0 issues

Commits

List of commits on branch master.
Unverified
8e2799480bd6645598a2c7c375961d580b3ccfe2

Ensure assembled programs are 16 instructions long

jjohshoff committed 3 years ago
Unverified
3ee6f24af6d2a035c74c9c1d46ac19f84628d92f

Remove tristate from bus

jjohshoff committed 3 years ago
Unverified
297975c42943ac4b740cc7cce467ed2ef523ab9a

Split test bench into separate file

jjohshoff committed 3 years ago
Unverified
2af2f520b3780da01eacf53d5c5f106e305f2d39

Move clock to test bench

jjohshoff committed 3 years ago
Unverified
71200d70dc1272c7285df9cc8d10f0600697bc8b

A working CPU!

jjohshoff committed 3 years ago

README

The README file for this repository.

This is an implementation of Ben Eater's Simple As Possible architecture SAP-1.

This is my first foray into Verilog and FPGA. As such, there are probably numerous errors and problems with the way I've done it. I had fun doing it, though, and maybe you'll find it interesting too. The assembler was quickly thrown together and has numerous known and unknown bugs.

There are some small deviations from the videos:

  • the clock is much simpler here, since it's been running in a simulator (so far),
  • there are added instructions jnc and jz as suggested by Scott Shambaugh,
  • the FI (flags in) is being inferred from ∑O (ALU read), and instead I use it to reset the micro instruction counter, to speed up the execusion,
  • the exact memory layout on the ROM is slightly different,
  • the naming is different in many places I mostly did it from memory,
  • and probably more...

Finally, a huge thanks to Ben Eater for making his video series and also to Stefan for his game Turing Complete. I wouldn't have been able to do this without both of them.

Running

Running this requires a Verilog simulator. I've only used Icarus Verilog.

To run, simply run

make

in the root folder of the project. It should run show the Fibonacci sequence:

OUT   0
OUT   1
OUT   2
OUT   3
OUT   5
OUT   8
OUT  13
OUT  21
OUT  34
OUT  55
OUT  89
OUT 144
OUT 233
cpu.v:204: $finish called at 552 (1s)