Giter Club home page Giter Club logo

chisel's Introduction

About Chisel

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

Chisel is embedded in the Scala programming language, which raises the level of hardware design abstraction by providing concepts including object orientation, functional programming, parameterized types, and type inference.

Chisel can generate a high-speed C++-based cycle-accurate software simulator, or low-level Verilog designed to pass on to standard ASIC or FPGA tools for synthesis and place and route.

Visit the community website for more information.

Getting started

Chisel Users

To start working on a circuit with Chisel, create a project directory with a standard Scala/SBT layout. You want your build.sbt file to contain a reference to Scala version greater or equal to 2.10 and add a dependency on the Chisel library.

$ cat build.sbt
scalaVersion := "2.10.2"
libraryDependencies += "edu.berkeley.cs" %% "chisel" % "2.0-SNAPSHOT"

Edit the source files for your circuit

$ cat Hello.scala
import Chisel._

class HelloModule extends Module {

    val io = new Bundle {}

    printf("Hello World!\n")
}

class HelloModuleTests(c: HelloModule) extends Tester(c, Array(c.io)) {
    defTests {
        true
    }
}

object hello {
    def main(args: Array[String]): Unit = {
        chiselMainTest(Array[String]("--backend", "c", "--genHarness"),
            () => Module(new HelloModule())){c => new HelloModuleTests(c)}
    }
}

Execute sbt run to generate the C++ simulation source for your circuit

$ sbt run

Compile the resulting C++ output to generate a simulation executable

$ g++ -std=c++11 -o HelloModule HelloModule.cpp HelloModule-emulator.cpp

Run the simulation executable for one clock cycle to generate a simulation trace

$ ./HelloModule 1
Hello World!

Chisel developpers

Checking coding style compliance

$ sbt scalastyle

Running unit tests with code coverage

$ sbt scct:test

Publishing jar to local system

$ sbt publish-local

Publishing to public Maven repo

$ sbt publish-signed

chisel's People

Contributors

jackbackrack avatar huytbvo avatar aswaterman avatar bwrcbcr avatar jcmartin avatar kasanovic avatar yunsup avatar marmbrus avatar sdtwigg avatar hcook avatar ccelio avatar metanest avatar schoeberl avatar rimasaviz avatar sbeamer avatar

Watchers

James Cloos avatar Rishi Naidu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.