Skip to content

Instantly share code, notes, and snippets.

View mattvenn's full-sized avatar

Matt Venn mattvenn

View GitHub Profile
@mattvenn
mattvenn / openroad
Created April 26, 2023 17:00
Matt Liberty's OpenROAD GUI config
if [gui::enabled] {
create_toolbar_button -text "P/G" -script {
set pwr_vis [gui::check_display_controls "Nets/Power" visible]
set gnd_vis [gui::check_display_controls "Nets/Ground" visible]
gui::set_display_controls "Nets/Power" visible [expr !$pwr_vis]
gui::set_display_controls "Nets/Ground" visible [expr !$gnd_vis]
}
create_toolbar_button -text "Insts" -script {
gui::set_display_controls "Layers/*" visible false
@mattvenn
mattvenn / build.sh
Last active June 25, 2021 21:00
caravel_user_project installation
magic_version=$(magic --version)
if [ $magic_version != 8.3.160 ]; then
echo "magic version too old. either update it or make the pdk with make pdk-nonnative"
exit
fi
git clone git@github.com:efabless/caravel_user_project.git
export PDK_ROOT=$(pwd)/pdk
export OPENLANE_ROOT=$(pwd)/openlane
export OPENLANE_TAG=v0.15
rm -rf $PDK_ROOT
mkdir $PDK_ROOT
cd $PDK_ROOT
git clone https://github.com/google/skywater-pdk.git
cd skywater-pdk/
git submodule update --init libraries/sky130_fd_sc_hd/latest
class CocoSPI()
def __init__(self, dut):
super().__init__()
self.dut = dut
# duplicates the behaviour of real spi driver
async def xfer(self, data):
await ClockCycles(self.dut.clk, SPI_CLOCK_PERIODS)
return_data = [0] * len(data)
@mattvenn
mattvenn / yosys crash
Created November 20, 2019 21:51
yosys crash
ThinkPad:2015 [master]: sby -f challenge.sby
SBY 22:50:38 [challenge] Removing direcory 'challenge'.
SBY 22:50:38 [challenge] Copy 'challenge.v' to 'challenge/src/challenge.v'.
Traceback (most recent call last):
File "/home/matt/symbiotic-20190504A-symbiotic/bin/../libexec/sby", line 388, in <module>
retcode |= run_job(t)
File "/home/matt/symbiotic-20190504A-symbiotic/bin/../libexec/sby", line 346, in run_job
job.run(setupmode)
File "/home/matt/symbiotic-20190504A-symbiotic/bin/../libexec/../share/yosys/python3/sby_core.py", line 598, in run
self.copy_src()
import numpy as np
import matplotlib.pyplot as plt
import glob
Fs = 32000000 / 16 # sampling rate
Ts = 1.0/Fs # sampling interval
def load(filename):
y = []
x = []
#!/usr/bin/python3
import sys
instructions = [ 'Sync', 'Call', 'Return', 'Execute', 'LoadCode', 'LoadCoeff0', 'LoadCoeff1', 'ContinueLoad', 'SetVBP', 'AddVBP', 'SetLBP', 'AddLBP', 'SetSBP', 'AddSBP', 'SetCBP', 'AddCBP', 'Store', 'Store0', 'Store1', '---', 'ReLU', 'ReLU0', 'ReLU1', '---', 'Save', 'Save0', 'Save1', '---', 'LdSet', 'LdSet0', 'LdSet1', '---', 'LdAdd', 'LdAdd0', 'LdAdd1', '---', '---', '---', '---', '---', 'MACC', 'MMAX', 'MACCZ', 'MMAXZ', '---', 'MMAXN' ]
def main(argv0, *args):
fh_in = sys.stdin
fh_out = sys.stdout
# Repeat ...
while True:
ThinkPad:497 [(HEAD detached at 30455092c)]: cmake -L ../../
-- Kicad install dir: </usr/local>
-- Check for installed GLEW -- found
-- Boost version: 1.62.0
-- Check for installed Python Interpreter -- found
-- Python module install path: lib/python2.7/dist-packages
-- wxPython version 3.0 found.
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- WARNING: Doxygen not found - doxygen-docs (Source Docs) target not created
-- S3DSG version: 2.0.0
[ 47%] Building CXX object 3d-viewer/3d_cache/sg/CMakeFiles/kicad_3dsg.dir/scenegraph.cpp.o
/home/matt/kicad-build/kicad/3d-viewer/3d_cache/sg/scenegraph.cpp: In member function ‘bool SCENEGRAPH::Prepare(const dmat4*, S3D::MATLIST&, std::vector<SMESH>&)’:
/home/matt/kicad-build/kicad/3d-viewer/3d_cache/sg/scenegraph.cpp:744:75: error: no matching function for call to ‘rotate(double&, glm::dvec3)’
glm::dmat4 rM = glm::rotate( rotation_angle, glm::dvec3( rX, rY, rZ ) );
^
In file included from /usr/include/glm/gtc/quaternion.hpp:434:0,
from /usr/include/glm/gtc/epsilon.inl:5,
from /home/matt/kicad-build/kicad/3d-viewer/3d_cache/sg/scenegraph.cpp:29:
/usr/include/glm/gtc/quaternion.inl:557:33: note: candidate: template<class T, glm::qualifier Q> glm::tquat<T, Q> glm::rotate(const glm::tquat<T, Q>&, const T&, const glm::vec<3, T, Q>&)
GLM_FUNC_QUALIFIER tquat<T, Q> rotate(tquat<T, Q> const& q, T con
@mattvenn
mattvenn / gist:2aa864092b7ea2105d8d8b764ed3c4d0
Created May 19, 2018 10:39
ubuntu kicad 18.04 LTS install notes
mkdir kicad-build
cd kicad-build
git clone -b master https://git.launchpad.net/kicad
cd kicad/
git checkout 3045509
mkdir -p build/release
cd build/release/
sudo apt install cmake
sudo apt install build-essential