Skip to content

Instantly share code, notes, and snippets.

Avatar

Austin Seipp thoughtpolice

View GitHub Profile
View bsc-libdir.tcl
#! /usr/bin/env bluetcl
# bsc-libdir: a tcl script that looks up Verilog primitives for
# the bluespec compiler, and emits them to stdout. this tool
# is more useful when combined with `bsc-rpc`, but might be
# of use on its own.
#
# usage:
#
# $ bluetcl bsc-libdir RegUN > RegUN.v
View Makefile
sim.exe: top.v sim.cpp
verilator --cc --coverage --exe -Wno-lint -trace --top-module top \
--Mdir bench_dir $^
$(MAKE) -C bench_dir -f Vtop.mk
cp bench_dir/Vtop $@
clean:
rm -f bench_dir sim.exe
.PHONY: clean
@thoughtpolice
thoughtpolice / ecp5pll.py
Last active May 7, 2020
Yosys script to generate ECP5 PLLs on the fly
View ecp5pll.py
# ecp5pll.py: yosys RPC frontend for generating ECP5 PLL modules on the fly
#
# Copyright (C) 2020 Austin Seipp
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
@thoughtpolice
thoughtpolice / symbiflow.nix
Created Sep 26, 2019
SymbiFlow for Nixpkgs
View symbiflow.nix
with import <nixpkgs> {};
let
nextpnr-gui = pkgs.nextpnr; # gui by default on upstream
nextpnr-nogui = pkgs.nextpnr.override { enableGui = false; };
common-pkgs = with pkgs; [
symbiyosys yosys verilog verilator
icestorm trellis
z3 yices boolector
@thoughtpolice
thoughtpolice / fastly-cache-debug.sh
Created Aug 1, 2019
Grab Fastly debugging info from cache.nixos.org
View fastly-cache-debug.sh
#!/usr/bin/env bash
[ -z "$1" ] && echo "ERROR: must provide arg" && exit 1
CACHE_URL=${CACHE_URL:-"https://cache.nixos.org"}
curl -v \
-HFastly-Debug:1 \
-o /dev/null 2>&1 \
"$CACHE_URL/$1" \
@thoughtpolice
thoughtpolice / foundationdb-beta1-getting-started.template
Created Feb 7, 2019
Ancient CloudFormation FoundationDB template, discovered by completing an ancient trial
View foundationdb-beta1-getting-started.template
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "FoundationDB CloudFormation Test. **WARNING** This template creates one or more Amazon EC2 instances. You will be billed for the AWS resources used if you create a stack from this template.",
"Parameters" : {
"InstanceType" : {
"Description" : "EC2 instance type",
"Type" : "String",
"Default" : "m1.large",
View decoder.sail
/* -------------------------------------------------------------------------- */
/* -- LUI encoding ---------------------------------------------------------- */
union clause ast = LUI : Utype
mapping clause encdec_base = LUI(imm, rd) <-> imm @ rd @ 0b0110111
function clause print_insn LUI(imm, rd) = "lui " ^ rd ^ ", " ^ bits_str(imm)
/* -------------------------------------------------------------------------- */
/* -- AUIPC encoding -------------------------------------------------------- */
@thoughtpolice
thoughtpolice / default.nix
Created Jan 15, 2019
nix-shell file for picorv32 development.
View default.nix
# nix.shell: PicoRV32 Development Environment
#
# This file allows you to use the Nix Package Manager (https://nixos.org/nix)
# in order to download, install, and prepare a working environment for doing
# PicoRV32/PicoSoC development on _any_ existing Linux distribution, provided
# the Nix package manager is installed.
#
# Current included tools:
#
# - Synthesis: Recent Yosys and SymbiYosys
@thoughtpolice
thoughtpolice / llvm-static-musl.nix
Created Jan 11, 2019
Static C++17 binaries with Clang, Musl, and libc++, using Nix
View llvm-static-musl.nix
{ useMusl ? false
}:
let
nixpkgs = import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/004cb5a694e39bd91b27b0adddc127daf2cb76cb.tar.gz";
sha256 = "0v5pfrisz0xspd3h54vx005fijmhrxwh0la7zmdk97hqm01x3mz4";
}) {};
pkgs = if useMusl then nixpkgs.pkgsMusl else nixpkgs;
@thoughtpolice
thoughtpolice / keybase.md
Created Sep 6, 2018
Keybase verification
View keybase.md

Keybase proof

I hereby claim:

  • I am thoughtpolice on github.
  • I am aseipp (https://keybase.io/aseipp) on keybase.
  • I have a public key ASDlfufSsLCTJwDnY7DS0FG0jNbxCw0gtfJ73wSFVHp-gAo

To claim this, I am signing this object: