joshuatshaffer / nand2tetris-extentions

Some scripts to streamline nand2tetris's chip testing.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nand2tetris-extentions

I came up with this Bash script that allows me test my chips very quickly from the command line. I made it for a Unix style system (OS X and Linux) but it might work on Windows if you use Putty.

This repo has several redundant versions:

  • test-all is the recommended version.
  • test-all-monochrome is the same as test-all except that it does not colorize its output. Use this if your terminal does not support ANSI color codes.
  • test-all-simple is the original and simplest version. It does the same job as test-all but it does not format its output.
  • test-all-OSX.command is the same as test-all except that it can be run by double clicking it in Finder. This one needs to be installed differently (see below.)

Install and Use

test-all, test-all-monochrome, and test-all-simple

  1. Save the script in your projects folder.
  2. Make sure it's executable.
    chmod +x test-all
  3. cd into the project you want to test.
  4. Run it by typing
    ../test-all
It should print something like
Testing RAM8 ... pass
Testing Register ... pass
Testing RightArithmeticBitshift ... pass
All tests passed!
on your terminal.

test-all-OSX.command

  1. Save test-all-OSX.command into the same folder as your chips.
  2. Run it by double clicking it in Finder.
A terminal window should open and display the same output as test-all.

Command line with no script file.

This is the same as test-all-simple.
  1. cd into the project you want to test
  2. Copy/paste this into the command line.
    for i in *.tst; do echo "Testing $i ..."; ../../tools/HardwareSimulator.sh $i; done

About

Some scripts to streamline nand2tetris's chip testing.


Languages

Language:Shell 100.0%