Skip to content

Instantly share code, notes, and snippets.

View mundya's full-sized avatar

Andrew Mundy mundya

View GitHub Profile

Keybase proof

I hereby claim:

  • I am mundya on github.
  • I am mundya (https://keybase.io/mundya) on keybase.
  • I have a public key ASDmd-DSr14q5UZjLQmC2bVFL55ai4irBE19sY57hCuK0go

To claim this, I am signing this object:

import cairocffi as cairo
import collections
from itertools import chain
from nengo_spinnaker.partition import divide_slice
from nengo_spinnaker.utils.itertools import flatten
import numpy as np
import pygraphviz as pgv
import random
from rig.machine import Cores, Machine
from rig.netlist import Net
"""Implementation of m-Tries for routing table minimisation.
Ahmand, S.; Mahapatra, R., "M-trie: an efficient approach to on-chip logic
minimization," in Computer Aided Design, 2004. ICCAD-2004. IEEE/ACM
International Conference on , vol., no., pp.428-435, 7-11 Nov. 2004
"""
from collections import defaultdict
from rig.routing_table import RoutingTableEntry
from six import iteritems
import sys
@mundya
mundya / basic-presentation-1.tex
Last active January 2, 2016 23:09
Introductory presentation for the (unofficial) University of Manchester Beamer theme.
%% Declare the document type
%% `t` means "align content to the top of the slide"
\documentclass[t]{beamer}
%% Include the theme
\usetheme{UniversityOfManchester}
%% Set some document properties
\title{Saluto Mondo}
\subtitle{New Beamer Theme}
@mundya
mundya / decoders-sigmoids.ipynb
Last active December 30, 2015 11:09
An attempt to build a working NEF example from scratch. Currently only for 1 dimension, but will work on `n` dimensions as soon as possible.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mundya
mundya / inspinnuator.py
Last active December 29, 2015 03:09
InSpiNNuator - Pretend to be a SpiNNaker board transmitting UDP packets to a host. Packets resemble those produced by io_printf.
import random, struct, socket, time
def generate_packet( data ):
"""Generates a random SpiNNaker UDP Packet with a random
chip x, y and core (taken from some sensible range)."""
# Pick x, y, core
x = random.randint( 0, 4 )
y = random.randint( 0, 4 )
core = random.randint( 0, 17 )
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// Generated by CoffeeScript 1.9.3
var _chip_xy, draw_machine;
_chip_xy = function(chip_spacing, machine_height, x, y) {
y = machine_height - y - 1;
x *= 1.0 + chip_spacing;
y *= 1.0 + chip_spacing;
x += y * Math.sin(Math.PI / 6.0);
y *= Math.cos(Math.PI / 6.0);
return [x, y];
import argparse
from rig.machine_control import MachineController
import sys
def count_dropped_mc(hostname):
"""Retrieve a count of the dropped packets on a given SpiNNaker machine."""
# Construct a controller for the machine
mc = MachineController(hostname)
"""Frequency masking experiment for COMP28512.
(C) University of Manchester 2015
Author: Andrew Mundy
"""
from __future__ import print_function
import comp28512_utils
from IPython import display
from matplotlib import pyplot as plt
import numpy as np