Skip to content

Instantly share code, notes, and snippets.

View jackkoenig's full-sized avatar
🔥
start fires

Jack Koenig jackkoenig

🔥
start fires
  • SiFive
  • Berkeley, CA
View GitHub Profile
layout title section
docs
Naming
chisel3

Naming

Historically, Chisel has had trouble reliably capturing the names of signals. The reasons for this are due to (1) primarily relying on reflection to find names, (2) using @chiselName macro which had unreliable behavior.

@jackkoenig
jackkoenig / hs_err_pidXXX.log
Created March 18, 2022 20:33
GraalVM 22.0.0.2 Java17 Linux AMD64 Crash Log
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fbb8d9a9e23, pid=827581, tid=827682
#
# JRE version: OpenJDK Runtime Environment GraalVM CE 22.0.0.2 (17.0.2+8) (build 17.0.2+8-jvmci-22.0-b05)
# Java VM: OpenJDK 64-Bit Server VM GraalVM CE 22.0.0.2 (17.0.2+8-jvmci-22.0-b05, mixed mode, sharing, tiered, jvmci, jvmci compiler, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0x728e23] G1ParCopyClosure<(G1Barrier)0, false>::do_oop(narrowOop*)+0x63
#

Sometimes you want to do the equivalent of a Github Squash-and-Merge without the merge.

I originally had the stuff below the line, but it turns out you can just do this with git merge --squash, see https://gist.github.com/aortbals/2aeb557bf127dd7ae88ea63da93479fc.

git checkout <my branch>
git checkout -b <my branch>-backup
git checkout <base branch>
git pull
# Make sure you have created -backup !!!
diff --git a/src/main/scala/chisel3/experimental/conversions/package.scala b/src/main/scala/chisel3/experimental/conversions/package.scala
index c52fd1fe..7f1102f5 100644
--- a/src/main/scala/chisel3/experimental/conversions/package.scala
+++ b/src/main/scala/chisel3/experimental/conversions/package.scala
@@ -69,12 +69,16 @@ package object conversions {
}
}
- /** Implicit conversion between `(A, B)` and `HWTuple2[A, B]` */
- implicit def tuple2hwtuple[T1 : DataProduct, T2 : DataProduct, V1 <: Data, V2 <: Data](
layout title section
docs
Upgrading From Chisel 3.4 to 3.5
chisel3

Upgrading From Chisel 3.4 to 3.5

@jackkoenig
jackkoenig / dataview_cookbook.md
Last active August 4, 2021 00:02
DataView Cookbook (after mdoc generation) - Updated 3 Aug 2021
@jackkoenig
jackkoenig / dataview_explanation.md
Last active October 7, 2021 19:36
DataView Explanation (after mdoc generation) - Updated 7 Oct 2021
layout title section
docs
DataView
chisel3

DataView

New in Chisel 3.5

Motivation

A common feature request in Chisel is to be able to have more control over the naming of Bundle fields [1, 2, 3, 4]. This request often involves dropping Bundle prefixes, most often to be able to have AXI Bundles that match the AXI naming conventions, while still having Bundle structure for subsets of the signals [1, 2].

For example, AXI has flattened ready-valid structure:

class AXI_AW_Full_Bundle extends Bundle {
  val AWADDR = Output(UInt(32.W))
  val AWVALID = Output(Bool())
 val AWREADY = Input(Bool())
@jackkoenig
jackkoenig / build.sbt
Created August 22, 2020 06:18
Example build.sbt with comments to help explain
// Common properties shared for a whole build
ThisBuild / scalaVersion := "2.12.12"
// These settings are mainly for publishing, they should be customized by the user
ThisBuild / organization := "edu.berkeley.cs"
// This is the version of your project
ThisBuild / version := "0.1-SNAPSHOT" // SNAPSHOT is used to indicate that it's a development (not stable) version
// A project is a compilation unit
// Many projects are fine with just one (like this example), but complex builds may have multiple
// The properties scoped in "ThisBuild" above are shared between all projects