Git Product home page Git Product logo

chisel-examples's Introduction

Chisel Examples

This repository is a collection of code examples for Chisel.

This collection has been moved to the latest version of Chisel, Chisel 3. I have collected notes on this move in TowardsChisel3

Getting the Examples

$ git clone https://github.com/schoeberl/chisel-examples.git

The collection is organized as follows:

hello-world is a self contained minimal project for a blinking LED in an FPGA.

The rest of the examples are rooted in the current folder.

Needed Tools

  • A recent version of Java (JDK 8 or later)

  • The Scala build tool sbt

Running the examples

make alu Generates the Verilog files for the small ALU. Synthesize it for the DE0 board with Quartus and the alu project file.

make alu-test Generats the C++ based simulation and runs the tests.

See the Makefile for further examples, or simply run sbt run to see all objects with a main.

Notes using the DE10-Nano

Change switches for FPGA configuration to:

+------+
|* ** *|
| *  * |
+------+

Probably add USB blaster permissions for: Bus 001 Device 005: ID 09fb:6810 Altera and 09fb:6010

A TTL UART is connected to GPIO pins 1 and 2 of GPIO 0.

GND * *
    * *
    * *
    * *
    * *
txd * * rxd (pin 1)

rxd and txd are from the FPGA view, therefore TTL UART rxd needs to be connected to txd (pin 2) and the other way around.

chisel-examples's People

Contributors

cgkiokas avatar schoeberl avatar wunderabt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chisel-examples's Issues

error on running the hello world chisel example

I was doing the 1.7 exercise and when I did run the hello world example I came across this error,
[error] (Compile / compileIncremental) Error compiling the sbt component 'compiler-bridge_2.12'

"Hello World" example from Section 1.7 Exercise throws exception

I'm trying to run the "Hello World" example from Section 1.7 Exercise and it does not work. Here is my setup:

  • 2013 MacBook Pro, running MacOS Mojave, Version 10.14.6

  • Scala compiler version 2.13.1 -- Copyright 2002-2019, LAMP/EPFL and Lightbend, Inc.

  • sbt version in this project: 1.3.8

  • javac / javac version 11.0.2

When I run it as described in Section 1.7, a firrtl.options.OptionsException is thrown. I've attached two files:

  • report1.txt which contains what happens when I do sbt run
  • report2.txt which contains what happens when I do sbt last Compile / bgRun

Happy to supply more details if wanted.

report1.txt
report2.txt

want to see VCD of UART.

Hey, I am using UART and I want to see VCD of UART in GTKWake. please guide me where I find VCD and which command I have to run to create it.

Thanks

"object iotesters is not a member of package chisel3" in "Hello World", 1.7 Exercise

Just started the book "Digital Design with Chisel" and tried the first exercise.

sbt run works and builds the verilog file. sbt testfails though.

The output of sbt run just for reference:

uwe@janeway:~/git/chisel-examples/hello-world$ sbt run
[info] [launcher] getting org.scala-sbt sbt 1.6.1  (this may take some time)...
[info] [launcher] getting Scala 2.12.15 (for sbt)...
[info] Updated file /home/uwe/git/chisel-examples/hello-world/project/build.properties: set sbt.version to 1.6.1
[info] welcome to sbt 1.6.1 (Ubuntu Java 11.0.13)
[info] loading project definition from /home/uwe/git/chisel-examples/hello-world/project
[info] loading settings for project hello-world from build.sbt ...
[info] set current project to hello-world (in build file:/home/uwe/git/chisel-examples/hello-world/)
[info] compiling 1 Scala source to /home/uwe/git/chisel-examples/hello-world/target/scala-2.12/classes ...
https://repo1.maven.org/maven2/org/scala-sbt/util-interface/1.6.0/util-interface-1.6.0.jar
  100.0% [##########] 2.5 KiB (66.2 KiB / s)
[info] Non-compiled module 'compiler-bridge_2.12' for Scala 2.12.13. Compiling...
[info]   Compilation completed in 7.663s.
[info] running Hello 
[success] Total time: 13 s, completed Jan 23, 2022, 10:45:51 AM

The output of sbt test where it fails:

uwe@janeway:~/git/chisel-examples/hello-world$ sbt test
[info] welcome to sbt 1.6.1 (Ubuntu Java 11.0.13)
[info] loading project definition from /home/uwe/git/chisel-examples/hello-world/project
[info] loading settings for project hello-world from build.sbt ...
[info] set current project to hello-world (in build file:/home/uwe/git/chisel-examples/hello-world/)
[info] compiling 1 Scala source to /home/uwe/git/chisel-examples/hello-world/target/scala-2.12/test-classes ...
[error] /home/uwe/git/chisel-examples/hello-world/src/test/scala/HelloTest.scala:1:16: object iotesters is not a member of package chisel3
[error] import chisel3.iotesters.PeekPokeTester
[error]                ^
[error] /home/uwe/git/chisel-examples/hello-world/src/test/scala/HelloTest.scala:7:13: object iotesters is not a member of package chisel3
[error]     chisel3.iotesters.Driver(() => new Hello()) { c =>
[error]             ^
[error] /home/uwe/git/chisel-examples/hello-world/src/test/scala/HelloTest.scala:8:11: not found: type PeekPokeTester
[error]       new PeekPokeTester(c) {
[error]           ^
[error] /home/uwe/git/chisel-examples/hello-world/src/test/scala/HelloTest.scala:13:11: not found: value step
[error]           step(10000)
[error]           ^
[error] /home/uwe/git/chisel-examples/hello-world/src/test/scala/HelloTest.scala:14:24: not found: value peek
[error]           val ledNow = peek(c.io.led).toInt
[error]                        ^
[error] 5 errors found
[error] (Test / compileIncremental) Compilation failed
[error] Total time: 3 s, completed Jan 23, 2022, 10:46:55 AM

Build failure

It's possible I did something wrong, but it looks to me like it's
an issue with chisel-examples.

I cloned the repo, ran cd hello-world; make and got this:

Getting Scala 2.12.3 (for sbt)...
:: retrieving :: org.scala-sbt#boot-scala
	confs: [default]
	5 artifacts copied, 0 already retrieved (19004kB/250ms)
[info] Updated file /home/tommy/chisel-examples/hello-world/project/build.properties: set sbt.version to 1.0.0
[info] Loading project definition from /home/tommy/chisel-examples/hello-world/project
[info] Updating {file:/home/tommy/chisel-examples/hello-world/project/}hello-world-build...
[info] downloading https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-core/2.8.1/log4j-core-2.8.1-tests.jar ...
[info] 	[SUCCESSFUL ] org.apache.logging.log4j#log4j-core;2.8.1!log4j-core.jar(test-jar) (517ms)
[info] Done updating.
[info] Loading settings from build.sbt ...
[info] Set current project to hello-world (in build file:/home/tommy/chisel-examples/hello-world/)
[error] Expected ID character
[error] Not a valid command: run-main
[error] Expected project ID
[error] Expected configuration
[error] Expected ':' (if selecting a configuration)
[error] Expected key
[error] Not a valid key: run-main (similar: runMain, bgRunMain, run)
[error] run-main Hello
[error]         ^
Makefile:5: recipe for target 'hdl' failed
make: *** [hdl] Error 1

Listing 9.1 is wrong

Listing 9.1 is wrong. The signals light is always True in all Master FSM's states, so the FSM will not blink.
image
image

ResolverFunctions is deprecated

When running sbt run command, I get the following deprecation warning.

C:\chisel\chisel-examples\hello-world> sbt run

[info] Updated file C:\chisel\chisel-examples\hello-world\project\build.properties: set sbt.version to 1.7.1
[info] welcome to sbt 1.7.1 (Temurin Java 1.8.0_312)
[info] loading project definition from C:\chisel\chisel-examples\hello-world\project

C:\chisel\chisel-examples\hello-world\build.sbt:9: warning: method sonatypeRepo in class ResolverFunctions is deprecated (since 1.7.0): Use sonatypeOssRepos instead
Resolver.sonatypeRepo("releases")
^
[info] loading settings for project hello-world from build.sbt ...
[info] set current project to hello-world (in build file:/C:/chisel/chisel-examples/hello-world/)
[info] compiling 1 Scala source to C:\chisel\chisel-examples\hello-world\target\scala-2.12\classes ...
[info] running Hello
[success] Total time: 15 s, completed Jul 27, 2022 4:46:48 PM

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.