Skip to content

Instantly share code, notes, and snippets.

View seldridge's full-sized avatar

Schuyler Eldridge seldridge

View GitHub Profile
@seldridge
seldridge / Foo.scala
Last active February 19, 2022 22:07
Example of running the Scala FIRRTL compiler and the MLIR FIRRTL compiler on the same Chisel hardware description using scala-cli. This requires an installation of CIRCT, i.e., `firtool` must be on your `$PATH`.
//> using scala "2.13"
//> using lib "edu.berkeley.cs::chisel3:3.5.1"
//> using lib "com.sifive::chisel-circt:0.3.0"
//> using mainClass "Foo"
import chisel3._
import chisel3.stage.{ChiselStage => SFC}
import circt.stage.{ChiselStage => MFC}
class Foo extends RawModule {
@seldridge
seldridge / forms2dep.md
Last active September 12, 2023 08:29 — forked from azidar/forms2dep.md
Migrating FIRRTL Transforms from inputForm/outputForm to dependency API

Introduction

Hello! Hopefully you saw this linked to in a deprecation warning and want to migrate your code. Great! We want to make your migration as easy as possible. If you have any questions (or feedback), feel free to get in touch with a developer via any of the following mediums:

@seldridge
seldridge / deprecations.md
Last active July 30, 2019 17:35
List of Chisel/FIRRTL current deprecations

Chisel3

./coreMacros/src/main/scala/chisel3/internal/RuntimeDeprecationTransform.scala:  /** Adds a Builder.deprecated(...) call based on the contents of a plain @deprecated annotation.
./coreMacros/src/main/scala/chisel3/internal/RuntimeDeprecationTransform.scala:          case _ => c.abort(c.enclosingPosition, s"@chiselRuntimeDeprecated annotion must be used with exactly one @deprecated annotation, got annotations $annotations") // scalastyle:ignore line.size.limit
./chiselFrontend/src/main/scala/chisel3/Reg.scala:  @deprecated("Use Reg(t), RegNext(next, [init]) or RegInit([t], init) instead", "chisel3")
./chiselFrontend/src/main/scala/chisel3/Mem.scala:  @deprecated("Mem argument order should be size, t; this will be removed by the official release", "chisel3")
./chiselFrontend/src/main/scala/chisel3/Mem.scala:  @deprecated("Mem argument order should be size, t; this will be removed by the official release", "chisel3")
./chiselFrontend/src/main/scala/chisel3/Mem.scala:  @deprecated("SeqMem/SyncReadM
/*
The default error message is:
/home/se/tmp/implicit.scala:41: error: could not find implicit value for parameter c: this.Converter[String]
println(view[String](1))
^
We could change this to something better..., e.g.,
/home/se/tmp/implicit.scala:41: error: No implicit `Converter` for type String found in scope. Did you forget to import it?
object X {
def f(x: Int): Int = 1
}
object Y {
def f(x: Int): String = "a"
}
import X._
import Y._
@seldridge
seldridge / treadle-annos-feedback.md
Last active July 31, 2018 21:57
Thoughts on Treadle Options/Annotations Refactor

This looks very good! I'm fine with it and the refactor aligns with what I've been pushing.

Some overall feedback along with some bigger thoughts follows.

As there are three locations in which information can exist, I'll use the following nomenclature:

  • "case class option" -> a member of a case class used to represent options (e.g., topName of firrtl.FirrtlExecutionOptions)
  • "CLI option" -> a command line argument
  • "annotation" -> an annotation
[info] [0.002] Elaborating design...
Interrupt map (2 harts 2 interrupts):
[1, 2] => dut
[error] (run-main-0) java.lang.reflect.InvocationTargetException
[error] java.lang.reflect.InvocationTargetException
[error] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[error] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[error] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[error] at java.lang.reflect.Constructor.newInstance(Constructor.java:423)