Glasgow

This guide was developed with revC1 hardware.

Reference

Get Toolchain

# see: https://github.com/open-tool-forge/fpga-toolchain/releases

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

read url < <(
  curl -L "https://api.github.com/repos/open-tool-forge/fpga-toolchain/releases/latest" \
    | jq -r \
      --arg os "${os}" \
      --arg arch "${arch}" \
      '
        .assets[]
          | 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

Note

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

cd ${GLASGOW_REPO_ROOT}
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

Note

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 ${GLASGOW_REPO_ROOT}
cd ./software/
python3 setup.py sdist

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

Factory Setup

Bug

The revC1 design currently does not work correctly with pins-int, pins-ext or pins-pull, leading to many false-positives.

glasgow factory --rev C1
glasgow flash

# power cycle the board, or unplug/plug it

# disconnect all pins
glasgow run selftest loopback

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

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

Setup

Step 1 (loopback)

floating

Step 2 (pins-loop)

pins-loop

Step 3 (voltage)

voltage

Serial Number

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

Note

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.

Running glasgow list will report a list of all boards attached to the system.

serial