Chisel (programming language)

{{Short description|Open-source hardware description language (HDL)}}

{{Infobox programming language

| name = Constructing Hardware in a Scala Embedded Language (Chisel)

| logo = Chisel(ProgrammingLanguage)Logo.svg

| logo caption =

| screenshot =

| screenshot caption =

| paradigms = Multi-paradigm: concurrent, functional, imperative, object-oriented

| family = Scala

| designers =

| developer = University of California, Berkeley

| released = {{Start date and age|2012|06}}

| latest release version = 3.6.0

| latest release date = {{Start date and age|2023|04|14}}

| latest preview version =

| latest preview date = {{Start date and age|2021}}

| typing = Inferred, static, strong, structural

| scope = Lexical (static)

| programming language = Scala

| platform = Java virtual machine (JVM)
JavaScript ([https://scala-js.org Scala.js])
LLVM ([https://scala-native.org/ Scala Native]) (experimental)

| operating system =

| license = Apache License 2.0

| file ext =

| file format =

| website = {{URL|www.chisel-lang.org}}

| implementations =

| dialects =

| influenced by =

| influenced =

}}

Chisel (an acronym for Constructing Hardware in a Scala Embedded Language{{ cite conference | last1 = Bachrach | first1 = J. | last2 = Vo | first2 = H. | last3 = Richards | first3 = B. | last4 = Lee | first4 = Y. | last5 = Waterman | first5 = A. | last6 = Avižienis | first6 = R. | last7 = Wawrzynek | first7 = J. | last8 = Asanović | first8 = K. | date = June 2012 | url = https://dl.acm.org/doi/abs/10.1145/2228360.2228584 | doi = 10.1145/2228360.2228584 | title = Chisel: constructing hardware in a Scala embedded language | publisher = Association for Computing Machinery (ACM) | book-title = Proceedings of the 49th Annual Design Automation Conference (DAC 2012) | pages = 1216–25 | isbn = 978-1-4503-1199-1 | location = San Francisco, California, US | url-access = subscription }}) is an open-source hardware description language (HDL) used to describe digital electronics and circuits at the register-transfer level.{{Cite web |title=Chisel |url=https://people.eecs.berkeley.edu/~jrb/Projects/chisel/chisel.htm |access-date=2020-07-08 |website=people.eecs.berkeley.edu |publisher=University of California, Berkeley |location=California, U.S. |archive-date=2021-10-16 |archive-url=https://web.archive.org/web/20211016083643/https://people.eecs.berkeley.edu/~jrb/Projects/chisel/chisel.htm |url-status=dead }}{{Cite web |editor-last=Bachrach |editor-first=Jonathan |title=Chisel: Accelerating Hardware Design |url=https://riscv.org/wp-content/uploads/2015/01/riscv-chisel-tutorial-bootcamp-jan2015.pdf |website=RISC-V |publisher=RISC-V International |location=California, U.S.}}

Chisel is based on Scala as a domain-specific language (DSL). Chisel inherits the object-oriented and functional programming aspects of Scala for describing digital hardware. Using Scala as a basis allows describing circuit generators. High quality, free access documentation exists in several languages.{{cite book |last=Schoeberl |first=Martin |date=August 30, 2019 |title=Digital Design with Chisel |url=http://www.imm.dtu.dk/~masca/chisel-book.html |publisher=Kindle Direct Publishing |language=en, zh, ja, vi |edition=2nd |isbn=978-1689336031}}

Circuits described in Chisel can be converted to a description in Verilog for synthesis and simulation.

Code examples

A simple example describing an adder circuit and showing the organization of components in Module with input and output ports:

class Add extends Module {

val io = IO(new Bundle {

val a = Input(UInt(8.W))

val b = Input(UInt(8.W))

val y = Output(UInt(8.W))

})

io.y := io.a + io.b

}

A 32-bit register with a reset value of 0:

val reg = RegInit(0.U(32.W))

A multiplexer is part of the Chisel library:

val result = Mux(sel, a, b)

Use

Although Chisel is not yet a mainstream hardware description language, it has been explored by several companies and institutions. The most prominent use of Chisel is an implementation of the RISC-V instruction set, the open-source Rocket chip.{{cite web |url=https://github.com/ucb-bar/rocket-chip |title=rocket-chip |last=Asanović |first=Krste |author-link=Krste Asanović |display-authors=etal|website=GitHub |publisher=RISC-V International |access-date=11 November 2016}}

Chisel is mentioned by the Defense Advanced Research Projects Agency (DARPA) as a technology to improve the efficiency of electronic design, where smaller design teams do larger designs.

{{cite news

| last=Moore

| first=Samuel K.

| date=2018-07-16

| title=DARPA Plans a Major Remake of U.S. Electronics

| url=https://spectrum.ieee.org/darpas-planning-a-major-remake-of-us-electronics-pay-attention

| work=IEEE Spectrum

| publisher=Institute of Electrical and Electronics Engineers (IEEE)

| access-date=2020-06-10

}} Google has used Chisel to develop a Tensor Processing Unit for edge computing.

{{cite AV media

| people=Derek Lockhart, Stephen Twigg, Ravi Narayanaswami, Jeremy Coriell, Uday Dasari, Richard Ho, Doug Hogberg, George Huang, Anand Kane, Chintan Kaur, Tao Liu, Adriana Maggiore, Kevin Townsend, Emre Tuncer

| date=2018-11-16

| title=Experiences Building Edge TPU with Chisel

| url=https://www.youtube.com/watch?v=x85342Cny8c

| access-date=2020-06-10

}} Some developers prefer Chisel as it requires one-fifth as much code and is much faster to develop than Verilog.{{Cite web |date=2021-07-05 |title=XiangShan open-source 64-bit RISC-V processor to rival Arm Cortex-A76 - CNX Software |url=https://www.cnx-software.com/2021/07/05/xiangshan-open-source-64-bit-risc-v-processor-rival-arm-cortex-a76/ |access-date=2022-03-26 |website=CNX Software - Embedded Systems News |language=en-US}}

Circuits described in Chisel can be converted to a description in Verilog for synthesis and simulation using a program named FIRRTL.{{Cite web |title=Chisel/FIRRTL Hardware Compiler Framework |url=https://www.chisel-lang.org/ |access-date=2022-09-08 |website= |publisher= |location=}}{{better|reason=independent source needed.|date=September 2022}}

See also

{{Portal|Computer programming|Free and open-source software}}

References

{{Reflist}}