Skip to content

Instantly share code, notes, and snippets.

View buttercutter's full-sized avatar

Phung Cheng Fei buttercutter

View GitHub Profile
@buttercutter
buttercutter / tx_port_writer.v
Created September 7, 2018 06:47
Modified full duplex tx_port_writer.v
// ----------------------------------------------------------------------
// Copyright (c) 2016, The Regents of the University of California All
// rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// ----------------------------------------------------------------------
// Copyright (c) 2016, The Regents of the University of California All
// rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
# Maintainer: promach
_gitname=sentencepiece
pkgname=${_gitname}-git
pkgver=r288.df2c033
pkgrel=1
pkgdesc="SentencePiece is an unsupervised text tokenizer and detokenizer mainly for Neural Network-based text generation systems where the vocabulary size is predetermined prior to the neural model training."
arch=('x86_64')
url="https://github.com/google/sentencepiece.git"
license=('GPL')
depends=('autoconf' 'automake' 'libtool' 'pkg-config' 'protobuf')
@buttercutter
buttercutter / async_fifo.sby
Created July 12, 2018 01:25
Formal verification of asynchronous FIFO using yosys-smtbmc
[options]
mode prove
depth 2
multiclock on
[engines]
smtbmc yices
# smtbmc boolector
# abc pdr
# aiger avy
@buttercutter
buttercutter / riffa_full_duplex.gtkw
Last active August 6, 2018 12:42
ILA waveforms for https://github.com/promach/riffa/tree/development Remember to Edit->Toggle Trace Hier
[*]
[*] GTKWave Analyzer v3.3.86 (w)1999-2017 BSI
[*] Mon Aug 6 12:39:05 2018
[*]
[dumpfile] "/home/phung/Documents/fpga_overlay/riffa/fpga/altera/de4/DE4Gen2x8If128/prj/riffa_full_duplex_not_working.vcd"
[dumpfile_mtime] "Fri Aug 3 10:48:16 2018"
[dumpfile_size] 753880
[savefile] "/home/phung/Documents/fpga_overlay/riffa/fpga/altera/de4/DE4Gen2x8If128/prj/riffa_full_duplex_not_working.gtkw"
[timestart] 0
[size] 1920 1115
@buttercutter
buttercutter / inv.net
Last active July 7, 2018 16:02
Test circuit for measuring output impedance of CMOS inverter
*CMOS inverter https://electronics.stackexchange.com/questions/383552/measurement-of-output-impedance-of-a-cmos-inverter
.PARAM V_SUPPLY = 3.3
.PARAM V_OUT = 2
*.PARAM INP_FREQ = '#INP_FREQ#'
*.PARAM INP_PERIOD = '1/INP_FREQ'
*.PARAM NO_PERIODS = '4'
*.PARAM TMEAS_START = '(NO_PERIODS-1)*INP_PERIOD'
*.PARAM TMEAS_STOP = '(NO_PERIODS)*INP_PERIOD'
.PARAM AC_POINTS = 10
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@buttercutter
buttercutter / filter.c
Created June 19, 2018 04:53
filter.c sobel filter code for MXP
#include "vbx.h"
void filter(uint8_t* in_vid,uint8_t* out_vid,int rows, int cols,int pitch){
int rowlen=cols;
// save scratchpad allocator state
vbx_sp_push();
vbx_ubyte_t* line_in= vbx_sp_malloc(rowlen*3);
vbx_word_t* v_tmp0=vbx_sp_malloc(rowlen*sizeof(vbx_word_t));
vbx_word_t* v_tmp1=vbx_sp_malloc(rowlen*sizeof(vbx_word_t));
# Maintainer: promach
_gitname=SymbiYosys
pkgname=${_gitname}-git
pkgver=r114.983f066
pkgrel=1
pkgdesc="SymbiYosys (sby) is a front-end driver program for Yosys-based formal hardware verification flows"
arch=('x86_64')
url="https://github.com/cliffordwolf/SymbiYosys.git"
license=('GPL')
depends=('yosys')
@buttercutter
buttercutter / mxp_filters.ipynb
Last active June 20, 2018 02:48
Python code for Vector Processor MXP. See https://github.com/Xilinx/PYNQ/issues/641
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.