Skip to content

Instantly share code, notes, and snippets.

View likewise's full-sized avatar

Leon Woestenberg likewise

View GitHub Profile
@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 / 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
@likewise
likewise / reset_roulette_sync_async.sv
Created May 27, 2018 23:00 — forked from chiggs/reset_roulette_sync_async.sv
Abstract away synchronous or asynchronous resets
`ifdef ARCH_RESET_IS_SYNCHRONOUS
`define CLOCKED_PROCESS(_clk, _reset) always_ff @(posedge _clk)
`elsif ARCH_RESET_IS_ASYNCHRONOUS
`define CLOCKED_PROCESS(_clk, _reset) always_ff @(posedge _clk or `_RESET_EVENT(_reset))
`endif