Skip to content

Instantly share code, notes, and snippets.

View carlosedp's full-sized avatar

Carlos Eduardo carlosedp

View GitHub Profile
@carlosedp
carlosedp / ChiselArgs.scala
Last active November 2, 2022 17:22
Chisel + Circt test with args
//> using scala "2.13.8"
//> using lib "edu.berkeley.cs::chisel3::3.5.4"
//> using lib "com.sifive::chisel-circt::0.6.0"
//> using plugin "edu.berkeley.cs:::chisel3-plugin::3.5.4"
import chisel3._
import circt.stage.ChiselStage
import chisel3.stage.ChiselGeneratorAnnotation
class FooBundle extends Bundle {
# Description: Boxstarter Script
# Author: CarlosEDP
#
# First set: Set-ExecutionPolicy RemoteSigned
#
# Install boxstarter:
# . { iwr -useb https://boxstarter.org/bootstrapper.ps1 } | iex; Get-Boxstarter -Force
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
# start http://boxstarter.org/package/nr/url?https://github.com/carlosedp/dotfiles/raw/master/boxstarter.ps1
/** SemVer bump mode type
*/
object BumpMode extends Enumeration {
type Mode = Value
val Major, Minor, Patch, None = Value
}
object SemVer {
/** Creates a new [[SemVer]] with bump and manipulation
*
@carlosedp
carlosedp / el_docker.py
Created September 13, 2022 20:13
Edalize Launcher script for containers
#!/usr/bin/python3
import os
import shutil
import subprocess
import sys
import logging
import shlex
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger("EdalizeLauncher")
@carlosedp
carlosedp / Readme.md
Last active September 5, 2022 19:52
Scala Mill build file for ScalaScripts

Scala Mill build.sc file for Scala Scripts

This build file defines a ScalaScript trait that can be used to build Scala Scripts.

The trait adds some methods to the build process:

  • run to execute the script
  • test to call a matching script test file in the pattern scriptname.test.scala
  • native to build a native image using GraalVM in the same dir. The binary is compressed with UPX.
@carlosedp
carlosedp / Readme.md
Last active May 3, 2023 19:13
Find plugin updates for Scala cli, mill build tool and ammonite scripts

This is a Scala script to check for Mill build plugin and scala-cli lib updates. The plugin requires scala-cli.

Run directly from the gist with:

scala-cli https://gist.github.com/carlosedp/c3ea2814ac5392051a562e95c1298239/raw/checkdeps.sc

Or download the script, make it executable and run as:

@carlosedp
carlosedp / minio-template.yaml
Created July 28, 2022 22:16
Min.io OpenShift template
# To create a new Minio instance, you can use the following command:
#
# oc new-project minio
# oc new-app --namespace=minio -f minio-template.yaml -p MINIO_ROOT_USER=root -p MINIO_ROOT_PASSWORD=mysecret -p APPLICATION_DOMAIN=minio.$(oc get ingresses.config/cluster -o jsonpath={.spec.domain}) -p PV_SIZE=20Gi
#
apiVersion: v1
kind: Template
labels:
app: minio
template: minio
@carlosedp
carlosedp / _mill
Last active July 19, 2022 20:15
Scala mill build tool Zsh completion script
#compdef mill
# Install this file somewhere in your $FPATH (Zsh completion path)
# shellcheck disable=SC2207
__mill_debug()
{
# To enable debug, export in the shell the BASH_COMP_DEBUG_FILE variable to a file.
# Eg. BASH_COMP_DEBUG_FILE="/tmp/mill_debug.txt"
@carlosedp
carlosedp / ft2232_to_digilent_jtag.md
Created February 15, 2022 19:28 — forked from rikka0w0/ft2232_to_digilent_jtag.md
FT2232 to Digilent JTag for Xilinx FPGAs (ISE/Vivado)

The Digilent JTag uses FT2232, but its configuration EEPROM contains secrete data needed to be recoginzed by Xilinx ISE/Vivado. The following method only works on linux (tested on Ubuntu16.04), but the patched FT2232 doggle also works on Windows. Since WSL1 does not provide USB device access, the following method will not work for WSL1.

DONT use FT_Prog on offical Digilent cable, as it can trash the firmware! The offical eeprom contains secrete data that cannot be handled correctly by FT_Prog.

Here are steps to create a Digilent-like Jtag that can be used in Xilinx ISE and Vivado

  1. Install softwares: sudo apt-get install libftdi1 ftdi-eeprom
  2. Create a file "flash_digilent.conf" with the following content:
@carlosedp
carlosedp / Dockerfile
Last active February 17, 2022 21:45
Project X-Ray Edalize Backend and Launcher for Docker Containers
ARG PART = xc7k325tffg676-1
# Set this to the part you want to build for
# pass it thru the command line
# e.g. --build-arg PART=xc7k325tffg676-1
FROM python:3.5 as builder
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y sudo ca-certificates git build-essential wget cmake xz-utils python3-yaml libboost-all-dev qt5-default libqt5opengl5-dev libeigen3-dev --no-install-recommends