Skip to content

Instantly share code, notes, and snippets.

View shohei's full-sized avatar

Shohei Aoki shohei

View GitHub Profile
@shohei
shohei / FIR Acceleration on PYNQ.ipynb
Created March 22, 2018 07:08 — forked from fpgadeveloper/FIR Acceleration on PYNQ.ipynb
How to accelerate a Python function with PYNQ
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shohei
shohei / simulator.ino
Created December 19, 2017 04:00
Simulation of manage_heater() in Sprinter firmware
#include <stdarg.h>
#define ARDBUFFER 16
int ardprintf(char *str, ...)
{
int i, count=0, j=0, flag=0;
char temp[ARDBUFFER+1];
for(i=0; str[i]!='\0';i++) if(str[i]=='%') count++;
va_list argv;
@shohei
shohei / asm.ino
Created November 13, 2017 13:02
Sprinter inline assembler analysis
// intRes = intIn1 * intIn2 >> 16
// uses:
// r26 to store 0
// r27 to store the byte 1 of the 24 bit result
#define Hoge(intRes, charIn1, intIn2) \
asm volatile ( \
"clr r26 \n\t" \
"mul %A1, %B2 \n\t" \
"movw %A0, r0 \n\t" \
"mul %A1, %A2 \n\t" \
@shohei
shohei / uEnv.txt
Last active November 7, 2017 00:42
Petalinux xapp1078 config file for u-boot
kernel_image=uImage
devicetree_image=system.dtb
netstart=0x10000000
dtbnetstart=0x11800000
bootargs=console=ttyPS0,115200 rw rootwait earlyprintk root=/dev/mmcblk0p2 rootfstype=ext4 maxcpus=1 mem=384M
uenvcmd=mmcinfo && echo bootargs ${bootargs} && fatload mmc 0 ${netstart} ${kernel_image} && fatload mmc 0 ${dtbnetstart} ${devicetree_image} && bootm ${netstart} - ${dtbnetstart}
@shohei
shohei / app.js
Created October 3, 2017 05:36
OSX PS3 controller
var dualShock = require('dualshock-controller');
//pass options to init the controller.
var controller = dualShock(
{
//you can use a ds4 by uncommenting this line.
//config: "dualshock4-generic-driver",
//if the above configuration doesn't work for you,
//try uncommenting the following line instead.
//config: "dualshock4-alternate-driver"
@shohei
shohei / calc
Created September 21, 2017 01:22
calc torqu
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""
Motor torque calculator
Copyright Shokara Inc. 2017
"""
import math
from pylab import *
@shohei
shohei / fpga.csv
Created August 25, 2017 08:52
fpga
Designator Pin Name Net Bus Type Part No. Pin Group
H12 IO_L1N_T0_34 AMUX_S2 I/O 1 IO
G11 IO_L1P_T0_34 AMUX_S1 I/O 1 IO
H13 IO_L2N_T0_34 BDBUS0 I/O 1 IO
G12 IO_L2P_T0_34 AMUX_S0 I/O 1 IO
H14 IO_L3N_T0_DQS_34 BDBUS1 I/O 1 IO
G14 IO_L3P_T0_DQS_PUDC_B_34 FPGA LED I/O 1 IO
K15 IO_L4N_T0_34 BDBUS4 I/O 1 IO
J15 IO_L4P_T0_34 BDBUS2 I/O 1 IO
シーケンスの中の測定器 1 - N6705B - TCPIP0::192.168.0.53::inst0::INSTR
Start Time 2017-07-27 14:03:58.896
Stop Time 2017-07-27 14:03:58.896
Time Step 1 - Set CH1 Current Limit 1 - Set CH2 Priority Mode 1 - Set CH1 On/Off 1 - Set CH2 On/Off 1 - Vs 1 - Sweep CH2 Current Setting Set (Vin) Set (Iin) Set (Vout) Set (Iout) Set (Efficient) 1 - Set CH2 On/Off 1 - Set CH1 On/Off ()
2017-07-27 14:03:59.144 1 0.1
2017-07-27 14:03:59.183 2 Current
2017-07-27 14:03:59.227 3 1
2017-07-27 14:03:59.261 4 1
2017-07-27 14:03:59.817 5 1 -0.001 1.000463 -1.908397E-05 -6.120045 -3.583107E-06 -114.85360621076
シーケンスの中の測定器 1 - N6705B - TCPIP0::192.168.0.53::inst0::INSTR
Start Time 2017-07-27 14:03:58.896
Stop Time 2017-07-27 14:03:58.896
Time Step 1 - Set CH1 Current Limit 1 - Set CH2 Priority Mode 1 - Set CH1 On/Off 1 - Set CH2 On/Off 1 - Vs 1 - Sweep CH2 Current Setting Set (Vin) Set (Iin) Set (Vout) Set (Iout) Set (Efficient) 1 - Set CH2 On/Off 1 - Set CH1 On/Off ()
2017-07-27 14:03:59.144 1 0.1
2017-07-27 14:03:59.183 2 Current
2017-07-27 14:03:59.227 3 1
2017-07-27 14:03:59.261 4 1
2017-07-27 14:03:59.817 5 1 -0.001 1.000463 -1.908397E-05 -6.120045 -3.583107E-06 -114.85360621076
@shohei
shohei / csv.txt
Created July 28, 2017 03:44
test csv
hoge
moge
foo
bar
hogehoge
Source,Target,Type,Id,Weight,Average Degree
1,3,Undirected,1,1.0,1.0
2,10,Undirected,8,1.0,1.0
3,4,Undirected,2,1.0,1.0
4,5,Undirected,3,1.0,1.0