Skip to content
Branch: release
Go to file
Code

Latest commit

4 people committed e567a5f Jun 1, 2020
Bump for 3.3.1 (#162)
* Update deprecations (#150)

* Update deprecations

* Ensure TesterOptionsManager isn't shared between tests.

* Respond to comments - remove () from asBool.

* Respond to comment - ensure testOptionsManager has parsed args.

* Provide a utility copy method to copy TesterOptionsManager state

* Fix some typos in tutorial.tex (#148) (#155)

(cherry picked from commit 2d43a86)

Co-authored-by: Felix Yan <felixonmars@archlinux.org>

* Bump sbt and scala versions (#157)

* Bump SNAPSHOT versions for master branch (#156)

* Bump release versions

* Bump sbt to 1.3.7. (#154)

OpenJDK 13 causes problems with old versions of SBT. See [this issue](sbt/sbt#5093).

(cherry picked from commit d47fa0d)

Co-authored-by: Paul Rigge <rigge@berkeley.edu>

* Remove explicit chisel3 dependency (#158)

* Remove explicit chisel3 dependency
Rely on testers to pull in the correct version.

* Bump iotesters to correct SNAPSHOT version; simplify libraryDependencies.

* Use SNAPSHOT version (for master/SNAPSHOT branches)

* fix single port ram code (#160)

Co-authored-by: bqwer <liventsev@gmail.com>

* Bump sbt to 1.3.10 (#161)

Co-authored-by: Felix Yan <felixonmars@archlinux.org>
Co-authored-by: Paul Rigge <rigge@berkeley.edu>
Co-authored-by: bqwer <liventsev@gmail.com>

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
doc
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 

README.md

Chisel Tutorials (Release branch)

These are the tutorials for Chisel.

Chisel is an open-source hardware construction language developed at UC Berkeley that supports advanced hardware design using highly parameterized generators and layered domain-specific hardware languages.

Getting the Repo

$ git clone https://github.com/ucb-bar/chisel-tutorial.git
$ cd chisel-tutorial
$ git fetch origin
$ git checkout release

Executing Chisel

####Testing Your System First make sure that you have sbt (the scala build tool) installed. See details in sbt.

$ sbt run

This will generate and test a simple block (Hello) that always outputs the number 42 (aka 0x2a). You should see [success] on the last line of output (from sbt) and PASSED on the line before indicating the block passed the testcase. If you are doing this for the first time, sbt will automatically download the appropriate versions of Chisel3, the Chisel Testers harness and Scala and cache them (usually in ~/.ivy2).

Completing the Tutorials

To learn Chisel, we recommend learning by example and just trying things out. To help with this, we have produced exercises with circuits (src/main/scala/problems) and their associated test harnesses (src/test/scala/problems) which have clearly marked places to complete their functionality and simple test cases. You can compare your work with our sample solutions in (src/main/scala/solutions) and (src/test/scala/solutions). This hierarchical organization and separation of circuits and tests is a good practice and we encourage you to understand it and use it in the future. Typically when you work on a problem you will have two open editor windows (vi, emacs, IDE, etc) one to edit the circuit and the other to edit the tests.

To speed things up, we will keep sbt running. To get started:

$ sbt

Mux2

This should already work. Try

> test:runMain problems.Launcher Mux2

Note that Mux2 is defined in Mux4.scala.

Mux4

You can instantiate a module with val foo = Module(new Bar())

> test:runMain problems.Launcher Mux4

Counter

You can conditionally update a value without a mux by using when (cond) { foo := bar }

> test:runMain problems.Launcher Counter

Vending Machine

> test:runMain problems.Launcher VendingMachine

Memo

The type of memory that's inferred is based on how you handle the read and write enables. This is pretty much the same as how Xilinx and Altera infer memories.

> test:runMain problems.Launcher Memo

Mul

> test:runMain problems.Launcher Mul

RealGCD

> test:runMain problems.Launcher RealGCD

To check that all of your solutions are correct:

$ ./run-problem.sh all

To run all of our reference solutions:

$ ./run-solution.sh all

Note: ./run-problem.sh, ./run-solution.sh, ./run-examples.sh are convenience scripts to invoke tests

Learning More Chisel

In addition to the problems and the solutions, we have also provided some examples of more complex circuits (src/main/scala/examples) and (src/test/scala/examples). You should take a look at the source and test them out:

$ ./run-examples.sh all

The wiki attached to this repo contains more information on working with Chisel. Additional documentation may be found on the chisel3 repo wiki and the documentation section of the website.

Fixes/Updates

If you wish to submit pull requests for changes to this repo, plus check out the master branch, and make your pull requests against that branch.

You can’t perform that action at this time.