The Elements of Computing Systems / Nisan
& Schocken / www.idc.ac.il/tecs
Project 0: Getting Started
Objective:
Learn the hardware simulator environment, and experiment with some built-in
chips.
Contract: This optional "project" is a self-study exercise. You don't have to build or hand-in anything, but rather get acquainted with the concepts of chip testing and hardware simulation.
Steps
0: Download and install the TECS software suite (see the Software section of the TECS web site) on your computer.
1: Read Chapter 1 of the book.
2. Go through parts I-II-III of the Hardware Simulator Tutorial (see the Study Plan Section of the TECS web site).
3. Create a directory named projects/00 on your computer, and extract project 00.zip into it.
4. Invoke the hardware simulator (which is now installed on your computer), load one of the .tst test scripts listed below, and experiment with the chip.
The Chips (with which you are invited to play)
Chip name | Function | Test scripts | Compare files |
And Mux8Way16 Register RAM8 |
And gate 16-bit 8-way multiplexor 16-bit register 8-register RAM |
How to experiment with the chips
What you see above is a selection of some illustrative chips, designed to demonstrate the hardware simulation process. Since the purpose of this exercise is to play with chips rather than build them, you should work with their built-in versions.
Note that the And and Mux8Way16 chips are combinational, and the Register and RAM8 chips are sequential (clock-dependent). Therefore the latter two chips will make sense only after you read Chapter 3, and in preparation for Project 3.
To load a built-in chip into the hardware simulator, click the chip icon or select "load chip" from the File menu. Then navigate to the tools/builtInChips directory and select the chip file name from there.
After the chip is loaded into the simulator, you can put different values in the chip's input pins, click the "Eval" icon, and inspect the results. (If you are playing with a clocked chip rather than a combinational chip, you have to use "TickTock" instead of "Eval").
You will notice that some built-in chips, e.g. Register and RAM8, have a GUI. This GUI enables testing these chips visually.
At some point, you can load the chip's test script (.tst file), and run it. This will show you exactly what type of behavior is expected from the chip. Needless to say, this knowledge is nice to have before you actually set out to build the chip in HDL.
What exactly is a built-in chip?
The activity described in this project is sometimes called "behavioral simulation" -- experimenting with the chip's functionality. For this purpose, there's no need to create a gate logic implementation of the chip. Instead, one can implement the chip logic using any other means, e.g. Java. And that's precisely what our built-in chips are -- Java classes that the hardware simulator is programmed to use each time it does not find an .hdl file in the current directory.
The next step
Every chip that you will be asked to build in this course is accompanied by .tst and .cmp files. Therefore, you never have to guess what the chip is supposed to do -- we supply an executable definition of this contract. In addition, for each chip we supply a basic .hdl file that you are supposed to extend into a working HDL chip definition.
Tip: almost every chip that you will be asked to build has a pre-defined, built-in version. Therefore, if you want to experiment with the a chip before you set out to build it, simply load the respective .tst script into the hardware simulator and start the simulation. Since a typical .tst file begins with a command that tells the simulator to load the chip, the simulator will look for the .hdl file in the current directory, will not find it, and then open the built-in version of the chip instead. At this point you can experiment with the chip's functionality, exactly like you did in this project.