artiq/README_PHASER.rst

118 lines
6.1 KiB
ReStructuredText
Raw Normal View History

2016-10-06 01:24:34 +08:00
ARTIQ Phaser
============
2016-12-07 03:22:47 +08:00
This ARTIQ branch contains a proof-of-concept design of a GHz-datarate, multi-channel, interpolating, multi-tone, direct digital synthesizer (DDS) compatible with ARTIQ's RTIO channels.
Ultimately it will be the basis for the ARTIQ Sayma Smart Arbitrary Waveform Generator project. See https://github.com/m-labs/sinara and https://github.com/m-labs/artiq-hardware.
2016-10-06 01:24:34 +08:00
2016-10-12 22:00:46 +08:00
*Features*:
2016-10-06 01:24:34 +08:00
2016-11-21 23:58:07 +08:00
* up to 4 channels
* up to 500 MHz data rate per channel (KC705 limitation)
* up to 8x interpolation to 2.4 GHz DAC sample rate
2016-12-07 03:22:47 +08:00
* Real-time sample-coherent control over amplitude, frequency, phase of each channel through ARTIQ RTIO commands
2016-10-12 22:00:46 +08:00
* Full configurability of the AD9154 and AD9516 through SPI with ARTIQ kernel support
2016-10-06 01:25:53 +08:00
* All SPI registers and register bits exposed as human readable names
* Parametrized JESD204B core (also capable of operation with eight lanes)
2016-10-12 22:00:46 +08:00
* The code can be reconfigured. Possible example configurations are: support 2 channels at 1 GHz datarate, support 4 channels at 300 MHz data rate, no interpolation, and using mix mode to stress the second and third Nyquist zones (150-300 MHz and 300-450 MHz).
2016-11-21 23:58:07 +08:00
The hardware required to use the ARTIQ phaser branch is a KC705 with an AD9154-FMC-EBZ plugged into the HPC connector and a low-noise sample rate reference clock.
2016-10-06 01:24:34 +08:00
2016-12-07 03:22:47 +08:00
This work was supported by the Army Research Lab and the University of Maryland.
2016-10-06 01:24:34 +08:00
2016-10-12 22:00:46 +08:00
The code that was developed for this project is located in several repositories:
2016-10-06 01:24:34 +08:00
2016-12-07 03:22:47 +08:00
* In ARTIQ, the SAWG and Phaser code: https://github.com/m-labs/artiq/compare/phaser2
* The Migen/MiSoC JESD204B core: https://github.com/m-labs/jesd204b
2016-10-06 01:25:53 +08:00
2016-10-06 01:24:34 +08:00
Installation
------------
These installation instructions are a short form of those in the ARTIQ manual.
2016-10-12 22:00:46 +08:00
Please refer to and follow the ARTIQ manual for more details:
2016-12-07 03:22:47 +08:00
https://m-labs.hk/artiq/manual-master/index.html
2016-10-06 01:24:34 +08:00
* Set up a new conda environment and activate it.
* Install the standard ARTIQ runtime/install dependencies.
See ``conda/artiq/meta.yaml`` for a list.
They are all packaged as conda packages in ``m-labs/main``.
* Install the standard ARTIQ build dependencies.
2016-10-12 22:32:19 +08:00
They are all available as conda packages in m-labs/main or m-labs/dev for linux-64:
2016-10-06 01:24:34 +08:00
2016-12-07 03:22:47 +08:00
- migen
- misoc
- jesd204b
- llvm-or1k
2016-10-06 01:24:34 +08:00
- rust-core-or1k
- cargo
2016-12-07 03:22:47 +08:00
- binutils-or1k-linux
2016-10-06 01:24:34 +08:00
2016-10-12 22:00:46 +08:00
* Install a recent version of Vivado (tested and developed with 2016.2).
2016-12-07 03:22:47 +08:00
* Do a checkout of the ARTIQ phaser2 branch: ::
2016-10-06 01:24:34 +08:00
2016-10-12 22:00:46 +08:00
mkdir ~/src
cd ~/src
2016-12-07 03:22:47 +08:00
git clone --recursive -b phaser2 https://github.com/m-labs/artiq.git
2016-10-12 22:00:46 +08:00
cd ../artiq
python setup.py develop
2016-10-06 01:24:34 +08:00
Setup
-----
2016-10-12 22:00:46 +08:00
* Setup the KC705 (jumpers, etc.) observing the ARTIQ manual.
VADJ does not need to be changed.
2016-10-06 01:24:34 +08:00
* On the AD9154-FMC-EBZ put jumpers:
- on XP1, between pin 5 and 6 (will keep the PIC in reset)
- on JP3 (will force output enable on FXLA108)
2016-10-06 01:25:53 +08:00
* Compile the ARTIQ Phaser bitstream, bios, and runtime (c.f. ARTIQ manual): ::
2016-12-07 03:22:47 +08:00
python -m artiq.gateware.targets.phaser
2016-10-06 01:24:34 +08:00
2016-12-07 03:22:47 +08:00
* Generate an ARTIQ configuration flash image with MAC and IP address (see the
documentation for ``artiq_mkfs``). Name it ``phaser_config.bin``.
2016-10-12 22:32:19 +08:00
* Run the following OpenOCD command to flash the ARTIQ phaser design: ::
2016-10-12 22:00:46 +08:00
2016-12-07 03:22:47 +08:00
openocd -f board/kc705.cfg -c "init; jtagspi_init 0 bscan_spi_xc7k325t.bit; jtagspi_program misoc_phaser_kc705/gateware/top.bin 0x000000; jtagspi_program misoc_phaser_kc705/software/bios/bios.bin 0xaf0000; jtagspi_program misoc_phaser_kc705/software/runtime/runtime.fbi 0xb00000;jtagspi_program phaser_config.bin 0xb80000; xc7_program xc7.tap; exit"
2016-10-12 22:00:46 +08:00
The proxy bitstream ``bscan_spi_xc7k325t.bit`` can be found at https://github.com/jordens/bscan_spi_bitstreams or in any ARTIQ conda package for the KC705.
See the source code of ``artiq_flash.py`` from ARTIQ for more details.
2016-10-06 01:25:53 +08:00
2016-10-12 22:00:46 +08:00
If you are using the OpenOCD Conda package:
2016-10-06 01:24:34 +08:00
2016-10-12 22:00:46 +08:00
* locate the OpenOCD scripts directory with: ``python3 -c "import artiq.frontend.artiq_flash as af; print(af.scripts_path)"``
* add ``-s <scripts directory>`` to the OpenOCD command line.
2016-10-06 01:24:34 +08:00
* Refer to the ARTIQ documentation to configure an IP address and other settings for the transmitter device.
If the board was running stock ARTIQ before, the settings will be kept.
2016-11-21 23:58:07 +08:00
* A 300 MHz clock of roughly 10 dBm (0.2 to 3.4 V peak-to-peak into 50 Ohm) must be connected to the AD9154-FMC-EBZ J1.
2016-12-07 03:22:47 +08:00
The external RTIO clock, DAC deviceclock, FPGA deviceclock, and SYSREF are derived from this signal. There is no internal RTIO clock.
2016-10-14 19:21:54 +08:00
* An example device database, several status and test scripts are provided in ``artiq/examples/phaser/``. ::
cd artiq/examples/phaser
* Edit ``device_db.pyon`` to match the hostname or IP address of the core device.
2016-10-06 01:24:34 +08:00
* The ``startup_clock`` needs to be set to internal (``i``) for bootstrapping the clock distribution tree.
* Compile and flash the startup kernel in ``artiq/examples/phaser/startup_kernel.py``.
2016-10-14 19:21:54 +08:00
* Erase any possible idle kernels.
* Use ``ping`` and ``flterm`` to verify that the core device starts up and boots correctly.
2016-10-06 01:24:34 +08:00
Usage
-----
2016-10-12 22:00:46 +08:00
* After each boot, run the ``dac_setup.py`` experiment to establish the JESD204B links (``artiq_run repository/dac_setup.py``).
2016-10-14 19:21:54 +08:00
* Run ``artiq_run repository/ad9154_test_status.py`` to retrieve and print several status registers from the AD9154 DAC.
* Run ``artiq_run repository/ad9154_test_prbs.py`` to test the JESD204B PHY layer for bit errors. Reboot the core device afterwards.
* Run ``artiq_run repository/ad9154_test_stpl.py`` to executes a JESD204B short transport layer test.
* Run ``artiq_run repository/demo.py`` for an example that exercises several different use cases of synchronized phase, amplitude, and frequency updates.
for an example that exercises several different use cases of synchronized phase, amplitude, and frequency updates.
2016-12-07 03:22:47 +08:00
* Run ``artiq_run repository/demo_2tone.py`` for an example that emits a shaped two-tone pulse.
2016-10-06 01:24:34 +08:00
* Implement your own experiments using the SAWG channels.
2016-11-21 23:58:07 +08:00
* Verify clock stability between the sample rate reference clock and the DAC outputs.
2016-10-06 01:24:34 +08:00
* Changes to the AD9154 configuration can also be performed at runtime in experiments.
2016-10-12 22:00:46 +08:00
See the example ``dac_setup.py``.
2016-10-06 01:24:34 +08:00
This can e.g. be used to enable and evaluate mix mode without having to change any other code (bitstream/bios/runtime/startup_kernel).