From 440f687bacb974794e6e62f837b9829458a76898 Mon Sep 17 00:00:00 2001 From: mwojcik Date: Mon, 3 Jun 2024 15:55:58 +0800 Subject: [PATCH] clarify Xilinx path, flake --- src/hw/mirny_almazny.md | 49 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/src/hw/mirny_almazny.md b/src/hw/mirny_almazny.md index 6be98bf..a66c16a 100644 --- a/src/hw/mirny_almazny.md +++ b/src/hw/mirny_almazny.md @@ -15,6 +15,49 @@ } ``` +## Building firmware + +Once you get your hands on the firmware, you will need to work around few shortcomings of Nix, mainly not being able to run dynamically linked executables. + +You will need: +- Xilinx ISE 14.7 installed on your system (this guide is assuming ``/opt/Xilinx`` path), +- an environment with Migen. + +One way to do it is to create an FHS environment, like ARTIQ does for Vivado, within ARTIQ's ``flake.nix`` (to leverage Migen already being there), by adding these lines: + +``` +iseEnv = pkgs.buildFHSEnv { + name = "ise-env"; + targetPkgs = vivadoDeps; +}; + +ise = pkgs.buildFHSEnv { + name = "ise"; + targetPkgs = vivadoDeps; + profile = "set -e; source /opt/Xilinx/14.7/ISE_DS/settings64.sh"; + runScript = "ise"; +}; +``` + +Add them below ``vivadoEnv``. Then add ``iseEnv`` and ``ise`` to the dev shell's build inputs. Call ``nix develop`` on that. + +Then you can build Mirny: + +```shell +nix develop +ise-env +cd ../mirny # or wherever your source is at +source /opt/Xilinx/14.7/ISE_DS/settings64.sh +python mirny_impl.py +``` + +### Flashing + +```shell +nix-shell -p xc3sprog +xc3sprog -c jtaghs2 -m /opt/Xilinx/14.7/ISE_DS/ISE/xbr/data -v build/mirny.jed +``` + ## Testing ### Without Almazny @@ -49,7 +92,7 @@ After running `artiq_sinara_test`: ![](../img/mirny_gqrx.png) -### With Almazny +### With Almazny (ARTIQ 7) At first, `artiq_sinara_test` will prompt you for testing Mirnies as the would be without Almazny. After that, it will prompt you with testing the Almazny: @@ -97,4 +140,6 @@ You should also see differences in various modes, but that may require disabling ### Tips -~~Mirnies often fail `ValueError: MUXOUT not high`, in that case restart the tests or reboot the board(s).~~ - fixed in [9569cfb](https://github.com/m-labs/artiq/commit/9569cfb26329c0acdc1705d3256d2506b7bccce5) \ No newline at end of file +~~Mirnies often fail `ValueError: MUXOUT not high`, in that case restart the tests or reboot the board(s).~~ - fixed in [9569cfb](https://github.com/m-labs/artiq/commit/9569cfb26329c0acdc1705d3256d2506b7bccce5) + +For Almazny v1.2+ support, CPLD firmware above 0.3.0 (with fixes) must be flashed onto Mirny. \ No newline at end of file