Skip to content

Instantly share code, notes, and snippets.

(venv) # Exit:0 2023-03-12 16:59:27 [r2q2@Reformer#[:~/opt/llama.cpp]
$(: !605 ) ./main -m ./models/65B/ggml-model-q4_0.bin -t 8 -n 128
main: seed = 1678658429
llama_model_load: loading model from './models/65B/ggml-model-q4_0.bin' - please wait ...
llama_model_load: n_vocab = 32000
llama_model_load: n_ctx = 512
llama_model_load: n_embd = 8192
llama_model_load: n_mult = 256
llama_model_load: n_head = 64
llama_model_load: n_layer = 80
@ECP5-PCIe
ECP5-PCIe / fabrictdc.py
Created January 16, 2022 04:40
Time to digital test
# Based on https://gist.github.com/newhouseb/784cc0c24f8681c3224c15758be5d1b8
# Connect serial monitor with 115200 baud over the FTDI (might require fixing the FTDI with https://github.com/trabucayre/fixFT2232_ecp5evn)
# WARNING: Maybe this might damage your FPGA (this one seems fine, even after running at 1+ GHz for extended time periods)
# Code for ECP5 EVN board
from amaranth import *
from amaranth.build import *
from amaranth.lib.coding import Decoder
from amaranth_boards import ecp5_5g_evn as FPGA
from amaranth_stdio.serial import AsyncSerial
@buttercutter
buttercutter / ddr3_memory_controller.sby
Last active February 12, 2022 03:15
A simple DDR3 memory controller
[tasks]
proof
cover
[options]
proof: mode prove
proof: depth 10
cover: mode cover
cover: depth 40
@progrium
progrium / README.md
Last active July 3, 2024 07:19
Setting up M1 Macs for x86 development with Homebrew

Key Points

  • In general, binaries built just for x86 architecture will automatically be run in x86 mode
  • You can force apps in Rosetta 2 / x86 mode by right-clicking app, click Get Info, check "Open using Rosetta"
  • You can force command-line apps by prefixing with arch -x86_64, for example arch -x86_64 go
  • Running a shell in this mode means you don't have to prefix commands: arch -x86_64 zsh then go or whatever
  • Don't just immediately install Homebrew as usual. It should most likely be installed in x86 mode.

Homebrew

Not all toolchains and libraries properly support M1 arm64 chips just yet. Although

@walkermalling
walkermalling / luks-encrypted-root-on-nixos.org
Last active July 16, 2024 10:59
Nix Setup with LUKS encrypted root

Setting up NixOs with LUKS encrypted root

Here are my working notes on getting a system up and running.

WARNING: You can run into a hidden problem that will prevent a correct partition setup and /etc/nixos/configuration.nix from working: if you are setting up a UEFI system, then you need to make sure you boot into the NixOS installation from the UEFI partition of the bootable media. You may have to enter your BIOS boot selection menu to verify this. For example, if you setup a NixOS installer image on a flash drive, your BIOS menu may display several boot options from that flash drive: choose the one explicitly labeled with “UEFI”.

References

I used these resources:

@pcornier
pcornier / dump.py
Created February 8, 2019 13:14
Signals in jupyter notebook
from IPython.display import HTML
from Verilog_VCD import Verilog_VCD as vcd
dump = vcd.parse_vcd('./dump.vcd')
# make some signals more readable
resolvers = {
'ir': lambda v: opc._fields[int(v,2)] if len(opc)>=int(v,2) else str(hex(int(v,2))),
'cyc': lambda v: (['F1','F2','D','E','M1','M2'][int(v,2)],['#faa','#faa','#aaf','#faf','#0f0','#0f0'][int(v,2)])
}
FROM resin/odroid-xu4-ubuntu:xenial as pybombs-slim
RUN [ "cross-build-start" ]
# Set prefix variables
ENV PyBOMBS_prefix skyscraper
ENV PyBOMBS_init /usr/local
# Update apt-get and install some dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \