Designing a RISC-V CPU, Part 2: Successfully executing (some) instructions

The previous instalment of this series was "basically an explanation of what FPGAs are and a 'hello world' nMigen example."1 In this post, I will be detailing the design of my CPU as it currently stands, and going over the various mistakes I made along the way. As with …

Continue reading »

Designing a RISC-V CPU, Part 1: Learning hardware design as a software engineer

I have no experience in digital logic design. That is, I didn't until I recently decided that I would like to try designing my own CPU and running it on an FPGA! If you too are a software engineer with a vague interest in hardware design, I hope this series …

Continue reading »

Why can't I pass std::vector<Child*> as std::vector<Parent*>?

Introduction

This is a short post reflecting on some pretty basic C++ that bothered me because I felt like I didn't fully understand it. I felt that the language should be able to do more, and wanted to understand why it could not.

Subtype polymorphism and templates

In C++, subtype …

Continue reading »

Emulating an STM32F4 in QEMU to test ARM assembly

I recently published a blog post titled How to flash an LED about writing ARM assembly for an STM32. I was running my code on a 1bitsy development board, but I wanted anyone to be able to have a go at writing the assembly and testing it – even if they …

Continue reading »

How to flash an LED

Today we are going to be learning how to flash an LED on a microcontroller by writing ARM assembly.

If you write software but are unfamiliar with basic electronics or embedded software development, there will be explanations of some fundamentals – I expect you will not feel left behind :).

If you'd …

Continue reading »

Let's break CPython together, for fun and mischief

I promise that nothing we do here will be useful.

But I promise it will be entertaining, and (hopefully) educational:

  • if you don't know anything about the CPython internals, you're about to learn (a bit)

  • if you do know about the CPython internals, you're hopefully about to learn some new …

Continue reading »

C++ is not a superset of C

If you're not familiar with both languages, you might have heard people say that C++ is a superset of C. If you're experienced in both languages, you'll know that this is not true at all.

Of course, C++ has many features that C does not; but there are also a …

Continue reading »

C++20 concepts are not like Rust traits

At writing, Rust's Wikipedia currently says the following:

Functions can be given generic parameters, which usually require the generic type to implement a certain trait or traits. Within such a function, the generic value can only be used through those traits. This means that a generic function can be type-checked …

Continue reading »

Rust: a future for real-time and safety-critical software without C or C++

Overview

Rust is a fairly new programming language that I'm really excited about. I gave a talk about it to my coworkers, primarily aimed at C++ programmers. This is that talk translated to a blog post. I hope you will be excited about Rust too by the end of this …

Continue reading »

Making things at the Cambridge Makespace

I joined the Cambridge Makespace, my local community workshop, earlier this year. I've made a few nice simple things on a laser cutter since, and wanted to share a couple of my favourites.

I've been trained on a 3D printer and the CNC router and look forward to using those …

Continue reading »

LED Hackers jacket for EMF camp

Hack the Planet!

The 1995 film Hackers is probably my favourite film. It is so much fun: I love the outrageous fashion, the rollerblading, the unabashed cheesiness. It represents a more hopeful time I wish to embody. This write up of it says all I could hope to, and says …

Continue reading »

Property based testing

The following is a rough transcript of a talk I did for my colleagues at PA on property based testing. You can find more materials here at the Github repo.

Introduction

As software engineers and programmers, we all know the value of writing automated tests for our code. Many of …

Continue reading »

Making an automatic chord recogniser

I've started working on an automatic chord recogniser for audio. It's something I've wanted to try out for a while but hadn't found the time until recently! It seems like a neat project :) I'm still in the beginnings, but I'm going to talk about what I have so far.

Continue reading »

All things wooden wonderful

I haven't posted on my blog in ages! I just changed themes to the lovely Pelican Hyde, and thought it was time to update the content, too.

I made some exciting wooden things around Christmas time – or rather, I embellished one and designed another. Both were presents for others, and …

Continue reading »

The Desk

The finished
desk

A few months ago I bought a desk. It was the end of a long and consuming search to find one I liked that would fit in the 105cm wide alcove in my living room.

A combination of things meant I decided it would be a good idea to refinish …

Continue reading »