Lab 0: Getting Started with Chisel

This assignment is designed to get you familar with chisel before completing the first lab.

You will be using chisel-tutorial as a means to learning Chisel. Do not copy or look at the solutions. It is in your interest not to look at the solutions. After turning in your assignment, you are encouraged to look at the solutions to look how else the circuits might be expressed.

This assignment, as with all lab assignments, is to be completed individually. However, discussion of the assignment is encouraged, especially on Piazza. Please exercise common sense when helping others (e.g. don't give solutions).

Deliverables:
0) Survey filled out.
1) Your solutions to the problems in src/main/scala/problems and src/test/scala/problems
2) A Fibonacci circuit, called Fib.scala, plus a testbench, called FibTest.scala, that verifies that your circuit is working. The circuit should produce the sequence of Fibonacci numbers in order until it reaches some known end. Your circuit should use a handshaking interface for the input and be able to compute the 70th Fibonacci number. The input should be the length of the Fibonacci sequence. The output should produce a single Fibonacci number in the sequence, a valid signal, and an output signal indicating that it is done.
3) A README that should include your name, approximately how long you spent on the assignment, and any additional comments on the assignment.

Instructions:
1) Follow the instructions for Getting the Repo and Executing Chisel at chisel-tutorial. Read the rest of the document as well as you will need it later.
1.5) Copy Makefile into the chisel-tutorial direcory.
wget http://inst.eecs.berkeley.edu/~cs250/sp17/assignments/lab0/Makefile

2) Look over the examples in src/main/scala/examples and try to figure out what they are doing.
3) Read Chisel Tutorial, Annotations Extending Chisel and Firrtl, and Running Stuff.
4) Look at the examples again and make sure you fully understand them now. Be sure to also understand the testbenches in src/test/scala/examples.
5) Complete the solutions to the problems in src/main/scala/problems and src/test/scala/problems. Make sure that they work.
6) Complete the Fibonacci circuit and testbench, Fib.scala and FibTest.scala. Try to make your circuit as succinct as possible.
7) Complete the README.
8) Submit your assignment.
Useful Reference Material:
- Chisel Cheatsheet
- Chisel Tester Cheatsheet
- Printing in Chisel
- Chisel Cookbook
- Scala land vs Chisel land
- Useful sbt Commands

Instructional Machine Setup
In order to help get you ready for the first lab, we request that you complete this assignment on the instructional computers.

You can see some setup instructions for using the instructional machines here.

Please make sure to fill out this survey after completing the machine setup.

Scala Info
If you want a quick overview of Scala, you may look at the getting started guide used in past chisel bootcamps here.
There are plenty of tutorials on-line for learning scala as well, including several MOOCs: basic and advanced.
Submission
For the Chisel assignment, we will not be using the github submission yet. Instead, we will use the normal inst submission system.
You can find info about that system here.

You should first register your account with the system (to be done only once per account).

register

To submit to the system:

cd chisel-tutorial
make
cd submission
submit lab0

This will look for the results of each exercise as well as a README that should include your name, approximately how long you spent on the assignment, and any additional comments on the assignment. Make sure that Fib.scala is in src/main/scala/problems and FibTest.scala is in src/test/scala/problems. make will not work if you did not copy over the Makefile or if you put Fib.scala and FibTest.scala in other places.

You can submit multiple times, and I will be able to see each of them but will only grade the latest before the deadline.

If you have any questions, feel free to post them on Piazza.