You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
run shell command $ scalac -classpath lib/chisel3_2.12-3.1.6.jar -d classes GCD.scala
I got error. src\intro\GCD.scala:23: error: value load is not a member of chisel3.Bundle when (io.load) { ^ src\intro\GCD.scala:24: error: value a is not a member of chisel3.Bundle x := io.a; y := io.b ^ src\intro\GCD.scala:24: error: value b is not a member of chisel3.Bundle x := io.a; y := io.b ^ src\intro\GCD.scala:33: error: value out is not a member of chisel3.Bundle io.out := x ^ src\intro\GCD.scala:34: error: value valid is not a member of chisel3.Bundle io.valid := y === 0.U ^
GCD.scala
// See LICENSE.txt for license details.packageexamplesimportchisel3._classGCDextendsModule {
valio=IO(newBundle {
vala=Input(UInt(16.W))
valb=Input(UInt(16.W))
valload=Input(Bool())
valout=Output(UInt(16.W))
valvalid=Output(Bool())
})
valx=Reg(UInt())
valy=Reg(UInt())
when (io.load) {
x := io.a; y := io.b
} .otherwise {
when (x > y) {
x := x - y
} .elsewhen (x <= y) {
y := y - x
}
}
io.out := x
io.valid := y ===0.U
}
Unfortunately, pulling the chisel3 JAR from Maven is not enough since it doesn't contain all the dependencies of Chisel. (Those JARs are referred to as 'fat jars'.)
Unfortunately for most real development projects, trying to collect all the non-fat JARs manually isn't very feasible, which is why tools like maven, sbt, and ammonite sprung up. See https://stackoverflow.com/questions/3589562/why-maven-what-are-the-benefits for an example of the sorts of issues involved.
This looks to me like the pesky -Xsource:2.11 issue. Scala 2.12 changed semantics for anonymous bundles (relied on structural types working in a more permissive way).
In ammonite, the magic incantation is interp.configureCompiler(x => x.settings.source.value = scala.tools.nsc.settings.ScalaVersion("2.11.12")). In sbt, scalacOptions += "-Xsource:2.11" should work.
thanks all for your reply.
I used ammonite on os: windows 10 / cygwin-64 / java 1.8.151 / scala 2.12.8
amm give me an error,
java.io.IOException: Cannot run program "powershell.exe": CreateProcess error=2, The system cannot find the file specified Why can't amm use bash in cygwin ?
then I add powershell to cygwin PATH var, amm run ok. I found
default home directory,
C:\Users\Administrator.ammonite
all .jar file downloaded in the position,
C:\Users\Administrator\AppData\Local\Coursier\cache
they are different directory !! can I put the downloading .jar dir to other place specified by command option ?
I've tried option '--home', it didn't work.
I'm not sure what's going on there as I am not a windows user. I think we generally advise windows users to use WSL- sometimes it is necessary to use verilator for simulations, and verilator on windows is tricky unless you use WSL. I suspect it would also resolve the issues you're seeing.
I'd suggest starting with chisel-bootcamp. The examples are newer and it is the primary place to learn chisel. It should get you going without any need to use sbt.
Activity
edwardcwang commentedon Feb 4, 2019
Unfortunately, pulling the chisel3 JAR from Maven is not enough since it doesn't contain all the dependencies of Chisel. (Those JARs are referred to as 'fat jars'.)
Thankfully there is another option to enable single-file Chisel designs without sbt, and you can check out the demo here: https://github.com/edwardcwang/chisel-single-file
By default though we still recommend the full Chisel template as it provides a standardized structure for building and testing your designs.
balanx commentedon Feb 5, 2019
@edwardcwang, thanks for your reply, it works.
where is the downloading directory of jar files ? I can't find them in ~/..ammonite .
edwardcwang commentedon Feb 5, 2019
Many Scala tools including ammonite and sbt use
~/.ivy2/cacheas a cache directory for downloaded JARs.balanx commentedon Feb 6, 2019
amm has downloaded dependency jar file from maven. I copy all .jar to ./lib and scalac again.
scalac -classpath "\ ./lib/antlr-runtime-3.5.2-sources.jar;\ ./lib/antlr-runtime-3.5.2.jar;\ ./lib/antlr4-4.7.1-sources.jar;\ ./lib/antlr4-4.7.1.jar;\ ./lib/antlr4-runtime-4.7.1-sources.jar;\ ./lib/antlr4-runtime-4.7.1.jar;\ ./lib/chisel3_2.11-3.1.6-sources.jar;\ ./lib/chisel3_2.11-3.1.6.jar;\ ./lib/firrtl_2.11-1.1.6-sources.jar;\ ./lib/firrtl_2.11-1.1.6.jar;\ ./lib/icu4j-58.2-sources.jar;\ ./lib/icu4j-58.2.jar;\ ./lib/javax.json-1.0.4-sources.jar;\ ./lib/javax.json-1.0.4.jar;\ ./lib/joda-convert-1.2-sources.jar;\ ./lib/joda-convert-1.2.jar;\ ./lib/joda-time-2.9.4-sources.jar;\ ./lib/joda-time-2.9.4.jar;\ ./lib/json4s-ast_2.11-3.5.3-sources.jar;\ ./lib/json4s-ast_2.11-3.5.3.jar;\ ./lib/json4s-core_2.11-3.5.3-sources.jar;\ ./lib/json4s-core_2.11-3.5.3.jar;\ ./lib/json4s-native_2.11-3.5.3-sources.jar;\ ./lib/json4s-native_2.11-3.5.3.jar;\ ./lib/json4s-scalap_2.11-3.5.3-sources.jar;\ ./lib/json4s-scalap_2.11-3.5.3.jar;\ ./lib/logback-classic-1.2.3-sources.jar;\ ./lib/logback-classic-1.2.3.jar;\ ./lib/logback-core-1.2.3-sources.jar;\ ./lib/logback-core-1.2.3.jar;\ ./lib/moultingyaml_2.11-0.4.0-sources.jar;\ ./lib/moultingyaml_2.11-0.4.0.jar;\ ./lib/nscala-time_2.11-2.14.0-sources.jar;\ ./lib/nscala-time_2.11-2.14.0.jar;\ ./lib/org.abego.treelayout.core-1.0.3-sources.jar;\ ./lib/org.abego.treelayout.core-1.0.3.jar;\ ./lib/paranamer-2.8-sources.jar;\ ./lib/paranamer-2.8.jar;\ ./lib/scala-logging_2.11-3.7.2-sources.jar;\ ./lib/scala-logging_2.11-3.7.2.jar;\ ./lib/slf4j-api-1.7.25-sources.jar;\ ./lib/slf4j-api-1.7.25.jar;\ ./lib/snakeyaml-1.17-sources.jar;\ ./lib/snakeyaml-1.17.jar;\ ./lib/ST4-4.0.8-sources.jar;\ ./lib/ST4-4.0.8.jar;\ " -d classes src/intro/GCD.scalaI got the same eror again :( :(
can I have a simple way to generate verilog ?
edwardcwang commentedon Feb 6, 2019
Unfortunately for most real development projects, trying to collect all the non-fat JARs manually isn't very feasible, which is why tools like maven, sbt, and ammonite sprung up. See https://stackoverflow.com/questions/3589562/why-maven-what-are-the-benefits for an example of the sorts of issues involved.
grebe commentedon Feb 6, 2019
This looks to me like the pesky
-Xsource:2.11issue. Scala 2.12 changed semantics for anonymous bundles (relied on structural types working in a more permissive way).In ammonite, the magic incantation is
interp.configureCompiler(x => x.settings.source.value = scala.tools.nsc.settings.ScalaVersion("2.11.12")). In sbt,scalacOptions += "-Xsource:2.11"should work.jackkoenig commentedon Feb 6, 2019
We could make a mill
build.scfor the tutorial. Still a build tool but generally nicer to use than sbt.balanx commentedon Feb 7, 2019
thanks all for your reply.
I used ammonite on os: windows 10 / cygwin-64 / java 1.8.151 / scala 2.12.8
amm give me an error,
java.io.IOException: Cannot run program "powershell.exe": CreateProcess error=2, The system cannot find the file specifiedWhy can't amm use bash in cygwin ?
then I add powershell to cygwin PATH var, amm run ok. I found
default home directory,
C:\Users\Administrator.ammonite
all .jar file downloaded in the position,
C:\Users\Administrator\AppData\Local\Coursier\cache
they are different directory !!
can I put the downloading .jar dir to other place specified by command option ?
I've tried option '--home', it didn't work.
grebe commentedon Feb 7, 2019
I'm not sure what's going on there as I am not a windows user. I think we generally advise windows users to use WSL- sometimes it is necessary to use verilator for simulations, and verilator on windows is tricky unless you use WSL. I suspect it would also resolve the issues you're seeing.
balanx commentedon Feb 14, 2019
bad things ! we can't leave sbt.
I feel Chisel is neither a library nor a new language now.
long long way to go.
chick commentedon Feb 14, 2019
I'd suggest starting with chisel-bootcamp. The examples are newer and it is the primary place to learn chisel. It should get you going without any need to use sbt.
balanx commentedon Feb 21, 2019
God blessing !
It works OK when I degrade scala ftom 2.12 to 2.11.
I create a repo on 'https://github.com/balanx/chisel-make'.
GCD runs success with ~28MB jars only.
thanks all