1
0
Fork 0
ARTIQ Zynq-based core device support
Go to file
pca006132 8923feceac runtime/eh_artiq: use forced unwind
This patches ports the LLVM libunwind newly added forced unwinding
function. This enables us to run forced unwinding to obtain correct
backtrace when uncaught exceptions occur.

This patch also changes the exception handling scheme from the standard
two-phase unwinding to single phase using forced unwinding. This brings
some performance improvement and prepared for later nested exception
support. For nested exceptions, we will have to record the backtrace
regardless if the exception is an uncaught exception, as there can be
another exception being thrown while executing the finally block for
caught exceptions, and we will lose the backtrace if we don't store it
earlier before running the cleanup pads.
2022-01-14 13:35:24 +08:00
examples zc706: updated device_db for tests 2021-10-16 19:01:54 +08:00
src runtime/eh_artiq: use forced unwind 2022-01-14 13:35:24 +08:00
.gitignore move build artifacts out of tree 2020-05-07 13:52:40 +08:00
LICENSE add license 2020-07-20 19:44:45 +08:00
README.md little fixes for README (#157) 2021-12-06 15:20:55 +08:00
default.nix eh_artiq: handle catch clauses appropriately 2022-01-06 13:41:47 +08:00
demo.json add Kasli-SoC demo JSON 2021-02-15 19:51:46 +08:00
kasli-soc-master.json update build scripts for DRTIO 2021-10-08 16:25:13 +08:00
kasli-soc-satellite.json update build scripts for DRTIO 2021-10-08 16:25:13 +08:00
local_run.sh update build scripts for DRTIO 2021-10-08 16:25:13 +08:00
remote_run.sh update build scripts for DRTIO 2021-10-08 16:25:13 +08:00
shell.nix support Kasli-SoC in run scripts 2021-06-25 17:03:55 +08:00
zynq-rs.nix update dependencies 2021-08-09 15:16:54 +08:00

README.md

ARTIQ on Zynq

How to use

  1. Install ARTIQ-6 or newer.
  2. Select the latest successful build on Hydra: https://nixbld.m-labs.hk/jobset/artiq/zynq
  3. Search for the job named <board>-<variant>-sd (for example: zc706-nist_clock-sd or zc706-nist_qc2-sd).
  4. Download the boot.bin "binary distribution" and place it at the root of a FAT-formatted SD card.
  5. Optionally, create a config.txt configuration file at the root of the SD card containing key=value pairs on each line. Use the ip, ip6 and mac keys to respectively set the IPv4, IPv6 and MAC address of the board. Configuring an IPv6 address is entirely optional. If these keys are not found, the firmware will use default values that may or may not be compatible with your network.
  6. Insert the SD card into the board and set up the board to boot from the SD card. For the ZC706, this is achieved by placing the large DIP switch SW11 in the 00110 position.
  7. Power up the board. After the firmware starts successfully, it should respond to ping at its IP addresses, and boot messages can be observed from its UART at 115200bps.
  8. Create and use an ARTIQ device database as usual, but set "target": "cortexa9" in the arguments of the core device.

Configuration

Configuring the device is done using the config.txt text file at the root of the SD card, plus the contents of the config folder. When searching for a configuration key, the firmware first looks for a file named /config/[key].bin and, if it exists, returns the contents of that file. If not, it looks into /config.txt, which contains a list of key=value pairs, one per line. The config folder allows configuration values that consist in binary data, such as the startup kernel.

The following configuration keys are available:

  • mac: Ethernet MAC address.
  • ip: IPv4 address.
  • ip6: IPv6 address.
  • startup: startup kernel in ELF format (as produced by artiq_compile).
  • rtio_clock: source of RTIO clock; valid values are ext0_bypass and int_125.
  • boot: SD card "boot.bin" file, for replacing the boot firmware/gateware. Write only.

Configurations can be read/written/removed via artiq_coremgmt. Config erase is not implemented as it seems not very useful.

Development instructions

Configure Nix channels:

nix-channel --add https://nixbld.m-labs.hk/channel/custom/artiq/fast-beta/artiq-fast
nix-channel --update

Note: if you are using Nix channels the first time, you need to be aware of this bug: https://github.com/NixOS/nix/issues/3831

Pure build with Nix and execution on a remote JTAG server:

nix-build -A zc706-nist_clock-jtag  # or zc706-nist_qc2-jtag or zc706-nist_clock_satellite-jtag etc.
./remote_run.sh

Impure incremental build and execution on a remote JTAG server:

nix-shell
cd src
gateware/zc706.py -g ../build/gateware -v <variant> # build gateware
make GWARGS="-V <variant>" <runtime/satman>    # build firmware
cd ..
./remote_run.sh -i

Notes:

  • This is developed with Nixpkgs 21.051, and the nixbld.m-labs.hk binary substituter can also be used here (see the ARTIQ manual for the public key and instructions).
  • The impure build process is also compatible with non-Nix systems.
  • When calling make, you need to specify both the variant and firmware type.
  • Firmware type must be either runtime for DRTIO-less or DRTIO master variants, or satman for DRTIO satellite.
  • If the board is connected to the local machine, use the local_run.sh script.
  • To update zynq-rs, update the cargo files as per usual for Rust projects, but also keep zynq-rs.nix in sync.

License

Copyright (C) 2019-2021 M-Labs Limited.

ARTIQ is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

ARTIQ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with ARTIQ. If not, see http://www.gnu.org/licenses/.


  1. Thus, on newer version of NixOS, you should run nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/21.05.tar.gz instead ↩︎