Skip to content

smirolo/chisel-tutorial

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chisel Tutorials

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.

Visit the community website for more information.

Getting the repo

$ git clone https://github.com/ucb-bar/chisel-tutorial.git

Running the Tutorials

First make sure the prerequisites are installed. These include make, gcc and sbt.

# solutions to the partially implemented circuits in  problems/
$ cd solutions
$ make

# more complex examples of circuits implemented in Chisel
$ cd examples
$ make

Doing the problems

cd problems

sbt

Mux2

This should already work. Try run Mux2 --backend c --targetDir ../emulator --compile --test --genHarness

Mux4

You can instantiate a module with val foo = Module(new Bar()) run Mux4 --backend c --targetDir ../emulator --compile --test --genHarness

Counter

You can conditionally update a value without a mux by using when (cond) { foo := bar } run Counter --backend c --targetDir ../emulator --compile --test --genHarness

Vending Machine

run VendingMachine --backend c --targetDir ../emulator --compile --test --genHarness

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. run Memo --backend c --targetDir ../emulator --compile --test --genHarness

Mul

run Mul --backend c --targetDir ../emulator --compile --test --genHarness

RealGCD

run RealGCD --backend c --targetDir ../emulator --compile --test --genHarness

About

chisel tutorial exercises and answers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Scala 96.8%
  • Python 3.2%