Skip to content

Instantly share code, notes, and snippets.

View rafaelnp's full-sized avatar
🔬
NVLLIVS IN VERBA

Rafael Pereira rafaelnp

🔬
NVLLIVS IN VERBA
View GitHub Profile
@rafaelnp
rafaelnp / ftdi_sio.conf
Created May 27, 2023 11:56
Block ftdi_sio so the FPGA boards using FTDI IC can be detected by Vivado
# date: 2023.05.27
# description: Block ftdi_sio, so the FPGA boards using FTDI based ICs can be detected by Vivado
# Linux Kernel: 6.3.4
# Vivado: 2022.2, 2023.1
# Boards: Arty7, Basys3, ZyboZ7-20
#
blacklist ftdi_sio
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.numeric_std_unsigned.all;
library vunit_lib;
context vunit_lib.vunit_context;
context vunit_lib.vc_context;
entity axi_stream_master_min_tb is
@rafaelnp
rafaelnp / fusesoc_examples.md
Last active March 15, 2022 23:50
short description of fusesoc commands

Fusesoc examples

kind of a "crash course" on fusesoc, the usual commands used during a FPGA development cycle. A good starting point is to watch Olof's presentation at Wosh: https://www.youtube.com/watch?v=HOFYplIBSWM

create library (local)

fusesoc library add <library_name>

where can be a local filesystem or a git repository

@rafaelnp
rafaelnp / ring_buffer_tb.vhd
Last active September 16, 2021 15:04
constrained_fifo_vhdlwhiz
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
library vunit_lib;
context vunit_lib.vunit_context;
library osvvm;
use osvvm.RandomPkg.all;
use osvvm.CoveragePkg.all;
@rafaelnp
rafaelnp / open-with-neovim-menu.reg
Last active May 11, 2022 07:24
Open with Neovim context menu
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\Open with Neovim]
@="Open with Neovim"
"Icon"="C:\\tools\\neovim\\nvim-win64\\bin\\nvim-qt.exe"
[HKEY_CLASSES_ROOT\*\shell\Open with Neovim\command]
@="C:\\tools\\neovim\\nvim-win64\\bin\\nvim-qt.exe \"%1\""
@rafaelnp
rafaelnp / numdigit_pwr2.py
Created February 8, 2021 13:41
numbers of digits vs powers of 2
"""
numbers of digits vs powers of 2
--------------------------------
plot (and print) in jupyter number of digits used by every power of 2 twom from 0 to 128, e.g.:
2^16 = 65536 (5 digits)
it is useful when converting binary to BCD (Binary Coded Decimal), often used in FPGA/ASIC
(using double-dabble algorithm) development, to convert a number into a human readable format, e.g.:
@rafaelnp
rafaelnp / git_clone_token.sh
Created June 30, 2020 18:09
Clone git repository using token for http transport
#!/bin/sh
export GIT_USER=my_user
export GIT_TOKEN=my_token
export GIT_REPOSITORY=my_repository
export GIT_SERVER=my_server
git clone https://${GIT_USER}:${GIT_TOKEN}@${GIT_SERVER}/${GIT_REPOSITORY}
@rafaelnp
rafaelnp / vim-plug-install.vim
Created June 12, 2020 12:50
Neovim auto-install vim-plug
" auto-install vim-plug
if empty(glob('~/.config/nvim/autoload/plug.vim'))
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall | source $MYVIMRC
endif
-- get current simulation time
report "current simulation time = " & time'image(now);
-- storing in a variable
variable v_curtime : time := 0 ns;
v_curtime := now;