Skip to content

Instantly share code, notes, and snippets.

View TinyTinfoil's full-sized avatar

Venkadesh E. TinyTinfoil

View GitHub Profile
@TinyTinfoil
TinyTinfoil / lvs
Created October 9, 2025 16:42
Modified lvs script for subcircuit comparison in Magic
#!/usr/bin/env python3
import os, sys
if len(sys.argv) != 4:
print('lvs: You must specify two netlist filenames and a subcircuit to compare.')
sys.exit(1)
os.system('netgen -batch lvs \"{} {top}\" \"{} {top}\" /usr/local/share/pdk/sky130A/libs.tech/netgen/sky130A_setup.tcl'.format(sys.argv[1], sys.argv[2],top=sys.argv[3]))
sys.exit(0)
@TinyTinfoil
TinyTinfoil / test.py
Created May 19, 2023 17:09
Ensure consistant Python formatting before commits. Checks for google style docstrings, unit test coverage, and code formating (with black and pylint).
#!/bin/bash
if [ "$1" == "-h" ]; then
echo -e "Pre-commit test script for python files. \n Input files to test like so: ../../../test.sh file"
exit
fi
coverage run -m pytest *.py
coverage report
black .
pylint *.py
@TinyTinfoil
TinyTinfoil / clippyconsole.js
Created May 5, 2021 01:29
Make your browser console speak out everything you log (paste into the devtools console for best effect)
logger = console.log;
console.log = (msg, ...others) => {
speechSynthesis.speak(new window.SpeechSynthesisUtterance(msg))
logger(msg, ...others)
};