Compare commits

...

173 Commits

Author SHA1 Message Date
Astro f7dd925234 artiq-fast: do update nixpkgs.nix 2021-03-11 19:12:46 +01:00
Astro bc501c96ab hydra/artiq.json: use my fork, keep only 1 2021-03-11 18:54:20 +01:00
Astro a7ceb26099 Merge branch 'no-stdenv-lib' into astro 2021-03-11 18:54:09 +01:00
Astro 4294277702 Merge branch 'pin-nixpkgs' into astro 2021-03-11 18:53:55 +01:00
Astro e42e87d56b artiq-fast: pin nixpkgs, use in artiq-board-generated+artiq-full
attempt at gitea issue #31
2021-03-11 18:52:01 +01:00
Astro 84fc1375d1 s/stdenv.lib/lib/ 2021-03-11 17:32:26 +01:00
Leon Riesebos 50fb3cd8e1 update flake8-artiq 2021-03-08 12:14:12 -05:00
Sebastien Bourdeauducq b8a803a64f conda: require python<3.8 for llvmlite 2021-03-01 15:35:30 +08:00
Sebastien Bourdeauducq 4e9339e3a8 misoc: bump 2021-02-28 14:31:52 +08:00
Sebastien Bourdeauducq f2bdeaf401 example-user-env: disable cirq 2021-02-26 11:40:46 +08:00
Sebastien Bourdeauducq a57b927418 targets -> boards 2021-02-17 16:25:18 +08:00
Sebastien Bourdeauducq 5b2ee17cb9 build Zynq targets against ARTIQ stable 2021-02-17 16:21:51 +08:00
Sebastien Bourdeauducq c46534d41b ARTIQ-6 is now stable, add legacy builds 2021-02-17 16:13:09 +08:00
Sebastien Bourdeauducq 5eea3a8267 beta -> a6p 2021-02-17 16:01:19 +08:00
Sebastien Bourdeauducq 9806228a8c check artiq-board-generated more often 2021-02-16 10:01:10 +08:00
Astro bc1ffe4fbf artiq-full/conda-channel: fix artiq-fast path 2021-02-15 21:26:52 +01:00
Sebastien Bourdeauducq 0c3f5161e1 misoc: bump 2021-02-15 21:44:13 +08:00
Astro 72fb469b0b artiq-full/conda-channel: fix artiq-fast path 2021-02-15 14:18:25 +01:00
Sebastien Bourdeauducq a6ea6e3666 migen: bump 2021-02-15 18:44:00 +08:00
Astro 64ee51b673 artiq-full: split code generation into artiq-board-generated jobset 2021-02-15 04:15:09 +01:00
Astro 33c33d49df artiq-full: replace variants list with readDir of sinara-systems 2021-02-11 21:41:23 +01:00
Sebastien Bourdeauducq d1a6c2f5db artiq-full: disable archived variants 2021-02-07 09:43:56 +08:00
Sebastien Bourdeauducq 5c6dc61d4d mcu: missing file rename from 0d706f000f 2021-02-06 22:05:00 +08:00
Sebastien Bourdeauducq 87c2586250 mcu: add Hydra Git input for Sayma MMC firmware 2021-02-06 22:03:13 +08:00
Sebastien Bourdeauducq 42107ff1e9 mcu: build Sayma MMC firmware 2021-02-06 22:00:54 +08:00
Sebastien Bourdeauducq 0d706f000f stm32 -> mcu 2021-02-06 21:45:40 +08:00
topquark12 29b4cb1b09 artiq-full: add stanford 2021-02-04 16:08:25 +08:00
topquark12 b83f40008c artiq-full: add cu2 2021-02-04 14:44:48 +08:00
topquark12 6d0dafb722 artiq-full: add cu3 2021-02-04 12:35:35 +08:00
topquark12 f1d689ae78 artiq-full: add sydney2 2021-02-04 10:46:22 +08:00
Harry Ho 487bf219ba artiq-full: build illinois 2021-02-03 17:55:48 +08:00
Astro 4666f1aa6a artiq-full: concatenate paths as paths not strings
fixes running with restrict-eval=true on Hydra
2021-02-02 13:24:02 +01:00
Astro d149c66d05 artiq-full: move reading standalone flag from sinara-systems to before generatedNix 2021-02-02 13:23:31 +01:00
Sebastien Bourdeauducq 3c1a84a07e Revert "artiq-full: move reading standalone flag from sinara-systems to before generatedNix"
hydra-eval-jobs returned exit code 1:
error: --- Error --- hydra-eval-jobs
worker error: error: --- RestrictedPathError --- hydra-eval-jobs
access to path '/nix/store/xq8mnh5rf5v0www2amzvlbf8m6r0ckjv-pm405hs1s21h4p3bq7fg2vcwwc1gqcfv-source/apm.json' is forbidden in restricted mode

This reverts commit b0e041c716.
2021-02-02 15:29:26 +08:00
Astro 70a0b8f90f artiq-full: let drtio-ddbs depend on one json file instead of full sinara-systems 2021-02-02 15:11:52 +08:00
Astro b0e041c716 artiq-full: move reading standalone flag from sinara-systems to before generatedNix 2021-02-02 15:11:52 +08:00
Harry Ho 6fe5a903b9 stm32: update stabilizer IP address override
* Affected by 2144af5bcd .
2021-02-02 12:16:10 +08:00
Harry Ho 726ee7aa82 stm32: allow binary filename and package name to be different
* The major motivation is that Stabilizer ( since f1f15aca65 ) now contains multiple binaries, and the filenames of the generated ELFs (e.g. `dual-iir`, `lockin-internal`) do not necessarily contain the project name as a substring.
2021-02-02 11:16:24 +08:00
Harry Ho 21f5362b6f stm32: fix stabilizer IP address override
* required by at least 659a6879f7 or later
* also substitutes the default gateway address (24-bit netmask)
2021-02-01 16:40:28 +08:00
Harry Ho 35c2844612 artiq-full: build cu 2021-02-01 12:18:09 +08:00
Sebastien Bourdeauducq d5b5dbeeb2 migen-axi: bump 2021-01-30 18:24:05 +08:00
Sebastien Bourdeauducq 57aca5d142 migen: bump 2021-01-30 18:22:22 +08:00
David Nadlinger 87fdb2c5ea Export qasync from artiq-fast
This makes it easier to pull in qasync from custom dev environments
(artiq-fast.qasync).
2021-01-29 14:29:22 +00:00
Sebastien Bourdeauducq 58aabaaa0e example-user-env: disable spyder 2021-01-28 12:22:27 +08:00
Sebastien Bourdeauducq eac7f4bddb Revert "artiq: move stable to nixpkgs 20.09"
This reverts commit b810407aa9.
2021-01-28 12:21:09 +08:00
Sebastien Bourdeauducq b810407aa9 artiq: move stable to nixpkgs 20.09 2021-01-27 13:14:12 +08:00
Sebastien Bourdeauducq e39f359122 bump sipyco 2021-01-27 13:09:08 +08:00
occheung 049de83093 artiq-full: build hw3 2021-01-26 15:17:12 +08:00
Sebastien Bourdeauducq 221d2fe793 example-user-env: artiq-5 compat 2021-01-18 15:21:45 +08:00
Sebastien Bourdeauducq 8b59734705 example-user-env: add flake8-artiq 2021-01-18 15:20:42 +08:00
Sebastien Bourdeauducq 360eb10ada update flake8-artiq 2021-01-18 15:19:55 +08:00
Sebastien Bourdeauducq 4d99f4884e example-user-env: matplotlib-qt issues 2021-01-15 17:48:59 +08:00
Sebastien Bourdeauducq 45f46f8901 add user environment test 2021-01-15 17:23:19 +08:00
Sebastien Bourdeauducq 7ee9e4f068 fix syntax 2021-01-15 17:22:48 +08:00
Sebastien Bourdeauducq 8396cfa1cb extras: update controllers 2021-01-15 16:53:54 +08:00
Sebastien Bourdeauducq 7a76d08cb0 simplify/fix jsonschema dependency 2021-01-15 16:36:48 +08:00
Astro ce676be8e4 artiq: add dependency jsonschema (#38)
artiq: add dependency jsonschema

Support for resolution of https://github.com/m-labs/artiq/issues/1474

Co-authored-by: Stephan Maka <sm@m-labs.hk>
Reviewed-on: M-Labs/nix-scripts#38
Co-Authored-By: Astro <sm@m-labs.hk>
Co-Committed-By: Astro <sm@m-labs.hk>
2021-01-15 16:32:55 +08:00
Sebastien Bourdeauducq 2984cff156 artiq-full: disable archived variants 2021-01-15 16:30:29 +08:00
occheung 3cd8e64846 artiq-full: build stfc master + satellite 2021-01-15 13:05:22 +08:00
occheung f5145e23ee artiq-full: build okinawa 2021-01-05 12:43:59 +08:00
occheung 58b49c173e artiq-full: build nist3 2020-12-29 13:29:33 +08:00
occheung d4c78c8d1b artiq-full: build berkeley3 master + satellite 2020-12-28 16:05:03 +08:00
Astro cc6e7095f3 artiq-full: add a boardsWithoutBuildSplit blacklist 2020-12-27 02:04:47 +01:00
Astro e189ee4c8f artiq-board: refactor vivado derivations into discardContextFromPath, tighten software src 2020-12-23 18:03:40 +01:00
Astro 2f4b063513 artiq-board: use new misoc top-level Makefile for software build 2020-12-23 17:46:31 +01:00
Astro 0cf2def070 artiq-board: move software build into separate derivation 2020-12-23 17:46:12 +01:00
Astro 22a6d5fb2e artiq-full: fix artiq-board paths 2020-12-23 15:31:14 +01:00
Astro 1c103ccb62 artiq-fast: move new artiq-board.nix to artiq-full/ 2020-12-23 15:31:14 +01:00
Sebastien Bourdeauducq 42df27a7fd misoc: bump 2020-12-23 12:01:37 +08:00
Drew Risinger 2577aa52c0 artiq: pass wrapped python env to subprocesses
Fixes https://github.com/m-labs/artiq-comtools/issues/7.
Basically, python subprocesses can't see all installed python packages
in a python environment because it uses the wrong Python exe (i.e. it
doesn't use the wrapped exe). This patches the PATH in the binary
wrappers (e.g. */bin/artiq_session) to include the correct python path.
2020-12-23 10:55:43 +08:00
Sebastien Bourdeauducq a45b6fc771 misoc: bump 2020-12-22 23:46:51 +08:00
Sebastien Bourdeauducq 228a73fc55 artiq-full: remove vlbai leftovers 2020-12-22 22:40:18 +08:00
occheung e97e8be246 artiq-full: move nist2 to 6+ (kasli2) 2020-12-22 09:34:44 +08:00
Sebastien Bourdeauducq 2814292f05 jesd204: bump 2020-12-19 17:04:59 +08:00
Robert Jördens cefb3ce2f2 vlbai*: deactivate 2020-12-19 09:42:45 +01:00
Robert Jördens 2f2ed2b68e disable mpik 2020-12-17 18:34:58 +01:00
Robert Jördens 718230f12a remove hub,opticlock,ptb 2020-12-17 18:06:31 +01:00
Drew Risinger ca28925120 treewide: name -> pname where possible
Changes "name = '...-${version}" -> "pname = '...'" syntax everywhere
that is easy.
This matches current best nixpkgs convention.
The nixpkgs standard derivation will convert this to name =
"${pname}-${version}" automatically.
This also has the added benefit of adding the version to the filepath
for several packages that didn't have it before.

The only remaining files are ./artiq-full/extras.nix &
./artiq-fast/pkgs/python-deps.nix.
extras.nix had a
semi-confusing function that I didn't want to mess with.
2020-12-17 14:16:45 +08:00
Drew Risinger beb99234fe conda build: allow pname or name convention 2020-12-17 14:16:45 +08:00
Sebastien Bourdeauducq f072c46ee3 wand: depend on quamash 2020-12-16 15:44:12 +08:00
occheung abf17296c8 artiq-full: build nus 2020-12-15 09:46:45 +08:00
occheung 755f36ecdf artiq-full: build ucsb 2020-12-14 21:23:48 +08:00
Sebastien Bourdeauducq 0c3cb62cde artiq-full: use uTCA for sayma-satellite-st 2020-12-14 11:38:33 +08:00
occheung d1f7e5d25f add wipm7 device database 2020-12-14 11:18:42 +08:00
occheung 73d7fe2502 artiq-full: build wipm7 master + satellite 2020-12-14 09:37:08 +08:00
Sebastien Bourdeauducq eb48b4a6b8 artiq-fast: do not put both quamash and qasync in conda channel
This causes conda's lame excuse for a dependency solver to break, as usual.
2020-12-12 22:27:23 +08:00
Sebastien Bourdeauducq 093b1b7224 artiq-fast: quamash -> qasync on artiq-6+ 2020-12-12 21:58:04 +08:00
Sebastien Bourdeauducq faedd3e1ea artiq-full: fix typo/syntax 2020-12-12 14:30:57 +08:00
Sebastien Bourdeauducq 56382d6301 artiq-full: disable flake8-artiq manual 2020-12-10 11:35:50 +08:00
Robert Jördens 6721a8ea17 Merge remote-tracking branch 'quartiq/master'
* quartiq/master:
  added innsbruck5
  added basel
  add ptb8
2020-12-09 20:07:02 +01:00
SingularitySurfer 08241d9ab0 added innsbruck5 2020-12-09 16:08:38 +00:00
Sebastien Bourdeauducq 7259a0b3aa artiq-full: disable archived variants 2020-12-09 12:26:23 +08:00
SingularitySurfer b17a99ac3b added basel 2020-12-08 16:22:15 +01:00
SingularitySurfer 3d26cd62cf add ptb8 2020-12-08 16:22:15 +01:00
SingularitySurfer 8771512787 added basel 2020-12-08 13:24:07 +00:00
Sebastien Bourdeauducq d688ed1a56 extras: add flake8-artiq 2020-12-08 13:45:40 +08:00
Sebastien Bourdeauducq ea292df252 artiq-full: add artiq-board-sayma-satellite-st 2020-12-07 18:09:12 +08:00
Astro 00352b9942 artiq-board, artiq-board-legacy: dontFixup board packages
resolves gitea issue #35
2020-12-02 17:07:19 +01:00
SingularitySurfer cf4ca3e4f2 add ptb8 2020-12-02 15:22:35 +00:00
Astro eab83a6a3f artiq-fast: build gateware from a self-contained separate source derivation (#23)
artiq-fast: add nativeBuildInputs to artiq-board-legacy.nix

artiq-board: fix scope of toPythonModule

artiq-board: use new --gateware-identifier-str

artiq-board: use legacy code for artiq<6

artiq-board: get/remove/re-add version identifiers

artiq-fast: build gateware from a self-contained separate source derivation

Addresses item 2. of Gitea issue #1.

Co-authored-by: Stephan Maka <stephan@spaceboyz.net>
Reviewed-on: M-Labs/nix-scripts#23
2020-12-02 17:22:54 +08:00
occheung 262ef72eb7 artiq-full: build apm 2020-11-30 18:25:22 +08:00
Astro 12fbe64616 artiq-fast: add strictDeps=true to fetchcargo.nix, nativeBuildInputs to artiq-board.nix
this indeed cuts runtime dependencies (gitea issue #34)
2020-11-26 17:10:36 +01:00
Robert Jördens 6acf5b3f93 innsbruck4, ubirmingham2: add 2020-11-26 15:56:10 +01:00
Astro 5695977531 Revert "artiq-board.nix: move compilers into nativeBuildInputs"
This reverts commit fd25af0733.
2020-11-25 21:23:03 +01:00
Astro 2e62831998 Revert "artiq-fast: add strictDeps=true to fetchcargo.nix"
This reverts commit 843da12452.
2020-11-25 21:23:02 +01:00
Astro fd25af0733 artiq-board.nix: move compilers into nativeBuildInputs
Part of Gitea issue #34
2020-11-25 18:19:03 +01:00
Astro 843da12452 artiq-fast: add strictDeps=true to fetchcargo.nix
part of gitea issue #34. unfortunately, the flag has inferior
documentation, so this is just a try.
2020-11-25 18:05:51 +01:00
Drew Risinger 267b497ac4 python3Packages.pyqtgraph: 0.10.0 -> 0.11.0 2020-11-24 23:14:17 +08:00
Sebastien Bourdeauducq ff54c815d5 artiq-full: move ptb7 to 6+ (kasli2) 2020-11-24 00:10:49 +08:00
Sebastien Bourdeauducq eb398dcc53 artiq-full: package wand 2020-11-23 23:23:02 +08:00
Robert Jördens 88cd472f90 innsbruck3: artiq 6 2020-11-17 18:55:03 +01:00
Robert Jördens 6eac1b5f3f ptb3master/satellite: fix artiq major version restrictions 2020-11-17 18:53:32 +01:00
Robert Jördens c31b0144d3 innsbruck3, ptb7: add 2020-11-16 08:42:48 +00:00
Robert Jördens 34c5ff76b9 ptb2/3: refactor 2020-11-16 08:42:32 +00:00
Astro 571cfbd8a6 python-deps: bump migen, migen-axi 2020-11-12 15:43:17 +01:00
Sebastien Bourdeauducq 0db0ffb128 zynq: power off board when done 2020-11-10 22:49:07 +08:00
Sebastien Bourdeauducq 083e389b41 artiq-fast: put board lockfile into separate directory
Files at the root of /tmp cannot be written by different users for some reason.
2020-11-10 22:47:48 +08:00
Sebastien Bourdeauducq 777b9dbecd phaser: remove inappropriate load-after-build code 2020-11-09 13:45:36 +08:00
Sebastien Bourdeauducq 0a11450df3 migen: bump 2020-11-06 12:32:51 +08:00
Sebastien Bourdeauducq 30629929a8 migen: bump 2020-11-06 12:25:21 +08:00
Sebastien Bourdeauducq d53eed3880 phaser: remove unnecessary patch 2020-11-06 12:24:20 +08:00
Astro df36762bfe stm32: update rustc 2020-10-30 14:49:33 +01:00
occheung 8477bc2919 artiq-full: build wipm6 2020-10-22 17:35:21 +08:00
Sebastien Bourdeauducq 01dbcb5886 artiq-full: build atomionics 2020-10-21 18:28:22 +08:00
Sebastien Bourdeauducq f2c9e226ac zynq: install artiq-netboot for HITL test 2020-10-15 16:15:39 +08:00
Sebastien Bourdeauducq b46f418176 add artiq-netboot package 2020-10-15 16:12:51 +08:00
Harry Ho 6ee5fa70ec artiq-full: build siom 2020-10-15 15:12:00 +08:00
Sebastien Bourdeauducq 24510c81d6 python-deps: update migen-axi 2020-10-14 20:30:59 +08:00
occheung 17e6cbf6b1 artiq-full: build ustc3 2020-10-14 11:57:34 +08:00
Sebastien Bourdeauducq 59844c28d9 zynq: build with nixos 20.09 2020-10-13 18:24:57 +08:00
Sebastien Bourdeauducq 4172f745e3 add Phaser gateware 2020-10-12 22:49:47 +08:00
Sebastien Bourdeauducq ee9983728e update migen+misoc 2020-10-12 22:33:40 +08:00
Sebastien Bourdeauducq b50d1a0f7e artiq-full: build nist2 2020-10-12 17:45:48 +08:00
Sebastien Bourdeauducq a9108d5fa3 stm32: move to nixos 20.09 2020-10-08 14:43:22 +08:00
Sebastien Bourdeauducq 0064906c6f stm32: use nativeBuildInputs correctly 2020-10-08 14:32:36 +08:00
Sebastien Bourdeauducq 9754f45904 use new simplified hydra jobset declarations 2020-10-08 14:08:20 +08:00
Sebastien Bourdeauducq 59ad8b124a remove HeavyX 2020-10-08 14:00:18 +08:00
Sebastien Bourdeauducq 1263c7f15f Revert "attempting to fix hydra jobsets"
This reverts commit 477f9ce197.
2020-10-08 13:54:36 +08:00
Sebastien Bourdeauducq 477f9ce197 attempting to fix hydra jobsets 2020-10-08 13:52:17 +08:00
Sebastien Bourdeauducq 4dd16d3aa8 replace deprecated nixpkgs-channels repository 2020-10-08 09:15:50 +08:00
Sebastien Bourdeauducq 497f1970a0 gluelogic: move to nixos 20.09 2020-10-08 09:10:46 +08:00
Sebastien Bourdeauducq bf45666b2b artiq: move beta to nixos 20.09
There are still issues on Zynq due to cargo, so keep 20.03 there for now.
2020-10-08 09:09:10 +08:00
Sebastien Bourdeauducq 6cbfebf626 artiq-full: update wavedrom 2020-10-07 19:30:04 +08:00
Sebastien Bourdeauducq 9870fce5a6 stm32: hydra restricted mode 2020-09-25 14:40:57 +08:00
Sebastien Bourdeauducq a6f94d37e9 stm32: hydra restricted mode 2020-09-25 14:38:09 +08:00
Sebastien Bourdeauducq 657d3c1b27 stm32: add humpback fpga build dependencies 2020-09-25 14:35:09 +08:00
Sebastien Bourdeauducq fe728a7303 artiq-full: disable archived variants 2020-09-24 18:06:09 +08:00
Sebastien Bourdeauducq f392ca6fd6 Revert "artiq-full: disable archived variants"
This reverts commit 9a39d707da.
2020-09-24 18:05:50 +08:00
Sebastien Bourdeauducq 9a39d707da artiq-full: disable archived variants 2020-09-24 18:05:08 +08:00
Sebastien Bourdeauducq 3e607f7d12 stm32: add humpback-dds 2020-09-24 11:12:19 +08:00
Sebastien Bourdeauducq f69616307e stm32: dontFixup 2020-09-24 11:12:05 +08:00
Astro 62f7610087 stm32: update rustc 2020-09-23 03:47:21 +02:00
Harry Ho 68318b05ec artiq-full: build ucsd 2020-09-18 10:05:27 +08:00
Astro 7c7c0cb58d stm32: add checkPhase to thermostat 2020-09-18 01:15:13 +02:00
Sebastien Bourdeauducq 5ba0896be6 migen: bump 2020-09-17 16:39:38 +08:00
Harry Ho 7c4eb8e770 stm32: generate memory image from elf for dfu bootloader to download 2020-09-17 12:52:18 +08:00
Sebastien Bourdeauducq c64d73649f stm32: update rustc 2020-09-11 22:25:43 +08:00
Sebastien Bourdeauducq e6fb3088b1 stm32: cleanup rustManifest 2020-09-11 22:21:15 +08:00
Sebastien Bourdeauducq e4d6dd253d stm32: fix stabilizer IP address override 2020-09-11 18:38:37 +08:00
Sebastien Bourdeauducq b5d7b1d10a stm32: update rustc 2020-09-11 18:38:20 +08:00
Sebastien Bourdeauducq 864bddd0b4 zynq: fix previous commit 2020-09-09 19:26:22 +08:00
Sebastien Bourdeauducq de7c867866 zynq: use exposed zynq-rs from artiq-zynq 2020-09-09 19:23:53 +08:00
Sebastien Bourdeauducq 58c9c6f83c zynq: try to work around hydra restricted mode problems 2020-09-09 19:19:10 +08:00
Sebastien Bourdeauducq 532dd5c861 zynq: fix previous commit 2020-09-09 19:14:41 +08:00
Sebastien Bourdeauducq eabcda5013 zynq: fix previous commit 2020-09-09 19:13:35 +08:00
Sebastien Bourdeauducq b3715bbfc8 zynq: use zynq-rs from artiq-zynq 2020-09-09 19:11:41 +08:00
Sebastien Bourdeauducq 51bd917512 cleanup 2020-09-09 18:46:46 +08:00
Sebastien Bourdeauducq b7a1f42a06 zynq: set SZL environment variable 2020-09-09 18:36:41 +08:00
Sebastien Bourdeauducq 53838bd55f zynq: use new zynq-rs 2020-09-09 16:51:03 +08:00
Sebastien Bourdeauducq 354f653a13 zynq: work around tnetplug connection freezing (attempt 2) 2020-09-09 16:33:28 +08:00
Sebastien Bourdeauducq 33b66b1a65 zynq: work around tnetplug connection freezing 2020-09-09 15:54:36 +08:00
Sebastien Bourdeauducq 1b324970e5 zynq: set OPENOCD_ZYNQ 2020-09-09 15:44:09 +08:00
Sebastien Bourdeauducq 44ffc90e3a zynq: artiq-zynq does not take mozillaOverlay anymore 2020-09-09 15:23:20 +08:00
51 changed files with 10243 additions and 2122 deletions

View File

@ -0,0 +1,97 @@
# Install Vivado in /opt and add to /etc/nixos/configuration.nix:
# nix.sandboxPaths = ["/opt"];
{ pkgs ? import <nixpkgs> {}
, artiq-fast
}:
let
artiqSrc = import (artiq-fast + "/pkgs/artiq-src.nix") { fetchgit = pkgs.fetchgit; };
artiqpkgs = import artiq-fast { inherit pkgs; };
pythonEnv = pkgs.python3.withPackages (ps: with ps; [
jinja2 jsonschema numpy artiqpkgs.migen artiqpkgs.microscope artiqpkgs.misoc artiqpkgs.jesd204b artiqpkgs.artiq
]);
fetchcargo = import (artiq-fast + "/fetchcargo.nix") {
inherit (pkgs) stdenv lib cacert git;
inherit (artiqpkgs) cargo cargo-vendor;
};
cargoDeps = fetchcargo rec {
name = "artiq-firmware-cargo-deps";
src = "${artiqSrc}/artiq/firmware";
sha256 = import (artiqSrc + "/artiq/firmware/cargosha256.nix");
};
cargoVendored = pkgs.stdenv.mkDerivation {
name = "artiq-firmware-cargo-vendored";
src = cargoDeps;
phases = [ "unpackPhase" "installPhase" ];
installPhase =
''
mkdir -p $out/registry
cat << EOF > $out/config
[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
replace-with = "vendored-sources"
[source."https://github.com/m-labs/libfringe"]
git = "https://github.com/m-labs/libfringe"
rev = "b8a6d8f"
replace-with = "vendored-sources"
[source.vendored-sources]
directory = "$out/registry"
EOF
cp -R * $out/registry
'';
};
in
{ target
, variant
, src ? null
, buildCommand ? "python -m artiq.gateware.targets.${target} -V ${variant}"
, extraInstallCommands ? ""
, ...
}:
let
name = "artiq-board-${target}-${variant}-${artiqpkgs.artiq.version}-xxx";
installPath = "${pkgs.python3Packages.python.sitePackages}/artiq/board-support/${target}-${variant}";
in
# Board packages are Python modules so that they get added to the ARTIQ Python
# environment, and artiq_flash finds them.
pkgs.stdenv.mkDerivation {
name = "artiq-board-${target}-${variant}-${artiqpkgs.artiq.version}";
inherit src;
phases = [ "buildPhase" "installPhase" ];
nativeBuildInputs = [
pkgs.gnumake pkgs.which pythonEnv
artiqpkgs.cargo
artiqpkgs.rustc
artiqpkgs.binutils-or1k
artiqpkgs.llvm-or1k
];
buildInputs = [ pythonEnv ];
buildPhase =
''
export CARGO_HOME=${cargoVendored}
export TARGET_AR=or1k-linux-ar
${buildCommand} --no-compile-gateware --gateware-identifier-str=unprogrammed
'';
installPhase =
''
mkdir -p $out
cp -ar artiq_${target}/${variant}/gateware $out
TARGET_DIR=$out/${pkgs.python3Packages.python.sitePackages}/artiq/board-support/${target}-${variant}
mkdir -p $TARGET_DIR
if [ -e artiq_${target}/${variant}/software/bootloader/bootloader.bin ]
then cp artiq_${target}/${variant}/software/bootloader/bootloader.bin $TARGET_DIR
fi
if [ -e artiq_${target}/${variant}/software/runtime ]
then cp artiq_${target}/${variant}/software/runtime/runtime.{elf,fbi} $TARGET_DIR
else cp artiq_${target}/${variant}/software/satman/satman.{elf,fbi} $TARGET_DIR
fi
${extraInstallCommands}
'';
# don't mangle ELF files as they are not for NixOS
dontFixup = true;
}

View File

@ -0,0 +1,54 @@
{ pkgs ? import <artiq-fast/pkgs/nixpkgs.nix> { inherit (import <nixpkgs> {}) fetchgit; } {}
, artiq-fast ? <artiq-fast>
}:
let
sinaraSystemsSrc = <sinaraSystemsSrc>;
generatedNix = pkgs.runCommand "generated-nix" { buildInputs = [ pkgs.nix pkgs.git ]; }
''
mkdir $out
cp ${./artiq-board.nix} $out/artiq-board.nix
cp ${../artiq-full/artiq-targets.nix} $out/artiq-targets.nix
cp -a ${artiq-fast} $out/fast
REV=`git --git-dir ${sinaraSystemsSrc}/.git rev-parse HEAD`
echo -n $REV > $out/sinara-rev.txt
SINARA_SRC_CLEAN=`mktemp -d`
cp -a ${sinaraSystemsSrc}/. $SINARA_SRC_CLEAN
chmod -R 755 $SINARA_SRC_CLEAN/.git
chmod 755 $SINARA_SRC_CLEAN
rm -rf $SINARA_SRC_CLEAN/.git
HASH=`nix-hash --type sha256 --base32 $SINARA_SRC_CLEAN`
echo -n $HASH > $out/sinara-hash.txt
cat > $out/default.nix << EOF
{ pkgs ? import ./fast/pkgs/nixpkgs.git { inherit (import <nixpkgs> {}) fetchgit; }
}:
let
sinaraSystemsSrc = pkgs.fetchgit {
url = "https://git.m-labs.hk/M-Labs/sinara-systems.git";
rev = "$REV";
sha256 = "$HASH";
};
artiq-fast = import ./fast { inherit pkgs; };
artiq-board = import ./artiq-board.nix {
inherit pkgs;
artiq-fast = ./fast;
};
in
builtins.mapAttrs (_: conf: pkgs.lib.hydraJob (artiq-board conf)) (
import ./artiq-targets.nix {
inherit pkgs sinaraSystemsSrc;
artiqVersion = artiq-fast.artiq.version;
}
)
EOF
'';
artiq-board-generated = import generatedNix {
inherit pkgs;
};
in
artiq-board-generated // {
generated-nix = pkgs.lib.hydraJob generatedNix;
}

View File

@ -30,6 +30,22 @@ let
EOF
echo "{ stdenv, git, fetchgit }: \"$MAJOR_VERSION.$COMMIT_COUNT.`cut -c1-8 <<< $REV`$SUFFIX\"" > $out/pkgs/artiq-version.nix
echo "{ stdenv, git, fetchgit }: \"$TIMESTAMP\"" > $out/pkgs/artiq-timestamp.nix
REV=`git --git-dir ${<nixpkgs>}/.git rev-parse HEAD`
NIXPKGS_CLEAN=`mktemp -d`
cp -a ${<nixpkgs>}/. $NIXPKGS_CLEAN
chmod -R 755 $NIXPKGS_CLEAN/.git
chmod 755 $NIXPKGS_CLEAN
rm -rf $NIXPKGS_CLEAN/.git
HASH=`nix-hash --type sha256 --base32 $NIXPKGS_CLEAN`
cat > $out/pkgs/nixpkgs.nix << EOF
{ fetchgit }:
import (fetchgit {
url = "https://github.com/nixos/nixpkgs.git";
rev = "$REV";
sha256 = "$HASH";
})
EOF
'';
artiqpkgs = import "${generatedNix}/default.nix" { inherit pkgs; };
artiqVersion = import "${generatedNix}/pkgs/artiq-version.nix" (with pkgs; { inherit stdenv fetchgit git; });
@ -84,7 +100,7 @@ in
-i $HOME/.ssh/id_rsa \
-o UserKnownHostsFile=$HOME/.ssh/known_hosts \
sb@rpi-1 \
'flock /tmp/board_lock-kc705-1 -c "echo Ok; cat"' \
'mkdir -p /tmp/board_lock && flock /tmp/board_lock/kc705-1 -c "echo Ok; cat"' \
| (
# End remote flock via FIFO
atexit_unlock() {

View File

@ -9,7 +9,7 @@ let
artiqSrc = import ./pkgs/artiq-src.nix { fetchgit = pkgs.fetchgit; };
artiqpkgs = import ./default.nix { inherit pkgs; };
fetchcargo = import ./fetchcargo.nix {
inherit (pkgs) stdenv cacert git;
inherit (pkgs) stdenv lib cacert git;
inherit (artiqpkgs) cargo cargo-vendor;
};
cargoDeps = fetchcargo rec {
@ -47,7 +47,8 @@ in
, variant
, src ? null
, buildCommand ? "python -m artiq.gateware.targets.${target} -V ${variant}"
, extraInstallCommands ? ""}:
, extraInstallCommands ? ""
, ... }:
# Board packages are Python modules so that they get added to the ARTIQ Python
# environment, and artiq_flash finds them.
@ -56,15 +57,15 @@ pkgs.python3Packages.toPythonModule (pkgs.stdenv.mkDerivation rec {
version = import ./pkgs/artiq-version.nix (with pkgs; { inherit stdenv fetchgit git; });
inherit src;
phases = [ "buildPhase" "installCheckPhase" "installPhase" "checkPhase" ];
buildInputs = [
nativeBuildInputs = [
vivado
pkgs.gnumake
(pkgs.python3.withPackages(ps: with ps; [ jinja2 numpy artiqpkgs.migen artiqpkgs.microscope artiqpkgs.misoc artiqpkgs.jesd204b artiqpkgs.artiq ]))
artiqpkgs.cargo
artiqpkgs.rustc
artiqpkgs.binutils-or1k
artiqpkgs.llvm-or1k
];
buildInputs = [ (pkgs.python3.withPackages(ps: with ps; [ jinja2 numpy artiqpkgs.migen artiqpkgs.microscope artiqpkgs.misoc artiqpkgs.jesd204b artiqpkgs.artiq ])) ];
buildPhase =
''
export CARGO_HOME=${cargoVendored}
@ -96,4 +97,6 @@ pkgs.python3Packages.toPythonModule (pkgs.stdenv.mkDerivation rec {
fi
${extraInstallCommands}
'';
# don't mangle ELF files as they are not for NixOS
dontFixup = true;
})

View File

@ -36,6 +36,8 @@ let
build:
- cmake
- llvm-or1k
run:
- python<3.8
EOF
cat > bld.bat << EOF

View File

@ -1,16 +0,0 @@
[
"llvmlite-artiq"
"binutils-or1k-linux"
"pythonparser"
"scipy"
"numpy"
"prettytable"
"h5py"
"python-dateutil"
"pyqt"
"quamash"
"pyqtgraph"
"pygit2"
"python-levenshtein"
"sipyco"
]

View File

@ -6,7 +6,22 @@ let
name = "artiq";
inherit version;
src = import ../pkgs/artiq-src.nix { fetchgit = pkgs.fetchgit; };
dependencies = import ./artiq-deps.nix;
dependencies = [
"llvmlite-artiq"
"binutils-or1k-linux"
"pythonparser"
"scipy"
"numpy"
"prettytable"
"h5py"
"python-dateutil"
"pyqt"
(if (pkgs.lib.strings.versionAtLeast version "6.0") then "qasync" else "quamash")
"pyqtgraph"
"pygit2"
"python-levenshtein"
"sipyco"
];
extraYaml =
''
about:

View File

@ -2,12 +2,22 @@
# recipe must be a string pointing to a path within the source.
{ pkgs }:
{ name, src, recipe ? "fake-conda"}:
{ name ? null
, src
, pname ? null
, version ? null
, recipe ? "fake-conda"
}:
# Check that either name is specified or both pname & version are specified.
assert (name == null) -> pname != null && version != null;
assert (name != null) -> pname == null && version == null;
let
condaBuilderEnv = import ./builder-env.nix { inherit pkgs; };
realName = if (name != null) then name else "${pname}-${version}";
in pkgs.stdenv.mkDerivation {
inherit name src;
name = realName;
inherit src;
buildCommand =
''
HOME=`pwd`

View File

@ -25,7 +25,7 @@ let
# that they are not there if they have been installed from files.
requirements:
run:
- python
- python<3.8
- ncurses [linux]
EOF

View File

@ -1,8 +1,8 @@
{ pkgs ? import <nixpkgs> {}}:
{ pkgs ? import ./pkgs/nixpkgs.nix { inherit (import <nixpkgs> {}) fetchgit; } {}}:
with pkgs;
let
artiq6 = pkgs.lib.strings.versionAtLeast mainPackages.artiq.version "6.0";
pythonDeps = import ./pkgs/python-deps.nix { inherit (pkgs) stdenv fetchFromGitHub python3Packages; misoc-new = artiq6; };
pythonDeps = import ./pkgs/python-deps.nix { inherit (pkgs) lib fetchgit fetchFromGitHub python3Packages; misoc-new = artiq6; };
boards = [
{ target = "kasli"; variant = "tester"; }
@ -20,12 +20,12 @@ let
}) {} boards;
mainPackages = rec {
inherit (pythonDeps) sipyco asyncserial pythonparser pyqtgraph-qt5 misoc migen microscope jesd204b migen-axi lit outputcheck;
inherit (pythonDeps) sipyco asyncserial pythonparser pyqtgraph-qt5 artiq-netboot misoc migen microscope jesd204b migen-axi lit outputcheck qasync;
binutils-or1k = callPackage ./pkgs/binutils.nix { platform = "or1k"; target = "or1k-linux"; };
binutils-arm = callPackage ./pkgs/binutils.nix { platform = "arm"; target = "armv7-unknown-linux-gnueabihf"; };
llvm-or1k = callPackage ./pkgs/llvm-or1k.nix {};
rustc = callPackage ./pkgs/rust/rustc-with-crates.nix
((stdenv.lib.optionalAttrs (stdenv.cc.isGNU && stdenv.hostPlatform.isi686) {
((lib.optionalAttrs (stdenv.cc.isGNU && stdenv.hostPlatform.isi686) {
stdenv = overrideCC stdenv gcc6; # with gcc-7: undefined reference to `__divmoddi4'
}) //
{ inherit llvm-or1k; });
@ -40,7 +40,8 @@ let
condaNoarch = {
conda-pythonparser = import ./conda/build.nix { inherit pkgs; } {
name = "conda-pythonparser";
pname = "conda-pythonparser";
inherit (pythonDeps.pythonparser) version;
src = import ./conda/fake-source.nix { inherit pkgs; } {
name = "pythonparser";
inherit (pythonDeps.pythonparser) version src;
@ -49,7 +50,8 @@ let
};
};
conda-sipyco = import ./conda/build.nix { inherit pkgs; } {
name = "conda-sipyco";
pname = "conda-sipyco";
inherit (pythonDeps.sipyco) version;
src = import ./conda/fake-source.nix { inherit pkgs; } {
name = "sipyco";
inherit (pythonDeps.sipyco) version src;
@ -57,11 +59,20 @@ let
};
};
conda-quamash = import ./conda/build.nix { inherit pkgs; } {
name = "conda-quamash";
pname = "conda-quamash";
inherit (pkgs.python3Packages.quamash) version;
src = import ./conda/fake-source.nix { inherit pkgs; } {
name = "quamash";
inherit (pkgs.python3Packages.quamash) version src;
};
};
conda-qasync = import ./conda/build.nix { inherit pkgs; } {
pname = "conda-qasync";
inherit (pythonDeps.qasync) version;
src = import ./conda/fake-source.nix { inherit pkgs; } {
name = "qasync";
inherit (pythonDeps.qasync) version src;
};
};
conda-bscan-spi-bitstreams = import ./conda/bscan-spi-bitstreams.nix {
inherit pkgs;
@ -69,7 +80,8 @@ let
};
conda-artiq = import ./conda/artiq.nix { inherit pkgs; };
conda-asyncserial = import ./conda/build.nix { inherit pkgs; } {
name = "conda-asyncserial";
pname = "conda-asyncserial";
inherit (pythonDeps.asyncserial) version;
src = import ./conda/fake-source.nix { inherit pkgs; } {
name = "asyncserial";
inherit (pythonDeps.asyncserial) version src;

View File

@ -1,7 +1,8 @@
{ stdenv, cacert, git, cargo, cargo-vendor }:
{ stdenv, lib, cacert, git, cargo, cargo-vendor }:
{ name, src, sha256 }:
stdenv.mkDerivation {
name = "${name}-vendor";
strictDeps = true;
nativeBuildInputs = [ cacert git cargo cargo-vendor ];
inherit src;
@ -30,6 +31,6 @@ stdenv.mkDerivation {
outputHashMode = "recursive";
outputHash = sha256;
impureEnvVars = stdenv.lib.fetchers.proxyImpureEnvVars;
impureEnvVars = lib.fetchers.proxyImpureEnvVars;
preferLocalBuild = true;
}

View File

@ -1,7 +1,7 @@
{ stdenv, lib, pythonDeps, fetchgit, git, python3Packages, qt5, binutils-or1k, binutils-arm, llvm-or1k, llvmlite-artiq, libartiq-support, lit, outputcheck }:
python3Packages.buildPythonPackage rec {
name = "artiq-${version}";
pname = "artiq";
version = import ./artiq-version.nix { inherit stdenv fetchgit git; };
src = import ./artiq-src.nix { inherit fetchgit; };
@ -11,7 +11,8 @@ python3Packages.buildPythonPackage rec {
propagatedBuildInputs = [ binutils-or1k llvm-or1k llvmlite-artiq ]
++ (lib.lists.optionals (lib.strings.versionAtLeast version "6.0") [ binutils-arm ])
++ (with pythonDeps; [ sipyco pyqtgraph-qt5 pythonparser ])
++ (with python3Packages; [ pygit2 numpy dateutil quamash scipy prettytable pyserial python-Levenshtein h5py pyqt5 ]);
++ (with python3Packages; [ pygit2 numpy dateutil scipy prettytable pyserial python-Levenshtein h5py pyqt5 ])
++ [(if (lib.strings.versionAtLeast version "6.0") then pythonDeps.qasync else python3Packages.quamash)];
dontWrapQtApps = true;
postFixup = ''
@ -20,6 +21,10 @@ python3Packages.buildPythonPackage rec {
wrapQtApp "$out/bin/artiq_session"
'';
# Modifies PATH to pass the wrapped python environment (i.e. python3.withPackages(...) to subprocesses.
# Allows subprocesses using python to find all packages you have installed
makeWrapperArgs = [ ''--run 'if [ ! -z "$NIX_PYTHONPREFIX" ]; then export PATH=$NIX_PYTHONPREFIX/bin:$PATH;fi' '' ];
checkInputs = [ binutils-or1k outputcheck ];
checkPhase =
''
@ -31,7 +36,7 @@ python3Packages.buildPythonPackage rec {
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "A leading-edge control system for quantum information experiments";
homepage = https://m-labs/artiq;
license = licenses.lgpl3;

View File

@ -1,4 +1,4 @@
{ stdenv, buildPackages
{ stdenv, lib, buildPackages
, fetchurl, zlib
, platform, target
}:
@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
`gprof', `nm', `strip', etc.
'';
homepage = http://www.gnu.org/software/binutils/;
license = stdenv.lib.licenses.gpl3Plus;
license = lib.licenses.gpl3Plus;
/* Give binutils a lower priority than gcc-wrapper to prevent a
collision due to the ld/as wrappers/symlinks in the latter. */
priority = "10";

View File

@ -1,6 +1,6 @@
{ stdenv, fetchgit, git, rustc }:
stdenv.mkDerivation rec {
name = "libartiq-support-${version}";
pname = "libartiq-support";
version = import ./artiq-version.nix { inherit stdenv fetchgit git; };
src = import ./artiq-src.nix { inherit fetchgit; };

View File

@ -1,4 +1,4 @@
{ stdenv
{ stdenv, lib
, fetchFromGitHub, runCommand
, perl, groff, cmake, libxml2, python, libffi, valgrind
}:
@ -25,12 +25,12 @@ let
'';
in
stdenv.mkDerivation rec {
name = "llvm-or1k";
pname = "llvm-or1k";
version = "6.0.0";
passthru.llvm-src = llvm-src;
src = llvm-clang-src;
version = "6.0.0";
buildInputs = [ perl groff cmake libxml2 python libffi ] ++ stdenv.lib.optional stdenv.isLinux valgrind;
buildInputs = [ perl groff cmake libxml2 python libffi ] ++ lib.optional stdenv.isLinux valgrind;
preBuild = ''
NIX_BUILD_CORES=4
@ -59,8 +59,8 @@ in
meta = {
description = "Collection of modular and reusable compiler and toolchain technologies";
homepage = http://llvm.org/;
license = stdenv.lib.licenses.bsd3;
maintainers = with stdenv.lib.maintainers; [ sb0 ];
platforms = stdenv.lib.platforms.all;
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ sb0 ];
platforms = lib.platforms.all;
};
}

View File

@ -1,6 +1,6 @@
{ stdenv, fetchFromGitHub, llvm-or1k, makeWrapper, python3, ncurses, zlib, python3Packages }:
{ stdenv, lib, fetchFromGitHub, llvm-or1k, makeWrapper, python3, ncurses, zlib, python3Packages }:
python3Packages.buildPythonPackage rec {
name = "llvmlite-artiq";
pname = "llvmlite-artiq";
version = "0.23.0.dev";
src = fetchFromGitHub {
rev = "158f9d3a898dbf055ca513d69505df288c681fea";
@ -13,7 +13,7 @@ python3Packages.buildPythonPackage rec {
preBuild = "export LLVM_CONFIG=${llvm-or1k}/bin/llvm-config";
meta = with stdenv.lib; {
meta = with lib; {
description = "A lightweight LLVM python binding for writing JIT compilers";
homepage = "http://llvmlite.pydata.org/";
maintainers = with maintainers; [ sb0 ];

View File

@ -0,0 +1,6 @@
{ fetchgit }:
import (fetchgit {
url = "https://github.com/nixos/nixpkgs.git";
rev = "1c7f02b0b9f115ccbc122ce39ae99debc1af857a";
sha256 = "14sichs3hyg4ybcacvzglw97lg747y1ls5lsazv0n5yxv5w06l3d";
})

View File

@ -1,7 +1,7 @@
{ stdenv, fetchFromGitHub, autoreconfHook, libftdi, libusb1, pkgconfig, hidapi }:
{ stdenv, lib, fetchFromGitHub, autoreconfHook, libftdi, libusb1, pkgconfig, hidapi }:
stdenv.mkDerivation rec {
name = "openocd-mlabs-${version}";
pname = "openocd-mlabs";
version = "0.10.0";
src = fetchFromGitHub {
@ -55,7 +55,7 @@ stdenv.mkDerivation rec {
cp ${bscan_spi_bitstreams}/*.bit "$out/share/bscan-spi-bitstreams"
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "Free and Open On-Chip Debugging, In-System Programming and Boundary-Scan Testing";
longDescription = ''
OpenOCD provides on-chip programming and debugging support with a layered

View File

@ -1,21 +1,21 @@
{ stdenv, fetchFromGitHub, python3Packages, misoc-new }:
{ lib, fetchgit, fetchFromGitHub, python3Packages, misoc-new }:
rec {
# User dependencies
sipyco = python3Packages.buildPythonPackage rec {
name = "sipyco";
version = "1.1";
pname = "sipyco";
version = "1.2";
src = fetchFromGitHub {
owner = "m-labs";
repo = "sipyco";
rev = "v${version}";
sha256 = "09vyrzfhnbp65ybd7w2g96gvvnhzafpn72syls2kbg2paqjjf9gs";
sha256 = "02x2s66x9bbzj82d823vjg2i73w7iqwvkrjbbyrsav6ccj7f90sj";
};
propagatedBuildInputs = with python3Packages; [ numpy ];
};
asyncserial = python3Packages.buildPythonPackage rec {
name = "asyncserial";
pname = "asyncserial";
version = "0.1";
src = fetchFromGitHub {
owner = "m-labs";
@ -27,7 +27,7 @@ rec {
};
pythonparser = python3Packages.buildPythonPackage rec {
name = "pythonparser";
pname = "pythonparser";
version = "1.3";
src = fetchFromGitHub {
owner = "m-labs";
@ -40,28 +40,60 @@ rec {
};
pyqtgraph-qt5 = python3Packages.buildPythonPackage rec {
name = "pyqtgraph_qt5-${version}";
version = "0.10.0";
pname = "pyqtgraph_qt5";
version = "0.11.0";
doCheck = false;
pythonImportsCheck = [ "pyqtgraph" ];
src = fetchFromGitHub {
owner = "pyqtgraph";
repo = "pyqtgraph";
rev = "1426e334e1d20542400d77c72c132b04c6d17ddb";
sha256 = "1079haxyr316jf0wpirxdj0ry6j8mr16cqr0dyyrd5cnxwl7zssh";
rev = "pyqtgraph-${version}";
sha256 = "03fvpkqdn80ni51msvyivmghw41qk4vplwdqndkvzzzlppimdjbn";
};
propagatedBuildInputs = with python3Packages; [ scipy numpy pyqt5 pyopengl ];
};
qasync = python3Packages.buildPythonPackage rec {
pname = "qasync";
version = "0.10.0";
src = fetchFromGitHub {
owner = "CabbageDevelopment";
repo = "qasync";
rev = "v${version}";
sha256 = "1zga8s6dr7gk6awmxkh4pf25gbg8n6dv1j4b0by7y0fhi949qakq";
};
propagatedBuildInputs = [ python3Packages.pyqt5 ];
checkInputs = [ python3Packages.pytest ];
checkPhase = ''
pytest -k 'test_qthreadexec.py' # the others cause the test execution to be aborted, I think because of asyncio
'';
};
# Development/firmware dependencies
artiq-netboot = python3Packages.buildPythonPackage rec {
pname = "artiq-netboot";
version = "unstable-2020-10-15";
src = fetchgit {
url = "https://git.m-labs.hk/m-labs/artiq-netboot.git";
rev = "04f69eb07df73abe4b89fde2c24084f7664f2104";
sha256 = "0ql4fr8m8gpb2yql8aqsdqsssxb8zqd6l65kl1f6s9845zy7shs9";
};
};
misoc = python3Packages.buildPythonPackage {
name = "misoc";
pname = "misoc";
version = if misoc-new then "unstable-2021-02-15" else "unstable-2020-05-29";
src = if misoc-new
then (fetchFromGitHub {
owner = "m-labs";
repo = "misoc";
rev = "9cad449a283d3b7a6e496afa523547df06e75829";
sha256 = "1fw3qfhaa435iv5qnvhhfwj29skhkj6yagr6ila9va9nb2zvklf5";
rev = "d84551418042cea0891ea743442e20684b51e77a";
sha256 = "1id5qjr9dl4r3vi6jdn7dfpnr2wb08nrm3nfscn18clbbdxybyjn";
fetchSubmodules = true;
})
else (fetchFromGitHub {
@ -74,10 +106,10 @@ rec {
# TODO: fix misoc bitrot and re-enable tests
doCheck = false;
propagatedBuildInputs = with python3Packages; [ pyserial jinja2 numpy asyncserial migen ];
meta = with stdenv.lib; {
meta = with lib; {
description = "A high performance and small footprint system-on-chip based on Migen";
homepage = "https://m-labs.hk/migen";
license = licenses.bsd2;
@ -86,18 +118,19 @@ rec {
};
migen = python3Packages.buildPythonPackage rec {
name = "migen";
pname = "migen";
version = "unstable-2021-02-08";
src = fetchFromGitHub {
owner = "m-labs";
repo = "migen";
rev = "12e7ba6a4c19ee65ff9e042747220972aecc05ac";
sha256 = "0z76jfcvm7k6iqkmpdck3mw06hlg0kqvbpr047rgyvaw5im98wj5";
rev = "7014bdccc11270764186e6a4441fb58238c612aa";
sha256 = "12mhmcdf0jqv33ald9x9zb1qi26sw4ywdfgg5saqvmx0pmbmvynk";
};
propagatedBuildInputs = with python3Packages; [ colorama ];
meta = with stdenv.lib; {
meta = with lib; {
description = "A Python toolbox for building complex digital hardware";
homepage = "https://m-labs.hk/migen";
license = licenses.bsd2;
@ -106,7 +139,8 @@ rec {
};
microscope = python3Packages.buildPythonPackage rec {
name = "microscope";
pname = "microscope";
version = "unstable-2019-05-17";
src = fetchFromGitHub {
owner = "m-labs";
@ -117,7 +151,7 @@ rec {
propagatedBuildInputs = with python3Packages; [ pyserial prettytable msgpack migen ];
meta = with stdenv.lib; {
meta = with lib; {
description = "Finding the bacteria in rotting FPGA designs";
homepage = "https://m-labs.hk/migen";
license = licenses.bsd2;
@ -126,18 +160,19 @@ rec {
};
jesd204b = python3Packages.buildPythonPackage rec {
name = "jesd204b";
pname = "jesd204b";
version = "unstable-2020-12-18";
src = fetchFromGitHub {
owner = "m-labs";
repo = "jesd204b";
rev = "ac877ac5975411a438415f824e182338ed773529";
sha256 = "1lkb7cyj87bq4y0hp6379jq4q4lm2ijldccpyhawiizcfkawxa10";
rev = "23bd08f5ee95eb42502f9fbe1c2a45e8c083eab9";
sha256 = "0x2mh5fv4q0b1f8pjc2kcyjqbfgiyp1hlvbfgk8dbsraj50i566h";
};
propagatedBuildInputs = with python3Packages; [ migen misoc ];
meta = with stdenv.lib; {
meta = with lib; {
description = "JESD204B core for Migen/MiSoC";
homepage = "https://m-labs.hk/migen";
license = licenses.bsd2;
@ -154,7 +189,7 @@ rec {
sha256 = "0j15i54p7nri6hkzn1wal9pxri4pgql01wgjccig6ar0v5jjbvsy";
};
meta = with stdenv.lib; {
meta = with lib; {
description = "Super-fast and clean conversions to numbers";
homepage = "https://github.com/SethMMorton/fastnumbers";
license = licenses.mit;
@ -163,7 +198,8 @@ rec {
};
ramda = python3Packages.buildPythonPackage {
name = "ramda";
pname = "ramda";
version = "unstable-2019-02-01";
src = fetchFromGitHub {
owner = "peteut";
@ -182,7 +218,7 @@ rec {
export PBR_VERSION=0.0.1
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "Ramda, ported to Python";
homepage = "https://github.com/peteut/ramda.py";
license = licenses.mit;
@ -191,13 +227,14 @@ rec {
};
migen-axi = python3Packages.buildPythonPackage {
name = "migen-axi";
pname = "migen-axi";
version = "unstable-2021-01-22";
src = fetchFromGitHub {
owner = "peteut";
repo = "migen-axi";
rev = "623f368702c1380afff51f67cc744427b871f967";
sha256 = "0nca8piril1lwwffdxi3x32drgq4mgj88r23mxwzdfa28ws506il";
rev = "9439ee900358598cecc682db327aa30e506172b5";
sha256 = "1z5s8ifq7fbpqi6sx2i87rmz63kbgh9ck94fs2qf21ixhxi46nm3";
};
nativeBuildInputs = [ python3Packages.pbr ];
@ -222,7 +259,7 @@ rec {
export PBR_VERSION=0.0.1
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "AXI support for Migen/MiSoC";
homepage = "https://github.com/peteut/migen-axi";
license = licenses.mit;
@ -243,7 +280,7 @@ rec {
# Non-standard test suite. Needs custom checkPhase.
doCheck = false;
meta = with stdenv.lib; {
meta = with lib; {
description = "Portable tool for executing LLVM and Clang style test suites";
homepage = http://llvm.org/docs/CommandGuide/lit.html;
license = licenses.ncsa;
@ -262,7 +299,7 @@ rec {
};
prePatch = "echo ${version} > RELEASE-VERSION";
meta = with stdenv.lib; {
meta = with lib; {
description = "A tool for checking tool output inspired by LLVM's FileCheck";
homepage = "https://github.com/stp/OutputCheck";
license = licenses.bsd3;

View File

@ -1,4 +1,4 @@
{ stdenv, makeWrapper, bash, buildRustPackage, curl, darwin
{ stdenv, lib, makeWrapper, bash, buildRustPackage, curl, darwin
, version
, src
, platform
@ -6,7 +6,7 @@
}:
let
inherit (stdenv.lib) optionalString;
inherit (lib) optionalString;
inherit (darwin.apple_sdk.frameworks) Security;
bootstrapping = versionType == "bootstrap";
@ -26,14 +26,14 @@ rec {
inherit version;
inherit src;
meta = with stdenv.lib; {
meta = with lib; {
homepage = http://www.rust-lang.org/;
description = "A safe, concurrent, practical language";
maintainers = with maintainers; [ sb0 ];
license = [ licenses.mit licenses.asl20 ];
};
buildInputs = [ bash ] ++ stdenv.lib.optional stdenv.isDarwin Security;
buildInputs = [ bash ] ++ lib.optional stdenv.isDarwin Security;
postPatch = ''
patchShebangs .
@ -60,7 +60,7 @@ rec {
install_name_tool -change /usr/lib/libresolv.9.dylib '${darwin.libresolv}/lib/libresolv.9.dylib' "$out/bin/rustdoc"
install_name_tool -change /usr/lib/libiconv.2.dylib '${darwin.libiconv}/lib/libiconv.2.dylib' "$out/bin/cargo"
install_name_tool -change /usr/lib/libresolv.9.dylib '${darwin.libresolv}/lib/libresolv.9.dylib' "$out/bin/cargo"
install_name_tool -change /usr/lib/libcurl.4.dylib '${stdenv.lib.getLib curl}/lib/libcurl.4.dylib' "$out/bin/cargo"
install_name_tool -change /usr/lib/libcurl.4.dylib '${lib.getLib curl}/lib/libcurl.4.dylib' "$out/bin/cargo"
for f in $out/lib/lib*.dylib; do
install_name_tool -change /usr/lib/libresolv.9.dylib '${darwin.libresolv}/lib/libresolv.9.dylib' "$f"
done
@ -80,14 +80,14 @@ rec {
inherit version;
inherit src;
meta = with stdenv.lib; {
meta = with lib; {
homepage = http://www.rust-lang.org/;
description = "A safe, concurrent, practical language";
maintainers = with maintainers; [ sb0 ];
license = [ licenses.mit licenses.asl20 ];
};
buildInputs = [ makeWrapper bash ] ++ stdenv.lib.optional stdenv.isDarwin Security;
buildInputs = [ makeWrapper bash ] ++ lib.optional stdenv.isDarwin Security;
postPatch = ''
patchShebangs .
@ -107,7 +107,7 @@ rec {
${optionalString (stdenv.isDarwin && bootstrapping) ''
install_name_tool -change /usr/lib/libiconv.2.dylib '${darwin.libiconv}/lib/libiconv.2.dylib' "$out/bin/cargo"
install_name_tool -change /usr/lib/libresolv.9.dylib '${darwin.libresolv}/lib/libresolv.9.dylib' "$out/bin/cargo"
install_name_tool -change /usr/lib/libcurl.4.dylib '${stdenv.lib.getLib curl}/lib/libcurl.4.dylib' "$out/bin/cargo"
install_name_tool -change /usr/lib/libcurl.4.dylib '${lib.getLib curl}/lib/libcurl.4.dylib' "$out/bin/cargo"
''}
wrapProgram "$out/bin/cargo" \

View File

@ -1,4 +1,4 @@
{ stdenv, file, curl, pkgconfig, python, openssl, cmake, zlib
{ stdenv, lib, file, curl, pkgconfig, python, openssl, cmake, zlib
, makeWrapper, libiconv, cacert, rustPlatform, rustc, libgit2
, fetchurl
}:
@ -7,7 +7,7 @@ rustPlatform.buildRustPackage rec {
# Note: we can't build cargo 1.28.0 because rustc tightened the borrow checker rules and broke
# backward compatibility, which affects old cargo versions.
# There are also issues with asm/llvm_asm with recent rustc and cargo versions prior to 1.39.
name = "cargo-${version}";
pname = "cargo";
version = "1.39.0";
src = fetchurl {
url = "https://static.rust-lang.org/dist/rustc-1.39.0-src.tar.gz";
@ -52,7 +52,7 @@ rustPlatform.buildRustPackage rec {
# Disable check phase as there are failures (4 tests fail)
doCheck = false;
meta = with stdenv.lib; {
meta = with lib; {
homepage = https://crates.io;
description = "Downloads your Rust project's dependencies and builds your project";
maintainers = with maintainers; [ wizeman retrry ];

View File

@ -1,4 +1,4 @@
{ stdenv, targetPackages
{ stdenv, lib, targetPackages
, fetchurl, file, python2, tzdata, ps
, llvm-or1k, ncurses, zlib, darwin, rustPlatform, git, cmake, curl
, which, libffi, gdb
@ -14,7 +14,7 @@
}:
let
inherit (stdenv.lib) optional optionalString;
inherit (lib) optional optionalString;
inherit (darwin.apple_sdk.frameworks) Security;
target = builtins.replaceStrings [" "] [","] (builtins.toString targets);
@ -26,7 +26,7 @@ let
in
stdenv.mkDerivation {
name = "rustc-${version}";
pname = "rustc";
inherit version;
inherit src;
@ -171,7 +171,7 @@ stdenv.mkDerivation {
# https://github.com/rust-lang/rust/issues/30181
# enableParallelBuilding = false;
meta = with stdenv.lib; {
meta = with lib; {
homepage = https://www.rust-lang.org/;
description = "A safe, concurrent, practical language";
maintainers = with maintainers; [ sb0 ];

View File

@ -8,7 +8,7 @@ in
buildInputs = [
vivado
pkgs.gnumake
(pkgs.python3.withPackages(ps: (with ps; [ jinja2 numpy paramiko ]) ++ (with artiqpkgs; [ migen microscope misoc jesd204b migen-axi artiq ])))
(pkgs.python3.withPackages(ps: (with ps; [ jinja2 jsonschema numpy paramiko ]) ++ (with artiqpkgs; [ migen microscope misoc jesd204b migen-axi artiq ])))
artiqpkgs.cargo
artiqpkgs.rustc
artiqpkgs.binutils-or1k

View File

@ -15,6 +15,7 @@ let
name = "conda-deps";
script = let
artiq6 = pkgs.lib.strings.versionAtLeast artiqpkgs.artiq.version "6.0";
qt-asyncio-package = if artiq6 then artiqpkgs.conda-qasync else artiqpkgs.conda-quamash;
conda-deps-noarch = import (if artiq6 then ./conda_noarch_packages.nix else ./conda_noarch_packages-legacy.nix) { inherit pkgs; };
conda-deps-win-64 = import (if artiq6 then ./conda_win-64_packages.nix else ./conda_win-64_packages-legacy.nix) { inherit pkgs; };
conda-packages-put = pkgs.lib.strings.concatStringsSep "\n"
@ -32,7 +33,7 @@ let
win-put ${artiqpkgs.conda-pythonparser}/noarch/*.tar.bz2 'fake-channel/noarch'
win-put ${artiqpkgs.conda-sipyco}/noarch/*.tar.bz2 'fake-channel/noarch'
win-put ${artiqpkgs.conda-quamash}/noarch/*.tar.bz2 'fake-channel/noarch'
win-put ${qt-asyncio-package}/noarch/*.tar.bz2 'fake-channel/noarch'
'';
};
in

View File

@ -1,118 +1,128 @@
{ pkgs ? import <nixpkgs> {}}:
{ a6p ? <a6p>
, artiq-fast ? (
if a6p
then <artiq-board-generated/fast>
else <artiq-fast>
)
, pkgs ? import (artiq-fast + "/pkgs/nixpkgs.nix") { inherit (import <nixpkgs> {}) fetchgit; } {}
}:
let
sinaraSystemsSrc = <sinaraSystemsSrc>;
sinaraSystemsRev = builtins.readFile <artiq-board-generated/sinara-rev.txt>;
sinaraSystemsHash = builtins.readFile <artiq-board-generated/sinara-hash.txt>;
sinaraSystemsSrc =
if a6p
then pkgs.fetchgit {
url = "https://git.m-labs.hk/M-Labs/sinara-systems.git";
rev = sinaraSystemsRev;
sha256 = sinaraSystemsHash;
}
else <sinaraSystemsSrc>;
artiqVersion = import (artiq-fast + "/pkgs/artiq-version.nix") {
inherit (pkgs) stdenv git fetchgit;
};
targets = import ./artiq-full/artiq-targets.nix {
inherit pkgs artiqVersion sinaraSystemsSrc;
};
kasliVariants = map ({ variant, ... }: variant) (
builtins.filter ({ target, ... }: target == "kasli") (
builtins.attrValues targets
)
);
standaloneVariants = map ({ variant, ... }: variant) (
builtins.filter ({ target, standalone ? false, ... }: target == "kasli" && standalone) (
builtins.attrValues targets
)
);
serializedTargets = pkgs.lib.generators.toPretty {} (
map (conf:
if conf ? buildCommand
then conf // {
buildCommand = builtins.replaceStrings ["$"] ["\\\\\\$"] conf.buildCommand;
}
else conf
) (builtins.attrValues targets)
);
generatedNix = pkgs.runCommand "generated-nix" { buildInputs = [ pkgs.nix pkgs.git ]; }
''
mkdir $out
cp -a ${<artiq-fast>} $out/fast
cp ${./artiq-full/conda-artiq-board.nix} $out/conda-artiq-board.nix
cp ${./artiq-full/extras.nix} $out/extras.nix
${if a6p
then ''
cp -a ${<artiq-board-generated>} $out/board-generated
ln -s board-generated/fast $out/fast
''
else "cp -a ${<artiq-fast>} $out/fast"}
cp ${./artiq-full}/artiq-board-vivado.nix $out
cp ${./artiq-full}/generate-identifier.py $out
cp ${./artiq-full}/conda-artiq-board.nix $out
cp ${./artiq-full}/extras.nix $out
cp ${./artiq-full}/*.patch $out
REV=`git --git-dir ${sinaraSystemsSrc}/.git rev-parse HEAD`
SINARA_SRC_CLEAN=`mktemp -d`
cp -a ${sinaraSystemsSrc}/. $SINARA_SRC_CLEAN
chmod -R 755 $SINARA_SRC_CLEAN/.git
chmod 755 $SINARA_SRC_CLEAN
rm -rf $SINARA_SRC_CLEAN/.git
HASH=`nix-hash --type sha256 --base32 $SINARA_SRC_CLEAN`
${if a6p
then ''
REV=${sinaraSystemsRev}
HASH=${sinaraSystemsHash}
''
else ''
REV=`git --git-dir ${sinaraSystemsSrc}/.git rev-parse HEAD`
SINARA_SRC_CLEAN=`mktemp -d`
cp -a ${sinaraSystemsSrc}/. $SINARA_SRC_CLEAN
chmod -R 755 $SINARA_SRC_CLEAN/.git
chmod 755 $SINARA_SRC_CLEAN
rm -rf $SINARA_SRC_CLEAN/.git
HASH=`nix-hash --type sha256 --base32 $SINARA_SRC_CLEAN`
''}
cat > $out/default.nix << EOF
{ pkgs ? import <nixpkgs> {}}:
{ pkgs ? import ./fast/pkgs/nixpkgs.nix { inherit (import <nixpkgs> {}) fetchgit; } {} }:
let
artiq-fast = import ./fast { inherit pkgs; };
artiq-fast = import ${if a6p then "./board-generated" else "."}/fast { inherit pkgs; };
ddbDeps = [
artiq-fast.artiq
(pkgs.python3.withPackages (ps: [ ps.jsonschema ]))
];
target = "kasli";
variants = [
"afmaster"
"afsatellite"
"berkeley3"
"csu"
"duke3"
"femto1"
"femto2"
"femto3"
"freiburg1"
"griffith"
"hub"
"hw"
"indiana"
"innsbruck2"
"ist"
"liaf"
"luh2"
"luh3"
"mikes"
"mit"
"mitll3"
"mitll4master"
"mitll4satellite"
"mpik"
"mpq"
"nict"
"nist"
"no"
"npl1"
"npl2"
"oklahoma"
"olomouc"
"opticlock"
"oregon"
"osaka"
"ptb"
"ptb2"
"ptb3"
"ptb4"
"ptb5"
"ptb6"
"ptbal"
"ptbin"
"purpleberry"
"qe"
"qleds"
"rice"
"saymamaster"
"siegen"
"sydney"
"uaarhus"
"ubirmingham"
"ugranada"
"unlv"
"ustc2"
"vlbaimaster"
"vlbaisatellite"
"wipm"
"wipm5master"
"wipm5satellite"
] ++ (pkgs.lib.lists.optionals (pkgs.lib.strings.versionAtLeast artiq-fast.artiq.version "6.0") [
"bonn1master"
"bonn1satellite"
"hw2master"
"hw2satellite"
"luh"
"purduemaster"
"purduesatellite"
"uamsterdam"
]);
kasliVariants = [${builtins.concatStringsSep " " (
builtins.map (variant: "\"${variant}\"") kasliVariants
)}];
standaloneVariants = [${builtins.concatStringsSep " " (
builtins.map (variant: "\"${variant}\"") standaloneVariants
)}];
vivado = import ./fast/vivado.nix { inherit pkgs; };
artiq-board = import ./fast/artiq-board.nix { inherit pkgs vivado; };
vivado = import ${if a6p then "./board-generated" else "."}/fast/vivado.nix {
inherit pkgs;
};
artiq-board =
${if a6p
then ''
import ./artiq-board-vivado.nix {
inherit pkgs vivado;
version = artiq-fast.artiq.version;
board-generated = import ./board-generated {
inherit pkgs;
};
}
''
else ''
import ./fast/artiq-board.nix {
inherit pkgs vivado;
}
''};
conda-artiq-board = import ./conda-artiq-board.nix { inherit pkgs; };
src = pkgs.fetchgit {
url = "https://git.m-labs.hk/M-Labs/sinara-systems.git";
rev = "$REV";
sha256 = "$HASH";
};
generic-kasli = pkgs.lib.lists.foldr (variant: start:
artiq-targets = pkgs.lib.lists.foldr (conf: start:
let
json = builtins.toPath (src + "/\''${variant}.json");
boardBinaries = artiq-board {
inherit target variant;
inherit (conf) target variant;
json = src + "/\''${variant}.json";
boardBinaries = artiq-board (conf // {
src = json;
buildCommand = "python -m artiq.gateware.targets.kasli_generic \$src";
};
});
in
start // {
"artiq-board-\''${target}-\''${variant}" = boardBinaries;
@ -120,10 +130,13 @@ let
boardBinaries = boardBinaries;
inherit target variant;
};
} // (pkgs.lib.optionalAttrs ((builtins.fromJSON (builtins.readFile json)).base == "standalone") {
} // (pkgs.lib.optionalAttrs (
target == "kasli" &&
builtins.elem variant standaloneVariants
) {
"device-db-\''${target}-\''${variant}" = pkgs.stdenv.mkDerivation {
name = "device-db-\''${target}-\''${variant}";
buildInputs = [ artiq-fast.artiq ];
buildInputs = ddbDeps;
phases = [ "buildPhase" ];
buildPhase = "
mkdir \$out
@ -132,62 +145,64 @@ let
echo file device_db_template \$out/device_db.py >> \$out/nix-support/hydra-build-products
";
};
})) {} variants;
})
) {} ${serializedTargets};
drtio-systems = {
af = {
master = "afmaster";
satellites = {
"1" = "afsatellite";
${pkgs.lib.optionalString a6p ''
berkeley3 = {
master = "berkeley3master";
satellites = {
"1" = "berkeley3satellite";
};
};
};
mitll4 = {
master = "mitll4master";
satellites = {
"1" = "mitll4satellite";
bonn1 = {
master = "bonn1master";
satellites = {
"1" = "bonn1satellite";
};
};
};
vlbai = {
master = "vlbaimaster";
satellites = {
"1" = "vlbaisatellite";
hw2 = {
master = "hw2master";
satellites = {
"1" = "hw2satellite";
};
};
};
wipm5 = {
master = "wipm5master";
satellites = {
"1" = "wipm5satellite";
ptb3 = {
master = "ptb3master";
satellites = {
"1" = "ptb3satellite";
};
};
};
} // (pkgs.lib.optionalAttrs (pkgs.lib.strings.versionAtLeast artiq-fast.artiq.version "6.0") {
bonn1 = {
master = "bonn1master";
satellites = {
"1" = "bonn1satellite";
purdue = {
master = "purduemaster";
satellites = {
"1" = "purduesatellite";
};
};
};
hw2 = {
master = "hw2master";
satellites = {
"1" = "hw2satellite";
stfc = {
master = "stfcmaster";
satellites = {
"1" = "stfcsatellite";
};
};
};
purdue = {
master = "purduemaster";
satellites = {
"1" = "purduesatellite";
wipm7 = {
master = "wipm7master";
satellites = {
"1" = "wipm7satellite";
};
};
};
});
''}
};
drtio-ddbs = pkgs.lib.attrsets.mapAttrs'
(system: crates: pkgs.lib.attrsets.nameValuePair ("device-db-" + system)
(pkgs.stdenv.mkDerivation {
name = "device-db-\''${system}";
buildInputs = [ artiq-fast.artiq ];
buildInputs = ddbDeps;
phases = [ "buildPhase" ];
buildPhase = "
mkdir \$out
artiq_ddb_template \
\''${pkgs.lib.strings.concatStringsSep " " (pkgs.lib.attrsets.mapAttrsToList (dest: desc: "-s " + dest + " " + src + "/" + desc + ".json") crates.satellites) } \
\''${pkgs.lib.strings.concatStringsSep " " (pkgs.lib.attrsets.mapAttrsToList (dest: desc: "-s " + dest + " " + (src + "/\''${desc}.json")) crates.satellites) } \
\''${src}/\''${crates.master}.json -o \$out/device_db.py
mkdir \$out/nix-support
echo file device_db_template \$out/device_db.py >> \$out/nix-support/hydra-build-products
@ -195,42 +210,7 @@ let
})) drtio-systems;
extras = import ./extras.nix { inherit pkgs; inherit (artiq-fast) sipyco asyncserial artiq; };
in
artiq-fast // generic-kasli // drtio-ddbs // extras // rec {
artiq-board-sayma-rtm = artiq-board {
target = "sayma";
variant = "rtm";
buildCommand = "python -m artiq.gateware.targets.sayma_rtm";
};
artiq-board-sayma-satellite = artiq-board {
target = "sayma";
variant = "satellite";
buildCommand = "python -m artiq.gateware.targets.sayma_amc";
};
artiq-board-metlino-master = artiq-board {
target = "metlino";
variant = "master";
buildCommand = "python -m artiq.gateware.targets.metlino";
};
artiq-board-kc705-nist_qc2 = artiq-board {
target = "kc705";
variant = "nist_qc2";
};
conda-artiq-board-sayma-rtm = conda-artiq-board {
target = "sayma";
variant = "rtm";
boardBinaries = artiq-board-sayma-rtm;
};
conda-artiq-board-sayma-satellite = conda-artiq-board {
target = "sayma";
variant = "satellite";
boardBinaries = artiq-board-sayma-satellite;
};
conda-artiq-board-metlino-master = conda-artiq-board {
target = "metlino";
variant = "master";
boardBinaries = artiq-board-metlino-master;
};
artiq-fast // artiq-targets // drtio-ddbs // extras // rec {
conda-artiq-board-kasli-tester = conda-artiq-board {
target = "kasli";
variant = "tester";
@ -241,28 +221,22 @@ let
variant = "nist_clock";
boardBinaries = artiq-fast.artiq-board-kc705-nist_clock;
};
conda-artiq-board-kc705-nist_qc2 = conda-artiq-board {
target = "kc705";
variant = "nist_qc2";
boardBinaries = artiq-board-kc705-nist_qc2;
};
}
EOF
'';
pythonDeps = import ./artiq-full/python-deps.nix { inherit pkgs; };
sipycoManualPackages = import ./artiq-full/sipyco-manual.nix {
inherit (pkgs) stdenv lib python3Packages texlive texinfo;
inherit (import <artiq-fast> { inherit pkgs; }) sipyco;
inherit (import artiq-fast { inherit pkgs; }) sipyco;
};
artiqManualPackages = import ./artiq-full/artiq-manual.nix {
inherit (pkgs) stdenv lib fetchgit git python3Packages texlive texinfo;
inherit (pythonDeps) sphinxcontrib-wavedrom;
inherit artiq-fast;
};
jobs = (import generatedNix { inherit pkgs; }) // sipycoManualPackages // artiqManualPackages // {
# This is in the example in the ARTIQ manual - precompile it to speed up
# installation for users.
matplotlib-qt = pkgs.lib.hydraJob (pkgs.python3Packages.matplotlib.override { enableQt = true; });
};
artiq-full = import generatedNix { inherit pkgs; };
exampleUserEnv = import ./artiq-full/example-user-env.nix { inherit pkgs artiq-full; };
jobs = artiq-full // sipycoManualPackages // artiqManualPackages // exampleUserEnv;
in
builtins.mapAttrs (key: value: pkgs.lib.hydraJob value) jobs // {
artiq-full = pkgs.releaseTools.channel {
@ -270,5 +244,5 @@ in
src = generatedNix;
constituents = [];
};
conda-channel = import ./artiq-full/conda-channel.nix { inherit pkgs; } { inherit jobs; };
conda-channel = import ./artiq-full/conda-channel.nix { inherit pkgs artiq-fast; } { inherit jobs; };
}

View File

@ -0,0 +1,125 @@
# Install Vivado in /opt and add to /etc/nixos/configuration.nix:
# nix.sandboxPaths = ["/opt"];
{ pkgs
, vivado ? import ./fast/vivado.nix { inherit pkgs; }
, board-generated
, version
}:
let
# Funnelling the source code through a Nix string allows dropping
# all dependencies via `unsafeDiscardStringContext`.
discardContextFromPath = { name, src }:
let
packed = pkgs.stdenv.mkDerivation {
name = "${name}.nar.base64";
buildInputs = [ pkgs.nix ];
phases = [ "installPhase" ];
installPhase = "nix-store --dump ${src} | base64 -w0 > $out";
};
unpacked = archive:
pkgs.stdenvNoCC.mkDerivation {
name = builtins.unsafeDiscardStringContext name;
phases = [ "installPhase" ];
buildInputs = [ pkgs.nix ];
installPhase = "base64 -d < ${archive} | nix-store --restore $out";
};
in
unpacked (
builtins.toFile "${builtins.unsafeDiscardStringContext name}.nar.base64" (
builtins.unsafeDiscardStringContext (
builtins.readFile packed
))) ;
in
{ target
, variant
, extraInstallCommands ? ""
, ... }:
let
name = "artiq-board-${target}-${variant}-${version}";
installPath = builtins.unsafeDiscardStringContext "${pkgs.python3Packages.python.sitePackages}/artiq/board-support/${target}-${variant}";
generated = board-generated."artiq-board-${target}-${variant}";
identifierStr = "${version};${variant}";
identifiers = import (
pkgs.runCommandLocal "${name}-identifiers.nix" {
buildInputs = [ pkgs.python3 ];
} ''python ${./generate-identifier.py} "${identifierStr}" > $out''
);
# Depends on just Vivado and the generated Bitstream source
vivadoCheckpoint = pkgs.stdenvNoCC.mkDerivation {
name = builtins.unsafeDiscardStringContext "${name}-vivado-checkpoint";
src = discardContextFromPath {
name = "${name}-gateware";
src = "${generated}/gateware";
};
buildInputs = [ vivado pkgs.nix ];
buildPhase = ''
vivado -mode batch -source top_route.tcl
'';
installPhase = ''
mkdir -p $out
chmod a+r top_route.dcp
cp top_route.dcp $out
cp top_bitstream.tcl $out
'';
};
vivadoOutput = pkgs.stdenvNoCC.mkDerivation {
name = builtins.unsafeDiscardStringContext "${name}-vivado-output";
src = vivadoCheckpoint;
buildInputs = [ vivado ];
buildPhase =
''
cat >top.tcl <<EOF
open_checkpoint top_route.dcp
'' +
(pkgs.lib.concatMapStrings ({ cell, init }:
''
set_property INIT ${init} [get_cell ${cell}]
''
) identifiers) +
''
source "top_bitstream.tcl"
EOF
vivado -mode batch -source top.tcl
'';
installPhase = ''
TARGET_DIR=$out/${installPath}
mkdir -p $TARGET_DIR
chmod a+r top.bit
cp top.bit $TARGET_DIR/
'';
# temporarily disabled because there is currently always at least one Kasli bitstream
# that fails timing and blocks the conda channel.
doCheck = false;
checkPhase = ''
# Search for PCREs in the Vivado output to check for errors
check_log() {
set +e
grep -Pe "$1" vivado.log
FOUND=$?
set -e
if [ $FOUND != 1 ]; then
exit 1
fi
}
check_log "\d+ constraint not met\."
check_log "Timing constraints are not met\."
'';
};
in
pkgs.python3Packages.toPythonModule (
pkgs.buildEnv rec {
inherit name;
paths = [ generated vivadoOutput ];
pathsToLink = [ "/${installPath}" ];
})

View File

@ -1,7 +1,7 @@
{ stdenv, lib, fetchgit, git, python3Packages, texlive, texinfo, sphinxcontrib-wavedrom }:
{ stdenv, lib, fetchgit, git, python3Packages, texlive, texinfo, sphinxcontrib-wavedrom, artiq-fast }:
let
artiqVersion = import <artiq-fast/pkgs/artiq-version.nix> { inherit stdenv fetchgit git; };
artiqVersion = import (artiq-fast + "/pkgs/artiq-version.nix") { inherit stdenv fetchgit git; };
isLatexPdfTarget = target: builtins.match "latexpdf.*" target != null;
@ -16,7 +16,7 @@ let
name = "artiq-manual-${target}-${version}";
version = artiqVersion;
src = import <artiq-fast/pkgs/artiq-src.nix> { inherit fetchgit; };
src = import (artiq-fast + "/pkgs/artiq-src.nix") { inherit fetchgit; };
buildInputs = [
python3Packages.sphinx python3Packages.sphinx_rtd_theme
python3Packages.sphinx-argparse sphinxcontrib-wavedrom
@ -26,7 +26,7 @@ let
preBuild = ''
export VERSIONEER_OVERRIDE=${artiqVersion}
export SOURCE_DATE_EPOCH=${import <artiq-fast/pkgs/artiq-timestamp.nix> { inherit stdenv fetchgit git; }}
export SOURCE_DATE_EPOCH=${import (artiq-fast + "/pkgs/artiq-timestamp.nix") { inherit stdenv fetchgit git; }}
cd doc/manual
'';
makeFlags = [ target ];

View File

@ -0,0 +1,65 @@
{ pkgs
, artiqVersion
, sinaraSystemsSrc
}:
let
jsons =
map (jsonFile: builtins.fromJSON (
builtins.readFile (sinaraSystemsSrc + "/${jsonFile}")
)) (
builtins.attrNames (
pkgs.lib.filterAttrs (name: type:
type != "directory" &&
builtins.match ".+\\.json" name != null
) (builtins.readDir sinaraSystemsSrc)
)
);
kasli = builtins.listToAttrs (
builtins.map ({ variant, base, ... }: {
name = "artiq-board-kasli-${variant}";
value = {
target = "kasli";
inherit variant;
src = sinaraSystemsSrc + "/${variant}.json";
buildCommand = "python -m artiq.gateware.targets.kasli_generic $src";
standalone = base == "standalone";
};
}) (
builtins.filter (json:
pkgs.lib.strings.versionAtLeast artiqVersion (
if json ? min_artiq_version
then json.min_artiq_version
else "0"
)
) jsons
)
);
in
kasli // {
artiq-board-sayma-rtm = {
target = "sayma";
variant = "rtm";
buildCommand = "python -m artiq.gateware.targets.sayma_rtm";
};
artiq-board-sayma-satellite = {
target = "sayma";
variant = "satellite";
buildCommand = "python -m artiq.gateware.targets.sayma_amc";
};
artiq-board-metlino-master = {
target = "metlino";
variant = "master";
buildCommand = "python -m artiq.gateware.targets.metlino";
};
artiq-board-kc705-nist_qc2 = {
target = "kc705";
variant = "nist_qc2";
};
} // (pkgs.lib.optionalAttrs (pkgs.lib.strings.versionAtLeast artiqVersion "6.0") {
artiq-board-sayma-satellite-st = {
target = "sayma";
variant = "satellite";
buildCommand = "python -m artiq.gateware.targets.sayma_amc --jdcg-type syncdds";
};
})

View File

@ -1,8 +1,8 @@
{ pkgs }:
{ pkgs, artiq-fast }:
{ jobs }:
let
condaBuilderEnv = import <artiq-fast/conda/builder-env.nix> { inherit pkgs; };
condaBuilderEnv = import (artiq-fast + "/conda/builder-env.nix") { inherit pkgs; };
in
pkgs.runCommand "conda-channel" { }
''

View File

@ -0,0 +1,38 @@
{ pkgs, artiq-full }:
let
matplotlib-qt = (pkgs.python3Packages.matplotlib.override { enableQt = true; });
in
{
artiq-example-user-env = pkgs.runCommand "artiq-example-user-env" {
buildInputs = [
(pkgs.python3.withPackages(ps: [
artiq-full.artiq
artiq-full.artiq-comtools
artiq-full.wand
artiq-full.flake8-artiq
artiq-full.lda
artiq-full.korad_ka3005p
artiq-full.novatech409b
artiq-full.thorlabs_tcube
artiq-full.artiq-board-kc705-nist_clock
artiq-full.artiq-board-kasli-oregon
ps.paramiko
ps.pandas
ps.numpy
ps.scipy
ps.numba
ps.bokeh
matplotlib-qt
# cirq is broken and doesn't build (as of 20.09.3281.06b11191834)
#(ps.cirq.override { matplotlib = matplotlib-qt; })
# qiskit does not work with matplotlib-qt
#ps.qiskit
]))
artiq-full.openocd
pkgs.gtkwave
#pkgs.spyder # broken on 20.03
pkgs.R
];
} "touch $out";
}

View File

@ -3,13 +3,20 @@ let
condaBuild = import ./fast/conda/build.nix { inherit pkgs; };
condaFakeSource = import ./fast/conda/fake-source.nix { inherit pkgs; };
dualPackage = (
{ name, version, src, pythonOptions ? {}, condaOptions ? {}}:
{ name, version, src, pythonOptions ? {}, condaOptions ? {}, withManual ? true}:
{
"${name}" = pkgs.python3Packages.buildPythonPackage ({
inherit version;
name = "${name}-${version}";
inherit src;
} // pythonOptions);
"conda-${name}" = condaBuild {
name = "conda-${name}";
src = condaFakeSource ({
inherit name version src;
} // condaOptions);
};
} // (pkgs.lib.optionalAttrs withManual {
"${name}-manual-html" = pkgs.stdenv.mkDerivation {
name = "${name}-manual-html-${version}";
inherit version src;
@ -31,13 +38,7 @@ let
echo doc manual ${dest}/html index.html >> $out/nix-support/hydra-build-products
'';
};
"conda-${name}" = condaBuild {
name = "conda-${name}";
src = condaFakeSource ({
inherit name version src;
} // condaOptions);
};
}
})
);
# https://github.com/m-labs/artiq/issues/23
hidapi = pkgs.hidapi.overrideAttrs (oa: {
@ -55,8 +56,8 @@ in
src = pkgs.fetchFromGitHub {
owner = "m-labs";
repo = "korad_ka3005p";
rev = "a0cfaa5792a211e166d224314c4d0be4881b9b8d";
sha256 = "1bxzyjyvdhsbm9hj7ypf0vgkd1lvc340bb6lx3wchvh30n7bv9gv";
rev = "a1898409cb188b388ed1cf84e76ca69e9c8a74eb";
sha256 = "0h20qss70nssqiagc2fx75mravq1pji7rizhag3nq8xrcz2w20nc";
};
pythonOptions = { propagatedBuildInputs = [ sipyco asyncserial ]; };
condaOptions = { dependencies = [ "sipyco" "asyncserial" ]; };
@ -66,8 +67,8 @@ in
src = pkgs.fetchFromGitHub {
owner = "m-labs";
repo = "novatech409b";
rev = "8740b3e7b254e03395135e6bc128bbaca70d4fbb";
sha256 = "0mwm434y83y8jb30fpz69z6z3b6sxbc8dv3nw0hq4wc7iginx89d";
rev = "3bd559753972f07d881df66b7c6819afc5436053";
sha256 = "1g9qv6fn5h7d393mb1v7w8sg6fimqg34blqdj22qnayb4agw1wyg";
};
pythonOptions = { propagatedBuildInputs = [ sipyco asyncserial ]; };
condaOptions = { dependencies = [ "sipyco" "asyncserial" ]; };
@ -77,8 +78,8 @@ in
src = pkgs.fetchFromGitHub {
owner = "m-labs";
repo = "lda";
rev = "6138a94a1116c8f7b40b8bd8bb161f847065aab6";
sha256 = "1009k9pq8wx5zxrljkxr1g95g8q979i7mq3csksdkd3d0v2jvqif";
rev = "e6bf828b6dfd7fbf59b61b691712736c98c95970";
sha256 = "1w4ykzsl3386bz4ggpd6i60b6a3k7rnc6qjw59xm3hk0vs3w2vyn";
};
pythonOptions = {
propagatedBuildInputs = [ sipyco ];
@ -95,8 +96,8 @@ in
src = pkgs.fetchFromGitHub {
owner = "m-labs";
repo = "thorlabs_tcube";
rev = "8b85292d76a69ae72ba8da32b894c87c794574ba";
sha256 = "09cy9nhydcwdib21wb0qg1cinvibfbszwgphrmf2ajw5kqpr1d6a";
rev = "0cb0c15fc7e660a150e193245f5338d48f8b97db";
sha256 = "1n4zmjcj2kpd97217y602pq6x8s80w39fgyi6qjmal92aicqdg07";
};
pythonOptions = { propagatedBuildInputs = [ sipyco asyncserial ]; };
condaOptions = { dependencies = [ "sipyco" "asyncserial" ]; };
@ -194,6 +195,9 @@ in
sha256 = "165j12k9nnrkf2pv0idcv6xhnp1hnsllna4rps2dssnqgjfaw1ss";
};
propagatedBuildInputs = [ sipyco pkgs.python3Packages.numpy pkgs.python3Packages.aiohttp ];
# Modifies PATH to pass the wrapped python environment (i.e. python3.withPackages(...) to subprocesses.
# Allows subprocesses using python to find all packages you have installed
makeWrapperArgs = [ ''--run 'if [ ! -z "$NIX_PYTHONPREFIX" ]; then export PATH=$NIX_PYTHONPREFIX/bin:$PATH;fi' '' ];
};
conda-artiq-comtools = condaBuild {
name = "conda-artiq-comtools";
@ -203,4 +207,42 @@ in
dependencies = [ "sipyco" "numpy" "aiohttp >=3" ];
};
};
}
} // {
wand = pkgs.python3Packages.buildPythonApplication rec {
name = "wand";
version = "0.4.dev";
src = pkgs.fetchFromGitHub {
owner = "OxfordIonTrapGroup";
repo = "wand";
rev = "0bf1cfef4aa37e5761c20ac8702abec125b45e23";
sha256 = "0jfw6w6id7qkx2f6rklrmp13b2hsnvii1qbls60ampx399lcb43g";
};
patches = [ ./wand-fix-config-dir.patch ];
nativeBuildInputs = [ pkgs.qt5.wrapQtAppsHook ];
dontWrapQtApps = true;
postFixup = ''
wrapQtApp "$out/bin/wand_gui"
'';
propagatedBuildInputs = with pkgs.python3Packages; [ artiq quamash numpy scipy influxdb setuptools ];
};
} // (dualPackage {
name = "flake8-artiq";
version = "0.1.0";
withManual = false;
src = pkgs.fetchgit {
url = "https://gitlab.com/duke-artiq/flake8-artiq.git";
rev = "3d011bdadc41bb5d4b7e536fbfdb3744d9d9a6de";
sha256 = "1i6vk2j97fr1fnm6lzi5n33l6ldvcyfjgfxgr59pcpbz6xhbbgp2";
};
pythonOptions = {
propagatedBuildInputs = [ pkgs.python3Packages.flake8 ];
checkInputs = [ pkgs.python3Packages.pytest pkgs.python3Packages.mypy pkgs.python3Packages.flake8 ];
checkPhase =
''
pytest
mypy
flake8
'';
};
condaOptions = { dependencies = [ "flake8" ]; };
})

View File

@ -0,0 +1,24 @@
#!/usr/bin/env python
#
# Encodes data like ARTIQ build_soc.py ReprogrammableIdentifier
import sys
if len(sys.argv) != 2:
raise ValueError('argument missing')
identifier_str = sys.argv[1]
contents = list(identifier_str.encode())
l = len(contents)
if l > 255:
raise ValueError("Identifier string must be 255 characters or less")
contents.insert(0, l)
f = sys.stdout
f.write("[\n");
for i in range(7):
init = sum(1 << j if c & (1 << i) else 0 for j, c in enumerate(contents))
f.write(
' {{ cell = "identifier_str{}"; init = "256\'h{:X}"; }}\n'.format(i, init)
)
f.write("]\n");

View File

@ -3,18 +3,18 @@
rec {
wavedrom = pkgs.python3Packages.buildPythonPackage rec {
pname = "wavedrom";
version = "0.1";
version = "2.0.3.post2";
src = pkgs.python3Packages.fetchPypi {
inherit pname version;
sha256 = "006w683zlmmwcw5xz1n5dwg34ims5jg3gl2700ql4wr0myjz6710";
sha256 = "13a4086417nv836s2wbj3f4r31gwapbyw5smgl00jsqizwsk96r3";
};
buildInputs = [ pkgs.python3Packages.setuptools_scm ];
propagatedBuildInputs = with pkgs.python3Packages; [ svgwrite attrdict ];
doCheck = false;
meta = with pkgs.stdenv.lib; {
meta = with pkgs.lib; {
description = "WaveDrom compatible Python module and command line";
homepage = "https://pypi.org/project/wavedrom/";
license = licenses.mit;
@ -23,18 +23,18 @@ rec {
sphinxcontrib-wavedrom = pkgs.python3Packages.buildPythonPackage rec {
pname = "sphinxcontrib-wavedrom";
version = "2.0.0";
version = "2.1.1";
src = pkgs.python3Packages.fetchPypi {
inherit pname version;
sha256 = "0nk36zqq5ipxqx9izz2iazb3iraasanv3nm05bjr21gw42zgkz22";
sha256 = "09xq4csdcil2x8mm38yd5k6lfbkazicvm278xnzwbfc9vghkqqs2";
};
buildInputs = [ pkgs.python3Packages.setuptools_scm ];
propagatedBuildInputs = [ wavedrom ] ++ (with pkgs.python3Packages; [ sphinx xcffib cairosvg ]);
doCheck = false;
meta = with pkgs.stdenv.lib; {
meta = with pkgs.lib; {
description = "A Sphinx extension that allows including WaveDrom diagrams";
homepage = "https://pypi.org/project/sphinxcontrib-wavedrom/";
license = licenses.mit;

View File

@ -0,0 +1,30 @@
diff --git a/wand/tools.py b/wand/tools.py
index a51dabd..4d5a9d1 100644
--- a/wand/tools.py
+++ b/wand/tools.py
@@ -6,6 +6,7 @@ import shutil
import logging
from sipyco import pyon
+from artiq.appdirs import user_config_dir
import wand
logger = logging.getLogger(__name__)
@@ -26,10 +27,15 @@ class LockException(Exception):
pass
+def get_user_config_dir():
+ dir = user_config_dir("wand", "oitg", "1")
+ os.makedirs(dir, exist_ok=True)
+ return dir
+
+
def get_config_path(args, name_suffix=""):
config_file = "{}{}_config.pyon".format(args.name, name_suffix)
- wand_dir = os.path.dirname(wand.__file__)
- config_path = os.path.join(wand_dir, config_file)
+ config_path = os.path.join(get_user_config_dir(), config_file)
if args.backup_dir == "":
backup_path = ""

View File

@ -1,14 +1,15 @@
{ pkgs ? import <nixpkgs> {} }:
let
artiqpkgs = import ../artiq-fast/pkgs/python-deps.nix { inherit (pkgs) stdenv fetchFromGitHub python3Packages; misoc-new = false; };
artiqpkgs = import ../artiq-fast/pkgs/python-deps.nix { inherit (pkgs) stdenv fetchgit fetchFromGitHub python3Packages; misoc-new = true; };
ise = import ./ise.nix { inherit pkgs; };
vivado = import ../artiq-fast/vivado.nix { inherit pkgs; };
buildUrukulCpld = {version, src}: pkgs.stdenv.mkDerivation {
name = "urukul-cpld-${version}";
inherit src;
pname = "urukul-cpld";
inherit src version;
buildInputs = [(pkgs.python3.withPackages(ps: [artiqpkgs.migen]))] ++ (builtins.attrValues ise);
phases = ["buildPhase" "installPhase"];
buildPhase = "python $src/urukul_impl.py";
installPhase =
installPhase =
''
mkdir -p $out $out/nix-support
cp build/urukul.jed $out
@ -16,12 +17,12 @@ let
'';
};
buildMirnyCpld = {version, src}: pkgs.stdenv.mkDerivation {
name = "mirny-cpld-${version}";
inherit src;
pname = "mirny-cpld";
inherit src version;
buildInputs = [(pkgs.python3.withPackages(ps: [artiqpkgs.migen]))] ++ (builtins.attrValues ise);
phases = ["buildPhase" "installPhase"];
buildPhase = "python $src/mirny_impl.py";
installPhase =
installPhase =
''
mkdir -p $out $out/nix-support
cp build/mirny.jed $out
@ -78,4 +79,27 @@ in
echo file binary-dist $out/fastino.bin >> $out/nix-support/hydra-build-products
'';
};
phaser-fpga = pkgs.stdenv.mkDerivation {
name = "phaser-fpga";
src = <phaserSrc>;
patchPhase = ''
substituteInPlace phaser.py \
--replace "source ../load.tcl" \
""
'';
buildInputs = [ (pkgs.python3.withPackages(ps: [ artiqpkgs.migen artiqpkgs.misoc ])) ] ++ [ vivado ];
buildPhase = "python phaser.py";
installPhase =
''
mkdir -p $out $out/nix-support
cp build/phaser.bit $out
echo file binary-dist $out/phaser.bit >> $out/nix-support/hydra-build-products
'';
dontFixup = true;
doCheck = true;
checkInputs = [ pkgs.python3Packages.pytest ];
checkPhase = "pytest";
};
}

View File

@ -1,16 +1,187 @@
{
"enabled": 1,
"hidden": true,
"description": "js",
"nixexprinput": "nixScripts",
"nixexprpath": "hydra/artiq.nix",
"checkinterval": 300,
"schedulingshares": 10,
"enableemail": false,
"emailoverride": "",
"keepnr": 10,
"inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-20.03", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false }
"fast-beta": {
"enabled": 1,
"hidden": false,
"description": "Core ARTIQ packages to build fast for CI purposes (beta version)",
"nixexprinput": "nixScripts",
"nixexprpath": "artiq-fast.nix",
"checkinterval": 300,
"schedulingshares": 10,
"enableemail": false,
"emailoverride": "",
"keepnr": 1,
"inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs nixos-20.09", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/astro/nix-scripts.git", "emailresponsible": false },
"artiqSrc": { "type": "git", "value": "git://github.com/m-labs/artiq.git master 1", "emailresponsible": false }
}
},
"board-generated-beta": {
"enabled": 1,
"hidden": false,
"description": "Generated code for ARTIQ boards (beta version)",
"nixexprinput": "nixScripts",
"nixexprpath": "artiq-board-generated",
"checkinterval": 14400,
"schedulingshares": 1,
"enableemail": false,
"emailoverride": "",
"keepnr": 1,
"inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs nixos-20.09", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/astro/nix-scripts.git", "emailresponsible": false },
"sinaraSystemsSrc": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/sinara-systems.git master 1", "emailresponsible": false },
"artiq-fast": { "type": "sysbuild", "value": "artiq:fast-beta:generated-nix", "emailresponsible": false }
}
},
"full-beta": {
"enabled": 1,
"hidden": false,
"description": "Full set of ARTIQ packages (beta version)",
"nixexprinput": "nixScripts",
"nixexprpath": "artiq-full.nix",
"checkinterval": 86400,
"schedulingshares": 1,
"enableemail": false,
"emailoverride": "",
"keepnr": 1,
"inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs nixos-20.09", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/astro/nix-scripts.git", "emailresponsible": false },
"a6p": { "type": "boolean", "value": "true" },
"artiq-board-generated": { "type": "sysbuild", "value": "artiq:board-generated-beta:generated-nix", "emailresponsible": false }
}
},
"fast": {
"enabled": 1,
"hidden": false,
"description": "Core ARTIQ packages to build fast for CI purposes",
"nixexprinput": "nixScripts",
"nixexprpath": "artiq-fast.nix",
"checkinterval": 300,
"schedulingshares": 10,
"enableemail": false,
"emailoverride": "",
"keepnr": 1,
"inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs nixos-20.09", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/astro/nix-scripts.git", "emailresponsible": false },
"artiqSrc": { "type": "git", "value": "git://github.com/m-labs/artiq.git release-6 1", "emailresponsible": false }
}
},
"board-generated": {
"enabled": 1,
"hidden": false,
"description": "Generated code for ARTIQ boards",
"nixexprinput": "nixScripts",
"nixexprpath": "artiq-board-generated",
"checkinterval": 14400,
"schedulingshares": 1,
"enableemail": false,
"emailoverride": "",
"keepnr": 1,
"inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs nixos-20.09", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/astro/nix-scripts.git", "emailresponsible": false },
"sinaraSystemsSrc": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/sinara-systems.git master 1", "emailresponsible": false },
"artiq-fast": { "type": "sysbuild", "value": "artiq:fast:generated-nix", "emailresponsible": false }
}
},
"full": {
"enabled": 1,
"hidden": false,
"description": "Full set of ARTIQ packages",
"nixexprinput": "nixScripts",
"nixexprpath": "artiq-full.nix",
"checkinterval": 86400,
"schedulingshares": 1,
"enableemail": false,
"emailoverride": "",
"keepnr": 1,
"inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs nixos-20.09", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/astro/nix-scripts.git", "emailresponsible": false },
"a6p": { "type": "boolean", "value": "true" },
"artiq-board-generated": { "type": "sysbuild", "value": "artiq:board-generated:generated-nix", "emailresponsible": false }
}
},
"fast-legacy": {
"enabled": 1,
"hidden": false,
"description": "Core ARTIQ packages to build fast for CI purposes (legacy version)",
"nixexprinput": "nixScripts",
"nixexprpath": "artiq-fast.nix",
"checkinterval": 300,
"schedulingshares": 10,
"enableemail": false,
"emailoverride": "",
"keepnr": 1,
"inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs nixos-20.03", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/astro/nix-scripts.git", "emailresponsible": false },
"artiqSrc": { "type": "git", "value": "git://github.com/m-labs/artiq.git release-5 1", "emailresponsible": false }
}
},
"full-legacy": {
"enabled": 1,
"hidden": false,
"description": "Full set of ARTIQ packages (legacy version)",
"nixexprinput": "nixScripts",
"nixexprpath": "artiq-full.nix",
"checkinterval": 86400,
"schedulingshares": 1,
"enableemail": false,
"emailoverride": "",
"keepnr": 1,
"inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs nixos-20.03", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/astro/nix-scripts.git", "emailresponsible": false },
"sinaraSystemsSrc": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/sinara-systems.git master 1", "emailresponsible": false },
"a6p": { "type": "boolean", "value": "false" },
"artiq-fast": { "type": "sysbuild", "value": "artiq:fast-legacy:generated-nix", "emailresponsible": false }
}
},
"gluelogic": {
"enabled": 1,
"hidden": false,
"description": "Glue logic gateware for Sinara devices",
"nixexprinput": "nixScripts",
"nixexprpath": "gluelogic.nix",
"checkinterval": 172800,
"schedulingshares": 1,
"enableemail": false,
"emailoverride": "",
"keepnr": 1,
"inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs nixos-20.09", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/astro/nix-scripts.git", "emailresponsible": false },
"urukulSrc": { "type": "git", "value": "git://github.com/quartiq/urukul", "emailresponsible": false },
"mirnySrc": { "type": "git", "value": "git://github.com/quartiq/mirny", "emailresponsible": false },
"fastinoSrc": { "type": "git", "value": "git://github.com/quartiq/fastino", "emailresponsible": false },
"phaserSrc": { "type": "git", "value": "git://github.com/quartiq/phaser", "emailresponsible": false }
}
},
"zynq": {
"enabled": 1,
"hidden": false,
"description": "ARTIQ on Zynq",
"nixexprinput": "nixScripts",
"nixexprpath": "zynq.nix",
"checkinterval": 300,
"schedulingshares": 1,
"enableemail": false,
"emailoverride": "",
"keepnr": 1,
"inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs nixos-20.09", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/astro/nix-scripts.git", "emailresponsible": false },
"artiq-fast": { "type": "sysbuild", "value": "artiq:fast:generated-nix", "emailresponsible": false },
"zynq-rs": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/zynq-rs.git", "emailresponsible": false },
"artiq-zynq": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/artiq-zynq.git", "emailresponsible": false }
}
}
}

View File

@ -1,119 +0,0 @@
{ pkgs ? import <nixpkgs> {}}:
{
jobsets = pkgs.runCommand "spec.json" {}
''
cat > $out << EOF
{
"fast-beta": {
"enabled": 1,
"hidden": false,
"description": "Core ARTIQ packages to build fast for CI purposes (beta version)",
"nixexprinput": "nixScripts",
"nixexprpath": "artiq-fast.nix",
"checkinterval": 300,
"schedulingshares": 10,
"enableemail": false,
"emailoverride": "",
"keepnr": 10,
"inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-20.03", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
"artiqSrc": { "type": "git", "value": "git://github.com/m-labs/artiq.git master 1", "emailresponsible": false }
}
},
"full-beta": {
"enabled": 1,
"hidden": false,
"description": "Full set of ARTIQ packages (beta version)",
"nixexprinput": "nixScripts",
"nixexprpath": "artiq-full.nix",
"checkinterval": 86400,
"schedulingshares": 1,
"enableemail": false,
"emailoverride": "",
"keepnr": 10,
"inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-20.03", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
"sinaraSystemsSrc": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/sinara-systems.git master 1", "emailresponsible": false },
"artiq-fast": { "type": "sysbuild", "value": "artiq:fast-beta:generated-nix", "emailresponsible": false }
}
},
"fast": {
"enabled": 1,
"hidden": false,
"description": "Core ARTIQ packages to build fast for CI purposes",
"nixexprinput": "nixScripts",
"nixexprpath": "artiq-fast.nix",
"checkinterval": 300,
"schedulingshares": 10,
"enableemail": false,
"emailoverride": "",
"keepnr": 10,
"inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-20.03", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
"artiqSrc": { "type": "git", "value": "git://github.com/m-labs/artiq.git release-5 1", "emailresponsible": false }
}
},
"full": {
"enabled": 1,
"hidden": false,
"description": "Full set of ARTIQ packages",
"nixexprinput": "nixScripts",
"nixexprpath": "artiq-full.nix",
"checkinterval": 86400,
"schedulingshares": 1,
"enableemail": false,
"emailoverride": "",
"keepnr": 10,
"inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-20.03", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
"sinaraSystemsSrc": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/sinara-systems.git master 1", "emailresponsible": false },
"artiq-fast": { "type": "sysbuild", "value": "artiq:fast:generated-nix", "emailresponsible": false }
}
},
"gluelogic": {
"enabled": 1,
"hidden": false,
"description": "Glue logic gateware for Sinara devices",
"nixexprinput": "nixScripts",
"nixexprpath": "gluelogic.nix",
"checkinterval": 172800,
"schedulingshares": 1,
"enableemail": false,
"emailoverride": "",
"keepnr": 10,
"inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-20.03", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
"urukulSrc": { "type": "git", "value": "git://github.com/quartiq/urukul", "emailresponsible": false },
"mirnySrc": { "type": "git", "value": "git://github.com/quartiq/mirny", "emailresponsible": false },
"fastinoSrc": { "type": "git", "value": "git://github.com/quartiq/fastino", "emailresponsible": false }
}
},
"zynq": {
"enabled": 1,
"hidden": false,
"description": "ARTIQ on Zynq",
"nixexprinput": "nixScripts",
"nixexprpath": "zynq.nix",
"checkinterval": 300,
"schedulingshares": 1,
"enableemail": false,
"emailoverride": "",
"keepnr": 10,
"inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-20.03", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
"mozillaOverlay": { "type": "git", "value": "git://github.com/mozilla/nixpkgs-mozilla", "emailresponsible": false },
"artiq-fast": { "type": "sysbuild", "value": "artiq:fast-beta:generated-nix", "emailresponsible": false },
"zynq-rs": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/zynq-rs.git", "emailresponsible": false },
"artiq-zynq": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/artiq-zynq.git", "emailresponsible": false }
}
}
}
EOF
'';
}

View File

@ -1,16 +0,0 @@
{
"enabled": 1,
"hidden": true,
"description": "js",
"nixexprinput": "nixScripts",
"nixexprpath": "hydra/fpga.nix",
"checkinterval": 300,
"schedulingshares": 10,
"enableemail": false,
"emailoverride": "",
"keepnr": 10,
"inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-19.03", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false }
}
}

View File

@ -1,26 +0,0 @@
{ pkgs ? import <nixpkgs> {}}:
{
jobsets = pkgs.runCommand "spec.json" {}
''
cat > $out << EOF
{
"heavyx": {
"enabled": 1,
"hidden": false,
"description": "HeavyX SoC toolkit experiment",
"nixexprinput": "heavyx",
"nixexprpath": "release.nix",
"checkinterval": 300,
"schedulingshares": 10,
"enableemail": false,
"emailoverride": "",
"keepnr": 10,
"inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-19.03", "emailresponsible": false },
"heavyx": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/HeavyX.git", "emailresponsible": false }
}
}
}
EOF
'';
}

23
hydra/mcu.json Normal file
View File

@ -0,0 +1,23 @@
{
"mcu": {
"enabled": 1,
"hidden": false,
"description": "MCU firmware",
"nixexprinput": "nixScripts",
"nixexprpath": "mcu.nix",
"checkinterval": 300,
"schedulingshares": 10,
"enableemail": false,
"emailoverride": "",
"keepnr": 10,
"inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs nixos-20.09", "emailresponsible": false },
"mozillaOverlay": { "type": "git", "value": "git://github.com/mozilla/nixpkgs-mozilla.git", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
"stabilizerSrc": { "type": "git", "value": "git://github.com/quartiq/stabilizer.git", "emailresponsible": false },
"thermostatSrc": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/thermostat.git", "emailresponsible": false },
"humpbackDdsSrc": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/humpback-dds.git", "emailresponsible": false },
"saymaMmcSrc": { "type": "git", "value": "git://github.com/sinara-hw/openMMC sayma-devel", "emailresponsible": false }
}
}
}

View File

@ -1,16 +0,0 @@
{
"enabled": 1,
"hidden": true,
"description": "js",
"nixexprinput": "nixScripts",
"nixexprpath": "hydra/stm32.nix",
"checkinterval": 300,
"schedulingshares": 10,
"enableemail": false,
"emailoverride": "",
"keepnr": 10,
"inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-20.03", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false }
}
}

View File

@ -1,29 +0,0 @@
{ pkgs ? import <nixpkgs> {}}:
{
jobsets = pkgs.runCommand "spec.json" {}
''
cat > $out << EOF
{
"stm32": {
"enabled": 1,
"hidden": false,
"description": "STM32 firmware",
"nixexprinput": "nixScripts",
"nixexprpath": "stm32.nix",
"checkinterval": 300,
"schedulingshares": 10,
"enableemail": false,
"emailoverride": "",
"keepnr": 10,
"inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-20.03", "emailresponsible": false },
"mozillaOverlay": { "type": "git", "value": "git://github.com/mozilla/nixpkgs-mozilla.git", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
"stabilizerSrc": { "type": "git", "value": "git://github.com/quartiq/stabilizer.git", "emailresponsible": false },
"thermostatSrc": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/thermostat.git", "emailresponsible": false }
}
}
}
EOF
'';
}

View File

@ -1,16 +1,19 @@
{
"enabled": 1,
"hidden": true,
"description": "js",
"nixexprinput": "nixScripts",
"nixexprpath": "hydra/web.nix",
"checkinterval": 300,
"schedulingshares": 10,
"enableemail": false,
"emailoverride": "",
"keepnr": 10,
"inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-20.03", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false }
"web": {
"enabled": 1,
"hidden": false,
"description": "M-Labs website",
"nixexprinput": "nixScripts",
"nixexprpath": "web.nix",
"checkinterval": 300,
"schedulingshares": 10,
"enableemail": false,
"emailoverride": "",
"keepnr": 10,
"inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs nixos-20.03", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
"webSrc": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/web2019.git", "emailresponsible": false }
}
}
}

View File

@ -1,27 +0,0 @@
{ pkgs ? import <nixpkgs> {}}:
{
jobsets = pkgs.runCommand "spec.json" {}
''
cat > $out << EOF
{
"web": {
"enabled": 1,
"hidden": false,
"description": "M-Labs website",
"nixexprinput": "nixScripts",
"nixexprpath": "web.nix",
"checkinterval": 300,
"schedulingshares": 10,
"enableemail": false,
"emailoverride": "",
"keepnr": 10,
"inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-20.03", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
"webSrc": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/web2019.git", "emailresponsible": false }
}
}
}
EOF
'';
}

8
mcu.nix Normal file
View File

@ -0,0 +1,8 @@
{ pkgs ? import <nixpkgs> {} }:
let
jobs = import ./mcu/default.nix {
mozillaOverlay = import <mozillaOverlay>;
};
in
builtins.mapAttrs (key: value: pkgs.lib.hydraJob value) jobs

105
mcu/default.nix Normal file
View File

@ -0,0 +1,105 @@
{ # Use master branch of the overlay by default
mozillaOverlay ? import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz),
rustManifest ? ./channel-rust-nightly.toml
}:
let
pkgs = import <nixpkgs> { overlays = [ mozillaOverlay ]; };
rustPlatform = pkgs.recurseIntoAttrs (pkgs.callPackage ./rustPlatform.nix {
inherit rustManifest;
});
buildStm32Firmware = { name, src, patchPhase ? "", extraNativeBuildInputs ? [], checkPhase ? "", ... } @ args:
let
# If binaryName is specified as an arg of buildStm32Firmware,
# then the .nix containing the cargoSha256 must be named "cargosha256-${binaryName}.nix";
# otherwise, the .nix must be named "cargosha256.nix".
cargoSha256Drv = pkgs.runCommand "${name}-cargosha256" { } ''
cp "${src}/cargosha256${
if (args ? binaryName) then "-" + args.binaryName else ""
}.nix" $out
'';
# If binaryName is specified as an arg of buildStm32Firmware,
# then use it as the filename of the ELF generated from `cargo build`;
# otherwise, use the `name` arg (i.e. the Rust package name) as the ELF filename.
binaryName = if (args ? binaryName) then args.binaryName else name;
in
rustPlatform.buildRustPackage rec {
inherit name;
version = "0.0.0";
inherit src;
cargoSha256 = (import cargoSha256Drv);
inherit patchPhase;
nativeBuildInputs = [ pkgs.llvm ] ++ extraNativeBuildInputs;
buildPhase = ''
export CARGO_HOME=$(mktemp -d cargo-home.XXX)
cargo build --release
'';
inherit checkPhase;
installPhase = ''
mkdir -p $out $out/nix-support
cp target/thumbv7em-none-eabihf/release/${binaryName} $out/${name}.elf
echo file binary-dist $out/${name}.elf >> $out/nix-support/hydra-build-products
llvm-objcopy -O binary target/thumbv7em-none-eabihf/release/${binaryName} $out/${name}.bin
echo file binary-dist $out/${name}.bin >> $out/nix-support/hydra-build-products
'';
dontFixup = true;
};
migen = (import ../artiq-fast/pkgs/python-deps.nix { inherit (pkgs) stdenv fetchgit fetchFromGitHub python3Packages; misoc-new = true; }).migen;
in
{
stabilizer-dual-iir = buildStm32Firmware {
name = "stabilizer-dual-iir";
binaryName = "dual-iir";
src = <stabilizerSrc>;
patchPhase = ''
substituteInPlace src/hardware/configuration.rs \
--replace "IpAddress::v4(10, 34, 16, 103)" \
"IpAddress::v4(192, 168, 1, 76)" \
--replace "Ipv4Address::new(10, 34, 16, 1)" \
"Ipv4Address::new(192, 168, 1, 1)"
'';
};
thermostat = buildStm32Firmware {
name = "thermostat";
src = <thermostatSrc>;
checkPhase = ''
cargo test --target=${pkgs.rust.toRustTarget pkgs.stdenv.targetPlatform}
'';
};
humpback-dds = buildStm32Firmware {
name = "humpback-dds";
src = <humpbackDdsSrc>;
extraNativeBuildInputs = [
(pkgs.python3.withPackages(ps: [ migen ]))
pkgs.yosys
pkgs.nextpnr
pkgs.icestorm
];
};
# openMMC build system breaks if host compiler is not available, so do not use stdenvNoCC here
sayma-mmc = pkgs.stdenv.mkDerivation {
name = "sayma-mmc";
src = <saymaMmcSrc>;
phases = [ "unpackPhase" "buildPhase" "installPhase" ];
nativeBuildInputs = [ pkgs.cmake pkgs.gcc-arm-embedded ];
buildPhase =
''
mkdir build
cd build
cmake .. -DBOARD=sayma -DBOARD_RTM=sayma -DVERSION= -DTARGET_CONTROLLER=LPC1776 -DCMAKE_BUILD_TYPE=Debug
make
'';
installPhase =
''
mkdir $out
cp out/* $out
mkdir -p $out $out/nix-support
echo file binary-dist $out/openMMC.axf >> $out/nix-support/hydra-build-products
echo file binary-dist $out/openMMC.bin >> $out/nix-support/hydra-build-products
'';
};
}

View File

@ -1,9 +0,0 @@
{ pkgs ? import <nixpkgs> {}, rustManifest ? ./stm32/channel-rust-nightly.toml }:
let
jobs = import ./stm32/default.nix {
inherit rustManifest;
mozillaOverlay = import <mozillaOverlay>;
};
in
builtins.mapAttrs (key: value: pkgs.lib.hydraJob value) jobs

View File

@ -1,50 +0,0 @@
{ # Use master branch of the overlay by default
mozillaOverlay ? import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz),
rustManifest ? builtins.fetchurl "https://static.rust-lang.org/dist/channel-rust-nightly.toml"
}:
let
pkgs = import <nixpkgs> { overlays = [ mozillaOverlay ]; };
rustPlatform = pkgs.recurseIntoAttrs (pkgs.callPackage ./rustPlatform.nix {
inherit rustManifest;
});
buildStm32Firmware = { name, src, patchPhase ? "" }:
let
cargoSha256Drv = pkgs.runCommand "${name}-cargosha256" { } ''cp "${src}/cargosha256.nix" $out'';
in
rustPlatform.buildRustPackage rec {
inherit name;
version = "0.0.0";
inherit src;
cargoSha256 = (import cargoSha256Drv);
inherit patchPhase;
buildPhase = ''
export CARGO_HOME=$(mktemp -d cargo-home.XXX)
cargo build --release
'';
doCheck = false;
installPhase = ''
mkdir -p $out $out/nix-support
cp target/thumbv7em-none-eabihf/release/${name} $out/${name}.elf
echo file binary-dist $out/${name}.elf >> $out/nix-support/hydra-build-products
'';
};
in
{
stabilizer = buildStm32Firmware {
name = "stabilizer";
src = <stabilizerSrc>;
patchPhase = ''
substituteInPlace src/main.rs \
--replace "let local_addr = net::wire::IpAddress::v4(10, 0, 16, 99);" \
"let local_addr = net::wire::IpAddress::v4(192, 168, 1, 76);"
'';
};
thermostat = buildStm32Firmware {
name = "thermostat";
src = <thermostatSrc>;
};
}

View File

@ -1,24 +1,11 @@
let
pkgs = import <nixpkgs> {};
zynq-rs = import <zynq-rs> { mozillaOverlay = import <mozillaOverlay>; };
artiq-zynq = import <artiq-zynq> { mozillaOverlay = import <mozillaOverlay>; };
zynq-rs-latest = import <zynq-rs>;
artiq-zynq = import <artiq-zynq>;
artiq-fast = import <artiq-fast> { inherit pkgs; };
addBuildProducts = drv: drv.overrideAttrs (oldAttrs: {
installPhase = ''
${oldAttrs.installPhase}
mkdir -p $out/nix-support
for f in $out/*.elf ; do
echo file binary-dist $f >> $out/nix-support/hydra-build-products
done
'';
});
in
(
builtins.mapAttrs (name: drv:
pkgs.lib.hydraJob (
addBuildProducts drv
)
) zynq-rs.zc706
builtins.mapAttrs (key: value: pkgs.lib.hydraJob value) zynq-rs-latest
) // (
builtins.mapAttrs (key: value: pkgs.lib.hydraJob value) artiq-zynq
) // {
@ -41,18 +28,19 @@ in
__networked = true;
buildInputs = [
pkgs.netcat pkgs.openssh pkgs.rsync artiq-fast.artiq
pkgs.netcat pkgs.openssh pkgs.rsync artiq-fast.artiq artiq-fast.artiq-netboot
];
phases = [ "buildPhase" ];
buildPhase =
''
echo Power cycling board...
(echo b; sleep 5; echo B) | nc -N 192.168.1.31 3131
sleep 5
(echo b; sleep 5; echo B; sleep 5) | nc -N -w6 192.168.1.31 3131
echo Power cycle done.
export USER=hydra
export OPENOCD_ZYNQ=${artiq-zynq.zynq-rs}/openocd
export SZL=${(import artiq-zynq.zynq-rs).zc706-szl}/szl.elf
pushd ${<artiq-zynq>}
bash ${<artiq-zynq>}/remote_run.sh -h rpi-4 -o "-F /dev/null -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR -i /opt/hydra_id_rsa" -d ${artiq-zynq.zc706-nist_qc2-jtag}
popd
@ -69,6 +57,9 @@ in
touch $out
echo Completed
(echo b; sleep 5) | nc -N -w6 192.168.1.31 3131
echo Board powered off
'';
});
}