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
;buildInfoPackage: chisel3, version: 3.1-SNAPSHOT, scalaVersion: 2.11.7, sbtVersion: 0.13.12, builtAtString: 2017-03-28 18:36:39.417, builtAtMillis: 1490726199417
circuit StackOverflowModule :
module StackOverflowModule :
input clock : Clock
input reset : UInt<1>
output io : {flip foo : UInt<7000>, bar : UInt<1>}
io is invalid
io is invalid
node bits_0 = bits(io.foo, 0, 0) @[Test.scala 10:21]
circuit TLSPIFlash_qspi :
module Queue_6 :
input clock : Clock
input reset : UInt<1>
output io : { flip enq : { flip ready : UInt<1>, valid : UInt<1>, bits : UInt<8>}, deq : { flip ready : UInt<1>, valid : UInt<1>, bits : UInt<8>}, count : UInt<4>}
io is invalid
io is invalid
cmem ram : UInt<8> [8] @[Decoupled.scala 182:24]
reg value : UInt<3>, clock with : (reset => (reset, UInt<3>("h0"))) @[Counter.scala 17:33]
module Test :
input a : UInt<10>
input b : UInt<2>
output z : UInt<10>
wire w : UInt<10>
w <= dshl(a, b)
; Replace with
node w = bits(dshl(a, b), 9, 0)
case class Foo(name: String, value: Int)
val foo = Foo("hi", 3)
foo match {
case foo: Foo => // Gets a ref
}
foo match {
case Foo(n, v) => // Have refs to the fields of Foo
}
@jackkoenig
jackkoenig / diff
Created June 28, 2017 19:59
rocketchip DefaultConfig with and without Firrtl replacing implicit reset with explicit mux
133573,133577c133573
< if (reset) begin
< pending_0 <= 1'h0;
< end else begin
< pending_0 <= 1'h0;
< end
---
> pending_0 <= 1'h0;
169978,169982c169974
< if (reset) begin
@jackkoenig
jackkoenig / Firrtl Object Count
Created September 20, 2017 17:36
Measurement of objects through Firrtl compilation
Nonequivalent refers to objects that are case class different (!=)
Unique refers to objects that are different references (ne)
A difference between nonequivalent and unique node counts shows object duplication in the compiler.
Ideally these numbers would always be the same.
Here is a measure using an old version of BOOMs ROB.
*New* unique nodes is a way to measure object duplication, how many nodes in the new circuit are not
found in the old circuit (by reference: ne)
@jackkoenig
jackkoenig / split_firrtl.py
Last active April 3, 2018 23:48
Script for splitting Firrtl files by module
#!/usr/bin/python
import sys
import os
import re
from collections import defaultdict
# Takes firrtl text, returns a dict from module name to module definition
def split_firrtl(firrtl_lines):
modules = defaultdict(list)
@jackkoenig
jackkoenig / retop_firrtl.py
Created February 28, 2018 00:29
Changes the top of a firrtl file, requires split_firrtl
#!/usr/bin/python
import sys
import os
import re
from collections import defaultdict
from split_firrtl import split_firrtl
def get_submods(modules):
submods = defaultdict(list)
@jackkoenig
jackkoenig / metadata
Last active September 13, 2018 18:43
Experimental CLA
{
"name": {
"title": "Full Name",
"type": "string",
"githubKey": "name",
"require": true
},
"email": {
"title": "E-Mail",
"type": "string",
@jackkoenig
jackkoenig / firrtl-cla
Last active February 21, 2019 18:35
FIRRTL CLA
The FIRRTL project admins request that You sign a Contributor License Agreement ("CLA")
regarding any software code and/or documentation You desire to contribute to
the FIRRTL Project ("Contribution").
If you are submitting your Contribution to the FIRRTL Project on behalf of the Regents
of the University of California, You hearby agree to license your Contribution under
the 3-Clause BSD License, and to include the appropriate copyright notice required by
the license.
If you are submitting your Contribution to the FIRRTL Project on behalf of yourself or