Skip to content

Instantly share code, notes, and snippets.

View dvtalk's full-sized avatar
🎯
Focusing

dvtalk dvtalk

🎯
Focusing
View GitHub Profile
@dvtalk
dvtalk / vimsend.zsh
Last active August 15, 2020 04:38
Use when inside vim terminal, zsh function to send file from vim terminal to open in current vim.
function vimsend() {
local path=""
if [ -e ./$1 ]; then
path="$PWD/${1}"
echo "$path"
elif [ -e $1 ]; then
path=$1
echo "$path"
else
echo "Oops, file not found yo!! $1"
@dvtalk
dvtalk / uvm_regular_expression.md
Last active October 10, 2024 04:11
uvm regular expression

Sometimes an expression syntax that is easy to read and easy to write is useful, even ifthe syntax is not as expressive as the full power of posix regular expressions. A popularsubstitute for regular expressions is globs. A glob is a simplified regular expression. Itonly has three metacharacters -- *, +, and ?. Character ranges are not allowed anddots are not a metacharacter in globs as they are in regular expressions. The followingtable shows glob metacharacters.

UVM 1.1 Class Reference 142 UVM html 1.2 https://verificationacademy.com/verification-methodology-reference/uvm/docs_1.2/html/index.html Check "uvm_resource" page

UVM cookbook 2018 page 30

#!/bin/bash
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/wtfpl/COPYING for more details.
for fgbg in 38 48 ; do # Foreground / Background
for color in {0..255} ; do # Colors
"
"
" β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
" β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€β–€β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–€β–€β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
" β–ˆβ–ˆβ–ˆβ–ˆβ–€β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–€β–ˆβ–ˆβ–ˆβ–ˆ
" β–ˆβ–ˆβ–ˆβ”‚β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β”‚β–ˆβ–ˆβ–ˆ
" β–ˆβ–ˆβ–Œβ”‚β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β”‚β–β–ˆβ–ˆ
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
export PATH="/home/hungvn/local/bin:$PATH"
# Path to your oh-my-zsh installation.
export ZSH="/home/hungvn/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
#set-environment -g PATH ""
set -g prefix M-Space
set-window-option -g mode-keys vi
set -g default-terminal "xterm-256color"
set-window-option -g aggressive-resize on
setw -g window-status-activity-style none
setw -g window-status-bell-style none
set-option -g status-position top
"
" β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
" β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€β–€β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–€β–€β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
" β–ˆβ–ˆβ–ˆβ–ˆβ–€β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–€β–ˆβ–ˆβ–ˆβ–ˆ
" β–ˆβ–ˆβ–ˆβ”‚β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β”‚β–ˆβ–ˆβ–ˆ
" β–ˆβ–ˆβ–Œβ”‚β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β”‚β–β–ˆβ–ˆ
" β–ˆβ–ˆβ–‘β””β”β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β”Œβ”˜β–‘β–ˆβ–ˆ
" β–ˆβ–ˆβ–‘β–‘β””β”β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β”Œβ”˜β–‘β–‘β–ˆβ–ˆ
" β–ˆβ–ˆβ–‘β–‘β”Œβ”˜β–„β–„β–„β–„β–„β–‘β–‘β–‘β–‘β–‘β–„β–„β–„β–„β–„β””β”β–‘β–‘β–ˆβ–ˆ
" β–ˆβ–ˆβ–Œβ–‘β”‚β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œβ–‘β–‘β–‘β–β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ”‚β–‘β–β–ˆβ–ˆ
@dvtalk
dvtalk / vimsend.sh
Last active January 24, 2021 14:19
Use when inside vim terminal, sh script to send file from vim terminal to open in current vim.
#!/bin/sh
pathdir="$( pwd )"
if [ -e ./$1 ]; then
pathdir="${pathdir}/${1}"
elif [ -e $1 ]; then
pathdir=$1
else
pathdir="${pathdir}/${1}"
fi
@dvtalk
dvtalk / aes_sv_c_dpi.c
Last active October 23, 2025 08:49
Example of SystemVerilog DPI-C for AES operation
// https://dvtalk.me/2021/08/29/systemverilog-dpi-example-with-aes-openssl-cmodel/
#include "svdpi.h"
#include "aes.c"
#include <stdint.h>
uint32_t cAesEncrypt(enum AES_OP_MODE svaes_mode,
svOpenArrayHandle svplaintext,
int svplaintext_len,
svOpenArrayHandle svkey,
int svkey_len,
@dvtalk
dvtalk / aes.c
Last active October 23, 2025 08:49
AES encryption/decryption using OpenSSL Library
// https://dvtalk.me/2021/08/29/systemverilog-dpi-example-with-aes-openssl-cmodel/
#ifndef __AES_C__
#define __AES_C__
#include "aes.h"
#include <openssl/conf.h>
#include <openssl/evp.h>
#include <openssl/err.h>
#include <stdio.h>
#include <stdlib.h>