Skip to content

Instantly share code, notes, and snippets.

View dadeba's full-sized avatar

N.Nakasato dadeba

  • University of Aizu
  • Japan
View GitHub Profile
@dadeba
dadeba / lfc-pynq.dts
Created August 28, 2018 14:26
FPGA Overlay DTS file for the PYNQ-BNN MNIST example
/dts-v1/;
/ {
fragment@0 {
target-path = "/amba/fpga-region0";
#address-cells = <0x1>;
#size-cells = <0x1>;
__overlay__ {
#address-cells = <0x1>;
#size-cells = <0x1>;
@dadeba
dadeba / bnn_pynq.py
Created August 28, 2018 14:23
A python implementation for the PYNQ-BNN MNIST example
import numpy as np
from udmabuf import Udmabuf
from uio import Uio
import os
import struct
import math
# set path to the BNN-PYQN repo.
BNN_PYNQ_ROOT = '.'
PARAM = 'bnn/params/mnist'
@dadeba
dadeba / pipeline_top.vhd
Created March 28, 2018 20:31
VHDL FP32
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity pipeline_top is
port (
xi : in std_logic_vector(31 downto 0);
yi : in std_logic_vector(31 downto 0);
@dadeba
dadeba / g5.q
Last active March 22, 2018 21:13
pipeline description
/VARI xi, yi, zi, e2;
/VARJ xj, yj, zj, mj;
/VARF ax, ay, az, ap;
dx = xj - xi;
dy = yj - yi;
dz = zj - zi;
r2 = dx*dx + dy*dy + dz*dz + e2;
r1i = powm12(r2);
r2i = r1i*r1i;
r1im = mj*r1i;
@dadeba
dadeba / sph1.q
Created March 20, 2018 19:49
input
/VARI xi, yi, zi, vxi, vyi, vzi, hi;
/VARJ xj, yj, zj, vxj, vyj, vzj, hj, mj;
/VARF rho, rox, roy, roz, dd;
dx = xi - xj;
dy = yi - yj;
dz = zi - zj;
r2 = dx*dx + dy*dy + dz*dz;
r1 = sqrt(r2);
import math as math
import numpy as np
from chainer import Function, FunctionSet, gradient_check, Variable, optimizers
import chainer.functions as F
model = FunctionSet(
l1 = F.Linear(1, 10),
l3 = F.Linear(10, 1),
)
@dadeba
dadeba / timings-mpfr-cycles.c
Created January 21, 2015 09:06
Timing MPFR...
/* timings-mpfr - program to measure the efficiency of GNU MPFR
Copyright 2001, 2010, 2011 Free Software Foundation, Inc.
Copyright 2001 Norbert Mueller (Univ. Trier, Germany).
Contributed by the Arenaire and Caramel projects, INRIA.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
@dadeba
dadeba / log.haswell.gt3.txt
Last active August 29, 2015 14:10
OpenCL info for beignet 1.0
Number of platforms: 1
Platform Profile: FULL_PROFILE
Platform Version: OpenCL 1.2 beignet 1.0 (git-23497c6)
Platform Name: Intel Gen OCL Driver
Platform Vendor: Intel
Platform Extensions: cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_icd
Platform Name: Intel Gen OCL Driver
Number of devices: 1
@dadeba
dadeba / Makefile
Last active August 29, 2015 14:08
Makefile for a new Chisel project
SBT ?= sbt
SBT_FLAGS ?= -Dsbt.log.noformat=true
.SHELLFLAGS := -e -o pipefail
# If a chiselVersion is defined, use that.
ifneq (,$(chiselVersion))
CHISEL_SMOKE_VERSION := $(chiselVersion)
CHISEL_CHECK_VERSION := $(chiselVersion)
CHISEL_DEFAULT_VERSION := $(chiselVersion)
scalaVersion := "2.10.2"
resolvers ++= Seq(
"scct-github-repository" at "http://mtkopone.github.com/scct/maven-repo"
)
scalacOptions ++= Seq("-deprecation", "-feature", "-unchecked", "-language:reflectiveCalls")
val chiselVersion_h = System.getProperty("chiselVersion", "latest.release")