Skip to content

Instantly share code, notes, and snippets.

View likewise's full-sized avatar

Leon Woestenberg likewise

View GitHub Profile
@likewise
likewise / 80-myusb.rules
Created August 28, 2025 18:18
How to add senseful names for ttyUSB according to serial number or product description
KERNEL=="ttyUSB[0-9]*",MODE="0666"
KERNEL=="ttyACM[0-9]*",MODE="0666"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", ATTRS{serial}=="887301250090", SYMLINK+="ttyUSB%E{ID_USB_INTERFACE_NUM}-RFSoC4x2", MODE:="0666"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", ATTRS{serial}=="887301250090", ENV{ID_USB_INTERFACE_NUM}=="01", SYMLINK+="ttyRFSoC4x2", MODE:="0666"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", ATTRS{product}=="Lattice HW-USBN-2B Ch", SYMLINK+="ttyUSB%E{ID_USB_INTERFACE_NUM}-Lattice", MODE:="0666"
# You can find the serial number using udevadm info -a /dev/ttyUSBx and selecting the ATTRS{serial} attribute from the output.
@likewise
likewise / gist:116e1cac891cb2e0c633ba72f756a0b2
Created May 14, 2025 10:25
Dell U4323QE control ddcutil
Dell Display Manager replacement
sudo ddcutil detect
sudo ddcutil -l "DELL U4323QE" capabilities
sudo ddcutil -l "DELL U4323QE" vcpinfo 62
# VCP code 62: Audio speaker volume
sudo ddcutil -l "DELL U4323QE" getvcp AUDIO
@likewise
likewise / bp_test.c
Created September 4, 2024 12:29 — forked from jld/bp_test.c
Example of using a perf_event breakpoint counter to crash on write to a specific location.
#include <fcntl.h>
#include <linux/hw_breakpoint.h>
#include <linux/perf_event.h>
#include <signal.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/syscall.h>
#include <sys/types.h>
/*
* SPSC Bounded Queue
* Based on public domain C++ version by mstump[1]. Released under
* the same license terms.
*
* [1] https://github.com/mstump/queues/blob/master/include/spsc-bounded-queue.hpp
*/
#if !defined(__ATOMIC_RELAXED)
@likewise
likewise / modelsim_installation.md
Created August 22, 2021 15:01 — forked from robodhruv/modelsim_installation.md
Sorting ModelSim installation issues

ModelSim Installation issues

Ubuntu 14.xx and above

Ignore this if you have not encountered any issue with the installation and running of ModelSim and Quartus on your system. You are very lucky. (Just Kidding! You have surely had this issue, only sorted.)

Hence assuming you have been following the procedure given in this guide. Most certainly, Quartus will install jsut fine, and so will ModelSim. The issue is in launching due to inappropriate linking etc.

Stage 1

This is the simplest error you would encounter. Navigate to the modelsim_ase folder and run:

@likewise
likewise / parameterize_mark_debug.vhd
Created May 11, 2020 21:11
Parameterize mark_debug from VHDL to SystemVerilog. Tested with Vivado 2019.1
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
-- show how to steer mark_debug from VHDL top to SystemVerilog module
entity top is
generic
(
pENABLE : boolean := false;
pDEBUG : boolean := false
@likewise
likewise / vivado_cleanup.sh
Created February 22, 2020 11:14
Clean up Xilinx Vivado log files
rm vivado{,_[0-9]*}{,.backup}.{jou,log}
@likewise
likewise / make_ipxe_uefi_usb.md
Created March 19, 2019 10:31 — forked from AdrianKoshka/make_ipxe_uefi_usb.md
Making a UEFI bootable iPXE USB drive

Making a UEFI bootable iPXE USB drive

Build the UEFI executable for iPXE

# First we'll clone iPXE
$ git clone git://git.ipxe.org/ipxe.git
# Go into the src directory of the cloned git repo
$ cd ipxe/src
# Compile the UEFI iPXE executable
`CLOCKED_PROCESS(clk, reset) begin
`RESET_CONDITION(reset) begin
state <= 'x;
state.a <= 1'b0;
end else begin
state.a <= data_a;
state.b <= data_b;
end
end
@likewise
likewise / reset_roulette_reset_abstraction.sv
Created May 27, 2018 23:01 — forked from chiggs/reset_roulette_reset_abstraction.sv
Support active high or active low resets
`ifdef ARCH_ACTIVE_HIGH_RESET
`define _RESET_EVENT(_reset) posedge _reset
`define RESET_CONDITION(_reset) if (_reset)
`elsif ARCH_ACIVE_LOW_RESET
`define _RESET_EVENT(_reset) negedge _reset
`define RESET_CONDITION(_reset) if (~_reset)
`endif