Skip to content

Instantly share code, notes, and snippets.

Avatar

Sam Collinson scollinson

View GitHub Profile
View setup_usb.sh
#!/bin/bash
sed /mnt/scratch/xilinx/14.5/ISE_DS/common/bin/lin64/xusbdfwu.rules -e 's:BUS=="usb", ::g' -e 's:SYSFS:ATTRS:g' -e 's:TEMPNODE:tempnode:g' > /etc/udev/rules.d/xusbdfwu.rules
cp /mnt/scratch/xilinx/14.5/ISE_DS/common/bin/lin64/xusb*.hex /usr/share/
service udev restart
@scollinson
scollinson / gist:10705300
Last active Aug 29, 2015
dual data rate register
View gist:10705300
if rising_edge(clk) then
q <= d1;
elsif falling_edge(clk) then
q <= d2;
end if;
View valid_store.vhd
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.std_logic_unsigned.all;
library unisim;
use unisim.vcomponents.all;
entity valid_store is
port (
View keybase.md

Keybase proof

I hereby claim:

  • I am scollinson on github.
  • I am scollinson (https://keybase.io/scollinson) on keybase.
  • I have a public key whose fingerprint is 8949 587C 2DD3 896D 2B81 1652 C533 09CD FDA9 9E56

To claim this, I am signing this object:

@scollinson
scollinson / gist:8553582
Last active Jan 4, 2016
for a given maximum comparator width, determine a list of comparator stages
View gist:8553582
MAX_COMPARATOR_WIDTH = 24
def stages(n, max_width=MAX_COMPARATOR_WIDTH):
s = []
while n > 1:
q = n // max_width
r = n % max_width
s.append([max_width]*q + [r])
View gist:5809711
end if;
end if;
end case;
end case;
end if;
end if;
end process;
View gist:5746959
dq, tap_cnt
0 13
1 13
2 13
3 13
4 13
5 24
6 13
7 13
8 13
View gist:5745419
dq, tap_cnt
0 0
1 10
2 0
3 0
4 0
5 11
6 0
7 0
8 0
@scollinson
scollinson / gist:5701772
Created Jun 3, 2013
PCIe Read Requests and Completions
View gist:5701772
# Read requests
# id, length, dw1, dw2
0 128 00000080010000FF 0022A000D0DAD0DA
1 128 00000080010001FF 0022A080D0DAD0DA
2 128 00000080010002FF 0022A100D0DAD0DA
3 128 00000080010003FF 0022A180D0DAD0DA
4 128 00000080010004FF 0022A200D0DAD0DA
5 128 00000080010005FF 0022A280D0DAD0DA
6 128 00000080010006FF 0022A300D0DAD0DA
7 128 00000080010007FF 0022A380D0DAD0DA
@scollinson
scollinson / grabaseat.py
Created Jul 17, 2012
kiwicon grabaseat script
View grabaseat.py
#!/usr/bin/env python
"""
Script to poll grabaseat.co.nz for cheap flights to and from conferences
Written by Sam Collinson (smc@affinity.net.nz) on 19/08/10
** Updated 17/07/12 with new URL
"""
import urllib, urllib2
from datetime import datetime, date
from sys import version_info