Commit Graph

6 Commits

Author SHA1 Message Date
b38cec30f0 Initial implementation of hack cpu and test bench
The test bench 'cpu_tb.vhdl' currently fails for almost all inputs. Though from
analysis of the vcd output, everything seems to be working correctly. It
seems that the compare data from the nand to tetris course for
synchronized circuits/chips does not behave nicely with this simulation
because it assumes two clock cycles is one discreet time
unit (tick-tock) whereas in this simulation every pulse of the
clock (1 ns period) acts as a single discreet time unit. This however
still needs to be investigated and also is an issue in the
implementation of 'pc_tb.vhdl'.

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-05-23 03:39:37 -04:00
7c231bf6fd Tiny cleanup of formatting/filenames
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-05-23 03:27:10 -04:00
0af4a3eecd Added GPL3 license and cleaned up formatting
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-05-22 02:14:14 -04:00
90c8cc2ea8 Fix gitignore files
Ignore everything but vhdl source files in src, instead of at top level.

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-05-21 19:11:38 -04:00
8415eb51c6 Minor modification to .gitignore
Avoid having executables show up in git status.
2015-05-21 18:33:27 -04:00
6ab2badb26 Initial commit
Contains vhdl code and test benches for the following chips:

- adder
- add16
- alu
- dff
- dbit
- dregister
- dmux
- dmux4way
- dmux8way
- mux
- mux16
- mux4way16
- mux8way16
- pc
- ram8
- ram64
- ram512
- ram4k
- ram16k

For simulation of sequential chips, a clock must be used; this is
implemented as 'src/clock.vhdl' with accompanying test bench
'src/clock_tb.vhdl'.

'src/wave/gktw' contains gtkwave save files for viewing the output of
the various test benches.

The 'schematics' directory contains schematics of the various
chips (incomplete).

Things not yet completed:
- weird issue with 'src/pc_tb.vhdl'; that is, the test data from the
"nand to tetris" course doesn't fit the simulation but the simulation
appears to be correct (by inspection).
- cpu chip
- build system (currently things can built by hand using ghdl as
follows)

To build the various chips and their respective test benches, use ghdl
like so:
$ cd src
$ ghdl -i --workdir=work *.vhdl
$ ghdl -m --workdir=work <chip_name>_tb
$ ghdl -r <chip_name>_tb --vcd=wave/vcd/<chip_name>.vcd

You can then view the wave output file in
'src/wave/vcd/<chip_name>.vcd'.
2015-05-21 15:12:01 -04:00