This guide was developed with revC1 hardware.


Get Toolchain

# see:

read os <<< "linux"
read arch < <( uname -i )

read url < <(
  curl "" \
    | jq -r \
      --arg os "${os}" \
      --arg arch "${arch}" \
          | select(.name | contains($os + "_" + $arch))
          | select(.name | endswith(".tar.gz"))
          | .browser_download_url

curl -LO "${url}"
tar -xvf "${url##*/}"

export PATH="$(readlink -f ./fpga-toolchain/bin/):${PATH}"

yosys -V
nextpnr-ecp5 -V

udev Rules


You only need to copy 99-cypress.rules if you plan to work with brand new boards, or use the glasgow factory subcommand.

sudo cp -t /etc/udev/rules.d/ ./config/99-cypress.rules ./config/99-glasgow.rules
udevadm control --reload-rules

Virtual Environment

python3 -m venv venv
. venv/bin/activate

Build and Install Glasgow


Allowing nMigen to be installed automatically (as a dependancy) will cause a version conflict on pyvcd... to resolve this, just install nMigen explicitly first

cd ./software/
python3 sdist

pip install nmigen
pip install ./dist/glasgow-*.tar.gz

Factory Setup


The --pinmap-straight flag used below depends on commit 6a8befd, which has not yet been merged.


The revC1 design currently has issues with the pins-int test - see #151. As running the other tests will prove this path out anyway, I'm content with skipping it.

glasgow factory --rev C1
glasgow flash

# power cycle the board, or unplug/plug it

# disconnect all pins
glasgow run selftest loopback pins-ext pins-pull

# connect A[0:7] -> B[0:7]
glasgow run selftest pins-loop --pinmap-straight

# connect AV -> AS, BV -> BS
glasgow run selftest voltage


Step 1 (loopback, pins-ext and pins-pull)


Step 2 (pins-loop)


Step 3 (voltage)


Serial Number

The serial number is assigned by glasgow factory, and consists of the board revision and timestamp. For example: C1-20200923T174926Z.


The serial number is not present until the glasgow utility has interacted with the board for the first time. If you see a zero-length serial number, then try running something innocuous like glasgow run selftest loopback.

The serial number can be passed to glasgow using the --serial flag to select a specific board that may be attached to the system.

At present, there is no way to list the boards connected using the glasgow tool, but it is possible to use lsusb, as follows:

lsusb -d 20b7:9db1 -v | sed -rne '/iSerial/{s/^  iSerial +[0-9]+ //g;p}'

I have opened an issue (#206) suggesting that we implement this feature.