Skip to content

Instantly share code, notes, and snippets.

Avatar

Carlos Eduardo carlosedp

View GitHub Profile
@carlosedp
carlosedp / minio-template.yaml
Created Jul 28, 2022
Min.io OpenShift template
View minio-template.yaml
# 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 Jul 19, 2022
Scala mill build tool Zsh completion script
View _mill
#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 Feb 15, 2022 — forked from rikka0w0/ft2232_to_digilent_jtag.md
FT2232 to Digilent JTag for Xilinx FPGAs (ISE/Vivado)
View ft2232_to_digilent_jtag.md

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 Feb 17, 2022
Project X-Ray Edalize Backend and Launcher for Docker Containers
View Dockerfile
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
@carlosedp
carlosedp / readme.md
Last active Apr 28, 2022
Symbiflow - Edalize workflow for Quicklogic FPGAs
View readme.md
  • FuseSoc/Edalize container workflow - Solved thru https://gist.github.com/carlosedp/ac36e9052bfa23f84b2f42f1a05ee1bd
    • How to identify in the Edalize launcher script which container family to use (Eg. Symbiflow for xc7 or eos) since it only receives the command being called (symbiflow_synth, symbiflow_pack, etc...)? Maybe pass some environment variable?
    • The variable should match the naming from https://hdl.github.io/containers/
  • Symbiflow containers are only initialized thru profile.d so it requires running the commands thry bash unlike Trellis/Icestorm which the tools are already in the path.
    • Use a container Initialization before each tool (bash -lec). Would be easier if image already had path initialized since we need subprocess.call in shell mode which is insecure due to wrap command in commas.
    • Ref. hdl/containers#49
  • EOS scripts symbiflow_write_bitheader / symbiflow_write_bitstream are still using env vars so won't work
@carlosedp
carlosedp / el_docker.sh
Created Jan 17, 2022
Edalize Launcher script for Docker Contariner Wrapper
View el_docker.sh
#!/usr/bin/python3
import os
import shutil
import subprocess
import sys
import logging
import shlex
logger = logging.getLogger(__name__)
symbiflow_init = 'bash -lec {}'
@carlosedp
carlosedp / readme.md
Created Dec 22, 2021
Generate certificates
View readme.md

Generate certificates and keys with SAN

# Generate rootCA key and certificate
openssl genrsa -out rootCA.key 4096
openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1024 -out rootCA.crt

# Generate certificate key
openssl genrsa -out mydomain.com.key 2048
View gist:c654082ac7b78ea320c6113e048648b6
https://edotor.net/?engine=dot#digraph%20%22Toplevel%22%20%7B%0Alabel%3D%22Toplevel%22%3B%0Arankdir%3D%22LR%22%3B%0Aremincross%3Dtrue%3B%0An1%20%5B%20shape%3Ddiamond%2C%20label%3D%22io_in1_MULT18X18D_A0_P0%22%2C%20color%3D%22black%22%2C%20fontcolor%3D%22black%22%20%5D%3B%0An2%20%5B%20shape%3Ddiamond%2C%20label%3D%22io_out_MULT18X18D_P0_P18_CCU2C_A0_COUT%22%2C%20color%3D%22black%22%2C%20fontcolor%3D%22black%22%20%5D%3B%0An3%20%5B%20shape%3Ddiamond%2C%20label%3D%22io_out_MULT18X18D_P0_P18_CCU2C_A0_5_COUT%22%2C%20color%3D%22black%22%2C%20fontcolor%3D%22black%22%20%5D%3B%0An4%20%5B%20shape%3Ddiamond%2C%20label%3D%22io_in1_MULT18X18D_A0_1_P18%22%2C%20color%3D%22black%22%2C%20fontcolor%3D%22black%22%20%5D%3B%0An5%20%5B%20shape%3Ddiamond%2C%20label%3D%22io_out_CCU2C_S0_B0%22%2C%20color%3D%22black%22%2C%20fontcolor%3D%22black%22%20%5D%3B%0An6%20%5B%20shape%3Ddiamond%2C%20label%3D%22io_in1_MULT18X18D_A0_1_P32%22%2C%20color%3D%22black%22%2C%20fontcolor%3D%22black%22%20%5D%3B%0An7%20%5B%20shape%3Ddiamond%2C%20label%3D%2
@carlosedp
carlosedp / gtkwave.tcl
Last active Oct 7, 2021
GTKWave TCL script to colorize and group signals for Chisel projects
View gtkwave.tcl
#
# GTKWave Grouping and colorizing script
#
# Load the trace with `gtkwave -S gtkwave.tcl yourtrace.vcd`
#
# Customize the inserted traces in the TOPlevel section below
# and at the bottom in the add_signals function calls
#
# Customize this section as needed
View Blinky.vcd
$date
2021-06-29T19:15+0000
$end
$version
0.2
$end
$comment
$end
$timescale 1ns $end