forked from M-Labs/artiq
1
0
Fork 0

Compare commits

...

5095 Commits

Author SHA1 Message Date
Simon Renblad 76fba538b1 artiq_ddb_template: fixed missing separator 2023-12-18 13:23:39 +08:00
Sebastien Bourdeauducq 8dd8cfa6b0 master: implement devarg_override 2023-12-18 12:11:40 +08:00
Sebastien Bourdeauducq 5df0721811 dashboard,client: add device argument overrides to expid 2023-12-17 19:43:41 +08:00
Sebastien Bourdeauducq 6326051052 flake: forward cmdline arguments in devshell wrappers 2023-12-17 19:42:56 +08:00
Sebastien Bourdeauducq 44a95b5dda dashboard: add repository revision clear button 2023-12-17 16:37:02 +08:00
Sebastien Bourdeauducq 645b9b8c5f flake: add executable wrappers for frontends to devshell 2023-12-17 13:41:49 +08:00
Sebastien Bourdeauducq 858f0479ba aqctl_coreanalyzer_proxy: permissions and shebang 2023-12-17 13:27:38 +08:00
Sebastien Bourdeauducq 133b26b6ce flake: add ARTIQ sources to PYTHONPATH in devshell 2023-12-17 13:05:16 +08:00
Sebastien Bourdeauducq d96213dbbc flake: update dependencies 2023-12-17 12:55:36 +08:00
Sebastien Bourdeauducq 413d33c3d1 core: document analyzer proxy options 2023-12-13 14:29:33 +08:00
Sebastien Bourdeauducq c2b53ecb43 core: add option to trigger analyzer proxy at run end 2023-12-13 14:27:48 +08:00
Sebastien Bourdeauducq ede0b37c6e devices: introduce notify_run_end API 2023-12-13 14:27:04 +08:00
Sebastien Bourdeauducq 795c4372fa DeviceManager: fix close exception error message 2023-12-13 14:06:53 +08:00
Sebastien Bourdeauducq 402a5d3376 core: connect lazily to analyzer proxy
Otherwise artiq_compile and other uses of Core that does not access hardware/network may fail.
2023-12-13 13:46:47 +08:00
Sebastien Bourdeauducq 85850ad9e8 wavesynth: remove 2023-12-13 13:36:21 +08:00
Sebastien Bourdeauducq 7a863b4f5e core: add trigger_analyzer_proxy API 2023-12-13 13:08:54 +08:00
Sebastien Bourdeauducq a26cee6ca7 coreanalyzer_proxy: cleanups/renames 2023-12-13 13:07:35 +08:00
Sebastien Bourdeauducq be08862606 logo: text to path 2023-12-08 19:34:47 +08:00
Sebastien Bourdeauducq 05a9422e67 aqctl_coreanalyzer_proxy: cleanup 2023-12-08 18:56:10 +08:00
Simon Renblad b09a39c82e
add aqctl_coreanalyzer_proxy 2023-12-08 18:55:07 +08:00
mwojcik 49267671f9 core: fix precompile 2023-12-04 12:10:11 +08:00
Sebastien Bourdeauducq 8ca75a3fb9 firmware: deal with rust nonsense
Fixes
"error: edition 2021 is unstable and only available with -Z unstable-options.
error: could not compile `alloc`"
2023-12-03 11:20:18 +08:00
Florian Agbuya 8381b34a79 flake: add new booktabs dependency for artiq-manual-pdf 2023-12-03 11:18:59 +08:00
Sebastien Bourdeauducq d458fc27bf switch to new nixpkgs release 2023-12-03 11:18:25 +08:00
mwojcik 9f4b8db2de repeater: fix setting tsc 2023-12-01 16:43:48 +08:00
Florian Agbuya 1108cebd75 flake: fix ncurses on vivado
Signed-off-by: Florian Agbuya <fa@m-labs.ph>
2023-11-28 17:36:36 +08:00
Florian Agbuya cf7cbd0c3b flake: update nixpkgs
Signed-off-by: Florian Agbuya <fa@m-labs.ph>
2023-11-28 17:36:36 +08:00
mwojcik 1a28069aa2 support for pre-compiling subkernels 2023-11-23 16:49:02 +08:00
Sebastien Bourdeauducq 56418e342e take into account VERSIONEER_REV in artiq._version.get_rev 2023-11-22 20:51:02 +08:00
Sebastien Bourdeauducq 77c6553725 always provide artiq._version.get_rev 2023-11-14 14:14:47 +08:00
Sebastien Bourdeauducq e81e8f28cf gateware: merge kasli_generic into kasli. Closes #2279 2023-11-14 14:01:17 +08:00
mwojcik de10e584f6 support .tar flashed idle/startup kernels 2023-11-13 18:14:35 +08:00
Florian Agbuya 875666f3ec doc: add section on new nix flakes config (closes #2232)
Signed-off-by: Florian Agbuya <fa@m-labs.ph>
2023-11-10 16:47:56 +08:00
Sebastien Bourdeauducq 3ad3fac828 update ARTIQ-8 release notes 2023-11-08 11:17:17 +08:00
Simon Renblad 49afa116b3 RELEASE_NOTES: artiq_ddb_template needs gateware 2023-11-08 10:51:39 +08:00
Simon Renblad 363afb5fc9 artiq_ddb_template: add support for user LEDs
Add support for additional user LEDs.
2023-11-08 10:51:39 +08:00
Simon Renblad e7af219505 kasli_generic: add support for user LEDs
Add additional LED RTIO devices.
2023-11-08 10:51:39 +08:00
linuswck ec2b86b08d kc705: fix gtx clock path durnig init 2023-11-07 18:36:48 +08:00
linuswck 8f7d138dbd gtx: Always enable IBUFDS_GTE2, add clk_path_ready
- Set clk_path_ready to High to start Initialization of GTP TX and RX
2023-11-07 18:36:48 +08:00
Sebastien Bourdeauducq bbe6ff8cac flake: update dependencies 2023-11-07 18:36:11 +08:00
Sebastien Bourdeauducq c0a6252e77 afws_client: improve compatibility with older versions of prettytable. Closes #2264 2023-11-07 14:06:31 +08:00
mwojcik 6640bf0e82 drtioaux/subkernel/ddma: introduce proper errors, more robust 2023-11-07 13:42:04 +08:00
mwojcik b3c0d084d4 drtio: better control state of bigger payloads 2023-11-07 13:42:04 +08:00
linuswck bb0b8a6c00 kasli: Correct the GTP TX clock path during init
- TXOUT must be fed back into TXUSRCLK during initialization
- Now, MMCM Clock Input is switched before GTP TX Init is started instead of after GTP TX Init is done
- Reset in Sys Clock domain is kept asserted when clock is switched and GTP TX Init is NOT done
2023-11-07 13:40:32 +08:00
Sebastien Bourdeauducq ce80bf5717 flake: update dependencies 2023-11-07 13:40:17 +08:00
Florian Agbuya 378dd0e5ca flake: fix and upgrade wavedrom (closes #2266)
Signed-off-by: Florian Agbuya <fa@m-labs.ph>
2023-10-30 08:09:00 +01:00
jfniedermeyer 9c68451cae Add hotkeys to organize experiments in dashboard
Signed-off-by: jfniedermeyer <justin.niedermeyer@colorado.edu>
2023-10-27 21:47:30 +02:00
linuswck 93c9d8bcdf artiq_ddb_template:set default Shuttler drtio_dest
- remove default Shuttler "drtio_destination" value in jsonschema
- set the default Shuttler "drtio_destination" value according to
    board "target" and "hw_rev"
2023-10-27 21:46:02 +02:00
mwojcik e480bbe8d8 artiq_ddb_template: move satellite_cpu_target to core 2023-10-27 21:45:12 +02:00
mwojcik b168f0bb4b subkernel: separate tags and data 2023-10-17 12:18:03 +02:00
Sebastien Bourdeauducq 6705c9fbfb flake: update dependencies 2023-10-17 15:37:06 +08:00
mwojcik 5f445f6b92 ad53xx: fix `load()` references in documentation 2023-10-16 13:54:38 +08:00
occheung 363f7327f1 io_expander: initialize before service 2023-10-15 07:45:20 +08:00
Sebastien Bourdeauducq f7abc156cb flake: update dependencies 2023-10-11 16:41:34 +08:00
linuswck de41bd6655 eem_7series: pass through kwargs for shuttler 2023-10-11 12:15:06 +08:00
Simon Renblad 96941d7c04 big_number: fix metadata scaling, add unit label 2023-10-09 15:35:14 +08:00
mwojcik f3c79e71e1 firmware: merge runtime and satman linker scripts 2023-10-09 15:33:29 +08:00
Simon Renblad 333b81f789 set_argument_value warning in browser 2023-10-09 10:38:17 +08:00
Sebastien Bourdeauducq d070826911 flake: update dependencies 2023-10-09 10:13:58 +08:00
Sebastien Bourdeauducq 9c90f923d2 test: check return value of subprocesses in test_compile 2023-10-09 10:07:04 +08:00
Sebastien Bourdeauducq e23e4d39d7 artiq_compile: ignore subkernel_arg_types 2023-10-09 10:03:43 +08:00
David Nadlinger 08eea09d44 compiler: Catch escaping numpy.{array, full, transpose}() results
Function calls in general can still be used to hide escaping
allocations from the compiler (issue #1497), but these calls in
particular always allocate, so we can easily and accurately handle
them.
2023-10-09 09:00:26 +08:00
mwojcik 7ab52af603 docs: subkernel support 2023-10-08 17:12:06 +08:00
mwojcik 973fd88b27 core: compile and upload subkernels 2023-10-08 17:11:51 +08:00
mwojcik 8d7194941e tests: add lit tests for subkernels 2023-10-08 17:11:51 +08:00
mwojcik 0a750c77e8 compiler: support subkernels 2023-10-08 17:11:51 +08:00
mwojcik 1a0fc317df satman: support subkernels 2023-10-08 17:11:32 +08:00
mwojcik e05be2f8e4 runtime: support subkernels 2023-10-08 17:11:32 +08:00
mwojcik 6f4b8c641e drtioaux_proto: use better payload names 2023-10-08 17:11:32 +08:00
mwojcik b42816582e ksupport: support subkernels 2023-10-08 17:11:32 +08:00
Hartmann Michael (IFAG PSS SIS SCE QSE) 76f1318bc0 doc: Extend documentation
Extend the paragraph "Pitfalls" in the documentation of "Compiler" by
problems caused by returning values from the stack.
2023-10-07 07:20:33 +08:00
Sebastien Bourdeauducq 0131a8bef2 shuttler: cleanup 2023-10-06 14:55:51 +08:00
mwojcik e63e2a2897 artiq_ddb_template: better satellite formatting 2023-10-06 13:01:57 +08:00
Simon Renblad 47fc640f75 applets: rename 'ctl' attribute to 'req' 2023-10-05 12:32:01 +08:00
Simon Renblad bb7caacb5f RELEASE_NOTES: applet API extensions 2023-10-05 12:32:01 +08:00
Simon Renblad da9f7cb58a applet extensions documentation 2023-10-05 12:32:01 +08:00
occheung 43926574da shuttler: remove sdm constants 2023-10-05 07:40:00 +08:00
Simon Renblad 4f3e58db52 gui.applets: add EntryArea 2023-10-04 15:35:52 +08:00
Simon Renblad 13271cea64
gui: remove copies of _WheelFilter and refactor with parameter 2023-10-04 13:35:01 +08:00
occheung 0e8fa8933f shuttler: init sigma-delta modulator 2023-09-30 11:51:43 +08:00
David Nadlinger 2eb89cb168 dashboard: Fix occasional "unexpected action" applet errors on startup
This turned out to be a race between the dashboard's dataset db
subscriber being initialised and the applet "embed" request, with
artiq.applet.simple not being able to handle the unexpected "mod"
message. We were only handling the other ordering outcome of this
race before.
2023-09-30 00:27:25 +01:00
occheung a772dee1cc shuttler: change 0th order accumulator width
It now truncates the LSBs instead of the MSBs.
2023-09-29 10:09:39 +08:00
Simon Renblad bafb85a274 custom_applet: change constructor, data_changed signatures 2023-09-28 10:35:14 +01:00
mwojcik 0e8aa33979 core: separate master target from compilation 2023-09-28 10:41:55 +08:00
mwojcik fcf6c90ba2 ddb_template: support different satellite targets 2023-09-28 10:41:55 +08:00
linuswck 0c1b572872 Shuttler: Correct spelling and grammar in docs 2023-09-27 17:29:16 +08:00
linuswck ab0d4c41c3 Shuttler: pdq, efc->shuttler pdq_words->coef_words 2023-09-27 17:29:16 +08:00
Jonathan Coates 6eb81494c5 Allow using Python types in type annotations
This maps basic Python types (float, str, bool, np.int32, np.int64) as well as
some generics (list, tuple) to ARTIQ's own type instances.

Signed-off-by: Jonathan Coates <jonathan.coates@oxionics.com>
2023-09-26 23:46:43 +01:00
Jonathan Coates 586d97c6cb Fix type annotations with mixed tuples
The type checker/inferer visits every node in an AST tree, including
function return annotations. This means for a function definition like

    def f() -> TTuple([TInt32, TBool]):
      ...

We attempt to type check the list [TInt32, TBool], which generates the
unification constraint builtins.TBool ~ builtins.TInt. This causes an
internal error due to compiler weirdness.

We can avoid this by just nulling-out the return annotation in the
embedding stage. The return type isn't actually used anywhere (it's
extracted via the inspect module instead), so this is entirely safe.

Arguments aren't affected by this, as we already nulled out the
annotation (see visit_arg in embedding.py).

Signed-off-by: Jonathan Coates <jonathan.coates@oxionics.com>
2023-09-26 23:43:01 +01:00
David Nadlinger 892b0eaca2 compiler: Fix crash on multiple types with the same name
The original fix in 21574bdfa9
was incomplete, as it only addressed the TInstance types, but
not their linked (typ.constructor) TConstructor instances.

This would (potentially among other issues) cause assertion
errors in llvm_ir_generator due to the wrong associated globals
being referenced; see added test case for an example that
previously caused such a crash.

Also modified the name collision detection from O(len(type_map))
(so quadratic overall in the number of custom types) to cache
names in sets for O(1) lookup.
2023-09-26 23:31:21 +01:00
linuswck eedac7cf71 Shuttler: Patch ddb entries in the example code 2023-09-26 12:20:26 +08:00
linuswck a61bbf5618 Shuttler: Replace ddb with json for the example 2023-09-26 12:20:26 +08:00
occheung b7b8f0efa2
Generate coredevice entries for Shuttler (#2216)
* ddb: generate shuttler coredevice entries

* ddb: split-off all DRTIO-over-EEM peripherals

Only EFC uses DRTIO-over-EEM at this moment. It will be relevant to phaser-DRTIO in the future.

* ddb: generalize efc processing into drtio-over-eem peripherals

* ddb: check DRTIO role validity before processing
2023-09-26 09:44:21 +08:00
occheung b52f253dbd
Simplify OOB reset by clock division (#2217)
* oob: simply logic by dividing into clk100

* replace clk100 clk ctrl with clk200 async reset

* fix comment (singular/plural)

* oob reset: invoke platform commands locally

* cleanup

* oob reset: add async reset import

* fix duplicated comment
2023-09-26 08:02:49 +08:00
occheung 73ab71f443
shuttler: add documentation 2023-09-25 17:47:47 +08:00
linuswck ab8247b3d7 Shuttler: Add coredevice example code for Shuttler
This example code:
    - Demonstrates the init flow for Shuttler
    - Blinks LED L0, L1
    - Demonstrates the real-time control of relay
    - Includes example fns for configuring the PDQ Output Channel in mu
2023-09-25 14:56:47 +08:00
mwojcik 36b3678853 satman: fix ddma reporting wrong destination 2023-09-22 10:25:37 +08:00
mwojcik af77885dfc rtio_mgt: fix drtio reset on standalone 2023-09-22 09:46:40 +08:00
mwojcik eb57b3b393 drtio: async messages become synchronous
They are now a reply for DestinationStatusRequest.
This prevents gateware errors and lost packets if the receiver is busy.
2023-09-21 16:30:00 +08:00
Simon Renblad 40ac2e03ab set_argument_value in applets 2023-09-21 16:26:11 +08:00
occheung a2fbcb8bfd pre-dac gain/offsets: detect overflow & underflow
And output maximum / minimum DAC code when over/underflow
2023-09-19 18:49:20 +08:00
occheung 5c64eac8d2 relay: fix naming 2023-09-19 18:49:20 +08:00
occheung 477a7b693c remove debug for converter 2023-09-19 18:49:20 +08:00
occheung f2694f25eb re-impl ADC using general access methods 2023-09-19 18:49:20 +08:00
occheung 9e1447d104 adc: implement standby & power-down/up 2023-09-19 18:49:20 +08:00
occheung 870020bc9f adc: use a generous upper bound 2023-09-19 18:49:20 +08:00
occheung c2d136f669 shuttler: reorg SPI constants 2023-09-19 18:49:20 +08:00
occheung 06426e0ed9 shuttler: impl general reg access 2023-09-19 18:49:20 +08:00
occheung e443e06e62 shuttler: remove adc calibrate debug lines 2023-09-19 18:49:20 +08:00
occheung 55150ebdbb shuttler: fix calibration channel target 2023-09-19 18:49:20 +08:00
occheung eb08c55abe shuttler: add AFE drivers 2023-09-19 18:49:20 +08:00
occheung 67b6588d95 shuttler: implement gain & offset register access 2023-09-19 18:49:20 +08:00
occheung 1bb7e9ceef shuttler: support pre-DAC gain & offset 2023-09-19 18:49:20 +08:00
Florian Agbuya c02a14ba37 compiler: fix lit tests numpy.transpose error (#2190) 2023-09-18 22:11:46 +08:00
Simon Renblad 1f3b2ef645 dashboard.datasets: fix numpy objects in CreateEditDialog 2023-09-18 14:07:26 +08:00
linuswck 372008cb66 Firmware: AD9117 Add check presence of clk comment 2023-09-18 13:04:51 +08:00
linuswck 85abb1da2c Firmware: Set DACs RETIMER-CLK to Phase 1 Shuttler
- Intend to maintain the same pipeline latency across all DACs on Shuttler
- Force the RETIMER-CLK to be PHASE 1 on all DACs
- See Issue #2200 for details
2023-09-18 12:52:21 +08:00
David Nadlinger 9e5b62a6b1 gateware/targets/kasli: Only set DRTIO_ROLE in *Base classes [nfc]
kasli_generic uses the drtio_role setting to select the particular
*Generic class to use anyway.
2023-09-17 10:24:51 +08:00
David Nadlinger 22ab62324c gateware/targets/kasli: Set DRTIO_ROLE in {Master, Satellite}Base
These were introduced in 82bd913f63, and for Kasli only set from
the JSON description in the *Generic subclasses. Not all firmware
is built through that API, however, e.g. the CI system at the
University of Oxford. The missing attribute breaks artiq.build_soc.
2023-09-17 00:48:42 +01:00
David Nadlinger fc74b78a45 dashboard: Make Ctrl-Alt-W close non-docked applets only
I had introduced this in f11aef74b as a means of quickly cleaning up
after e.g. an exploratory session where a lot of transient applets were
opened from ndscan, or for a dashboard that has been running for a while
with CCBs enabled but without anybody actually working there.

It turns out that one usually wants the few docked applets to stay open,
as they were necessarily arranged manually at some prior point. And as a
corollary to the latter, if one did want to close them as well, doing so
manually would not be too onerous either.
2023-09-16 23:47:23 +01:00
Simon Renblad f01e654b9c gui.entries: fix RangeScan SpinBox size layouts 2023-09-16 16:06:45 +08:00
David Nadlinger e45dc948e9 setup.py: Add lmdb dependency
This has actually been a required dependency since
e710d4badd.
2023-09-15 17:25:45 +01:00
David Mak 460cbf4499 docs: Add section on untrusted substituters in Nix
Signed-off-by: David Mak <david.18.19.21@gmail.com>
2023-09-14 11:55:45 +08:00
Florian Agbuya 6df85478e4 scan: fix deprecated shuffle parameter in python 3.11 2023-09-13 12:24:44 +08:00
Jonathan Coates 5c85cef0c2
Allow indexing tuples in kernel code
This only allows for indexing with a constant value (e.g. x[0]).

While slices would be possible to implement, it's not clear how to
preserve type inference here. The current typing rule is:

  Γ ⊢ x : τ  Γ ⊢ a : Int  Γ ⊢ b : Int
  ------------------------------------
             Γ ⊢ x[a:b] : τ

However, tuples would require a different typing rule, and so we'd need
to defer type inference if τ is a tyvar. I'm not confident that this
won't change behaviour, so we leave as-is for now.

Signed-off-by: Jonathan Coates <jonathan.coates@oxionics.com>
2023-09-12 14:43:38 +01:00
linuswck ccb140a929 Firmware: Add AD9117 DAC Startup Seq for shuttler 2023-09-11 15:07:47 +08:00
linuswck 7c8073c1ce Shuttler: Add DAC Data Interface Gateware
- Add Parallel DDR Data Interface for DAC
- Add MMCM to generate phase shifted DDR Clk(45 degree phase shift by default)
- Connect dac_interface to Shuttler Module
2023-09-11 11:37:13 +08:00
Florian Agbuya 2f3329181c flake: fix deprecated 'U' mode in outputcheck for python 3.11 2023-09-06 19:02:41 +08:00
Sebastien Bourdeauducq 1ec1ab0502 flake: update dependencies 2023-09-06 18:28:08 +08:00
linuswck b49fb841ce Firmware: EFC enables error led when going panic 2023-09-06 15:54:35 +08:00
Florian Agbuya a619c9f3c2 almazny: fix minor doc formatting 2023-09-06 14:12:09 +08:00
Florian Agbuya 0188f31f3a i2c: fix doc formatting 2023-09-05 17:00:27 +08:00
Florian Agbuya 4e770509db almazny: fix doc formatting 2023-09-05 17:00:27 +08:00
occheung 7f63bb322d disable DRTIO-over-EEM OSERDES until clock is stable
This asserts OOB reset on EFC.
2023-09-05 16:59:01 +08:00
occheung 5e5d671f4c kasli: add invoke order comments 2023-09-04 12:05:45 +08:00
occheung 98904ef4c3 kasli: construct DRTIO-EEM modules before adding RTIO 2023-09-04 12:05:45 +08:00
Sebastien Bourdeauducq 73ac414912 flake: update dependencies 2023-09-03 10:59:52 +08:00
occheung 838cc80922
EFC: Implement OOB reset 2023-09-03 10:25:08 +08:00
Simon Renblad 904afe1632 tools: remove trim param 2023-09-01 20:06:19 +08:00
Simon Renblad 01d777c977
dashboard/datasets: fix CreateEditDialog datatype cast (#2176) 2023-09-01 13:59:17 +08:00
Sebastien Bourdeauducq 9556ca53de flake: update dependencies 2023-08-31 17:43:28 +08:00
occheung df99450faa
shuttler: add pdq-based waveform generator 2023-08-30 23:38:39 +08:00
Sebastien Bourdeauducq 1f58cd505c flake: update dependencies 2023-08-30 15:39:46 +08:00
linuswck ddb2b5e3a1 efc: add shuttler DAC parallel data interface pads 2023-08-30 10:25:39 +08:00
linuswck b56f7e429a
drtio: rename drtio_transceiver to gt_drtio 2023-08-28 04:50:46 +00:00
Sebastien Bourdeauducq 3452d0c423 efc: use variant (expected everywhere else) 2023-08-25 15:52:40 +08:00
Sebastien Bourdeauducq 2139456f80 firmware: skip clock switch for efc 2023-08-25 15:06:42 +08:00
Sebastien Bourdeauducq a2a780a3f2 firmware: fix compilation warning 2023-08-25 15:06:02 +08:00
Sebastien Bourdeauducq 3620358f12 flake: build efc firmware 2023-08-25 13:34:56 +08:00
Sebastien Bourdeauducq 72b0a17542 flake: register firmware outputs as hydra build products 2023-08-25 13:25:22 +08:00
Sebastien Bourdeauducq f5cbca9c29 kasli: implement DRTIO-over-EEM 2023-08-25 12:47:33 +08:00
linuswck 737ff79ae7 eem: add efc 2023-08-25 12:01:17 +08:00
linuswck dc97d3aee6 drtio-eem: CONFIG_EEM_TRANSCEIVERS -> CONFIG_EEM_DRTIO_COUNT 2023-08-25 11:49:39 +08:00
Sebastien Bourdeauducq 5d38db19d0 drtio-eem: remove unnecessary rtio_rx clock domain 2023-08-25 11:32:28 +08:00
Sebastien Bourdeauducq 9bee4b9697 flake: update dependencies 2023-08-25 11:13:33 +08:00
linuswck cd22e42cb4
efc: add DRTIO virtual LEDs
- EFC Gateware: Add virtual_leds to rtio
- EFC Firmware: io_expander is kept being serviced to update
  virtual_leds after init
2023-08-23 06:21:14 +00:00
linuswck b7bac8c9d8 EFC: Add SPI Gateware for Shuttler DAC
- Verified by a functional test reading back the rev register
2023-08-23 09:04:16 +08:00
mwojcik e8818c812c satman: fix non-eem satellites failing to build 2023-08-22 16:32:59 +08:00
occheung 68dd0e029f targets: add efc target 2023-08-10 00:02:01 +00:00
occheung 64d3f867a0
add DRTIO-over-EEM PHY
for EFC and perhaps Phaser
2023-08-09 23:59:40 +00:00
Sebastien Bourdeauducq df662c4262 flake: update llvmlite 2023-08-07 23:02:23 +08:00
Sebastien Bourdeauducq d2ac6aceb3 flake: update to Clang 14 2023-08-07 18:45:13 +08:00
Sebastien Bourdeauducq 9b94a09477 flake: update to LLVM 14 2023-08-07 18:28:44 +08:00
David Nadlinger efbae51f9d runtime: Validate ksupport ELF against hard-coded address ranges
This would have caught the reduction in header padding with LLD 14.
In theory, we could just get rid of the hard-coded kernel CPU address
ranges altogether and use ksupport.elf as the one source of truth; the
code already exists in dyld. The actual base address of the file would
still need to be forwarded to the kernel-side libunwind glue, though,
as there doesn't seem to be a clean way to get the equivalent of
KSUPPORT_HEADER_SIZE through the linker script. I have left this as-is
with the hard-coded KERNELCPU_… constants for now.
2023-08-07 10:10:38 +00:00
David Nadlinger 8acfa82586 ksupport: Remove unused sections from linker script [nfc]
We no longer build ksupport.ld in a position-independent fashion, and
the reference to the ld.bfd _GLOBAL_OFFSET_TABLE issue was just a
distraction
2023-08-07 10:10:38 +00:00
David Nadlinger 4d636ea593 Upgrade to LLD 14
Previous linker versions had inserted some zero padding bytes
between the ELF headers and the first section, but LLD 14 does
not anymore.

Hard-coding the offset of the first section in ksupport.elf
manually isn't ideal; we should probably parse the ELF program
headers instead when first setting up the kernel CPU.
2023-08-07 10:10:38 +00:00
Sebastien Bourdeauducq 3ed7e0ed06 flake: update dependencies 2023-08-07 17:52:42 +08:00
Simon Renblad c4259dab18
applets.simple: add kwargs to AppletControlRPC (#2155)
Co-authored-by: Simon Renblad <srenblad@m-labs.hk>
2023-08-05 11:38:07 +08:00
mwojcik c46ac6f87d spi2: update set_config_mu doc 2023-08-04 09:22:57 +00:00
linuswck 758b97426a Bootloader: SDRAM patch for EFC
- Modification of the CFG flag ensure EFC to initialize DDRPHY correctly
Note that Kasli and EFC share the same model of SDRAM
2023-08-02 02:18:45 +00:00
linuswck c206e92f29 Bootloader: Remove kusddrphy support for SDRAM
- Delete all the kusddrphy cfg flags and related code
2023-08-02 02:18:20 +00:00
linuswck cb547c8a46
efc: turn on power of FMC peripheral
- Add efc's io expander method
- Enable VADJ, P3V3_FMC in satman main during startup
2023-08-01 00:29:45 +00:00
linuswck 72a5231493
artiq_flash: add EEM FMC Carrier Board Support
- The code is derived from PR #2134 936f24f6bdf47e577d3e7d73a330797542596ba8
2023-07-25 11:14:19 +08:00
Denis Ovchinnikov 07714be8a7
jsonschema: add kasli_soc HW revision v1.1 2023-07-24 16:32:13 +08:00
Simon Renblad 361088ae72 tools: add trim argument to format funcs 2023-07-21 08:38:49 +00:00
Simon Renblad a384df17a4 docs: add unit and precision explainer 2023-07-21 08:15:39 +00:00
Simon Renblad 6592b6ea1d artiq_client: change set_dataset with units 2023-07-21 08:15:39 +00:00
Simon Renblad 2fb085f1a2 datasets: change dataset value entry with units 2023-07-21 08:15:39 +00:00
Simon Renblad a7569a0b2d tools: add scale_from_metadata helper func 2023-07-21 08:15:39 +00:00
Simon Renblad 4fbff1648c scientific_spinbox: rename precision to sig_figs 2023-07-19 07:01:24 +00:00
Simon Renblad 8f4c8387f9 entries: rename setPrecision to setSigFigs 2023-07-19 07:01:24 +00:00
Simon Renblad a2d62e6006 RELEASE_NOTES: deprecated ndecimals 2023-07-18 08:02:42 +00:00
Simon Renblad 3d0feef614 docs: rename ndecimals to precision 2023-07-18 08:02:42 +00:00
Simon Renblad 59ad873831 examples: rename ndecimals to precision 2023-07-18 08:02:42 +00:00
Simon Renblad 8589da0723 test_arguments: rename ndecimals to precision 2023-07-18 08:02:42 +00:00
Simon Renblad 94e076e976 scan: rename ndecimals to precison 2023-07-18 08:02:42 +00:00
Simon Renblad a0094aafbb entries: rename ndecimals to precision 2023-07-18 08:02:42 +00:00
Simon Renblad 0befadee96 environment: rename ndecimals to precision 2023-07-18 08:02:42 +00:00
sven-oxionics b3dc199e6a Fix panic when receiving empty strings in rpc calls
Receiving an empty string in an RPC call currently panics.

When `length` is zero, a call to the `alloc` function (as implemented in `artiq/firmware/runtime/session.rs`) returns a null pointer. Constructing a `CMutSlice` from a null pointer panics.
A `CMutSlice` consists of a pointer and the length. Rust's documentation of the `core::ptr` module states: "The canonical way to obtain a pointer that is valid for zero-sized accesses is `NonNull::dangling`."
This commits adds a check for the length of a string received in an RPC call. Only for lengths greater than zero a memory allocation is performed. For zero-length strings, a dangling pointer is used.

Test plan:
Invoke the following experiment, which returns an empty string over RPC:
```
class ReturnEmptyString(artiq.experiment.EnvExperiment):
    def build(self):
        self.core: Core = self.get_device("core")

    @kernel
    def run(self):
        x = self.do_rpc()
        print(x)

    @rpc
    def do_rpc(self) -> TStr:
        return ""
```

Signed-off-by: Sven Over (Oxford Ionics) <sven.over@oxionics.com>
2023-07-18 04:00:32 +00:00
Florian Agbuya d73889fb27 gui/experiments: cast Qt timestamp to int preventing float type error 2023-07-14 08:33:27 +00:00
Simon Renblad 9f8bb6445f RELEASE_NOTES: add breaking change data_changed signature 2023-07-12 08:28:28 +00:00
Simon Renblad 068a2d1663 progress_bar: refactor data_changed 2023-07-12 08:28:28 +00:00
Simon Renblad 6c588b83d7 plot_xy_hist: refactor data_changed 2023-07-12 08:28:28 +00:00
Simon Renblad c17f69a51b plot_xy: refactor data_changed 2023-07-12 08:28:28 +00:00
Simon Renblad ac504069d2 plot_hist: refactor data_changed 2023-07-12 08:28:28 +00:00
Simon Renblad b6a83904b5 image: refactor data_changed 2023-07-12 08:28:28 +00:00
Simon Renblad 25959d0cd6 big_number: refactor data_changed 2023-07-12 08:28:28 +00:00
Simon Renblad 5695e9f77e simple: refactor TitleApplet data_changed signature 2023-07-12 08:28:28 +00:00
Simon Renblad fe0f6d8a2c simple: refactor SimpleApplet data_changed signature 2023-07-12 08:28:28 +00:00
Simon Renblad d1f2727126 simple: refactor RPC client set_dataset 2023-07-12 08:28:28 +00:00
Simon Renblad 16a3ce274f applets: add metadata param to set_dataset 2023-07-12 08:28:28 +00:00
Simon Renblad af7622d7ab simple: refactor IPC set_dataset 2023-07-12 08:28:28 +00:00
Jonathan Coates 9a84575649
eem_7series: fix typo in 77293d5
Signed-off-by: Jonathan Coates <jonathan.coates@oxionics.com>
2023-07-11 23:09:15 +00:00
Simon Renblad faf85e815a datasets: add metadata to CreateEditDialog 2023-07-10 06:50:41 +00:00
Simon Renblad 3663a6b8e8 artiq_client: refactor set_dataset, show_datasets 2023-07-10 04:50:54 +00:00
Simon Renblad 91442e2914 browser: refactor upload_clicked for dataset metadata 2023-07-10 04:26:08 +00:00
Simon Renblad 50a6dac178 files: read dataset metadata from HDF5 2023-07-10 04:26:08 +00:00
Simon Renblad 5292a8de82 browser: add metadata param to short_format 2023-07-10 04:26:08 +00:00
Sebastien Bourdeauducq 7791f85a1a flake: update dependencies 2023-07-10 11:29:59 +08:00
Sebastien Bourdeauducq 48bc8a2ecc gtx_7series_init: GTH -> GTX (NFC) 2023-07-10 11:26:07 +08:00
Denis Ovchinnikov 93882eb3ce kasli-soc: fix of SYS CLK switch failure
Change initialization behaviour of GTX transceivers
--
Modify the config parms CPLL of GTX transceiver for PLL to lock correctly
Modify the enabling requirement of GTX input clock buffer IBUFDS_GTE2 so
    that it depends on GTX PLL locked signal instead of TX Init Done
Modify the GTX Init FSM so that BruteForceClock Aligner can reset GTX
    transceiver without resetting the GTX transceiver PLL

kasli-soc: fix of SYS CLK switch failure
Changed initialization of GTX transceivers.
Successful SYS CLK switching requires IBUFDS_GTE2 to be properly enabled and not disabled during GTX transceiver initialization.
For this reason, CPLL is not reset during GTX initialization and clock alignment.

kasli-soc: refractor fix of SYS CLK switch failure
Remove gtXxreset & cpllreset assertion and deassertion
The removed code does not affect the fix
2023-07-10 03:24:28 +00:00
Simon Renblad 7ca02a119d RELEASE_NOTES: update lmdb migrate script 2023-07-10 02:33:59 +00:00
Simon Renblad 373fe3dbe7 test_datasets: add metadata tests 2023-07-10 02:33:59 +00:00
Simon Renblad 1af98727b7 test_scheduler: refactor dataset metadata support 2023-07-10 02:33:59 +00:00
Simon Renblad 376f36c965 datasets: add metadata format param 2023-07-10 02:33:59 +00:00
Simon Renblad e710d4badd databases: read and save metadata in lmdb 2023-07-10 02:33:59 +00:00
Simon Renblad bfbe13e51b worker_db: write hdf5 dataset metadata 2023-07-10 02:33:59 +00:00
Simon Renblad bf38fc8b0f tools: refactor short_format with metadata 2023-07-10 02:33:59 +00:00
Simon Renblad 337273acb6 environment: add get_dataset_metadata 2023-07-10 02:33:59 +00:00
Simon Renblad 748707e157 environment: add unit feature 2023-07-10 02:33:59 +00:00
Leon Riesebos 833fd8760e artiq_ddb_template: use the clk_div field
this field exists in the json schema but was not used.

Signed-off-by: Leon Riesebos <28567817+lriesebos@users.noreply.github.com>
2023-06-29 03:29:18 +00:00
Florian Agbuya 454597915a RELEASE_NOTES: update 2023-06-17 05:01:02 +00:00
Sebastien Bourdeauducq 77293d53e3 json: use schema defaults when applicable 2023-06-16 16:59:08 +08:00
Sebastien Bourdeauducq a792bc5456 json: factor handling of deprecated 'base' 2023-06-16 16:32:42 +08:00
Sebastien Bourdeauducq 20d4712815 json: base -> drtio_role 2023-06-16 16:17:31 +08:00
Spaqin 82bd913f63
satellites: add kernel cpu 2023-06-16 15:44:31 +08:00
Sebastien Bourdeauducq 115415d120 Revert "flake: update to LLVM 14 and llvmlite 0.40.0+master"
This reverts commit c25c0bd55a.
2023-06-14 18:54:33 +08:00
Florian Agbuya d140c960bb
applets: implement dataset modification feature in big number applet 2023-06-12 17:52:46 +08:00
Egor Savkin c25c0bd55a
flake: update to LLVM 14 and llvmlite 0.40.0+master 2023-06-09 13:25:08 +08:00
Egor Savkin 30ef8d8cb4
compiler: skip demangling list of empty names 2023-06-09 13:24:10 +08:00
Florian Agbuya 7ad32d903a browser: add update method to dataset controller 2023-06-06 11:07:08 +00:00
Florian Agbuya bf46ce4a92 applets.simple: add mutate_dataset feature 2023-06-05 12:30:14 +00:00
den512is 1f306a2859
flake: add packaging dependency
Needed for building Kasli firmware
2023-06-05 13:17:47 +08:00
Florian Agbuya 150d325fc1 applets.simple: add append_to_dataset feature 2023-06-02 14:56:00 +00:00
Florian Agbuya c298ec4c2e applets: add update_dataset for dataset mods 2023-06-02 14:56:00 +00:00
Sebastien Bourdeauducq 69bf2dfb81 flake: sleep longer before running HITL tests to allow for clock switch and reboot 2023-06-02 17:41:15 +08:00
mwojcik 29cb7e785d fix missing DIFF_TERM for Sampler and Mirny inputs 2023-06-02 17:21:00 +08:00
Sebastien Bourdeauducq b97f6a9e44 bootloader: fix compilation warning without Ethernet 2023-06-02 10:48:55 +08:00
Sebastien Bourdeauducq e0ebc1b21d applets: fix some asyncio problems 2023-05-31 22:56:48 +08:00
Sebastien Bourdeauducq c6ddd3af17 applets: add controller and set_dataset API 2023-05-31 22:51:48 +08:00
Florian Agbuya e12219e803
gui: add handler for applet set_dataset 2023-05-31 14:08:14 +00:00
Sebastien Bourdeauducq ff11b5df71 flake: add qtsvg 2023-05-31 22:07:05 +08:00
Sebastien Bourdeauducq c8dc2cbf09 browser: decouple dataset controller from dataset dock 2023-05-31 21:57:54 +08:00
Sebastien Bourdeauducq c6b29b30fb Revert "flake: update to LLVM 14 and llvmlite 40"
This reverts commit 748969c21e.
2023-05-31 19:36:43 +08:00
Sebastien Bourdeauducq b20d09aad5 Revert "flake: export llvmlite-new"
This reverts commit fabe88065b.
2023-05-31 19:36:41 +08:00
Sebastien Bourdeauducq 6276182c96 Revert "flake: fix clang version in boards shell"
This reverts commit 9a6bc6dc7b.
2023-05-31 19:36:40 +08:00
Sebastien Bourdeauducq d103cbea31 libboard_misoc: fix clang STB_WEAK warning 2023-05-31 18:59:51 +08:00
Sebastien Bourdeauducq 9a6bc6dc7b flake: fix clang version in boards shell 2023-05-31 18:59:39 +08:00
Sebastien Bourdeauducq fabe88065b flake: export llvmlite-new 2023-05-30 16:54:59 +08:00
Egor Savkin 748969c21e
flake: update to LLVM 14 and llvmlite 40
Signed-off-by: Egor Savkin <es@m-labs.hk>
2023-05-30 16:47:59 +08:00
Sebastien Bourdeauducq 75f6bdb6a1 flake: add boards dev shell 2023-05-30 16:21:06 +08:00
Sebastien Bourdeauducq 41caec797e flake: do not install ARTIQ itself in dev shell, only its dependencies
Otherwise, test runs take a long time when entering the shell, and failing tests stop entering the shell which is not what we want.
Also make jsonschema a regular dependency of ARTIQ, since users can now retrieve JSONs via AFWS.
2023-05-30 16:20:57 +08:00
Sebastien Bourdeauducq 953a8a9555 master: merge master_config and master_terminate 2023-05-30 15:55:19 +08:00
Sebastien Bourdeauducq 444bab2186 gui: datasets_sub -> dataset_sub (nfc) 2023-05-30 15:44:30 +08:00
Sebastien Bourdeauducq 0941d3a29a flake: update dependencies 2023-05-30 11:50:30 +08:00
Denis Ovchinnikov 22e2514ce6 update configuration of IBUFDS_GTE2
Input clock is terminated internally with 50 Ohm on each leg and to 4/5 MGTAVCC.
2023-05-30 11:42:51 +08:00
mwojcik a4895b591a analyzer: fix satellite behavior 2023-05-29 13:13:24 +08:00
Sebastien Bourdeauducq ef2cc2cc12 flake: buildFHSUserEnv -> buildFHSEnv 2023-05-27 18:03:18 +08:00
Sebastien Bourdeauducq 779810163f flake: fix rustPlatform deprecation warnings 2023-05-27 17:40:36 +08:00
Sebastien Bourdeauducq b9c7905b20 nixpkgs 23.05 2023-05-27 17:17:36 +08:00
Charles Baynham c2b0c97640 worker: Wait until datasets are written before quitting
Avoids a race condition in worker_impl.py where HDF5 dataset saving was
cut off before it finished for large datasets.
2023-05-23 21:48:56 +01:00
Sebastien Bourdeauducq 58cc3b8d0a kasli_generic: fix LooseVersion deprecation warning 2023-05-23 19:36:06 +08:00
Sebastien Bourdeauducq 598c7b1d25 flake: update qasync 2023-05-23 11:26:30 +08:00
Jonathan Coates ea9fe9b4e1
dma: fix off-by-one error in RawSlicer (#2090)
Signed-off-by: Jonathan Coates <jonathan.coates@oxionics.com>
2023-05-23 11:15:39 +08:00
mwojcik c1d6fd4bbe satman analyzer: remove forgotten comment 2023-05-19 11:39:14 +08:00
mwojcik ab52748cac analyzer sat: disarm on drop 2023-05-19 11:39:14 +08:00
mwojcik ddfe51e7ac analyzer: use transactions for data transmission 2023-05-19 11:39:14 +08:00
mwojcik 6c96033d41 analyzer: implement querying up satellites for data 2023-05-19 11:39:14 +08:00
mwojcik 0b03126038 satman: support analyzer packets 2023-05-19 11:39:14 +08:00
mwojcik fdca1ab7fc drtioaux: add analyzer related messages 2023-05-19 11:39:14 +08:00
mwojcik c36b6b3b65 master: only local rtio events in analyzer 2023-05-19 11:39:14 +08:00
mwojcik c0ca27e6cf satellite: add rtio_analyzer, only for local rtio 2023-05-19 11:39:14 +08:00
Jonathan Coates 3ca47537b8 Fix mismatched signatures for the wide interface
Lists are passed by-reference from python code, and so should be
&CSlice<_> not CSlice<_>.

Signed-off-by: Jonathan Coates <jonathan.coates@oxionics.com>
2023-05-19 10:18:06 +08:00
Hartmann Michael (IFAG PSS SIS SCE QSE) df15f53ee9 doc: conda installation notes 2023-05-12 17:44:38 +08:00
Sebastien Bourdeauducq e015483e48 RELEASE_NOTES: add LMDB migration script (#1743) 2023-05-09 14:56:43 +08:00
Sebastien Bourdeauducq c53d333d46 almazny: fix parameter 2023-05-09 14:27:37 +08:00
Sebastien Bourdeauducq 5b94ce82e4 artiq_ddb_template: fix almazny 2023-05-09 14:27:15 +08:00
Sebastien Bourdeauducq 45cd438fb8 Almazny v1.2 support
Based on PR #2060 by Robert Jördens.
2023-05-09 12:54:48 +08:00
Sebastien Bourdeauducq 0e7e30d46e test: fix hardware testbench trying to write to ARTIQ_ROOT 2023-04-30 17:16:36 +08:00
Sebastien Bourdeauducq d5a7755584 test: improve tmpdir names 2023-04-30 17:15:34 +08:00
Sebastien Bourdeauducq 3ff0be6540 PEP440 compliant version numbers 2023-04-30 16:55:49 +08:00
Sebastien Bourdeauducq 8409a6bb94 update gitignore 2023-04-30 16:53:49 +08:00
Sebastien Bourdeauducq 2c1438c4b9 coredevice: add missing pattern to sampler_hw_rev 2023-04-30 16:07:56 +08:00
Egor Savkin 5199bea353
master: emit warning if datasets will not be stored 2023-04-30 15:22:21 +08:00
mwojcik a533f2a0cd rtio: SED, InputCollector use rio clock domain 2023-04-28 17:49:12 +08:00
Jonathan Coates 0bf57f4ebd Fix ADF3536 having RTIO channel names
The channel in this device refers to a channel on the mirny, not an RTIO
channel.
2023-04-24 20:05:14 +08:00
Sebastien Bourdeauducq 4417acd13b flake: update dependencies 2023-04-24 17:36:13 +08:00
Sebastien Bourdeauducq 4056168875 master: store datasets in LMDB (#1743) 2023-04-24 17:34:30 +08:00
Egor Savkin 9331911139
add tests for client submit functionality 2023-04-24 11:43:24 +08:00
Spaqin 2f35869eb1
satman: fix PMP and L2 flush 2023-04-20 15:45:15 +08:00
Egor Savkin aed47d79ff
master: add terminate API 2023-04-18 15:03:06 +08:00
mwojcik 918d30b900 dma: pass "uses_ddma" for non-remote recordings 2023-04-18 12:35:37 +08:00
Egor Savkin b5d9062ba9 Fix AD9914 channel map
Signed-off-by: Egor Savkin <es@m-labs.hk>
2023-04-17 09:23:30 +08:00
Egor Savkin 8984f5104a Move RTIO errors formatting to the session_proto
This would be closer to the artiq-zynq implementation

Signed-off-by: Egor Savkin <es@m-labs.hk>
2023-04-17 09:23:30 +08:00
Egor Savkin d0b8818688 Add 125 MHz from 80 MHz reference option to rtio clocking
Signed-off-by: Egor Savkin <es@m-labs.hk>
2023-04-13 14:57:24 +08:00
Sebastien Bourdeauducq 757c00b0fe afws_client: improve UX of common build errors 2023-04-08 16:50:15 +08:00
Sebastien Bourdeauducq c1474c134a remove obsolete AFWS certificate 2023-04-07 16:09:47 +08:00
Sebastien Bourdeauducq dc3db8bb66 afws_client: WebSocket, system certificates 2023-04-07 16:03:33 +08:00
Sebastien Bourdeauducq 97161a3df2 firmware: improve RTIO map error reporting 2023-04-04 11:27:31 +08:00
Ikko Eltociear Ashimine 7ba06bfe61 fix typo in comm_analyzer.py
error_occured -> error_occurred
occured -> occurred
2023-04-02 09:17:37 +08:00
Spaqin b225717ddb
DDMA: documentation 2023-03-29 13:46:33 +08:00
mwojcik 696bda5c03 handle playback status in aux_transact 2023-03-28 14:18:29 +08:00
mwojcik 9150230ea7 dma: gate ddma features behind cfg(has_drtio) 2023-03-28 14:18:29 +08:00
Spaqin e9a153b985
runtime: implement distributed DMA 2023-03-22 11:16:25 +08:00
David Nadlinger 8b1f38b015 worker_impl: Remove misleading update() from ExamineDatasetMgr [nfc]
`update(mod)` would be on the DatasetDB, not the manager. Rather,
modifications currently just fail due to e.g. `set(…)` not being
defined.
2023-03-20 13:20:40 +08:00
Egor Savkin bbf80875fb
firmware: assume empty config records as removed (#2064)
This will return `KeyNotFound` for empty values, which are produced by `remove` operation

Signed-off-by: Egor Savkin <es@m-labs.hk>
2023-03-13 18:18:26 +08:00
Egor Savkin 1ca09b9484
Add support for default route (IPv4 and IPv6) (#2059)
Based on code by Michael Birtwell <michael.birtwell@oxionics.com>
2023-03-13 17:29:10 +08:00
Spaqin 84e7515721
satman: distributed DMA support 2023-03-11 18:36:36 +08:00
Ikko Eltociear Ashimine 15c18bdc81 fix typo in developing_a_ndsp.rst
occurence -> occurrence
2023-03-11 18:32:14 +08:00
Sebastien Bourdeauducq a9360823b1 libproto: remove obsolete Jdac packets 2023-03-02 20:29:09 +08:00
Egor Savkin 1ec0abbfcf Add Urukul PLL bypass option to the JSON
Signed-off-by: Egor Savkin <es@m-labs.hk>
2023-03-01 19:05:16 +08:00
mwojcik 90a6fe1c35 satellite: add dma to gateware 2023-02-23 17:33:23 +08:00
mwojcik d0437f5672 rtio core: fix minimum_coarse_timestamp 2023-02-22 10:44:25 +08:00
Michael Hartmann 07d684a35d doc: Add jsonschema to nix package list
Add jsonschema to the nix package list as it is required by
artiq_ddb_template.
2023-01-31 18:24:15 +08:00
Michael Hartmann 2371c825f5 doc: Add remark about FTDI drivers
Add a remark that on Windows you might need to install the FTDI drivers
first before you can connect to the serial port.
2023-01-26 21:05:47 +08:00
Egor Savkin 394138f00f
firmware: block session on startup kernel to be finished (#2046) 2023-01-19 16:46:53 +08:00
Sebastien Bourdeauducq 3f5cc4aa10 RELEASE_NOTES: fix formatting 2023-01-19 16:42:52 +08:00
Sebastien Bourdeauducq e9c65abebe manual: fix Nix flakes installation. Closes #2036 2023-01-15 13:03:15 +08:00
Sebastien Bourdeauducq 20e8f17b3d artiq_ddb_template: fix mistake in 18524911 2023-01-15 12:27:13 +08:00
Sebastien Bourdeauducq 57e87c9717 sampler: fix mistake in c591e7e3 2023-01-15 12:27:10 +08:00
Sebastien Bourdeauducq 248cd69673 flake: use nixpkgs cargo-xbuild 2023-01-12 18:03:46 +08:00
Sebastien Bourdeauducq b8968262d7 Merge branch 'syncrtio' 2023-01-12 16:44:54 +08:00
Sebastien Bourdeauducq babbbfadb3 update release notes 2023-01-12 13:12:05 +08:00
Sebastien Bourdeauducq 514ac953ce remove obsolete SI5324_AS_SYNTHESIZER config option 2023-01-12 13:01:08 +08:00
Sebastien Bourdeauducq 0a37a1a4c1 Merge branch 'syncrtio' 2023-01-12 12:58:19 +08:00
Sebastien Bourdeauducq 6d37d9d52c gui/state: fix asyncio loop management 2023-01-12 12:41:08 +08:00
Sebastien Bourdeauducq 5f77d4f5fa applets: fix asyncio loop management 2023-01-12 12:35:02 +08:00
Sebastien Bourdeauducq 2f289c552f remove unused import 2023-01-12 12:18:17 +08:00
Sebastien Bourdeauducq 9e8bb3c701 browser,dashboard: fix asyncio loop management 2023-01-12 12:17:16 +08:00
Sebastien Bourdeauducq d872c3ab4d aqctl_moninj_proxy: fix asyncio loop management 2023-01-12 12:16:53 +08:00
Sebastien Bourdeauducq f8d93813e9 aqctl_corelog: fix asyncio loop management 2023-01-12 10:52:26 +08:00
Sebastien Bourdeauducq 628b671433 update copyright year 2023-01-12 10:41:10 +08:00
Sebastien Bourdeauducq daad3d263a master: commit missing part of 7fd6dead8 2023-01-12 10:39:53 +08:00
Sebastien Bourdeauducq 80f261437a flake: update dependencies 2023-01-11 18:47:30 +08:00
Sebastien Bourdeauducq 7fd6dead8f master: fix asyncio loop management 2023-01-11 18:46:54 +08:00
Sebastien Bourdeauducq 73a4ef89ec scheduler: make asyncio loop a keyword-only argument, like in other asyncio APIs 2023-01-11 18:45:35 +08:00
mwojcik 70edc9c5c6 test_write_underflow: decrease underflow delay 2023-01-11 12:02:51 +08:00
mwojcik 9042426872 echo test: add two more yields 2023-01-11 12:02:51 +08:00
mwojcik cd860beda2 test_full_stack: restore missing check_ttls 2023-01-11 12:02:51 +08:00
mwojcik 627504b60e test_dma: remove redundant clock 2023-01-11 12:02:51 +08:00
Sebastien Bourdeauducq c8ab6c1b2b test_worker: fix asyncio event loop management 2023-01-10 12:36:33 +08:00
Sebastien Bourdeauducq a96bbd8508 test_scheduler: fix asyncio event loop management 2023-01-10 12:30:08 +08:00
Sebastien Bourdeauducq 6cfd1480a7 scheduler: support passing event loop 2023-01-10 12:26:24 +08:00
Sebastien Bourdeauducq c401559ed5 flake: update dependencies 2023-01-10 12:26:00 +08:00
Sebastien Bourdeauducq ea21f474a7 gateware: remove SAWG simulations 2023-01-09 18:37:19 +08:00
Sebastien Bourdeauducq cee9f3f44e flake: run gateware simulations 2023-01-09 18:36:55 +08:00
Sebastien Bourdeauducq b9bfe090f4 flake: cleanup 2023-01-09 18:23:36 +08:00
mwojcik eb3742fb08 kc705: do not reset si5324 during clock switch 2023-01-09 18:18:21 +08:00
Egor Savkin 070fed755b
firmware: unify RTIO error message format 2023-01-09 16:13:05 +08:00
Sebastien Bourdeauducq 63f1a6d197 drtio: partially fix tests 2023-01-06 18:33:13 +08:00
Sebastien Bourdeauducq 7dafdfe2f7 artiq_flash: fix bit2bin 2023-01-06 18:24:00 +08:00
Sebastien Bourdeauducq ec893222a4 rtio: remove support for async mode 2023-01-06 18:22:05 +08:00
Sebastien Bourdeauducq 573a895c1e remove RTIOClockMultiplier 2023-01-06 17:59:18 +08:00
Sebastien Bourdeauducq cf2a4972f7 remove WRPLL 2023-01-06 17:53:11 +08:00
Sebastien Bourdeauducq 668997a451 flake: update dependencies 2023-01-06 17:49:13 +08:00
Sebastien Bourdeauducq 5da9794895 remove Sayma and Metlino support 2023-01-06 17:41:12 +08:00
Spaqin 3838dfc1d1
DRTIO: RTIO/SYS clock merge, KC705 2023-01-06 07:13:38 +08:00
Sebastien Bourdeauducq 1be7e2a2e1 doc: duplicate nixConfig 2023-01-04 15:13:55 +08:00
Sebastien Bourdeauducq 1bf7188dec gui: update version in logo 2023-01-04 15:07:56 +08:00
mwojcik bdae594c79 suservo experimentals: fix rtio ch name changes 2023-01-04 14:56:18 +08:00
mwojcik 8dc6902c23 AD9912: Add PLL bypass option (pll_en) like AD9910 2022-12-21 13:34:31 +08:00
Norman Krackow dbb77b5356
artiq_sinara_tester: change mirny frequencies 2022-12-21 09:47:47 +08:00
Sebastien Bourdeauducq 1fc127c770 fix default version 2022-12-20 12:56:43 +08:00
David Nadlinger 88684dbd2a test_embedding: Fix up spelling in FIXME comment [nfc] 2022-12-19 01:02:51 +00:00
David Nadlinger b9f13d48aa firmware: Fix object references in tuples
Sine 8740ec3dd, the alignment() information from
"run-time type information" (i.e. the Tag type) is also
used when sending tuples to the host.
2022-12-19 00:57:46 +00:00
David Nadlinger 4bb2a3b9e0 RELEASE_NOTES: Two typo/formatting fixes 2022-12-18 17:26:58 +00:00
David Nadlinger f5c408d8d9 RELEASE_NOTES: Fix up punctuation 2022-12-18 17:11:36 +00:00
Sebastien Bourdeauducq 4be7f302e4 flake: vivado 2022.2 2022-12-18 16:51:02 +08:00
Spaqin 17efc28dbe
DRTIO: RTIO/SYS clock merge 2022-12-17 15:39:54 +08:00
David Nadlinger 1e0102379b firmware: Rename si5324 crystal_{ref -> as_ckin2} [nfc]
This would have made the issue in the pre-740543d4e code
much more obvious (the config option by itself does not
have any effect on the choice of active reference input).
2022-12-17 02:17:12 +00:00
David Nadlinger ceabeb8d84 firmware: Fix Si5324 initialisation for satellites
Commit 740543d4e2 had unintentionally broken DRTIO
satellites, as si5324::setup is also used there. This
imports setup_si5324_as_synthesizer() from artiq-zynq,
where the input selection was already explicitly done.

GitHub: Fixes #2028.
2022-12-17 02:17:06 +00:00
SingularitySurfer 8e476dd502 implement pca9539 and runtime io-expander chip selection
better comments and address translation

fix spurious };

unwrap init in runtime and return err instead of panic

propagate error

del unnecessary use

Signed-off-by: SingularitySurfer <Norman_Krackow@gmx.de>
2022-12-14 22:46:38 +08:00
David Nadlinger 874d298ceb master/scheduler: Unbreak submitting from repository
This is a fix-up to commit 2a58981822.
2022-12-13 14:58:23 +00:00
Egor Savkin d75ade7be6 Fix rtiomap failure on device aliases
Signed-off-by: Egor Savkin <es@m-labs.hk>
2022-12-13 17:21:10 +08:00
Egor Savkin 2a58981822 Scheduler: replace relative path to absolute
Signed-off-by: Egor Savkin <es@m-labs.hk>
2022-12-09 21:43:36 +08:00
Egor Savkin e80442811e
worker_impl: do not write results without rid (#2020) 2022-12-09 16:18:28 +08:00
Egor Savkin 12649720f1 browser: read artiq_version from HDF5 as string
Signed-off-by: Egor Savkin <es@m-labs.hk>
2022-12-07 16:39:19 +08:00
Egor Savkin 454ae39c5d
firmware: fix crash on exception with host message (#2017) 2022-12-07 10:41:43 +08:00
David Nadlinger 3c7a394eff runtime/rtio_clocking: Deduplicate/document input selection [nfc] 2022-12-04 04:21:44 +00:00
David Nadlinger 740543d4e2 firmware: Fix Kasli v2 runtime rtio_clock selection
SI5324_EXT_REF now only controls the (deprecated) fallbacks
for when the rtio_clock option is not set.
2022-12-04 02:23:38 +00:00
Egor Savkin b2b559e73b
browser: tolerate missing HDF5 metadata 2022-12-02 16:30:58 +08:00
Egor Savkin 1852491102
add channel names to RTIO errors 2022-12-02 16:27:03 +08:00
Egor Savkin c591e7e305
sampler: fix reference voltage of recent hardware 2022-12-02 10:45:40 +08:00
David Nadlinger 261dc6b933 firmware/runtime: Fix Ext0_Synth0_*to125 log messages 2022-12-02 01:37:56 +00:00
David Nadlinger 1abedba6dc coredevice/fastino: Fix stray punctuation [nfc] 2022-12-01 12:11:35 +00:00
Egor Savkin aa2febca53
browser: fix dummy device creation failure on analyze 2022-12-01 17:45:02 +08:00
Egor Savkin d60a96a715 Fix deprecated warnings on nix develop
Signed-off-by: Egor Savkin <es@m-labs.hk>
2022-12-01 17:33:18 +08:00
wlph17 3f93f16955
manual: add msys2 openocd instructions (#2014) 2022-12-01 17:23:51 +08:00
Sebastien Bourdeauducq 3735b7ea9d Revert "flake: update cargo-xbuild"
This reverts commit 195d2aea6a.
2022-11-30 22:19:27 +08:00
Sebastien Bourdeauducq 195d2aea6a flake: update cargo-xbuild 2022-11-30 21:48:25 +08:00
Sebastien Bourdeauducq 6d179b2bf5 flake: nixos 22.11 2022-11-30 21:36:36 +08:00
Sebastien Bourdeauducq 275b00bfc2 flake: fix libcrypt.so.1 not found by vivado 2022-11-30 11:26:23 +08:00
Jonathan Coates b8b6ce14cc Update smoltcp to 0.8.2
This fixes an issue where TCP issues are not retransmitted when only
some packets in a burst are acknowledged. This causes smoltcp to never
make progress and hang.

Signed-off-by: Jonathan Coates <jonathan.coates@oxionics.com>
2022-11-28 22:10:23 +08:00
Nico Pulido 88c5109627 language: check_unprocessed_arguments after constructing experiment
Signed-off-by: Nico Pulido-Mateo <pulido@iqo.uni-hannover.de>
2022-11-27 02:29:57 +00:00
David Nadlinger dee154b35b compiler: Add missing sections to kernel linker script
This caused sporadic LoadFaults with LLD 14 and above, as they
happened to lay out the (not otherwise mentioned) GOT/PLT such
that they would overlap with the stack guard page.

LLD does support the --orphan-handling=error option, which
would be useful to avoid similar problems in the future, but
then we'd need to mention all the other misc sections
(symbol table, comments) in the linker script as well.

GitHub: Fixes #1975.
2022-11-24 16:57:31 +00:00
David Nadlinger 950b9ac4d6 firmware: More explicit panic message if stack guard is tripped
This should give even only mildly technical users a
chance to figure out what's going on, which empirically
is not the case for a plain Exception(LoadFault) without
further context.
2022-11-24 16:54:49 +00:00
Egor Savkin 6c47aac760
dashboard: merge create dataset and edit dataset features 2022-11-23 18:22:53 +08:00
mwojcik f2c1e663a7 regenerate suservo_coherent patch with var_urukul base 2022-11-23 17:22:26 +08:00
Egor Savkin f7f027001e
compiler: insert new lines into long synthesized code (#1986) 2022-11-23 12:10:32 +08:00
David Nadlinger 0b3c232819 language: Clarify error message for unprocessed arguments
"Unexpected argument(s)" would be another less ambiguous,
shorter phrasing.
2022-11-22 11:26:07 +00:00
Etienne Wodey d45f9b6950 ddb_template: propagate fastino log2_width setting
Signed-off-by: Etienne Wodey <etienne.wodey@aqt.eu>
2022-11-17 10:54:37 +08:00
Sebastien Bourdeauducq 2fe02cee6f doc: MSYS2 packages 2022-11-15 19:32:06 +08:00
Sebastien Bourdeauducq 404f24af6b compiler: set lld emulation explicitly 2022-11-15 11:20:06 +08:00
David Nadlinger 3d25092cbd firmware/rpc_proto: Remove unnecessary cast [nfc] 2022-11-14 22:50:38 +00:00
David Nadlinger dbbe8e8ed4 firmware/rpc_proto: Fix typo breaking receiving of arrays
This was introduced in 8740ec3dd5.
2022-11-14 22:49:45 +00:00
David Nadlinger 8740ec3dd5 firmware/rpc_proto: Fix size/alignment calculation for structs with tail padding
Also factors out duplicate code for (de)serializing
elements of lists and ndarrays, and replaces the rounding
calculations by the well-known, much faster power-of-two-only
bit-twiddling version.

GitHub: Fixes #1934.
2022-11-14 11:37:45 +08:00
David Nadlinger 6caa779c74 firmware/ksupport: Include .gcc_except_table (LSDA)
For whatever reason, no language-specific unwind data
was generated for ksupport code so far, but rustc does
emit it for an upcoming refactoring.
2022-11-14 11:37:45 +08:00
David Nadlinger 4819016a3c firmware/ksupport: Document rpc_recv alignment requirements [nfc] 2022-11-14 11:37:45 +08:00
David Nadlinger 00a27b105a compiler: Extract maximum alignment from target data layout
In particular, i64/double are actually supposed to be aligned
to their size on RISC-V (at least according to the ELF psABI),
though it is unclear to me whether this actually caused any
issues.
2022-11-14 11:37:45 +08:00
David Nadlinger beff15de5e compiler/targets: Fix refactoring leftover for native (host) target
It's unclear whether this actually caused any issues, or why this
wasn't done before (instead just setting the now-removed endianness
flag).
2022-11-14 11:37:45 +08:00
火焚 富良 defc69d9c3
compiler: fix const str/bytes handling (#1990) 2022-11-11 13:15:50 +08:00
火焚 富良 e2178f6c86
Fix GUI log issues introduced by #1950 2022-11-09 16:55:17 +08:00
Sebastien Bourdeauducq f3f068036a use maintained fork of python-Levenshtein 2022-11-03 21:24:49 +08:00
mwojcik ad000609ce simplify tsc with no rtio/sys clk distinction 2022-11-01 08:12:54 +08:00
mwojcik af0b94bb34 rtio_clock: remove 150MHz support 2022-11-01 08:12:54 +08:00
mwojcik 5cd57e8688 rtio_clocking: switch clocks and reboot 2022-11-01 08:12:54 +08:00
mwojcik f8eb695c0f dma test: no more rsys or rtio domains 2022-11-01 08:12:54 +08:00
mwojcik 458bd8a927 kasli_generic: remove rtio clockdomain reference 2022-11-01 08:12:54 +08:00
mwojcik a6856a5e4a rtio: remove rtio clock, use sys instead 2022-11-01 08:12:54 +08:00
mwojcik 1eb87164be kasli: remove rtiocrg, use rtio/sys merge 2022-11-01 08:12:54 +08:00
Sebastien Bourdeauducq f75ddf78b0 dashboard: restore connection/version message 2022-10-21 19:17:00 +08:00
Sebastien Bourdeauducq e0b1098bc0 dashboard: remove incorrect moninj proxy message 2022-10-21 19:13:47 +08:00
Robert Jördens e5c621751f
Merge pull request #1962 from quartiq/miqro
Support MIQRO mode for Phaser
2022-10-19 16:56:02 +02:00
Robert Jördens 07db770423 phaser: fix tester 2022-10-19 16:54:00 +02:00
Robert Jördens eb7a0714b3 literal copy paste error 2022-10-19 16:44:44 +02:00
Robert Jördens e15b5b50d8 phaser: tweak docs, relax slack 2022-10-19 16:42:03 +02:00
Robert Jördens 1820e1f715 phaser: cleanup 2022-10-19 16:25:33 +02:00
Robert Jördens 118b7aca1d
Merge pull request #1980 from FabianSchwartau/fix_phaser_init_delays
Fixed two too low delay values in Phaser init
2022-10-19 15:55:11 +02:00
Fabian Schwartau d5e267fadf Fixed two too low delay values in Phaser init
Signed-off-by: Fabian Schwartau <fabian@opencode.eu>
2022-10-19 15:45:45 +02:00
Sebastien Bourdeauducq 286f151d9a flake: switch to upstream llvmlite 2022-10-19 13:05:51 +08:00
Sebastien Bourdeauducq 19b8d28a2e flake: update dependencies 2022-10-10 17:58:20 +08:00
Sebastien Bourdeauducq 3ffbc5681e flake: update dependencies, enable misoc tests 2022-10-08 13:31:52 +08:00
Sebastien Bourdeauducq 192cab887f afws_client: update 2022-10-07 11:39:36 +08:00
wlph17 9846ee653c
flake: set Nix Qt environment variables in development shell
allows applets to run standalone via ``python -m ...`` without requiring the Nix Qt wrapper
2022-10-07 11:31:43 +08:00
fanmingyu212 56e6b1428c llvm: change addr2line to symbolizer
`llvm-addr2line` is not included as part of the llvm binary package for Windows. This causes ARTIQ python compilations issues when conda is not used (so the `llvm-tools` conda package is not installed, which provides `llvm-addr2line` currently).
2022-10-04 09:35:56 +08:00
Michael Birtwell b895846322 Improve exception reports when exception can't be reconstructed
Artiq assumes that all exceptions raised by the kernel can be constructed with
a single string argument. This isn't always the case. Especially for
exceptions that originated in python and were propagated to the kernel over
rpc.

With out this change a mosek solver failure looks like:
```
ERROR    root:logging_tools.py:41 Terminating with exception (TypeError: __init__() missing 1 required positional argument: 'msg')
Traceback (most recent call last):
  File "/home/mb/.cache/pypoetry/virtualenvs/ion-transport-1-b41LI0-py3.8/lib/python3.8/site-packages/artiq/master/worker_impl.py", line 540, in main
    exp_inst.run()
  File "/home/mb/.cache/pypoetry/virtualenvs/ion-transport-1-b41LI0-py3.8/lib/python3.8/site-packages/artiq/test_tools/experiment.py", line 82, in wrapper
    meth()
  File "/home/mb/.cache/pypoetry/virtualenvs/ion-transport-1-b41LI0-py3.8/lib/python3.8/site-packages/artiq/language/core.py", line 54, in run_on_core
    return getattr(self, arg).run(run_on_core, ((self,) + k_args), k_kwargs)
  File "/home/mb/.cache/pypoetry/virtualenvs/ion-transport-1-b41LI0-py3.8/lib/python3.8/site-packages/artiq/coredevice/core.py", line 152, in run
    self.comm.serve(embedding_map, symbolizer, demangler)
  File "/home/mb/.cache/pypoetry/virtualenvs/ion-transport-1-b41LI0-py3.8/lib/python3.8/site-packages/artiq/coredevice/comm_kernel.py", line 720, in serve
    self._serve_exception(embedding_map, symbolizer, demangler)
  File "/home/mb/.cache/pypoetry/virtualenvs/ion-transport-1-b41LI0-py3.8/lib/python3.8/site-packages/artiq/coredevice/comm_kernel.py", line 699, in _serve_exception
    python_exn = python_exn_type(
TypeError: __init__() missing 1 required positional argument: 'msg'
```

With this change we get:
```
ERROR    root:logging_tools.py:41 Terminating with exception (RuntimeError: Exception type=<class 'mosek.Error'>, which couldn't be reconstructed (__init__() missing 1 required positional argument: 'msg'))
Core Device Traceback:
Traceback (most recent call first):
  File "/home/mb/oxionics/ion-transport/tests/test_end_to_end.py", line 280, in get_transport
    return self.seq.solve()
  File "/home/mb/oxionics/ion-transport/tests/test_end_to_end.py", line 288, in artiq_worker_test_end_to_end.TransportTestScan.run(..., ...) (RA=+0x2e4)
    self.seq.record(self.get_transport(1e-6 + 1e-7 * x))
mosek.Error(27): rescode.err_license_expired(1001): The license has expired.

End of Core Device Traceback
Traceback (most recent call last):
  File "/home/mb/oxionics/artiq/artiq/master/worker_impl.py", line 540, in main
    exp_inst.run()
  File "/home/mb/oxionics/artiq/artiq/test_tools/experiment.py", line 82, in wrapper
    meth()
  File "/home/mb/oxionics/artiq/artiq/language/core.py", line 54, in run_on_core
    return getattr(self, arg).run(run_on_core, ((self,) + k_args), k_kwargs)
  File "/home/mb/oxionics/artiq/artiq/coredevice/core.py", line 152, in run
    self.comm.serve(embedding_map, symbolizer, demangler)
  File "/home/mb/oxionics/artiq/artiq/coredevice/comm_kernel.py", line 732, in serve
    self._serve_exception(embedding_map, symbolizer, demangler)
  File "/home/mb/oxionics/artiq/artiq/coredevice/comm_kernel.py", line 714, in _serve_exception
    raise python_exn
RuntimeError: Exception type=<class 'mosek.Error'>, which couldn't be reconstructed (__init__() missing 1 required positional argument: 'msg')
```

Signed-off-by: Michael Birtwell <michael.birtwell@oxionics.com>
2022-09-26 20:25:13 +08:00
Robert Jördens a1a4545ed4 docs: fix syntax 2022-09-23 16:22:21 +02:00
Robert Jördens a0053f7a2b add release note 2022-09-23 15:57:43 +02:00
Robert Jördens 740f3d220b refine/fixes 2022-09-23 13:39:49 +00:00
Robert Jördens 513f9f00f3 miqro: document coredevice driver 2022-09-23 12:59:21 +00:00
Robert Jördens 5cfa8d9a42 add tester support, refactor gateware mode 2022-09-23 11:54:40 +00:00
Robert Jördens 0e4a87826c return pulse support 2022-09-20 14:35:06 +00:00
Sebastien Bourdeauducq 1709cf9717 afws_client: update 2022-09-19 16:58:41 +08:00
Sebastien Bourdeauducq 4266beeb9c experimental-features: rename patches to be compatible with AFWS server sanitize() 2022-09-19 16:57:53 +08:00
mwojcik c955ac15ed dashboard moninj: add tooltip for off button 2022-09-19 10:19:54 +08:00
mwojcik 81ef484864 dashboard moninj: check if ad9910 was init 2022-09-19 10:19:54 +08:00
mwojcik f2c3f95040 moninj: fix ad9914 behavior, comment cleanup 2022-09-19 10:19:54 +08:00
mwojcik 616ed3dcc2 moninj: dds inj: extract shared code
detect urukul already init in more than one way
detect ad9912 channel already init
2022-09-19 10:19:54 +08:00
Robert Jördens aedcf205c7 miqro: docs 2022-09-16 12:15:13 +00:00
Robert Jördens 14ab1d4bbc miqro format change: encode len, not end 2022-09-15 11:02:59 +00:00
Sebastien Bourdeauducq a028b5c9f7 afws_client: update 2022-09-15 09:15:38 +08:00
Sebastien Bourdeauducq 6085fe3319 experimental-features: add SU Servo coherent phase tracking mode (PR #1467) 2022-09-13 09:37:26 +08:00
Robert Jördens af28bf3550 simplify dt reset 2022-09-08 08:39:48 +02:00
Robert Jördens 4df880faf6 clean up docs 2022-09-08 08:38:26 +02:00
Robert Jördens 857fb4ecec spelling 2022-09-06 20:44:47 +00:00
Robert Jördens a91836e5fe easier fix for dt 2022-09-06 20:26:50 +00:00
Robert Jördens c5c5c30617 add set_window(), clean up api 2022-09-06 16:05:10 +00:00
Robert Jördens 27e3c044ed fix dt computation 2022-09-06 14:32:57 +00:00
Robert Jördens c26fa5eb90 err out on tune_fifo_offset 2022-09-05 20:48:15 +00:00
Sebastien Bourdeauducq 411afbdc23 experimental-features: add SU Servo extension for variable number of Urukuls (PR #1782) 2022-09-05 11:53:09 +08:00
Sebastien Bourdeauducq b4287ac9f4 flake: add experimental feature support 2022-09-05 11:48:43 +08:00
Robert Jördens 1cc57e2345 fix len 2022-09-04 21:00:24 +00:00
Robert Jördens 263c2751b3 add profile_mu 2022-09-04 20:43:28 +00:00
Robert Jördens 876f26ee30 add some docs 2022-09-04 19:56:52 +00:00
Robert Jördens fa3678f8a3 mem auto increment 2022-09-04 12:03:44 +00:00
Robert Jördens f4d325112c reset and elaborate, si functions 2022-09-04 11:19:38 +00:00
Robert Jördens b6586cd7e4 add window data delay 2022-09-02 20:45:13 +00:00
Robert Jördens 3809ac5470 fix type, clean clear 2022-09-02 19:47:06 +00:00
Robert Jördens b9727fdfce refactor for 32 bit mem access 2022-09-02 16:38:53 +00:00
Robert Jördens d6d0c2c866 miqro: name register constants 2022-09-02 15:55:28 +00:00
Robert Jördens 0df2cadcd3 fixes 2022-09-02 15:29:36 +00:00
Robert Jördens 25c0dc4688 whitespace 2022-09-02 14:54:18 +00:00
Robert Jördens cf48232a90 fixes 2022-09-02 14:38:38 +00:00
Robert Jördens a20087848d differentiate phaser modes 2022-09-02 11:03:23 +00:00
Robert Jördens 31663556b8 phaser: add miqro mode 2022-09-02 09:32:06 +00:00
Robert Jördens 47f90a58cc add miqro phy 2022-09-02 09:32:06 +00:00
Mikołaj Sowiński 3c7ab498d1 Added DDS selection for Kasli tester variant
Signed-off-by: Mikołaj Sowiński <msowinski@technosystem.com.pl>
2022-09-02 17:14:23 +08:00
Deepskyhunter 7c306d5609
GUI log: Apply level and text filter to existing log messages (#1950) 2022-08-29 15:20:44 +08:00
mwojcik b705862ecd afws_client: fix argument order 2022-08-25 13:17:41 +08:00
fanmingyu212 20cb99061e doc: updates artiq_flash syntax in developing.rst 2022-08-25 07:03:26 +08:00
Sebastien Bourdeauducq 5ef94d30dd versioneer: fix default 2022-08-18 14:35:58 +08:00
kk1050 3c72b8d646
dashboard: use break_realtime instead of reset for Urukul set freq (#1940) 2022-08-16 14:02:01 +08:00
Sebastien Bourdeauducq 27397625ba dashboard: improve moninj logging 2022-08-12 13:41:05 +08:00
cc78078 3535d0f1ae
kasli: relocate the SatelliteBase Error LED code (#1955) 2022-08-12 12:41:50 +08:00
cc78078 185c91f522
kasli: add Error LED to MasterBase and SatelliteBase 2022-08-11 15:06:58 +08:00
Deepskyhunter f31279411e
dashboard/moninj: make arguments a dict for DDS setters 2022-08-02 17:09:56 +08:00
Alex Wong Tat Hang a3ae82502c
gtx_7series: fix IBUFGS_GTE2 buffer parameters
Co-authored-by: topquark12 <aw@m-labs.hk>
2022-08-01 10:21:28 +08:00
Deepskyhunter 0cdb06fdf5
language/environment: support no argument manager
unbreak tests
2022-07-28 17:55:25 +08:00
Deepskyhunter 2a7a72b27a
language.environment: error out if unknown arguments are passed (#1927)
Closes #1641
2022-07-26 10:42:03 +08:00
kk1050 748e28be38
artiq_flash: bail out if scan chain is wrong
Due to OpenOCD limitations, there currently doesn't seem to be a better way of doing it. Upstream patch may be coming.
2022-07-26 09:49:48 +08:00
Sebastien Bourdeauducq 4b1715c80b typo 2022-07-21 11:58:25 +08:00
Robert Jördens 5985595845
Merge pull request #1933 from quartiq/nk/phaser-servo
Nk/phaser servo
2022-07-11 14:36:25 +02:00
Robert Jördens a8f498b478
Merge branch 'master' into nk/phaser-servo 2022-07-11 14:35:25 +02:00
Sebastien Bourdeauducq db4bccda7e flake: bump major version 2022-07-08 18:49:40 +08:00
Sebastien Bourdeauducq 5c461443e4 flake: update dependencies 2022-07-08 17:52:58 +08:00
Sebastien Bourdeauducq cb711e0ee3 edit ARTIQ-7 release notes 2022-07-08 17:51:02 +08:00
Sebastien Bourdeauducq 9ba239b8b2 flake: add aarch64 openocd package 2022-07-08 11:35:17 +08:00
Robert Jördens 4ea11f4609 RELEASE_NOTES: update servo note 2022-07-07 16:03:35 +02:00
SingularitySurfer 57ac6ec003 add release note 2022-07-07 15:57:08 +02:00
Robert Jördens d2dacc6433 Merge branch 'master' into nk/phaser-servo-clean
* master: (25 commits)
  flake: update rpi-1 host key
  aqctl_moninj_proxy: clear listeners on disconnect
  Add method to check if termination is requested (#811, #1932)
  moninj: fix underflows by order of operation fix channel toggle
  moninj: fix underflows for urukul freq set
  Urukul monitoring (#1142, #1921)
  moninj: make receive_task private again
  moninj,corelog: fix/cleanup exception handling (#1897)
  aqctl_corelog: enable keepalive, terminate on connection failure
  Modify log for matching the style
  Add log message when dashboard connected to proxy
  Public receive_task for the use in proxy
  applets.simple: Actually forward dataset_prefixes when using IPC
  master: Fixup 32db6ff978 (argument_ui support)
  Revert "add pull.yml (#1918)"
  add pull.yml (#1918)
  Allow experiments to specify a custom argument editor UI (#1916)
  dashboard: Add submit/close hooks for custom argument editors
  dashboard: Plumb through datasets client to ExperimentManager
  dashboard: Add cmdline option to load plugins on startup
  ...
2022-07-07 15:56:30 +02:00
Sebastien Bourdeauducq 734b2a6747 flake: update rpi-1 host key 2022-07-07 18:03:17 +08:00
Deepskyhunter c7394802bd
aqctl_moninj_proxy: clear listeners on disconnect 2022-07-07 17:20:08 +08:00
kk1050 7aa6104872
Add method to check if termination is requested (#811, #1932)
Co-authored-by: kk105 <kkl@m-kabs.hk>
2022-07-07 17:01:34 +08:00
mwojcik 46f2842d38 moninj: fix underflows by order of operation
fix channel toggle
2022-07-07 12:37:10 +08:00
mwojcik c9fb7b410f moninj: fix underflows for urukul freq set 2022-07-07 12:37:10 +08:00
Spaqin 8be945d5c7
Urukul monitoring (#1142, #1921) 2022-07-07 10:52:53 +08:00
SingularitySurfer 9c8ffa54b2 reverse to servo enable. hopefully adapted all comments etc. 2022-07-06 14:33:46 +00:00
Sebastien Bourdeauducq d17675e9b5 moninj: make receive_task private again 2022-07-02 17:58:24 +08:00
Sebastien Bourdeauducq 388b81af19 moninj,corelog: fix/cleanup exception handling (#1897) 2022-07-02 17:48:18 +08:00
Deepskyhunter 02b086c9e5
aqctl_corelog: enable keepalive, terminate on connection failure 2022-07-02 17:33:58 +08:00
SingularitySurfer 953dd899fd refine docu 2022-06-23 15:46:15 +00:00
SingularitySurfer 689a2ef8ba refine note 2022-06-23 15:23:00 +00:00
SingularitySurfer d8cfe22501 add note about setpoint resolution 2022-06-23 15:18:55 +00:00
Deepskyhunter b4f24dd326 Modify log for matching the style 2022-06-23 19:16:36 +08:00
Deepskyhunter da6d35e7c6 Add log message when dashboard connected to proxy 2022-06-23 19:16:36 +08:00
Deepskyhunter 745f440597 Public receive_task for the use in proxy
Notify proxy and terminate after receive_task end
2022-06-23 19:16:36 +08:00
SingularitySurfer 2e834cf406 unflip logic.. 2022-06-23 10:20:38 +00:00
SingularitySurfer 3f8a221c76 flip logic of enable bit to bypass bit and update some comments 2022-06-23 10:08:34 +00:00
SingularitySurfer ab097b8ef9 add offset to coefficients as data 2022-06-23 09:37:37 +00:00
SingularitySurfer 24b4ec46bd more documentation 2022-06-23 08:48:28 +00:00
Norman Krackow 56c59e38f0
Update artiq/coredevice/phaser.py
Co-authored-by: Robert Jördens <rj@quartiq.de>
2022-06-23 09:15:50 +02:00
SingularitySurfer c0581178d6 impl offsets. to be tested 2022-06-22 16:20:59 +00:00
SingularitySurfer 43c94577ce impl set_iir. untested 2022-06-22 15:35:49 +00:00
SingularitySurfer ce4055db3b force hold on bypass and use names in set_servo() in init 2022-06-21 10:11:49 +00:00
SingularitySurfer b67a70392d rename to coeff base and shorter write16 2022-06-21 09:59:40 +00:00
SingularitySurfer 57176fedb2 add servo docu 2022-06-21 09:29:42 +00:00
SingularitySurfer 8bea821f93 just &1 to stay in field 2022-06-21 08:43:55 +00:00
SingularitySurfer 0388161754 disable servo in init 2022-06-21 07:49:29 +00:00
SingularitySurfer 751af3144e fix old line that I forgot 2022-06-21 07:43:28 +00:00
SingularitySurfer 5df766e6da fix ors 2022-06-21 07:36:59 +00:00
David Nadlinger e1f9feae8b applets.simple: Actually forward dataset_prefixes when using IPC
Turns out I had inadvertently only tested 2d6fc154d using the
socket interface.
2022-06-19 18:08:25 +01:00
David Nadlinger dd928fc014 master: Fixup 32db6ff978 (argument_ui support)
This was lost in the ndscan diff upstreaming process
due to other Oxford-local changes in artiq.master.worker.
2022-06-19 11:33:40 +01:00
Sebastien Bourdeauducq 48cb111035 Revert "add pull.yml (#1918)"
This reverts commit d8597e9dc8.
2022-06-19 11:57:46 +08:00
hartytp d8597e9dc8
add pull.yml (#1918) 2022-06-18 12:37:23 +01:00
David Nadlinger 32db6ff978
Allow experiments to specify a custom argument editor UI (#1916)
On the master/EnvExperiment side, the only addition is an optional
property `argument_ui` that is made accessible to the dashboard, e.g.

    class Example(EnvExperiment):
        argument_ui = "ndscan"
        def build(self):
           …

Clients – primarily artiq_dashboard, but in principle e.g. a
command-line UI could do the same – can then compare the value to a
list of well-known names and prefer any matching custom UI handlers.

On the dashboard side, this commit adds the mechanism to register
a custom argument editor for a given argument_ui string, i.e. the
widget that displays the parameter values within the wider
experiment UI shell with the submit button, pipeline parameters, and
so on. The registry remains empty by default and would be filled by
out-of-tree plugins such as ndscan.

The UI state readback is implemented somewhat defensively to avoid
needless disruptions to users when upgrading.
2022-06-18 15:55:13 +08:00
David Nadlinger dbc87f08ff dashboard: Add submit/close hooks for custom argument editors
These are used by ndscan, as re-serialising the entire ndscan
parameter metadata tree, which can grow to be quite extensive,
on every single Qt change event is a bit excessive (and would
probably cause a bit of lag while typing for big experiments
on low-end machines).
2022-06-18 15:51:39 +08:00
David Nadlinger c4068e6896 dashboard: Plumb through datasets client to ExperimentManager
This is analogous to the explist/schedule subscribers, and allows
custom argument editors (such as ndscan) to provide hints/defaults/…
from datasets once available.
2022-06-18 15:50:05 +08:00
David Nadlinger 85895ab89b dashboard: Add cmdline option to load plugins on startup
Together with m-labs/artiq#1916, this allows the user to integrate
multiple argument UIs implemented in external libraries.
2022-06-18 15:48:32 +08:00
kk1050 46fb8916bb
update SEEN_ASYNC_ERRORS in destination_survey 2022-06-18 15:46:49 +08:00
David Nadlinger 2d6fc154db applets: Allow wildcard subscription to all datasets matching prefix via IPC
This allows ndscan v0.3+ to use the IPC interface for efficiency;
previously, the non-upstreamed RID dataset namespace feature allowed
the applets to somewhat efficient subscribe directly to the master
process via the socket interface.
2022-06-18 15:45:57 +08:00
David Nadlinger 4c42f65909 applets: Add ${server}, ${port_control}, ${port_notify} command substitutions
This facilitates applets that connect back to the master
(e.g. to update datasets on user request, as used by ndscan).
2022-06-18 15:19:35 +08:00
David Nadlinger f4d639242d units: Add nW (nanowatts)
We found this quite useful/common for laser beams.
2022-06-18 15:11:05 +08:00
SingularitySurfer d09153411f adress some review comments 2022-06-17 13:03:21 +00:00
Norman Krackow dc49372d57
Update artiq/coredevice/phaser.py
Co-authored-by: Robert Jördens <rj@quartiq.de>
2022-06-17 14:40:07 +02:00
Norman Krackow 2044dc3ae5
Update artiq/coredevice/phaser.py
Co-authored-by: Robert Jördens <rj@quartiq.de>
2022-06-17 14:39:37 +02:00
SingularitySurfer ae3f1c1c71 adapt servo functions. Todo: docu 2022-06-17 11:47:45 +00:00
Sebastien Bourdeauducq bf3b155a31 flake: update dependencies 2022-06-17 16:07:31 +08:00
SingularitySurfer 1bddadc6e2 cleanup and comments 2022-06-15 17:32:11 +00:00
SingularitySurfer b0f9fd9c4c implement main driver functions 2022-06-15 12:40:21 +00:00
Michael Birtwell 69c4026d2b Fix returning tuples of lists of arrays from RPCs
When serialising a list of objects `_send_rpc_value` makes a copy of the
upcoming tags to pass repeatedly to the recursive call. Then uses
`_skip_rpc_value` to skip over the tags that should have been processed.
This didn't handle numpy arrays so, after processing a list of arrays it
got out of sync and failed.

Signed-off-by: Michael Birtwell <michael.birtwell@oxionics.com>
2022-06-15 00:08:49 +08:00
Deepskyhunter e47834d82e Bugfix: Add missing item inside state to solve KeyError
KeyError raised when trying to load default_state()
due to missing Key "seed" in "RangeScan" and "CenterScan" in
state. Add {"seed": None} to resolve the bug.
2022-06-14 11:41:55 +08:00
Spaqin 4ede14b14d
dashboard: add DDS quick set-frequency feature 2022-06-09 12:01:06 +08:00
kk1050 4ddd2739ee
add log_tuples function (#1896)
Co-authored-by: kk105 <kkl@m-kabs.hk>
2022-06-06 18:41:46 +08:00
Sebastien Bourdeauducq e702624720 flake: do not use __impure (breaks hydra) 2022-06-04 10:32:02 +08:00
Sebastien Bourdeauducq 68ef0073ea doc: mock sipyco.keepalive. Closes #1900 2022-06-01 20:46:16 +08:00
Sebastien Bourdeauducq 71a37bb408 doc: switch to wavedrompy 2022-06-01 20:45:49 +08:00
occheung f79f7db3a2 dyld: handle rebind on symbols relocated by CALL_PLT 2022-06-01 12:44:33 +08:00
occheung 872f8f039f dyld: support additional RV32 reloc types
The support of LO12 type requires the runtime linker to find the corresponding HI20 symbol. resolve_rela needs the entire relocation section for that.
2022-06-01 12:44:33 +08:00
occheung 50495097e5 dyld: rename pltrel to jmprel
nac3ld will not generate PLT & its relocation section. There might not be a pltrel in that case.
On the other hand, rebinding will not be limited to the symbols in the PLT when linked with nac3ld.
Thus the renaming.
2022-06-01 12:44:33 +08:00
Sebastien Bourdeauducq ca614a3eea use asyncio get/new_event_loop as recommended 2022-05-31 23:06:54 +08:00
Sebastien Bourdeauducq 8bf6bc4d1f flake: update dependencies 2022-05-31 20:59:21 +08:00
occheung 6d46c886d7 ld.lld: translate TARGET2 reloc to relative 2022-05-31 18:26:06 +08:00
Sebastien Bourdeauducq a5b7e958f8 flake: update dependencies 2022-05-31 18:25:08 +08:00
Sebastien Bourdeauducq 667f36a2e7 gui: fix Python 3.10 PyQt float/int issues. Closes #1887 2022-05-29 08:43:25 +08:00
Sebastien Bourdeauducq 7cff63e539 frontend: use sipyco SignalHandler (#1063) 2022-05-27 15:17:33 +08:00
Sebastien Bourdeauducq df1b19082c flake: update dependencies 2022-05-27 15:14:11 +08:00
Sebastien Bourdeauducq d478086119 flake: support impure derivation for HITL test 2022-05-26 12:00:40 +08:00
Sebastien Bourdeauducq 18a08954c1 flake: update comtools 2022-05-25 15:48:17 +08:00
Sebastien Bourdeauducq 57086e2349 flake: update nixpkgs 2022-05-25 14:20:04 +08:00
mwojcik cf8e583847 comm_mgmt: expect error on config_read 2022-05-19 16:48:59 +08:00
mwojcik d24a36a02a comm_mgmt: fix read_expect 2022-05-19 16:48:59 +08:00
mwojcik 4bdb4c8e11 config: error instead of empty value if key not found 2022-05-19 16:48:59 +08:00
Sebastien Bourdeauducq 8599be5550 flake: update nixpkgs 2022-05-18 19:04:52 +08:00
Sebastien Bourdeauducq 9896d78e07 afws_client: update 2022-05-18 19:04:13 +08:00
kk1050 70503bee6f
dashboard: add dataset rename feature (#1893)
Co-authored-by: kk105 <kkl@m-kabs.hk>
2022-05-18 17:07:43 +08:00
Laurent Stephenson 16393efa7c fix issue #1890: make dashboard use moninj port from device_db
Signed-off-by: Laurent Stephenson <laurent.stephenson@nist.gov>
2022-05-13 06:23:59 +08:00
David Nadlinger 8a7af3f75c compiler: Fix "nowrite" miscompilation for sret functions
This affected e.g. rtio_input_timestamped_data().
2022-05-07 21:43:55 +01:00
Spaqin 35f30ddf05
Expose TTLClockGen for Kasli JSONs (#1886) 2022-05-06 13:33:42 +08:00
Sebastien Bourdeauducq c440f9fe1b flake: update dependencies 2022-05-04 08:28:55 +08:00
Sebastien Bourdeauducq 69b6426800 flake: use importCargoLock 2022-04-24 14:02:59 +08:00
Michael Birtwell 50dbda4f43 Use new ip_addr_storage module instead of net_settings
Necessary to avoid needing the alloc only trait impls in net_settings
when compiling the bootloader.
2022-04-24 10:10:43 +08:00
Michael Birtwell 95378cf9c9 Centralise all uses of the IPv4 index in net_settings.rs 2022-04-24 10:10:43 +08:00
Michael Birtwell 671453938b Require explicitly closing TcpStreams
Instead of automatically closing and draining the TcpStream in the Drop
implementation instead expect the user to call TcpStream::close.
Add close called to all users of TcpStream.
Document the requirement to call close on TcpListener::accept, this seems
to be the only way to get a new TcpStream at the moment.
2022-04-24 10:10:43 +08:00
Michael Birtwell 1fe59d27dc Use an Ipv4AddrConfig enum instead of the USE_DHCP constant 2022-04-24 10:10:43 +08:00
Michael Birtwell 73082d116f Ensure that pending data is sent when closing sockets
This is only necessary if close hasn't been called on the socket
but that's not always done. e.g. by the core analyzer server.
2022-04-24 10:10:43 +08:00
Michael Birtwell 596b9a265c Prefer DHCP to the built-in static IPs
Signed-off-by: Michael Birtwell <michael.birtwell@oxionics.com>
2022-04-24 10:10:42 +08:00
Michael Birtwell 6ffb1f83ee DHCP support for core device firmware
DHCP is enabled by setting the `ip` config entry to "use_dhcp". Reusing this
config field rather than creating a new one means that there is no ambiguity
over which config field takes precedence.

Adds a thread to configure the interface based on DHCP events
Adds a `Dhcpv4Socket` as a wrapper around smoltcp's version
Formalises the storage of the IP addresses so that we can update one in
another module.

There's also a workaround for the first DHCP discover packet frequently
going missing.

Signed-off-by: Michael Birtwell <michael.birtwell@oxionics.com>
2022-04-24 10:10:14 +08:00
Michael Birtwell c60de48a30 Upgrade smoltcp 0.6.0 -> 0.8.0
Main changes:
Deal with interfaces now being generic over mediums, update interface name
and initialisation.
Interfaces now own their sockets. So we store a reference to the Interface
instead of the SocketSet in Scheduler and IO.
Sockets are no longer reference counted. We never called the function to
increase the socket's reference count, so now we just remove it where it
was previously released. This will result in the socket being dropped at
a different time, but I think that should be fine.

Tested firmware upload to the bootloader and spamming artiq_coremgmt log
calls to download the log from the firmware.

Signed-off-by: Michael Birtwell <michael.birtwell@oxionics.com>
2022-04-24 10:09:27 +08:00
Suthep Pomjaksilp 06ad76b6ab
applets: add progress bar applet
Signed-off-by: Suthep Pomjaksilp <pomjaksi@physik.uni-kl.de>
2022-04-22 09:27:28 +08:00
David Nadlinger b2b84b1fd6 test: Fixup 6b5c390d4 typo 2022-04-22 00:29:03 +01:00
David Nadlinger 6b5c390d48 compiler: Fix #1871 (array() breaks math functions)
GitHub: Fixes #1871.
2022-04-22 00:12:20 +01:00
David Nadlinger 2cb08814e8 flake: Add compiler test prerequisites to devShell
Useful while working on the legacy compiler.
2022-04-21 23:47:23 +01:00
Sebastien Bourdeauducq 58b59b99ff flake: update dependencies 2022-04-19 11:04:49 +08:00
Sebastien Bourdeauducq fa3ee8ad23 flake: update sipyco 2022-04-12 08:54:58 +08:00
Michael Birtwell cab9d90d01 Use sipyco.keepalive
Remove the implementation of setting keepalive settings on sockets and use
the implementation from sipyco instead.

Signed-off-by: Michael Birtwell <michael.birtwell@oxionics.com>
2022-04-12 08:53:35 +08:00
Sebastien Bourdeauducq 0a029748ee flake: update dependencies 2022-04-09 17:24:44 +08:00
Leon Riesebos 386391e3f9 browser: support datasets that use h5 group notation
Signed-off-by: Leon Riesebos <leon.riesebos@duke.edu>
2022-04-07 18:18:13 +08:00
Leon Riesebos b5dc9fd640 browser: cleanup datasets panel for empty h5 files
this fix makes sure the datasets panel is cleared if an h5 file is empty or the datasets and archive groups are empty
2022-04-07 18:18:05 +08:00
Sebastien Bourdeauducq c82c358f3a runtime: provide/fix more libc mem functions 2022-03-28 13:33:57 +08:00
Sebastien Bourdeauducq 723f41c78b runtime: fix EXCEPTION_ID_LOOKUP 2022-03-26 20:10:24 +08:00
Sebastien Bourdeauducq 866a83796a firmware: add UnwrapNoneError exception 2022-03-26 15:28:13 +08:00
Timothy Ballance f91e106586 llvm_ir: fixed broken code in previous patch 2022-03-22 18:50:58 +08:00
Timothy Ballance a289d69883 llvm_ir: fixed stack leak on ffi call 2022-03-22 09:00:40 +08:00
Sebastien Bourdeauducq f89275b02a master: fix compiler access to source code with submit-by-content 2022-03-20 18:08:04 +08:00
Sebastien Bourdeauducq 65d2dd0173 fix compilation warning 2022-03-20 16:15:01 +08:00
Sebastien Bourdeauducq 6b33f3b719 update vivado 2022-03-20 16:09:58 +08:00
Sebastien Bourdeauducq 80d412a8bf support submitting experiments by content 2022-03-20 12:58:55 +08:00
Sebastien Bourdeauducq 922d2b1619 drop support for big-endian moninj 2022-03-19 22:58:31 +08:00
Sebastien Bourdeauducq d644e982c8 RELEASE_NOTES: update 2022-03-19 22:50:54 +08:00
Sebastien Bourdeauducq ec1efd7af9 dashboard: connect to moninj via proxy 2022-03-19 22:50:36 +08:00
Sebastien Bourdeauducq 735133a2b4 artiq_dashboard: remove references to core device in moninj 2022-03-19 22:36:07 +08:00
Sebastien Bourdeauducq 207717c740 artiq_dashboard: fix handling of moninj comment 2022-03-19 22:33:31 +08:00
Sebastien Bourdeauducq 6d92e539b1 artiq_ddb_template: add aqctl_moninj_proxy 2022-03-19 22:33:03 +08:00
Sebastien Bourdeauducq 6a49b8cb58 update dependencies 2022-03-19 19:53:38 +08:00
Sebastien Bourdeauducq df1513f0e9 add aqctl_moninj_proxy to device dbs 2022-03-19 19:25:21 +08:00
Sebastien Bourdeauducq d3073022ac aqctl_moninj_proxy: fix all major bugs 2022-03-19 19:06:12 +08:00
Sebastien Bourdeauducq bbb2c75194 add aqctl_moninj_proxy 2022-03-18 17:02:50 +08:00
Sebastien Bourdeauducq 710786388c update nixpkgs 2022-03-17 21:09:48 +08:00
Sebastien Bourdeauducq aff569b2c3 firmware: support 64-bit moninj probes 2022-03-17 19:56:07 +08:00
Sebastien Bourdeauducq a159ef642d drtio: demote default routing table message to info 2022-03-16 21:22:35 +08:00
Sebastien Bourdeauducq 1a26eb8cf2 coredevice: only print version mismatch warning when relevant 2022-03-16 21:21:43 +08:00
Sebastien Bourdeauducq c1c2d21ba7 flake: fix error message when Vivado is not found 2022-03-16 21:20:48 +08:00
Sebastien Bourdeauducq e5e4d55f84 mgmt: fix config write error message 2022-03-16 08:28:31 +08:00
Sebastien Bourdeauducq 71e8b49246 update nix dependencies 2022-03-10 17:04:44 +08:00
pca006132 ebfeb1869f firmware: use &CSlice for lists 2022-03-10 16:30:22 +08:00
pca006132 eb6817c8f1 compiler/transforms/llvm_ir_generator: changed list representation
The representation of TList(T) is changed from `{T*, u32}` to
`{T*, u32}*`. The old representation forbids changing the length of a
list when the list is passed as a parameter into functions, as the
length is passed by value. The representation now matches with nac3.
2022-03-10 16:30:22 +08:00
Sebastien Bourdeauducq 8415151866 update copyright year 2022-03-10 11:56:16 +08:00
ciciwu 67ca48fa84
manual: fix formatting (#1865) 2022-03-08 19:03:47 +08:00
ciciwu 9a96387dfe
phaser: fix docstring formatting (#1866) 2022-03-08 19:03:30 +08:00
Sebastien Bourdeauducq b02abc2bf4 remove legacy versioning files 2022-03-06 18:30:08 +08:00
Sebastien Bourdeauducq ac55da81d8 core: support precompilation of kernels 2022-03-06 18:25:18 +08:00
spaqin 232f28c0e8 kern_hw: fix return type 2022-03-04 15:16:14 +08:00
spaqin 51fa1b5e5e drtio: fix i2c switch 2022-03-04 15:16:14 +08:00
spaqin 17ecd35530 test_i2c: fix for missing readback 2022-03-01 17:40:20 +08:00
Spaqin a85b4d5f5e
I2C API for PCA9547 support (#1860) 2022-03-01 15:07:53 +08:00
David Nadlinger 9bfbd39fa3 flake.nix: Use upstream llvmlite 0.38.0, which already has the patches 2022-02-26 10:23:24 +08:00
Sebastien Bourdeauducq 338bb189b4 dashboard: fix typo (#1858) 2022-02-26 08:58:03 +08:00
Leon Riesebos c4292770f8
Kasli JSON description for SPI over DIO cards (#1800) 2022-02-26 07:36:00 +08:00
Sebastien Bourdeauducq 2b918ac6f7 coredevice: merge pcf8574a into i2c 2022-02-25 19:01:14 +08:00
Michael Birtwell 1b80746f48 Remove `outer_final`
We don't need to know whether there's a outer finally block
that's already implicit in the current break and continue
target.

Signed-off-by: Michael Birtwell <michael.birtwell@oxionics.com>
2022-02-24 19:58:33 +08:00
Michael Birtwell 2d6215158f Fix try/finally:while:try compilation
When we have a trys inside a loop then we want to make sure any
finallys are executed by break and continue inside this try. But
this shouldn't pull finallys defined outside the loop in to the
loop. This change resets the `outer_final` attribute when
visiting for and while loops so that this doesn't happen.

Signed-off-by: Michael Birtwell <michael.birtwell@oxionics.com>
2022-02-24 19:58:33 +08:00
mwojcik c000af9985 flake: extra-sandbox-paths too 2022-02-23 15:35:47 +08:00
mwojcik 35f91aef68 flake: fix substituters 2022-02-23 15:35:47 +08:00
Sebastien Bourdeauducq 0da7b83176 runtime: add nac3 exception symbols 2022-02-23 11:04:53 +08:00
Steve Fan ad656d1e53
dashboard: add device database reload action in context menu (#1853) 2022-02-22 16:18:27 +08:00
Sebastien Bourdeauducq 69ce09c7c0 manual: minor fixes 2022-02-21 18:44:18 +08:00
Sebastien Bourdeauducq 6a586c2e4d manual: kasli-soc flashing 2022-02-21 16:27:59 +08:00
Sebastien Bourdeauducq e84056f7e0 manual: Flakes installation instructions. Closes #1835 2022-02-21 16:20:14 +08:00
Mike Birtwell a106ed0295
artiq_flash: don't try to make rtm_binary_dir if binary_dir unset (#1851)
Signed-off-by: Michael Birtwell <michael.birtwell@oxionics.com>
2022-02-18 18:54:17 +08:00
Robert Jördens c8b9eed9c9 fastino: add comments about sideeffects on v0.1 2022-02-16 14:42:22 +00:00
Robert Jördens 08b65470cd fastino: robustify init()
* init() now also clear and resets more state including the interpolators.
  If not done, this PLL unlocks/locks may lead to random interpolator state
  on boot to which the CICs react badly.
* Use and expose `t_frame`
* Clarify implementation state of `read()`
2022-02-16 14:34:22 +00:00
Sebastien Bourdeauducq 65eab31f23 simplify board package format and artiq_flash 2022-02-14 15:54:17 +08:00
Sebastien Bourdeauducq 6dfc854673 flake: install artiq-comtools 2022-02-13 17:15:25 +08:00
Sebastien Bourdeauducq 5a8928fbf3 flake: set pythonparser version 2022-02-12 17:48:35 +08:00
Sebastien Bourdeauducq b3b73948a2 flake: update dependencies 2022-02-12 11:04:41 +08:00
Sebastien Bourdeauducq 8433cc6731 flake: use sipyco flake 2022-02-12 10:59:10 +08:00
Sebastien Bourdeauducq 0649e69d94 flake: cleanup 2022-02-12 10:25:24 +08:00
Sebastien Bourdeauducq bbfa926fa6 flake: add documentation outputs 2022-02-11 14:36:18 +08:00
Sebastien Bourdeauducq 9e37fb95d6 manual: use recommended contents caption 2022-02-11 14:25:10 +08:00
Sebastien Bourdeauducq 034a0fdb35 flake: install recommended wavedrom-cli. Closes #1845 2022-02-11 14:24:41 +08:00
Sebastien Bourdeauducq 0e178e40ac RELEASE_NOTES: fix formatting 2022-02-11 14:23:56 +08:00
Sebastien Bourdeauducq a0070d4396 flake: add docs dependencies 2022-02-09 10:53:52 +08:00
Sebastien Bourdeauducq 03a367f565 flake: export more packages 2022-02-09 10:41:30 +08:00
Sebastien Bourdeauducq b893d97d7b afws_client: add login successful message 2022-02-08 21:52:48 +08:00
Sebastien Bourdeauducq b6f5ba8b5b afws_client: improve error message when output already exists 2022-02-08 21:26:12 +08:00
Sebastien Bourdeauducq cc69482dad afws: nix requires full Git commit hash 2022-02-08 21:05:39 +08:00
Sebastien Bourdeauducq 833acb6925 add AFWS client 2022-02-07 14:28:00 +08:00
occheung d5eec652ee tester: specify att with dB 2022-02-07 14:22:52 +08:00
occheung a74196aa27 mirny: allow set attenuation with dB 2022-02-07 14:22:52 +08:00
Steve Fan 798a412c6f
comm_moninj: set keepalive for socket (#1843) 2022-02-04 13:51:19 +08:00
David Nadlinger e45cb217be firmware: Explicitly use wrapping integer math in PRNGs
Patch by Hannah McLaughlin; apparently, the overflow actually
doesn't get checked/reported without `opt-level = 2` and
`lto = "thin"`.
2022-02-03 23:57:17 +00:00
Sebastien Bourdeauducq 8866ab301a flake: update dependencies 2022-02-02 16:39:49 +08:00
Sebastien Bourdeauducq 3cddb14174 flake: break artiq false dependencies 2022-02-02 16:33:17 +08:00
Sebastien Bourdeauducq 245fe6e9ea flake: remove non-HITL board packages
Those can be built externally by calling makeArtiqBoardPackage directly.
2022-02-02 16:04:00 +08:00
Sebastien Bourdeauducq ef25640937 compiler: fix noreturn attribute on __artiq_resume 2022-02-01 19:01:40 +08:00
Sebastien Bourdeauducq dd3279e506 flake: add jsonschema to makeArtiqBoardPackage 2022-01-30 19:38:56 +08:00
Sebastien Bourdeauducq afb98a1903 flake: export makeArtiqBoardPackage 2022-01-30 19:31:20 +08:00
Steve Fan 34008b7a21
Backport of "fixes alignment and size problem" from artiq-zynq (#1841) 2022-01-28 20:49:55 +08:00
pca006132 93328ad8ee compiler: only allow constant exception messages
Otherwise, the exception message might be allocated on a stack, and will
become a dangling pointer when the exception is raised.
This will break some code that constructs exceptions with a function by
passing the message as a parameter because we cannot know if the parameter
is a constant. A way to mitigate this would be to defer this check to
LLVM IR codegen stage, and do inlining first for those exception
allocation functions, but I am not sure if we will guarantee inlining
for certain functions, and whether this is really needed.
2022-01-28 09:01:39 +08:00
Steve Fan 234a82aaa9
dashboard: prioritize min as part of default value resolution (#1839) 2022-01-27 17:45:09 +08:00
Sebastien Bourdeauducq ee511758ce fix typo 2022-01-26 07:51:35 +08:00
Sebastien Bourdeauducq e6c18364ae flake: consistent version string 2022-01-26 07:51:02 +08:00
pca006132 9d43762695 test: fixed lit tests
Note that because we changed exception representation from using string
names as exception identifier into using integer IDs, we need to
initialize the embedding map in order to allocate the integer IDs. Also,
we can no longer print the exception names and messages from the kernel,
we will need the host to map exception IDs to names, and may need the
host to map string IDs to actual strings (messages can be static strings
in the firmware, or strings stored in the host only).

We now check for exception IDs for lit tests, which are fixed because we
preallocated all builtin exceptions.
2022-01-26 07:16:54 +08:00
pca006132 4132c450a5 firmware: runtime changes for exception
Ported from:
M-Labs/artiq-zynq#162

This includes new API for exception handling, some refactoring to avoid
code duplication for exception structures, and modified protocols to
send nested exceptions and avoid string allocation.
2022-01-26 07:16:54 +08:00
pca006132 536b3e0c26 test: added test case for nested exceptions and try 2022-01-26 07:16:54 +08:00
pca006132 ba34700798 coredevice: report nested exceptions 2022-01-26 07:16:54 +08:00
pca006132 6ec003c1c9 compiler: fixed dead code eliminator
Instead of removing basic blocks with no predecessor, we will now mark
and remove all blocks that are unreachable from the entry block. This
can handle loops that are dead code. This is needed as we will now
generate more complicated code for exception handling which the old dead
code eliminator failed to handle.
2022-01-26 07:16:54 +08:00
pca006132 da4ff44377 compiler: fixed try codegen and allocate exceptions
Exceptions are now allocated in the runtime when we raise the exception,
and destroyed when we exit the catch block. Nested exception and try
block is now supported, and should behave the same as in CPython.
Exceptions raised in except blocks will now unwind through finally
blocks, matching the behavior in CPython. Reraise will now preserve
backtrace.

Phi block LLVM IR generation is modified to handle landingpads, which
one ARTIQ IR will map to multiple LLVM IR.
2022-01-26 07:16:54 +08:00
pca006132 4644e105b1 compiler: modified exception representation
Exception name is replaced by exception ID, which requires no
allocation. Other strings in the exception can now be 'host-only'
strings, which is represented by a CSlice with len = usize::MAX and
ptr = key, to avoid the need for allocation when raising exceptions
through RPC.
2022-01-26 07:16:54 +08:00
hartytp 715bff3ebf
Revert "Merge pull request #1544 from airwoodix/dataset-compression" (#1838)
* Revert "Merge pull request #1544 from airwoodix/dataset-compression"

This reverts commit 311a818a49, reversing
changes made to 7ffe4dc2e3.

* fix accidental revert of f42bea06a8
2022-01-25 10:02:15 +08:00
Sebastien Bourdeauducq f58aa3bdf6 flake: update qasync 2022-01-19 20:44:50 +08:00
Sebastien Bourdeauducq 4e420fc297 flake: update inputs 2022-01-19 20:18:54 +08:00
Sebastien Bourdeauducq 5597be3356 flake: add beta to version string 2022-01-19 20:17:11 +08:00
Sebastien Bourdeauducq f542f045da manual: use git+https URL for ARTIQ flake
github: flake URL lacks revCount
2022-01-19 20:04:20 +08:00
Sebastien Bourdeauducq 53878fe1d4 flake: get version number from nix 2022-01-19 19:58:55 +08:00
Sebastien Bourdeauducq 735cd1eb3e manual: update development instructions 2022-01-14 16:50:08 +08:00
Steve Fan 3f812c4c2c
comm_kernel: fix RPC exception handling (#1801) 2022-01-12 15:23:37 +08:00
occheung b6c59a0cb3 update misoc dependencies
Suppress warning when compiling libunwind.
7242dc5a41
2022-01-11 17:32:19 +08:00
Steve Fan de5892a00a
comm_kernel: check if elements are within bounds for RPC list (#1824) 2022-01-11 17:16:45 +08:00
Peter Drmota 4eee49f889 gateware.test.suservo: Fix tests for python >=3.7
Closes #1748
2022-01-11 17:16:09 +08:00
occheung 9eee0e5a7b gateware/suservo: fix profile no. in test
Follow-up/Test update for 9d49302.
2022-01-11 14:20:47 +08:00
Steve Fan d7dd75e833 comm_kernel: fix off-by-one error for numeric value range check 2022-01-11 10:13:42 +08:00
Spaqin 095fb9e333
add Almazny support (#1780) 2022-01-11 09:55:39 +08:00
Sebastien Bourdeauducq 4e3e0d129c firmware: fix compilation warning 2022-01-11 09:31:26 +08:00
pca006132 12ee326fb4 firmware: fixed personality function 2022-01-11 09:30:19 +08:00
occheung 61349f9685 sinara_tester: fix outdated API 2022-01-10 17:23:28 +08:00
occheung cea0a15e1e suservo: use default urukul profile 2022-01-10 16:21:39 +08:00
occheung 8b45f917d1 urukul: use default profile 2022-01-10 16:21:39 +08:00
pca006132 6542b65db3 compiler: fixed exception codegen issues 2022-01-10 15:54:29 +08:00
pca006132 9f90088fa6 compiler: generate appropriate landingpad IR
When used together with modified personality function, we got ~20%
performance improvement in exception unwinding with zynq.
2022-01-10 15:54:29 +08:00
occheung 5e1847e7c1 compiler: rename `variables` to `retainedNodes`
Part of the changes that was made to LLVM 6 by the time that LLVM 7 was released.
LLVM commit: 2c864551df
LLVM differential review: https://reviews.llvm.org/D45024
2022-01-10 11:28:37 +08:00
occheung 6f3c49528d compiler: revert cabe5ac
The lack of debug emitter causes #1821.
2022-01-10 11:26:03 +08:00
Sebastien Bourdeauducq eaa1505c94 update documentation (#1820) 2022-01-08 11:55:52 +08:00
Leon Riesebos f42bea06a8 worker_db: removed warning for writing a dataset that is also in the archive
Signed-off-by: Leon Riesebos <leon.riesebos@duke.edu>
2022-01-08 11:48:18 +08:00
occheung 9d493028e5 gateware/suservo: write to profile 7
Fixes #1817.
2022-01-07 16:41:19 +08:00
Sebastien Bourdeauducq bbac477092 tools: fix importlib issue 2021-12-21 13:20:11 +08:00
Steve Fan c0a7be0a90 llvm_ir: move stacksave before lltag alloca in build_rpc
Signed-off-by: Steve Fan <sf@m-labs.hk>
2021-12-19 00:07:07 +00:00
Sebastien Bourdeauducq 9e5e234af3 stop using explicit ProactorEventLoop on Windows
It is now the default in Python.
2021-12-14 20:06:38 +08:00
Sebastien Bourdeauducq 352317df11 test_dataset_db: remove (too much breakage on Windows) 2021-12-14 19:27:15 +08:00
Sebastien Bourdeauducq a518963a47 test_dataset_db: disable tests broken on windows 2021-12-14 19:19:22 +08:00
Sebastien Bourdeauducq 37f14d94d0 test_dataset_db: fix for windows 2021-12-14 19:07:17 +08:00
Sebastien Bourdeauducq 4f723e19a6 RELEASE_NOTES: update 2021-12-14 00:05:49 +08:00
Peter Drmota 7c664142a5
Simplified use of the AD9910 RAM feature (#1584)
* coredevice: Change Urukul default single-tone profile to 7

This allows using the internal profile control in RAM modulation mode (which always starts to play back at profile 0) without competing for the content of the profile 0 register used in single tone mode.

Signed-off-by: Peter Drmota <peter.drmota@physics.ox.ac.uk>

* ad9910/set_mu: comment on caveats when setting register

* ad9910: avoid unnecessary write/param

Credit: Solution proposed by @pmldrmota in https://github.com/m-labs/artiq/pull/1584#issuecomment-987774353

* revert 1064fdff (`set_mu()` comments)

158a7be7 had addressed this issue.

Co-authored-by: occheung <dc@m-labs.hk>
2021-12-13 23:44:03 +08:00
Etienne Wodey 33a9ca2684 tools/file_import: use SourceFileLoader
This allows loading modules from files with extensions not in
importlib.machinery.SOURCE_SUFFIXES

Signed-off-by: Etienne Wodey <etienne.wodey@aqt.eu>
2021-12-09 11:47:04 +08:00
Sébastien Bourdeauducq 311a818a49
Merge pull request #1544 from airwoodix/dataset-compression
datasets: support compression in HDF5 archives
2021-12-06 12:43:19 +08:00
Sébastien Bourdeauducq 1def0d98c5
Merge branch 'master' into dataset-compression 2021-12-06 12:40:30 +08:00
Leon Riesebos 7ffe4dc2e3 coredevice: set default pow for ad9912 set_mu() 2021-12-06 12:34:55 +08:00
Leon Riesebos 9e3ea4e8ef coredevice: fixed type annotations for AD9910 2021-12-06 12:34:55 +08:00
Sebastien Bourdeauducq 12512bfb2f flake: get rid of TARGET_AR 2021-12-05 14:37:09 +08:00
Steve Fan 4a6bea479a
Host report for async error upon kernel termination (#1791)
Closes #1644
2021-12-04 13:33:24 +08:00
Sebastien Bourdeauducq 9bbf7eb485 flake: use ed25519 key for hitl 2021-12-03 18:35:10 +08:00
mwojcik f8a649deda release notes: mention 100mhz support 2021-12-03 17:19:11 +08:00
mwojcik 7953f3d705 kc705: add drtio 100mhz clk switch 2021-12-03 17:19:11 +08:00
mwojcik f281112779 satman: add 100mhz si5324 settings
siphaser: add calculated vco for 100mhz comment
2021-12-03 17:19:11 +08:00
mwojcik eec3ea6589 siphaser: add support for 100mhz rtio 2021-12-03 17:19:11 +08:00
Sebastien Bourdeauducq 163f5d9128 flake: debug hitl auth failures 2021-12-03 17:16:54 +08:00
Etienne Wodey 9f830b86c0
kasli: add SED lanes count option to HW description JSON file (#1745)
Signed-off-by: Etienne Wodey <etienne.wodey@aqt.eu>
2021-12-03 17:05:35 +08:00
Sebastien Bourdeauducq b8e7add785 language: remove deprecated set_dataset(..., save=...) 2021-12-01 22:41:34 +08:00
Sebastien Bourdeauducq 5a923a0956 flake: switch to nixos- branch 2021-12-01 22:39:24 +08:00
David Nadlinger c6039479e4 compiler: Add lit test for call site attributes [nfc] 2021-11-27 04:46:07 +00:00
David Nadlinger 63b5727a0c compiler: Also emit byval argument attributes at call sites
See previous commit.

GitHub: Fixes #1599.
2021-11-27 04:45:50 +00:00
David Nadlinger 9b01db3d11 compiler: Emit sret call site argument attributes
LLVM 6 seemed not to mind the mismatch, but more recent
versions produce miscompilations without this.

Needs llvmlite support (GitHub: numba/llvmlite#702).
2021-11-27 04:44:41 +00:00
Sebastien Bourdeauducq 6a433b2fce artiq_sinara_tester: test Urukul attenuator digital control 2021-11-24 18:57:16 +08:00
occheung 5ed9e49b94 changelog: update drtio protocol 2021-11-24 12:00:56 +08:00
occheung 9423428bb0 drtio: fix crc32 offset address 2021-11-24 12:00:56 +08:00
Sebastien Bourdeauducq 7307b30213 flake: update to nixpkgs 21.11 2021-11-23 12:15:17 +08:00
Harry Ho b49f813b17 artiq_flash: ignore checking non-RTM artifacts if unused 2021-11-18 16:59:32 +08:00
Peter Drmota 20e079a381
AD9910 driver feature extension and SUServo IIR readability (#1500)
* coredevice.ad9910: Add set_cfr2 function and extend arguments of set_cfr1 and set_sync

* SUServo: Wrap CPLD and DDS devices in a list

* SUServo: Refactor [nfc]

Co-authored-by: drmota <peter.drmota@physics.ox.ac.uk>
Co-authored-by: David Nadlinger <code@klickverbot.at>
2021-11-15 12:09:16 +08:00
Sebastien Bourdeauducq f0c50c80e6 flake: update dependencies 2021-11-12 19:28:51 +08:00
Sebastien Bourdeauducq 46604300a2 flake: update dependencies 2021-11-10 14:59:02 +08:00
Sebastien Bourdeauducq c029977a27 flake: update dependencies 2021-11-10 09:54:34 +08:00
Sebastien Bourdeauducq 80115fcc02 flake: apply llvmlite callsite patch 2021-11-08 17:34:30 +08:00
occheung ac2f55b3ff flake: patch llvmlite 2021-11-08 16:59:08 +08:00
occheung db3e5e83e6 bump misoc 2021-11-08 16:59:08 +08:00
occheung 09945ecc4d gateware: fix drtio/dma tests 2021-11-08 16:59:08 +08:00
occheung 02119282b8 build_soc: build VexRiscv_G if not kasli v1.x 2021-11-08 16:59:08 +08:00
occheung 750b0ce46d ddb_temp: select appropriate compiler target 2021-11-08 16:59:08 +08:00
occheung 531670d6c5 dyld: check ABI 2021-11-08 16:59:08 +08:00
occheung 0f660735bf ll_gen: adjust csr address by detecting target class 2021-11-08 16:59:08 +08:00
occheung 0755757601 compiler/tb: use FPU 2021-11-08 16:59:08 +08:00
occheung 0d708cd61a compiler/target: split RISCV target into float/non-float 2021-11-08 16:59:08 +08:00
occheung 03b803e764 firmware: adjust csr separation 2021-11-08 16:59:08 +08:00
occheung b3e315e24a rust: find json file using CARGO_TRIPLE 2021-11-08 16:59:08 +08:00
occheung 0898e101e2 board_misoc: reuse riscv dir for comm & kernel 2021-11-08 16:59:08 +08:00
occheung cb247f235f gateware: pass adr_w/data_w to submodules 2021-11-08 16:59:08 +08:00
occheung 90f944481c kernel_cpu: add fpu if not kasli v1.x 2021-11-08 16:59:08 +08:00
occheung d84ad0095b comm_cpu: select 64b bus if not kasli v1.x 2021-11-08 16:59:08 +08:00
occheung dd68b4ab82 mailbox: parametrize address width 2021-11-08 16:59:08 +08:00
occheung c6e0e26440 drtio: accept 32b/64b bus 2021-11-08 16:59:08 +08:00
occheung 8da924ec0f dma: set conversion granularity using bus width 2021-11-08 16:59:08 +08:00
Robert Jördens 591507a7c0
Merge pull request #1774 from m-labs/fastino-cic
Fastino cic
2021-10-28 17:44:20 +02:00
Robert Jördens 5a5b0cc7c0 fastino: expand docs 2021-10-28 15:19:48 +00:00
Spaqin 69cddc6b86
rtio_clocking: add warnings for unsupported rtio_clock settings (#1773) 2021-10-28 16:34:22 +08:00
Spaqin 9b1d7e297d
runtime: clock input specification improvements
closes #1735
2021-10-28 16:21:51 +08:00
Harry Ho 21b07dc667 flake: fix missing freetype & fontconfig libs for Vivado GUI mode 2021-10-28 14:39:47 +08:00
Robert Jördens 1ff474893d Revert "fastino: make driver filter order configurable"
This reverts commit 10c37b87ec.
2021-10-28 06:29:56 +00:00
Robert Jördens 10c37b87ec fastino: make driver filter order configurable 2021-10-27 20:24:58 +00:00
Harry Ho c940f104f1 artiq_flash: fix gateware header not in little-endian for RISC-V 2021-10-25 11:20:26 +08:00
Harry Ho 0aa8a739aa sayma_rtm: fix RTM firmware not in little-endian for RISC-V 2021-10-25 11:20:26 +08:00
Sebastien Bourdeauducq 43eab14f56 flake: update dependencies 2021-10-21 15:06:38 +08:00
Sebastien Bourdeauducq cc15a4f572 flake: update Vivado 2021-10-21 11:24:55 +08:00
Sebastien Bourdeauducq df6aeb99f6 flake: check gateware timing 2021-10-18 11:09:10 +08:00
Sebastien Bourdeauducq bb61f2dae6 flake: update dependencies 2021-10-18 10:38:28 +08:00
Sebastien Bourdeauducq b0cbad530b flake: update dependencies 2021-10-16 19:10:28 +08:00
Sebastien Bourdeauducq 92cdfac35a flake: fix cargoDeps sha256 2021-10-16 18:20:25 +08:00
occheung bf180c168c flake.lock: update dependencies 2021-10-16 17:42:24 +08:00
occheung d5fa3d131a cargo.lock: update libc version for libfringe 2021-10-16 17:42:24 +08:00
occheung 6d3164a912 riscv: print mtval on panic 2021-10-16 17:42:24 +08:00
occheung 46326716fd runtime: bump libfringe, impl ecall abi
See libfringe PR: M-Labs/libfringe#1
2021-10-16 17:42:24 +08:00
occheung 0a59c889de satman/kern: init locked PMP on startup 2021-10-16 17:42:24 +08:00
occheung 27a7a96626 runtime: setup pmp + transfer to user 2021-10-16 17:42:24 +08:00
occheung a0bf11b465 riscv: impl pmp 2021-10-16 17:42:24 +08:00
occheung 790a20edf6 linker: generate stack guard + symbol 2021-10-16 17:42:24 +08:00
fanmingyu212 178a86bcda master: add an argument to set an experiment subdirectory
Signed-off-by: Mingyu Fan <mingyufan@ucsb.edu>
2021-10-15 16:54:31 +08:00
Sebastien Bourdeauducq 35d21c98d3 Revert "runtime: expose rint from libm"
Consistency with NAR3/Zynq where rint is not available.

This reverts commit f5100702f6.
2021-10-11 08:12:04 +08:00
Sebastien Bourdeauducq f5100702f6 runtime: expose rint from libm 2021-10-10 20:40:17 +08:00
Sebastien Bourdeauducq 3c1cbf47d2 phaser: add more slack during init. Closes #1757 2021-10-10 16:18:55 +08:00
Robert Jördens 3f6bf33298 fastino: add interpolator support 2021-10-08 15:47:07 +00:00
Harry Ho 501eb1fa23 flake: add microscope 2021-10-08 12:39:35 +08:00
Harry Ho ea9bc04407 flake: add jesd204b 2021-10-08 12:39:35 +08:00
occheung 59065c4663 alloc_list: support alloc w/ large align
Signed-off-by: Oi Chee Cheung <dc@m-labs.hk>
2021-10-07 12:38:03 +08:00
Spaqin 1894f0f626
gateware: share RTIOClockMultiplier and fix_serdes_timing_path (#1760) 2021-10-07 08:19:38 +08:00
Sebastien Bourdeauducq 4bfd010f03 setup: Python 3.7+ 2021-09-27 17:46:25 +08:00
Etienne Wodey a8333053c9 sinara_tester: add device_db and test selection CLI options
Signed-off-by: Etienne Wodey <etienne.wodey@aqt.eu>
2021-09-27 17:44:50 +08:00
occheung 7a7e17f7e3 openocd: update and apply 4-byte address support patch
See the relevant commit made in nix-scripts repo.
575ef05cd5
2021-09-27 09:34:46 +08:00
Sebastien Bourdeauducq 3ed10221d8 compiler: remove big-endian support. Closes #1590 2021-09-13 13:40:24 +08:00
Sebastien Bourdeauducq e8a7a8f41e compiler: work around idiotic windoze behavior that causes conda ld.lld not to be found 2021-09-13 10:40:54 +08:00
Sebastien Bourdeauducq 4834966798 flake: add jsonschema to dev environment 2021-09-13 07:39:15 +08:00
Sebastien Bourdeauducq 7209e6f279 flake: add cargo-xbuild to dev environment 2021-09-13 07:20:36 +08:00
Sebastien Bourdeauducq ffb1e3ec2d wavesynth: np.int is deprecated 2021-09-13 07:02:35 +08:00
Sebastien Bourdeauducq 2d79d824f9 firmware: remove minor or1k leftovers 2021-09-12 20:03:37 +08:00
Sebastien Bourdeauducq 1a0c4219ec doc: mor1kx -> VexRiscv 2021-09-12 19:27:00 +08:00
Sebastien Bourdeauducq 2e5c32878f flake: add other KC705 NIST builds 2021-09-10 17:19:32 +08:00
occheung a573dcf3f9 board_misoc/build: use rv32 as target arg
The original rv64 argument was only to match the misoc counterpart.
2021-09-10 14:11:23 +08:00
occheung 448974fe11 runtime/main: cleanup 2021-09-10 13:59:53 +08:00
occheung b091d8cb66 kernel: flush cache before mod_init
This could be necessary as redirecting instructions from D$ directly to I$ as it seems.
Related: https://github.com/SpinalHDL/VexRiscv/issues/137
2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq d50e24acb1 update dependencies 2021-09-10 13:25:12 +08:00
occheung 5394d04669 test_spi: add delay 2021-09-10 13:25:12 +08:00
occheung b8ed5a0d91 alloc: fix alignment for riscv32 arch 2021-09-10 13:25:12 +08:00
occheung 2213e7ffac ksupp/rtio/exception: fix timestamp 2021-09-10 13:25:12 +08:00
occheung 09ffd9de1e dma: fix timestamp fetch 2021-09-10 13:25:12 +08:00
occheung 051a14abf2 rtio/dma: fix endianness 2021-09-10 13:25:12 +08:00
occheung c6ba0f3cf4 ksupport: fix dma cslice (ffi) 2021-09-10 13:25:12 +08:00
occheung c812a837ab runtime: enlarge stack size 2021-09-10 13:25:12 +08:00
occheung a596db404d satman: fix cargo xbuild sysroot 2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq eff7ae5aff flake: make llvm-strip in HITL test 2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq c78fbe9bd2 flake: make bscanspi bitstreams available in HITL test 2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq 17b9d2fc5a flake: add KC705 HITL test 2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq 5e2664ae7e flake: add openocd 2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq 64ce7e498b flake: make board package a Python package 2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq 952acce65b flake: build board package on Hydra 2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq 7ae4b2d9bb flake: update dependencies 2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq ce0964e25f flake: fix cargo sha256 2021-09-10 13:25:12 +08:00
occheung 4fab267593 cargo: std dependency hack 2021-09-10 13:25:12 +08:00
occheung dcbd9f905c cargo: use cargo xbuild 2021-09-10 13:25:12 +08:00
occheung 9f6b3f6014 firmware: clarify target triple
The lack of compressed instruction support can be inferred from the target triple, literally.
2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq 9697ec33eb flake: update dependencies 2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq eee80c7697 flake: use improved Rust support in nixpkgs 2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq b7efb2f633 flake: remove outdated comment 2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq 9ee03bd438 flake: reenable lit test 2021-09-10 13:25:12 +08:00
occheung 4619a33db4 test: remove broken array return tests
Removed test cases that do not respect lifetime/scope constraint.
See discussion in artiq-zynq repo: M-Labs/artiq-zynq#119
Referred to the patch from @dnadlinger. 5faa30a837
2021-09-10 13:25:12 +08:00
occheung 5985f7efb5 syscall: lower nowrite to inaccessiblememonly
In the origin implementation, the `nowrite` flag literally means not writing memory at all.
Due to the usage of flags on certain functions, it results in the same issues found in artiq-zynq after optimization passes. (M-Labs/artiq-zynq#119)
A fix wrote by @dnadlinger can resolve this issue. (c1e46cc7c8)
2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq 6db7280b09 flake: board package WIP 2021-09-10 13:25:12 +08:00
occheung d8ac429059 dyld: streamline lib.rs
Only riscv32 is supported anyway, no need to have excessive architecture check.
2021-09-10 13:25:12 +08:00
occheung 798774192d slave_fpga/bootloader: read in little endian 2021-09-10 13:25:12 +08:00
occheung eecd825d23 firmware: suppress warning 2021-09-10 13:25:12 +08:00
occheung 1da0554a49 pcr: purge 2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq 035d15af9d flake: clean up vivado, add installer environment 2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq 9addd08587 flake: fetch MiSoC submodules 2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq 3e09e48152 flake: set up Vivado 2021-09-10 13:25:12 +08:00
occheung 5d0a8cf9ac llvm_ir_gen: fix indent 2021-09-10 13:25:12 +08:00
occheung 70507e1b72 Cargo.lock: update 2021-09-10 13:25:12 +08:00
occheung c113cd6bf5 libfringe: bump 2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq 251cd4dcc6 flake: update dependencies 2021-09-10 13:25:12 +08:00
occheung 61b0170a12 firmware: purge or1k 2021-09-10 13:25:12 +08:00
occheung af263ffe1f ksupport: fix rpc, cache signature (FFI)
The reason of the borrow stuff is explained in M-Labs/artiq-zynq#76 (artiq-zyna repo).
As for `cache_get()`, compiler will perform stack allocation to pre-allocate the returned structure, and pass to cache_get alongside the `key`.
However, ksupport fails to recognize the passed memory, so it will always assume the passed memory as the key.
2021-09-10 13:25:12 +08:00
occheung a833974b50 analyzer: fix endianness 2021-09-10 13:25:12 +08:00
occheung d623acc29d llvm_ir_gen: fix now with now_pinning & little-endian target 2021-09-10 13:25:12 +08:00
occheung 8fa47b8119 rpc: enforce alignment 2021-09-10 13:25:12 +08:00
occheung de0f2d4a28 firmware: adopt endianness protocol in artiq-zynq
Related:
artiq-zynq: M-Labs/artiq-zynq#126
artiq: #1588
2021-09-10 13:25:12 +08:00
occheung 9afe63c08a ksupport: fix proto_artiq dependency 2021-09-10 13:25:12 +08:00
occheung 29a2f106d1 ksupport: replace asm with llvm_asm 2021-09-10 13:25:12 +08:00
occheung b30ed75e69 kernel.ld: load elf header and prog headers
ld.lld has a habit of not putting the headers under any load sections.
However, the headers are needed by libunwind to handle exception raised by the kernel.
Creating PT_LOAD section with FILEHDR and PHDRS solves this issue. Other PHDRS are also specified as linkers (not limited to ld.lld) will not create additional unspecified headers even when necessary.
2021-09-10 13:25:12 +08:00
occheung 279593f984 ksupport.ld: merge sbss with bss 2021-09-10 13:25:12 +08:00
occheung 1ba8c8dfee runtime: remove irq again 2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq 942bd1a95d flake: add hydraJobs 2021-09-10 13:25:12 +08:00
occheung 3d629006df makefiles: revert byte-swaps 2021-09-10 13:25:12 +08:00
occheung 7542105f0f board_misoc: remove pcr
VexRiscv seems to not support additional hardware performance counter, at least I have not seen any documentation on how to use it.
2021-09-10 13:25:12 +08:00
occheung 01ca114c66 runtime: remove irq dependency 2021-09-10 13:25:12 +08:00
occheung 36171f2c61 runtime: remove inaccurate sp on panic 2021-09-10 13:25:12 +08:00
occheung 01e357e5d3 ksupport.ld: reduce load section alignment 2021-09-10 13:25:12 +08:00
occheung f77b607b56 compiler: generate symbols 2021-09-10 13:25:12 +08:00
occheung 1293e0750e ld, makefiles: use ld.lld 2021-09-10 13:25:12 +08:00
occheung fc42d053d9 kernel: use vexriscv 2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq 9adab6c817 flake: add devshell 2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq 8c468d0346 flake: switch to nightly rust with mozilla overlay 2021-09-10 13:25:12 +08:00
occheung 1b516b16e2 targets: default to vexriscv cpu 2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq be5ae5c5b4 flake: configure binary cache 2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq d13efd6587 add Nix flake 2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq e8fe8409b2 libartiq_support: compatibility with recent stable rustc 2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq cabe5ace8e compiler: remove DebugInfoEmitter for now
Causes problems with LLVM 9 and not needed at first.
2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq 6629a49e86 compiler: use LLVM binutils/linker for Arm as well
Previously we kept GNU Binutils because they are less of a pain to support
on Windoze - the source of so many problems - but with RISC-V we need to
update LLVM anyway.
2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq 43d120359d compiler: switch to upstream llvmlite and RISC-V target 2021-09-10 13:25:12 +08:00
Sebastien Bourdeauducq 5656e52581 remove profiler 2021-09-10 13:25:12 +08:00
occheung 1b8b4baf6a ksupport: fix panic, libc, unwind 2021-09-10 13:25:12 +08:00
occheung 905330b0f1 ksupport: handle riscv exceptions 2021-09-10 13:25:12 +08:00
occheung 50a62b3d42 liballoc: change align to 16 bytes 2021-09-10 13:25:12 +08:00
occheung 7f0bc9f7f0 runtime/makefile: specify emulation, flip endianness 2021-09-10 13:25:12 +08:00
occheung c42adfe6fd runtime.ld: merge .sbss & .bss 2021-09-10 13:25:12 +08:00
occheung f56152e72f rust: fix dependencies 2021-09-10 13:25:12 +08:00
occheung c800b6c8d3 runtime: update rust alloc, managed 2021-09-10 13:25:09 +08:00
occheung e99061b013 runtime: add riscv 2021-09-10 13:23:22 +08:00
occheung ecedec577c runtime: impl riscv exception handling 2021-09-10 13:23:15 +08:00
occheung 252594a606 runtime: impl riscv panic handler 2021-09-10 13:20:31 +08:00
occheung 31bf17563c personality: update from rust/panic_unwind 2021-09-10 13:20:31 +08:00
occheung bfddd8a30f libdyld: add riscv support 2021-09-10 13:20:31 +08:00
occheung ad3037d0f6 libc: add minimal C types 2021-09-10 13:20:31 +08:00
occheung daaf6c3401 libunwind: add rust interface 2021-09-10 13:20:31 +08:00
occheung 6d9cebfd42 satman: handle .sbss generation 2021-09-10 13:20:31 +08:00
occheung 96438c9da7 satman: make fbi big-endian 2021-09-10 13:20:31 +08:00
occheung 6535b2f089 satman: fix feature 2021-09-10 13:20:31 +08:00
occheung 45adaa1d98 satman: add riscv exception handling 2021-09-10 13:20:31 +08:00
occheung 869a282410 satman: use riscv 2021-09-10 13:20:31 +08:00
occheung ebb9f298b5 proto_artiq: update alloc type path 2021-09-10 13:20:31 +08:00
occheung 97a0132f15 libio: update alloc type path 2021-09-10 13:20:31 +08:00
occheung 37ea863004 libio: pin failure version 2021-09-10 13:20:31 +08:00
occheung 3ff74e0693 bootloader: handle .sbss generation in .ld
Signed-off-by: occheung <dc@m-labs.hk>
2021-09-10 13:20:31 +08:00
occheung 448fe0e8cf bootloader: fix panic
Signed-off-by: occheung <dc@m-labs.hk>
2021-09-10 13:20:31 +08:00
occheung 8294d7fea5 bootloader: swap endianness
Signed-off-by: occheung <dc@m-labs.hk>
2021-09-10 13:20:31 +08:00
occheung 13032272fd bootloader: add rv32 exception handler
Signed-off-by: occheung <dc@m-labs.hk>
2021-09-10 13:20:31 +08:00
occheung 46102ee737 board_misoc: build vectors.S with rv64 target in misoc
Signed-off-by: occheung <dc@m-labs.hk>
2021-09-10 13:20:31 +08:00
occheung b87ea79d51 rv32: rm irq & vexriscv-rust
Signed-off-by: occheung <dc@m-labs.hk>
2021-09-10 13:20:31 +08:00
occheung 9aee42f0f2 rv32/boot: remove hotswap
Signed-off-by: occheung <dc@m-labs.hk>
2021-09-10 13:20:31 +08:00
occheung 82b4052cd6 libboard_misoc: vexriscv integration
Signed-off-by: occheung <dc@m-labs.hk>
2021-09-10 13:20:31 +08:00
Leon Riesebos 2cf144a60c ddb_template: edge counter keys correspond with according ttl keys
previously ttl_counter_0 and ttl_0 could be on completely different physical ttl output channels
with this change, ttl_0_counter (note the changed key format) is always on the same channel as ttl_0

Signed-off-by: Leon Riesebos <leon.riesebos@duke.edu>
2021-09-06 09:06:04 +08:00
Robert Jördens e7a46ec767
Merge pull request #1749 from airwoodix/phaser-frame-alignment-utils
Phaser: add helpers to align updates with RTIO timeline
2021-09-03 14:00:17 +02:00
Etienne Wodey 4d7bd3ee32 phaser: fail init() if frame timestamp measurement times out
Signed-off-by: Etienne Wodey <etienne.wodey@aqt.eu>
2021-09-03 12:01:26 +02:00
Etienne Wodey 075cb26dd7 phaser: rename get_next_frame_timestamp() to get_next_frame_mu()
and implement review comments (PR #1749)

Signed-off-by: Etienne Wodey <etienne.wodey@aqt.eu>
2021-09-03 09:58:01 +02:00
Etienne Wodey 7aebf02f84 phaser: docs: add reference to get_next_frame_timestamps(), fix typo
Signed-off-by: Etienne Wodey <etienne.wodey@aqt.eu>
2021-09-01 17:44:46 +02:00
Etienne Wodey 61b44d40dd phaser: add labels to debug init prints
Signed-off-by: Etienne Wodey <etienne.wodey@aqt.eu>
2021-09-01 17:43:30 +02:00
Etienne Wodey 65f8a97b56 phaser: add helpers to align updates to the RTIO timeline
Signed-off-by: Etienne Wodey <etienne.wodey@aqt.eu>
2021-09-01 17:42:54 +02:00
Robert Jördens 11790c6d7c
Merge pull request #1746 from quartiq/suservo_tester
Suservo tester
2021-08-19 10:20:29 +02:00
SingularitySurfer 65f63e6927 fix suservo start 2021-08-19 07:38:48 +00:00
Robert Jördens a53162d01d tester: tweak suservo
* p gain 1 to get reasonable power
* refine testing instructions and comments
2021-08-19 09:17:14 +02:00
SingularitySurfer 4d21a72407 Implement SUServo tester. 2021-08-18 15:10:27 +00:00
Mikołaj Sowiński 898122f3e5
Added support for HVAMP_8CH (#1741) 2021-08-16 13:39:00 +08:00
Sebastien Bourdeauducq 420891ba54 syntax 2021-08-12 13:01:35 +08:00
Sebastien Bourdeauducq 9f94bc61ae missing part of 477b1516d 2021-08-12 12:55:37 +08:00
Sebastien Bourdeauducq c69a1316ad compiler: stop using sys.version_info for parser 2021-08-12 12:52:24 +08:00
Sebastien Bourdeauducq 477b1516d3 remove profiler 2021-08-12 12:51:55 +08:00
Sebastien Bourdeauducq e3edb505e3 setup.py: remove outdated dependency_links 2021-08-12 12:48:46 +08:00
Sebastien Bourdeauducq 67847f98f4 artiq_run: fix multiarch 2021-08-12 12:48:10 +08:00
mwojcik 7879d3630b made kc705/gtx interface more similar to kasli/gtp 2021-08-10 18:53:52 +08:00
Sebastien Bourdeauducq 242dfae38e kc705: fix DRTIO targets 2021-08-06 15:41:47 +08:00
Star Chen 5111132ef0
ICAP: prevent sayma from using it (#1740) 2021-08-06 15:08:30 +08:00
Sebastien Bourdeauducq dc546630e4 kc705: DRTIO variants WIP 2021-08-06 14:41:41 +08:00
Robert Jördens fd824f7ad0 ddb_template: print LED channel nos on Kasli v2 2021-08-05 17:29:38 +02:00
Harry Ho c9608c0a89 zotino: default div_read unified with ad53xx at 16, fix ad53xx doc 2021-08-05 17:42:11 +08:00
Star Chen 6b88ea563d
talk to ICAP primitive to restart gateware (#1733) 2021-08-05 17:00:31 +08:00
Sebastien Bourdeauducq 97e994700b compiler: turn __repr__ into __str__ when sphinx is used. Closes #741 2021-08-05 11:32:20 +08:00
Sebastien Bourdeauducq c3d765f745 ad9910: fix type annotations 2021-08-05 11:30:54 +08:00
Robert Jördens 1e869aedd3
docs: clarify rtio_clock=e req's and use case
This regularly leads to people misunderstanding the setting.
Mentioning the Si5324 specifically or Urukul synchronization doesn't help constraining or explaining the feature, its consequences and requirements.
Despite being non-standard this feature is also generally not sufficient to achieve cross-device determinism as the other devices need to be made deterministic as well.
2021-08-03 11:36:04 +02:00
Sebastien Bourdeauducq 53a98acfe4 artiq_flash: cleanup openocd handling, do not follow symlinks
Not following symlinks allows files to be added to OpenOCD via nixpkgs buildEnv.
2021-07-26 17:01:24 +08:00
Star Chen 30e5e06a33
moninj: fix read of incomplete data (#1729) 2021-07-22 17:56:38 +08:00
Star Chen ebb67eaeee
applets: add length warning message on plot for `plot_xy_hist` and fix bug (#1725) 2021-07-19 15:45:48 +08:00
Star Chen 943a95e07a
applets: add data length warning message for `plot_xy` (#1722) 2021-07-19 15:14:15 +08:00
Star Chen e996b5f635
applets: fix warning timing 2021-07-19 12:26:01 +08:00
StarChen 796aeabb53 documentation: correct artiq_coremgmt examples 2021-07-19 12:09:51 +08:00
Sebastien Bourdeauducq 4fb8ea5b73 artiq_flash: determine which firmware to flash by looking at filesystem
Closes #1719
2021-07-14 16:43:00 +08:00
Star Chen 5cd721c514
applets: add plot_hist dataset length mismatch warning (#1718) 2021-07-14 15:57:55 +08:00
Sebastien Bourdeauducq d327d2a505 doc: document shell-dev shortcut 2021-07-14 08:32:03 +08:00
Sebastien Bourdeauducq bc7ce7d6aa doc: mention Vivado version from vivado.nix. Closes #1715 2021-07-14 08:27:08 +08:00
Star Chen 6ce9c26402
GUI: add option to create new datasets (#1716) 2021-07-13 12:53:35 +08:00
occheung 2204fd2b22 adf5356: add delay to sync()
Signed-off-by: Oi Chee Cheung <dc@m-labs.hk>
2021-07-08 10:03:20 +08:00
pca006132 b10d1bdd37 compiler: proper union find
The find implementation was not very optimized, and the unify function
did not consider tree height and may build some tall trees.
2021-07-07 09:22:16 +08:00
pca006132 4ede58e44b compiler: reduce calls to TypedTreeHasher
We need to check if our inference reached a fixed point. This is checked
using hash of the types in the AST, which is very slow. This patch
avoids computing the hash if we can make sure that the AST is definitely
changed, which is when we parse a new function.

For some simple programs with many functions, this can significantly
reduce the compile time by up to ~30%.
2021-07-07 09:22:16 +08:00
Sebastien Bourdeauducq 51d2861e63 Freenode -> OFTC 2021-07-05 22:15:58 +08:00
Sebastien Bourdeauducq 29fd58e34b RELEASE_NOTES: update and fix formatting 2021-07-05 21:22:34 +08:00
pca006132 0257ecc332 update release notes 2021-07-02 17:01:31 +08:00
pca006132 822e8565f7 compiler: supports kernel decorators with path 2021-07-02 17:01:31 +08:00
pca006132 6fb31a7abb compiler: allow empty list in quote 2021-07-02 15:16:19 +08:00
pca006132 0806b67dbf compiler: speedup list processing 2021-07-02 14:22:25 +08:00
pca006132 f531af510c compiler: fixed embedding annotation evaluation 2021-06-25 11:32:23 +08:00
pca006132 c29a149d16 compiler: allows string annotation
According to PEP484, type hint can be a string literal for forward
references. With PEP563, type hint would be preserved in annotations in
string form.
2021-06-25 11:01:48 +08:00
Etienne Wodey 094a346974 docs: fix snippet to advance the timeline by one coarse RTIO cycle
Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
2021-06-23 20:29:43 +08:00
Etienne Wodey 68268e3db8 docs: fix some formatting issues
Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
2021-06-23 20:29:43 +08:00
Etienne Wodey cca654bd47 test_device_db: fix on Windows (tempfile access limitations)
Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
2021-06-21 16:47:22 +08:00
Etienne Wodey 8bedf278f0 set_dataset: pass HDF5 options as a dict, not as loose kwargs
Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
2021-06-17 16:43:05 +02:00
Etienne Wodey 12ef907f34 master/databases: fix AttributeError in DatasetDB.set()
Add corresponding unit test.

Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
2021-06-17 16:30:38 +02:00
Etienne Wodey d8b1e59538 datasets: allow passing options to HDF5 backend (e.g. compression)
This breaks the internal dataset representation used by applets
and when saving to disk (``dataset_db.pyon``).

See ``test/test_dataset_db.py`` and ``test/test_datasets.py``
for examples.

Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
2021-06-17 12:04:16 +02:00
Etienne Wodey b8ab5f2607 master/databases: use tools.file_import to load the device_db
Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
2021-06-17 07:58:17 +08:00
Etienne Wodey 5c23e6edb6 test: add regression tests for master.databases.DeviceDB
Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
2021-06-17 07:58:17 +08:00
Sebastien Bourdeauducq 7046aa9c23 compiler: stop using deprecated numpy.float 2021-06-15 10:48:34 +08:00
Sebastien Bourdeauducq ea0c7b6173 Merge remote-tracking branch 'harrydrtio/k7-drtio' 2021-06-15 10:04:45 +08:00
Star Chen 9dee8bb9c9
Kasli: Added front panel user LED (#1623) (#1694) 2021-06-07 16:05:50 +08:00
pca006132 bcb030cc9c
aqctl_corelog: fix endianness issue (closes #1682) (#1689)
Fixed according to
https://forum.m-labs.hk/d/190-fetchingreading-the-core-log-in-a-central-location/10

Tested with both KC705 and ZC706.
2021-06-03 14:06:17 +08:00
Sebastien Bourdeauducq 522c2f5995 doc: nixpkgs 21.05 2021-06-02 08:18:28 +08:00
Sebastien Bourdeauducq ea1dd2da43 artiq_ddb_template: kasli-soc support 2021-05-30 20:33:44 +08:00
Leon Riesebos 07bd1e27c1 artiq_flash: wrap paramiko commands in bash login shell
the login shell will load the nix environment on non-nixos systems

Signed-off-by: Leon Riesebos <leon.riesebos@duke.edu>
2021-05-27 21:44:10 +08:00
David Nadlinger b89610bbcd manual/compiler: Mention TArray annotation 2021-05-24 11:50:10 +01:00
pca006132 4c743cf8af revert busy polling 2021-05-23 14:07:11 +08:00
pca006132 1e9a131386 coredevice.comm_kernel: performance improvement
reduced latency by busy polling, and improved byte list performance.
2021-05-23 13:30:00 +08:00
Harry Ho 43b2a3791c jsonschema: only allow enable_sata_drtio=true for Kasli if v1.0/1.1 2021-05-17 12:46:19 +08:00
Sebastien Bourdeauducq 935e18c1be artiq_flash: improve openocd not found error message 2021-05-13 14:45:23 +08:00
Robert Jördens 67d474e6cf
Merge pull request #1657 from pathfinder49/phaser 2021-05-12 12:54:05 +02:00
fanmingyu212 91832aa886 manual: cannot use empty lists in kernel
Signed-off-by: Mingyu Fan <mingyufan@ucsb.edu>
2021-05-12 11:37:18 +08:00
Marius Weber 129cf8c1dd Phaser: Make set_nco_phase set the phase of the NCO
Previous to this commit `set_nco_phase()` set the phase of the DUC instead
of the NCO. Setting the phase of the NCO may be desirable to utilise the
auto-sync functionality of the double-buffered DAC-NCO settings.

Signed-off-by: Marius Weber <marius.weber@physics.ox.ac.uk>
2021-05-11 23:16:14 +01:00
Charles Baynham 011f3bdb2e docs: Add artiq_influx_generic to default_network_ports.rst and list_of_ndsps.rst 2021-05-10 15:26:26 +08:00
Marius Weber fb6fad7c64 update release notes
Signed-off-by: Marius Weber <marius.weber@physics.ox.ac.uk>
2021-05-08 15:04:56 +01:00
Marius Weber 043c9c20d7 phaser: Improve documentation of DAC settings
1. Clarify which features require additional configuration via the `dac`
   constructor argument.
2. Document when DAC settings apply immediatly/are staged.
3. Document how staged DAC settings may be applied
4. Calrify operation of `dac_sync`

Signed-off-by: Marius Weber <marius.weber@physics.ox.ac.uk>
2021-05-08 14:58:30 +01:00
Marius Weber f97baa8aec phaser: workaround malformed output with `mixer_ena=1` & `nco_ena=0`
When Phaser is powered on and `init()` is first called, enabling the
DAC-mixer while leaving the NCO disabled causes malformed output.
This commit implements a workaround by making sure the NCO is enabled,
before being set to the disired state.

This commit also avoids the following procedure, resulting in
malformed output:
1. Operate Phaser with the DAC Mixer and NCO enabled
2. Set the NCO to a non-zero frequency
3. Disable the NCO in the device_db
4. Re-initialise Phaser

After this procedure, with CMIX disabled, incorrect output is produced.
To clear the fault one must re-enable the NCO and write the NCO freqeuncy
to zero before disabling the NCO.

Signed-off-by: Marius Weber <marius.weber@physics.ox.ac.uk>
2021-05-08 14:48:47 +01:00
Marius Weber 4fa2028671 phaser: fix coarse mixer register offset
The CMIX bits are bits 12-15 in register 0x0d. This has been checked
against the datasheet and verified on hardware. Until now, the bit for
CMIX1 was written to CMIX0. The CMIX0 bit was written to a reserved bit.

Signed-off-by: Marius Weber <marius.weber@physics.ox.ac.uk>
2021-05-08 14:48:47 +01:00
Marius Weber 515cfa7dfb Phaser: expose coarse mixer and document need to enable the DAC-mixer.
in some use cases a larger tunable range than available via the DUC may
be needed. Some use cases may wish to combine the coarse mixer with the
DUC to extend the tunable range.

Signed-off-by: Marius Weber <marius.weber@physics.ox.ac.uk>
2021-05-08 14:48:47 +01:00
Marius Weber 4f812cc4ed Phaser: zero oscillator amplitude after `init()` (close #1651)
Currently, `init()` leaves a single oscillator at full scale. The phase
accumulator of this oscillator is held continuously cleared. Provided no
upconverting mechanism is active (DUC, CMIX, NCO), this produces a full-scale
DC voltage. The DC voltage is blocked by hardware capacitors. This behaviour
is not mentioned by the `init` documentation.

If one attempts to use any other oscillator without reducing the amplitude
of the oscillator enabled by `init`, there is by significant clipping.

In the case that the NCO or CMIX are configured via the device_db
(suggested in the docs), leaving the osillator at full scale results in
full RF output power after calling `init()`. This may plausibly damage loads
driven by phaser.

Signed-off-by: Marius Weber <marius.weber@physics.ox.ac.uk>
2021-05-08 14:48:47 +01:00
Marius Weber 407fba232d Phaser upconverter: set phase-frequency detector to 62.5 MHz (close #1648)
The suitable PFD clock depends on the use case and will likely need
to be configured by some users. All things being equal, a higher PFD
clock is desirable as is results in lower local oscillator phase-noise.

Phaser was designed around a maximum PFD clock of 62.5 MHz. In integer mode,
with no local oscillator frequency divisor set, a 62.5 MHz PFD clock results
in a 125 MHz local oscillator step size. Given the +-200 MHz range of the DUC
(more if using the DAC mixer), this step size will be acceptable to many.
This seems like the most appropreate default configuration as it should offer
the best phase-noise performance.

Signed-off-by: Marius Weber <marius.weber@physics.ox.ac.uk>
2021-05-08 14:48:47 +01:00
Marius Weber 75445fe5f0 Phaser: expose and automate clearing of DAC `sif_sync` (close #1630 and #1650)
`sif_sync` must be triggered to apply NCO frequency changes. To achieve per
channel frequency tunability exeeding the range of the DUC, the NCO frequeny must
adjusted. User code will need to trigger `sif_sync` to achieve this.

`sif_sync` can only be triggered if the bit was cleared. To avoid this pitfall,
the clearing of `sif_sync` is automated.

Signed-off-by: Marius Weber <marius.weber@physics.ox.ac.uk>
2021-05-08 14:48:47 +01:00
Marius Weber 1c96797de5 Phaser upconverter: Follow datasheet procedure for VCO calibration (close #1643)
Signed-off-by: Marius Weber <marius.weber@physics.ox.ac.uk>
2021-05-08 14:48:47 +01:00
Marius Weber 7404152e4c Phaser upconverter: rename `ndiv` -> `nint` to match datasheet (close #1638)
Signed-off-by: Marius Weber <marius.weber@physics.ox.ac.uk>
2021-05-08 14:48:47 +01:00
Marius Weber eb477ee06b phaser: print gw_rev in debug mode 2021-05-08 14:48:46 +01:00
Marius Weber c7e992e26d Phaser: flake8
Signed-off-by: Marius Weber <marius.weber@physics.ox.ac.uk>
2021-05-08 14:48:46 +01:00
Sebastien Bourdeauducq eb38b664e3 phaser: typo 2021-05-07 10:00:10 +08:00
Peter Drmota 47bf5d36af coredevice.comm_kernel: Fix unpacking of lists of numpy.int64
test.coredevice.test_embedding: Add tests for list of numpy.int64
2021-04-21 15:46:58 +01:00
Leon Riesebos af4fadcd54 added DefaultMissing to __all__
Signed-off-by: Leon Riesebos <leon.riesebos@duke.edu>
2021-04-21 11:42:21 +08:00
Leon Riesebos a0cea3a011 added __iter__ and __len__ to ScanObject base class
Signed-off-by: Leon Riesebos <leon.riesebos@duke.edu>
2021-04-21 11:42:21 +08:00
Leon Riesebos 2671c271d4 ad99xx unified type annotations for cfg_sw() methods and fixed test cases
closes #1642

Signed-off-by: Leon Riesebos <leon.riesebos@duke.edu>
2021-04-21 11:29:55 +08:00
Leon Riesebos d745d50245 ad99xx added additional kernel invariants
Signed-off-by: Leon Riesebos <leon.riesebos@duke.edu>
2021-04-21 11:18:31 +08:00
Leon Riesebos 4a6201c083 ad99xx make kernel invariants instance variable
prevents mutations on class variable that applies to all instances at once
closes #1654

Signed-off-by: Leon Riesebos <leon.riesebos@duke.edu>
2021-04-21 11:18:31 +08:00
Robert Jördens ffe1c9f9b1
Merge pull request #1628 from pathfinder49/fastino_mu_fix
fastino: ensure `xxx_to_mu()` methods return int32 on the host
2021-04-15 15:02:12 +02:00
Marius Weber bda5aa7c7e fastino: ensure `xxx_to_mu()` methods return int32 on the host
Currently running `voltage_to_mu()` or `voltage_group_to_mu()` on the host will
convert all machine unit values to int64. This leads to issues when machine units
are returned from RPCs.

Signed-off-by: Marius Weber <marius.weber@physics.ox.ac.uk>
2021-04-15 11:41:22 +01:00
Sebastien Bourdeauducq 78490bef5d manual: document Vivado installer crash workaround 2021-04-05 09:17:50 +08:00
David Nadlinger b7f3eaebf9 gui: Fix occasional wrong fuzzy select menu position on KDE/Linux 2021-04-04 00:04:11 +01:00
Harry Ho fc59791583 jsonschema: mirny: fix clk_sel default value 2021-03-30 16:06:56 +08:00
Harry Ho 8002fcf8bb jsonschema: style 2021-03-29 17:49:43 +08:00
Harry Ho 5f32cb7196 jsonschema: mirny: accept string enums for validating clk_sel 2021-03-29 17:49:43 +08:00
Harry Ho 75efb8985c ddb_template: mirny_cpld: accept clk_sel as a string 2021-03-29 17:49:43 +08:00
Sebastien Bourdeauducq 523fa01343 manual: fix OpenOCD conda instructions 2021-03-27 12:16:08 +08:00
David Nadlinger bdaaf3c1d7 dashboard: Disable Group CCB policy menu before first entry is selected
It was possible to crash the dashboard by opening the context menu
before an applet entry had been selected for the first time (e.g.
immediately after startup) and selecting one of the Group CCB
actions, as the enable update slot would not have been run.
2021-03-21 02:04:24 +00:00
David Nadlinger 6fd088e339 test/lit: Fix invalid type inference test
This broke after b8cd163978, but
is invalid code to start with; this would have previously
crashed the code generator had the code actually been compiled.

(Allowing implicit conversion to bool would be a separate debate.)
2021-03-21 01:46:52 +00:00
David Nadlinger be4669d7a5 compiler: Fix crash with try/finally and stack-return function calls
The previous code could have never worked as-is, as the result slot
went unused, and it tried to append the load instruction to the
block just terminated with the invoke.

GitHub: Fixes #1506, #1531.
2021-03-21 01:31:26 +00:00
David Nadlinger 1f40f3ce15 compiler: Map host numpy.bool_ values to TBool
Since we don't implement any integer-like operations for TBool
(addition, bitwise not, etc.), TBool is currently neither
strictly equivalent to builtin bool nor numpy.bool_, but through
very obvious compiler errors (operation not supported) rather than
silently different runtime behaviour.

Just mapping both to TBool thus is a huge improvement over the
current behaviour (where numpy.False_ is a true-like object). In
the future, we could still implement more operations for TBool,
presumably following numpy.bool_ rather than the builtin type,
just like builtin integers get translated to the numpy-like
TInt{32,64}.

GitHub: Fixes #1275.
2021-03-20 00:54:41 +00:00
David Nadlinger b8cd163978 compiler: Fix type inference for "ternary" if expressions
Previously, any type would be accepted for the test expression,
leading to internal errors in the code generator if the passed
value wasn't in fact a bool.
2021-03-20 00:27:25 +00:00
David Nadlinger 888696f588 coredevice: Fix RPC typing for bool lists/arrays
GitHub: Fixes #1635.
2021-03-20 00:03:10 +00:00
Leon Riesebos d04bcd8754 add get_*() functions to ad9910, ad9912, and urukul. closes #1616
Signed-off-by: Leon Riesebos <leon.riesebos@duke.edu>
2021-03-15 13:06:24 +08:00
Leon Riesebos c22f731a61 added typing and reformatted driver for ad9910, ad9912, and urukul
Signed-off-by: Leon Riesebos <leon.riesebos@duke.edu>
2021-03-15 13:06:24 +08:00
David Nadlinger 5ba22c11c3 compiler: Change type inference rules for empty array() calls
array([...]), the constructor for NumPy arrays, currently has the
status of some weird kind of macro in ARTIQ Python, as it needs
to determine the number of dimensions in the resulting array
type, which is a fixed type parameter on which inference cannot
be performed.

This leads to an ambiguity for empty lists, which could contain
elements of arbitrary type, including other lists (which would
add to the number of dimensions).

Previously, I had chosen to make array([]) to be of completely
indeterminate type for this reason. However, this is different
to how the call behaves in host NumPy, where this is a well-formed
call creating an empty 1D array (or 2D for array([[], []]), etc.).

This commit adds special matching for (recursive lists of) empty
ListT AST nodes to treat them as scalar dimensions, with the
element type still unknown.

This also happens to fix type inference for embedding empty 1D
NumPy arrays from host object attributes, although multi-dimensional
arrays will still require work (see GitHub #1633).

GitHub: Fixes #1626.
2021-03-14 22:48:43 +00:00
David Nadlinger c707ccf7d7 compiler: Properly implement NumPy array slicing
Strided slicing of one-dimensional arrays (i.e. with non-trivial
steps) might have previously been working, but would have had
different semantics, as all slices were copies rather than a view
into the original data.

Fixing this in the future will require adding support for an index
stride field/tuple to our array representation (and all the
associated indexing logic).

GitHub: Fixes #1627.
2021-03-14 20:02:59 +00:00
David Nadlinger 557671b7db compiler: Fix type inference in slice expressions
This was a long-standing issue affecting both lists and
the new NumPy array implementation, just caused by the
generic inference passes not being run on the slice
subexpressions (and thus e.g. ints not being monomorphized).

GitHub: Fixes #1632.
2021-03-14 18:46:28 +00:00
David Nadlinger 75c255425d compiler: Linguistically untangle comment [nfc] 2021-03-14 18:40:21 +00:00
Leon Riesebos b8f4c6b9bb added test case for get_experiment() with nested class
Signed-off-by: Leon Riesebos <leon.riesebos@duke.edu>
2021-02-28 14:26:44 +08:00
Leon Riesebos 1deaa758ce get_experiment() is able to get nested experiment classes using dots in class names.
Signed-off-by: Leon Riesebos <leon.riesebos@duke.edu>
2021-02-28 14:26:44 +08:00
Leon Riesebos 3c68223337 replaced deprecated inspect.getargspec() with inspect.getfullargspec()
Signed-off-by: Leon Riesebos <leon.riesebos@duke.edu>
2021-02-28 14:25:05 +08:00
Leon Riesebos cd7f9531d7 added abstract describe method to ScanObject
Signed-off-by: Leon Riesebos <leon.riesebos@duke.edu>
2021-02-28 14:25:05 +08:00
jonathanpritchard e577542f6b
Updated NDSP documentation (#1617) 2021-02-25 09:27:10 +08:00
Sebastien Bourdeauducq 92fd705990 increase memory allocated to comms CPU
See discussion in #1612.
2021-02-21 19:06:12 +08:00
Sebastien Bourdeauducq 8deb269b9a update major version 2021-02-17 16:18:05 +08:00
Sebastien Bourdeauducq 489f950406 RELEASE_NOTES: update ARTIQ-6 section 2021-02-17 15:52:08 +08:00
Sebastien Bourdeauducq 14d464b4cf update copyright year 2021-02-17 15:52:08 +08:00
Etienne Wodey 3cd96a951a master: refactor experiments enumeration, use tools.get_experiment
Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
2021-02-13 10:06:12 +08:00
Etienne Wodey 2ca9b64ba1 test: add unit tests for tools.file_import and tools.get_experiment
Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
2021-02-13 10:06:12 +08:00
Sebastien Bourdeauducq d33a206f04 eem: fix Urukul QSPI after 9ef5717de8 (2) 2021-02-12 13:17:48 +08:00
Astro 3844cde97b jsonschema: validate hw_dev depending on target 2021-02-12 11:09:01 +08:00
Sebastien Bourdeauducq 22ce5b0299 eem: fix Urukul QSPI after 9ef5717de8 2021-02-12 10:59:53 +08:00
Etienne Wodey af411de639 tools/file_import: simplify, remove deprecated load_module() call
Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
2021-02-10 16:03:31 +08:00
Sebastien Bourdeauducq e54dd08821 metlino,sayma: adapt to new EEM API
This also enables 4X SERDES TTLs.
2021-02-10 15:32:10 +08:00
Sebastien Bourdeauducq 547254e89e eem_7series: pass through kwargs 2021-02-10 15:31:49 +08:00
Sebastien Bourdeauducq 49299c00a9 eem: enable DCI for LVDS TTL 2021-02-10 15:31:25 +08:00
Sebastien Bourdeauducq 9ef5717de8 eem: support different I/O standards in EEM slots 2021-02-10 15:31:05 +08:00
Drew 48a1c305c1 master: fix DeprecationWarning on logger.warn
Resolves error message shown.

The following error message is shown when worker_impl.py:199 is run: 

```
WARNING:worker(RID,EXPERIMENT):py.warnings:/nix/store/77sw4p03cb7rdayx86agi4yqxh5wq46b-python3.7-artiq-5.7141.1b68906/lib/python3.7/site-packages/artiq/master/worker_impl.py:199: DeprecationWarning: The 'warn' function is deprecated, use 'warning' instead
  logging.warn(message)
```
2021-02-10 15:27:22 +08:00
Astro 461199b903 kasli_generic: warn if min_artiq_version is not met 2021-02-10 15:26:15 +08:00
Astro 4b2ed67dd7 coredevice_generic.schema.json: add "min_artiq_version" 2021-02-10 15:26:15 +08:00
Sebastien Bourdeauducq cf9cf0ab6f ttl_serdes_7series: add dci (HP bank) support 2021-02-07 22:32:18 +08:00
Sebastien Bourdeauducq 997a48fb31 ttl_serdes_ultrascale: fix, add dummy dci argument 2021-02-07 22:31:46 +08:00
Sebastien Bourdeauducq bbe0c9162a ttl_serdes_ultrascale: cleanup 2021-02-07 22:00:33 +08:00
Sebastien Bourdeauducq 3572e2a9c7 ttl_serdes_7series: fix 2021-02-07 21:41:13 +08:00
Sebastien Bourdeauducq 88c212b84f ttl_serdes_7series: cleanup 2021-02-07 21:33:21 +08:00
Sebastien Bourdeauducq db25f4e8f7 ttl_serdes_7series: use simpler I/O buffers
In theory equivalent with these parameters.
2021-02-07 20:10:37 +08:00
Sebastien Bourdeauducq 6bd9691ba8 gateware: remove TTL dead code 2021-02-07 19:58:02 +08:00
Sebastien Bourdeauducq bfacd1e5b3 eem: fix Grabber cc_0-2 signal definitions 2021-02-07 18:01:05 +08:00
Sebastien Bourdeauducq f7a33a1f99 gateware: make 7-series EEM handling functions shareable 2021-02-07 14:34:26 +08:00
Sebastien Bourdeauducq 1213f78ee9 jsonschema: support kasli_soc 2021-02-07 13:39:01 +08:00
Robert Jördens 2f5ea67b69
Merge pull request #1596 from airwoodix/fix-adf5356-init
coredevice/adf5356: fix initial device detection
2021-02-02 18:20:08 +01:00
Robert Jördens 0c634c7a46
Merge pull request #1601 from airwoodix/enh-mirny-clksel
mirny: hw_rev independent, human readable clk_sel
2021-02-02 16:32:09 +01:00
Etienne Wodey d691b05d78 coredevice/mirny: better error handling for clk_sel
Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
2021-02-02 16:23:47 +01:00
Etienne Wodey 78e1b9f8e5 sinara_tester/mirny: remove hw_rev checking fixup code
Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
2021-01-29 18:47:40 +01:00
Etienne Wodey 6f8e788620 coredevice/mirny: support human readable clk_sel
In init(), read hw_rev to derive clk_sel code from user string.

Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
2021-01-29 18:46:47 +01:00
Etienne Wodey a8bc98a77b coredevice/adf5356: fix initial device detection
Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
2021-01-28 18:29:40 +01:00
Ilia Sergachev 78cbab4260 doc: fix missing artiq_flash argument 2021-01-29 00:45:17 +08:00
Sebastien Bourdeauducq 3657055bc0 doc: fix typo. Closes #1586 2021-01-27 13:15:04 +08:00
David Nadlinger f9872bb7b8 coredevice: Handle prematurely closed sockets in comm_kernel receive loop
recv() returns 0 instead of data if the socket has already
been closed. This is translated into a zero-length list on
the Python layer. Previously, the code would enter an
infinite loop if the socket was closed while attempting
to receive data.
2021-01-26 18:10:49 +08:00
David Nadlinger f1fd42ea98 coredevice: Re-enable TCP keepalive
This partially reverts commit b5e1bd3fa2,
which had removed keepalive. This, however, led to experiments
hanging forever if the core device had dropped the connection
(e.g. to a kernel CPU panic, or the device being rebooted).

The chosen keepalive settings are fairly conservative (with the
10 s timeout) to avoid any possible interaction with smoltcp's
3 s ARP try interval (see GitHub issue #1150), even though this
should be a non-issue now due to the larger ARP cache.
2021-01-26 18:10:49 +08:00
pca006132 8148fdb8a7
use device endian for core device protocols (#1591) 2021-01-22 16:33:21 +08:00
Harry Ho a0fd5261ea kc705: cleanup 2021-01-22 11:11:13 +08:00
Harry Ho 7c4eed7a11 kc705: simplify DRTIO master & satellite
* KC705 master: user can no longer choose whether or not the SMA acts as the 2nd DRTIO channel; SFP and SMA now act as the 1st and 2nd channel respectively by default.
* KC705 satellite: user should now use `--sma` to enable using the SMA as the satellite channel; SFP acts as the satellite channel by default.
2021-01-22 11:11:13 +08:00
David Nadlinger 1e443a3aea coredevice: Reuse Target.little_endian for protocol endianness [nfc] 2021-01-21 09:11:54 +01:00
pca006132 ec72eeda46 coredevice: use device endian for kernel and RPC 2021-01-21 09:07:48 +01:00
pca006132 3832b261b1 firmware: optimize integer array/list rpc 2021-01-21 09:05:17 +01:00
Harry Ho 88b14082b6 drtio/transceiver/gtx: delete obsolete modules 2021-01-20 15:05:32 +08:00
Harry Ho 9daf77bd58 kc705: add multichannel support on satellite
* Two DRTIO channels (i.e. satellite and repeater) are enabled by default.
* User can choose either the SFP or SMA as the satellite channel (by passing `--drtio-sat sfp` or --drtio-sat sma` to the argparser), and the unchosen would become the repeater channel.
2021-01-20 15:05:32 +08:00
Harry Ho 52afd4ef6b kc705: add GTX multilane support, add multichannel support on master
* One DRTIO master channel is enabled by default.
* User can set the SMA as the 2nd master channel (by passing --drtio-sma to the argparser).
* Multi-channel (i.e. with repeaters) on KC705 satellite is supported but has not been implemented yet.
2021-01-20 15:05:32 +08:00
Harry Ho f6d39fd6ba kc705: revive DRTIO master with updated syntax
* KC705 master variant now uses Si5324 as synthesiser.
* Multi-channel has not been implemented yet.
2021-01-20 15:05:31 +08:00
Harry Ho f25e86e934 kc705: revive DRTIO satellite with updated syntax, update GTX
* Multi-channel has not been implemented yet.
2021-01-20 11:25:38 +08:00
David Nadlinger c229e76d07 compiler: Add accidentally omitted note to invalid RPC type diagnostic
Might be a minor quality-of-life employment, but there
isn't a test case for this anyway.
2021-01-20 01:49:16 +01:00
Robert Jördens 261870bdee phaser: fix oscillator rtio address for even base addresses
close #1580
2021-01-19 16:56:50 +01:00
Sebastien Bourdeauducq 641f8bcdd6 doc: update development instructions. Closes #1585 2021-01-18 15:12:25 +08:00
David Nadlinger f11aef74b4 gui: Add context menu entry to close all applets
This is occasionally very useful if a large number of
applets were left open (e.g. spawned via CCB).
2021-01-17 11:56:03 +01:00
Sebastien Bourdeauducq c675488a99 reorganize JSON schema files 2021-01-16 10:43:14 +08:00
Astro de5f9cd49f RELEASE_NOTES: add JSON schema 2021-01-16 10:35:23 +08:00
Astro c6807f4594 kasli_generic: validate description against schema, use defaults from schema 2021-01-16 10:35:23 +08:00
Astro 45b5cfce05 gateware: add a kasli_generic.schema.json 2021-01-16 10:35:23 +08:00
Sebastien Bourdeauducq cb44b0cd1a doc: remove qutip from install example (removed from nixpkgs) 2021-01-15 17:18:44 +08:00
David Nadlinger 9b39b1e328 test: Add coredevice tests for matrix multiplication
Also includes a regression test specifically for
mixing multiple types in one kernel.
2021-01-12 03:02:07 +01:00
David Nadlinger f0284b2549 compiler: Fix collision of environments in matmult implementations
GitHub: Fixes #1578.
2021-01-12 03:02:07 +01:00
David Nadlinger 362f8ecb69 compiler: Add test for disallowing type-unstable array-assign binops 2021-01-12 03:02:07 +01:00
David Nadlinger 96692791cf compiler: Implement assigning binops for arrays
GitHub: Fixes #1579.
2021-01-12 03:02:07 +01:00
pca006132 5b5db1433b Revert "compiler: enabled vectorize option"
This reverts commit 636898c302.
2021-01-11 19:43:12 +08:00
Harry Ho 3e93d71aeb manual: fix artiq.dashboard becoming alias of unittest.mock
* Closes m-labs#1293
2021-01-11 18:48:30 +08:00
pca006132 636898c302 compiler: enabled vectorize option 2021-01-11 16:31:24 +08:00
occheung 6a5f5088e2 frontend: sinara_tester: add mirny test
Signed-off-by: Oi Chee Cheung <dc@m-labs.hk>
2021-01-05 17:01:01 +08:00
Harry Ho cff7bcc122 Merge branch 'master' (43be383c86) into k7-drtio 2020-12-31 13:30:46 +08:00
Harry Ho dc7addf394 Revert "drtio: remove KC705/GTX support"
This reverts commit ebdbaaad32.
2020-12-31 13:29:50 +08:00
Chris Ballance 43be383c86 kasli v2.0: drive TX_DISABLE low on all SFPs (fixes #1570)
This was the same problem as #1508 but on SFP1..3
2020-12-23 00:10:12 +08:00
Harry Ho 43ecb3fea6 sayma: add comments about CPLL line rate on KU GTH 2020-12-19 17:05:20 +08:00
Harry Ho 8cd794e9f4 jesd204_tools: use new syntax from jesd204b core
* requires jesd204b changes as in https://github.com/HarryMakes/jesd204b/tree/gth
2020-12-19 17:05:20 +08:00
Aadit Rahul Kamat 19f75f1cfd artiq_browser: update h5py api call
Signed-off-by: Aadit Rahul Kamat <aadit.k12@gmail.com>
2020-12-17 14:23:16 +08:00
Aadit Rahul Kamat 0a14cc5855 Update link to Release Notes doc in PR template
Signed-off-by: Aadit Rahul Kamat <aadit.k12@gmail.com>
2020-12-17 14:21:25 +08:00
occheung a017dafee6 ddb_template: mirny_cpld: add default value
Signed-off-by: Oi Chee Cheung <dc@m-labs.hk>
2020-12-15 11:00:59 +08:00
Harry Ho 73271600a1 jdcg: STPL tests now perform after DAC initialization 2020-12-14 18:03:31 +08:00
occheung 3f631c417d artiq_ddb_template: mirny_cpld: add refclk, clk_sel args
Signed-off-by: occheung <occheung@connect.ust.hk>
2020-12-14 13:38:20 +08:00
occheung 33d39b261a artiq_ddb_template: mirny_cpld: rename adf5355 to adf5356
Signed-off-by: occheung <occheung@connect.ust.hk>
2020-12-14 13:38:20 +08:00
Sebastien Bourdeauducq 4b10273a2d gui: quamash -> qasync 2020-12-12 21:59:25 +08:00
Sebastien Bourdeauducq 1ce505c547 coredevice: remove obsolete watchdog code (#1458) 2020-12-08 13:25:39 +08:00
Sebastien Bourdeauducq 072053c3b2 compiler: remove obsolete watchdog code (#1458) 2020-12-08 13:25:08 +08:00
Sebastien Bourdeauducq ccdc741e73 sayma_amc: fix --sfp argument 2020-12-07 18:02:36 +08:00
Robert Jördens 33285253fb
Merge pull request #1558 from quartiq/phased_ddb_fix
Phased ddb fix
2020-12-04 16:38:40 +01:00
Leon Riesebos 3b2c225fc4 allow dashboard to close if no connection can be made to moninj
Signed-off-by: Leon Riesebos <leon.riesebos@duke.edu>
2020-12-04 23:00:23 +08:00
Leon Riesebos 94271504dd Added RuntimeError to prelude to make the name available in kernels
closes #1477

Signed-off-by: Leon Riesebos <leon.riesebos@duke.edu>
2020-12-04 22:59:08 +08:00
SingularitySurfer 9b4b550f76 5 is correct. 2020-12-04 14:49:30 +00:00
SingularitySurfer cba631610c fixed phaser number of rtio channels 2020-12-04 14:40:59 +00:00
Robert Jördens 6ceb3f3095
Merge pull request #1551 from quartiq/tester_tweaks
modified urukul instructions in sinara tester script
2020-11-26 16:22:44 +01:00
Harry Ho d51d4e6ce0 doc: fix missing instructions for bypassing Si5324 on Kasli 2020-11-26 12:03:28 +08:00
Sebastien Bourdeauducq eda4850f64 Revert "fixes with statement with multiple items"
This reverts commit 88d346fa26.
2020-11-22 11:57:22 +08:00
Sebastien Bourdeauducq 8e46c3c1fd Revert "compiler: fix incorrect with behavior"
This reverts commit fe6115bcbb.
2020-11-22 11:57:21 +08:00
SingularitySurfer 0605267424 modified urukul instructions 2020-11-19 12:20:34 +00:00
Marius Weber 3e38833020 ad9910: fix `turns_to_pow` return-type on host
When run on the host, the `turns_to_pow` retrun-type is numpy.int64.
Sensibly, the compiler does not attempt to convert `numpy.int64` to `int32`.

Signed-off-by: Marius Weber <marius.weber@physics.ox.ac.uk>
2020-11-13 18:54:47 +01:00
David Nadlinger 9ff47bacab compiler: Provide libm special functions (erf, Bessel functions, …)
Tests hard-depend on SciPy to make sure this is exercised
during CI.
2020-11-11 19:15:30 +01:00
David Nadlinger a5dcd86fb8 test/lit: Rename `array` to avoid conflict with standard library
The old name created problems if a test dependency (e.g. NumPy/SciPy)
ends up importing the system `array` module internally somewhere.
2020-11-11 17:42:53 +01:00
David Nadlinger d95e619567 compiler: Implement binary NumPy math functions (arctan2, …)
The bulk of the diff is just factoring out the implementation
for binary arithmetic implementations, to be reused for binary
function calls.
2020-11-11 01:35:28 +01:00
David Nadlinger fcf4763ae7 RELEASE_NOTES: Expand information on ndarrays 2020-11-10 20:40:18 +01:00
David Nadlinger bc6fbecbda compiler, firmware: Do not expose abort() to kernels
This was only exposed for the assert implementation, and
does not exist on Zynq.
2020-11-10 20:40:18 +01:00
David Nadlinger 292043a0a7 compiler: Raise AssertionErrors instead of abort()ing on all targets 2020-11-10 20:40:18 +01:00
Leon Riesebos d8a5a8f568 fixed value scaling issue for the center scan gui widget
Signed-off-by: Leon Riesebos <leon.riesebos@duke.edu>
2020-11-10 18:42:18 +01:00
Etienne Wodey dbcac62fd0 coredevice: adf5356: fix/adjust docs
Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
2020-11-10 10:49:22 +08:00
Etienne Wodey e8730a7e14 coredevice: adf5356: add test for failed PLL lock
Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
2020-11-10 10:49:22 +08:00
Etienne Wodey 3844123c13 coredevice: adf5356: add enable/disable and power setting for outA
Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
2020-11-10 10:49:22 +08:00
Etienne Wodey 61dc2b8b64 coredevice: adf5356: add some tests
Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
2020-11-10 10:49:22 +08:00
Etienne Wodey b200465cce coredevice: adf5355: rename to adf5356
Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
2020-11-10 10:49:22 +08:00
Etienne Wodey d433f6e86d coredevice: adf5355: more general PLL parameters calculation
Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
2020-11-10 10:49:22 +08:00
Etienne Wodey b856df7c35 coredevice: adf5355: cleanup, style 2020-11-10 10:49:22 +08:00
Etienne Wodey 211500089f coredevice: mirny/adf5355: add basic high-level interface
Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
2020-11-10 10:49:22 +08:00
David Nadlinger 4f311e7448 compiler: Raise exception on failed assert()s rather than panic
This allows assert() to be used on Zynq, where abort() is not
currently implemented for kernels. Furthermore, this is arguably
the more natural implementation of assertions on all kernel targets
(i.e. where embedding into host Python is used), as it matches host
Python behavior, and the exception information actually makes it to
the user rather than leading to a ConnectionClosed error.

Since this does not implement printing of the subexpressions, I
left the old print+abort implementation as default for the time
being.

The lit/integration/instance.py diff isn't just a spurious change;
the exception-based assert implementation exposes a limitation in
the existing closure lifetime tracking algorithm (which is not
supposed to be what is tested there).

GitHub: Fixes #1539.
2020-11-10 00:51:24 +01:00
David Nadlinger f0ec987d23 test/coredevice: Avoid NumPy deprecation warning
Jagged arrays are no longer silently inferred as dtype=object,
as per NEP-34.

The compiler ndarray (re)implementation is unchanged, so the
test still fails.
2020-11-09 23:53:50 +01:00
Sebastien Bourdeauducq ea95d91428 wrpll: separate collector reset 2020-11-09 17:57:13 +08:00
David Nadlinger a97b4633cb compiler: Add math_fns module docstring [nfc] 2020-10-31 19:06:00 +01:00
Robert Jördens 19bd1e38d4
Merge pull request #1540 from airwoodix/fix-typo-phaser-doc
coredevice/phaser: fix typo in docstring
2020-10-29 22:55:06 +01:00
Etienne Wodey ecef5661ce coredevice/phaser: fix typos in docstring
Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
2020-10-29 20:27:08 +01:00
David Nadlinger d672d2fc35 test/coredevice: Fixup NumPy references
This fixes a copy/paste refactoring mistake from d5f90f6c9.
2020-10-20 02:49:05 +02:00
David Nadlinger d5f90f6c9f compiler: Fix quoting of multi-dimensional arrays
GitHub: Fixes m-labs/artiq#1523.
2020-10-20 01:40:14 +02:00
David Nadlinger d161fd5d84 compiler: Properly expand dimensions for array([]) with ndarray elements
This matches host NumPy behaviour (and, in either case, was
previously broken, as it still continued past the array element
type).
2020-10-20 01:40:14 +02:00
David Nadlinger 94489f9183 compiler: Fix inference order issue in multi-dim. subscript
This will be caught by the test for an imminent array quoting fix.
2020-10-20 01:40:14 +02:00
Robert Jördens a9dd0a268c
Merge pull request #1533 from m-labs/phaser
Phaser
2020-10-19 09:30:12 +02:00
Robert Jördens 30d1acee9f fastlink: fix fastino style link 2020-10-18 20:43:21 +00:00
Robert Jördens d98357051c add ref data 2020-10-18 20:43:21 +00:00
Robert Jördens 139385a571 fastlink: add fastino test 2020-10-18 17:11:09 +00:00
Sebastien Bourdeauducq d185f1ac67 wrpll: fix mulshift (2) 2020-10-17 00:32:02 +08:00
Sebastien Bourdeauducq 3f076bf79b wrpll: fix mulshift 2020-10-16 22:05:37 +08:00
Sebastien Bourdeauducq 90017da484 firmware: remove obsolete watchdog code (#1458) 2020-10-15 18:38:00 +08:00
Sebastien Bourdeauducq 6af8655cc7 README: update 2020-10-15 17:14:30 +08:00
Sebastien Bourdeauducq 840364cf0c RELEASE_NOTES: fix typo 2020-10-15 16:57:53 +08:00
Sebastien Bourdeauducq 24259523bb RELEASE_NOTES: link to issue consistently 2020-10-15 16:51:02 +08:00
Sebastien Bourdeauducq ed90450d2c README: mention Sinara in ARTIQ manifesto 2020-10-15 16:48:28 +08:00
Sebastien Bourdeauducq 0a37a3dbf7 RELEASE_NOTES: fix formatting 2020-10-15 16:45:17 +08:00
Sebastien Bourdeauducq 4027735a6d RELEASE_NOTES: fix formatting 2020-10-15 16:42:43 +08:00
Sebastien Bourdeauducq 4000adfb21 RELEASE_NOTES: update ARTIQ-6 section 2020-10-15 16:42:28 +08:00
Sebastien Bourdeauducq 59703ad31d test: stop checking for artiq_netboot 2020-10-15 16:18:56 +08:00
Sebastien Bourdeauducq 7a5996ba79 artiq_netboot: moved to git.m-labs.hk/M-Labs/artiq-netboot 2020-10-15 16:14:22 +08:00
Sebastien Bourdeauducq e66d2a6408 manual: clarify and expand nix-shell file 2020-10-15 14:31:25 +08:00
Sebastien Bourdeauducq 57ee57e7ea runtime: fix metlino si5324 init (2) 2020-10-14 18:41:56 +08:00
Sebastien Bourdeauducq ac35548d0f runtime: fix metlino si5324 init 2020-10-14 12:57:25 +08:00
Sebastien Bourdeauducq 35c61ce24d si5324: unify N31 settings when used as synthesizer
Closes #1528
2020-10-12 14:45:52 +08:00
hartytp a058be2ede wrpll: fix test_helper_collector 2020-10-08 19:43:12 +08:00
pca006132 d0d0a02fd0 test: added lit test for new error messages 2020-10-08 19:38:26 +08:00
pca006132 e9988f9d3b compiler: error message for custom operations
Emit error messages for custom comparison and inclusion test,
instead of compiler crashing.
2020-10-08 19:38:26 +08:00
Sebastien Bourdeauducq db62cf2abe wrpll: convert tests to self-checking unittests 2020-10-08 18:38:01 +08:00
Sebastien Bourdeauducq 07d43b6e5f wrpll: babysit Vivado DSP retiming
Design now passes timing.
2020-10-08 17:51:27 +08:00
Sebastien Bourdeauducq 7dfb4af682 kasli2: work around vivado clock constraint problem 2020-10-08 16:31:39 +08:00
Sebastien Bourdeauducq 96a5df0dc6 kasli2: add false path constraint for wrpll helper clock 2020-10-08 16:19:44 +08:00
Sebastien Bourdeauducq 6248970ef8 wrpll: clean up matlab comparison test 2020-10-08 15:40:15 +08:00
hartytp cd8c2ce713 wrpll: add test to compare collector+filter against Matlab simulation 2020-10-08 15:36:56 +08:00
hartytp d780faf4ac wrpll.si549: initialize the clock divider to a sensible value 2020-10-08 15:32:27 +08:00
hartytp e6ff2ddc32 wrpll: add more diagnostics in firmware and adapt to recent gateware changes 2020-10-08 15:32:27 +08:00
hartytp 7d7be6e711 wrpll.core: move collector into helper CD so we can get tags out while the filters are reset 2020-10-08 15:32:27 +08:00
Sebastien Bourdeauducq 3fa5d0b963 wrpll: clean up sign extension 2020-10-08 15:32:27 +08:00
hartytp 87911810d6 wrpll.core: add CSRs to monitor the collector outputs 2020-10-08 15:32:27 +08:00
hartytp f2f942a8b4 wrpll.ddmtd: remove CSRs from DDMTD
We will gather then from the collector output so we can get all tags on the same cycle
2020-10-08 15:32:27 +08:00
hartytp 85bb641917 wrpll.ddmtd: fix first edge deglitcher
The blind counter should be held in reset whenever the input is high,
not just when there is a rising edge (otherwise the counter runs down
during the main pulse and can then re-trigger on jitter from the falling edge)
2020-10-08 15:32:27 +08:00
hartytp f3cd0fc675 wrpll.filters: the helper clipping threshold is currently way too low. Move clipping after the bitshift to increase a bit.
TODO: think about this and pick a sensible threshold (and also think about integrator anti windup)
2020-10-08 15:32:27 +08:00
hartytp e5e648bde1 wrpll: add bit shift for collector helper output 2020-10-08 15:32:27 +08:00
hartytp c9ae406ac6 wrpll: change the DDMTD helper frequency to match CERN, improve docs 2020-10-08 15:32:27 +08:00
hartytp f6f6045f1a wrpll.thls: fix make 2020-10-08 15:32:27 +08:00
hartytp b44b870452 wrpll.filters: update to match Weida's MatLab simulations 2020-10-08 15:32:27 +08:00
hartytp e9ab434fa7 wrpll.core: update for modified collector 2020-10-08 15:32:27 +08:00
Sebastien Bourdeauducq 17c952b8fb wrpll: style 2020-10-08 15:32:27 +08:00
hartytp ebb7ccbfd1 wrpll: document DDMTD collector and fix unwrapping 2020-10-08 15:32:27 +08:00
Sebastien Bourdeauducq 7c2519c912 manual: nixpkgs 20.09 2020-10-08 09:18:46 +08:00
Sebastien Bourdeauducq 1bfe977203 manual: sphinx mock module whack-a-mole 2020-10-07 19:25:26 +08:00
Sebastien Bourdeauducq 66401aee9c dashboard: cleanup import 2020-10-07 19:24:54 +08:00
Sebastien Bourdeauducq 6baf3b2198 RELEASE_NOTES: fix indentation 2020-10-07 19:24:34 +08:00
pca006132 fe6115bcbb compiler: fix incorrect with behavior 2020-10-07 18:59:35 +08:00
pca006132 02f46e8b79 Fixes none to bool coercion
Fixes #1413 and #1414.
2020-10-07 15:34:24 +08:00
pca006132 88d346fa26 fixes with statement with multiple items
Closes #1478
2020-10-07 15:33:34 +08:00
Sebastien Bourdeauducq 9214e0f3e2 firmware: fix Si5324 CKIN selection on Kasli 2.0
https://github.com/sinara-hw/Kasli/issues/82#issuecomment-702129805
2020-10-02 20:35:32 +08:00
Robert Jördens eecd97ce4c phaser: debug and comments 2020-09-27 17:15:16 +00:00
Robert Jördens c453c24fb0 phaser: tweak slacks 2020-09-26 21:16:08 +00:00
Robert Jördens 6c8bddcf8d phaser: tune sync_dly 2020-09-26 21:13:00 +00:00
Robert Jördens 569e5e56cd phaser: autotune and fix fifo_offset 2020-09-26 20:37:16 +00:00
Robert Jördens 2fba3cfc78 phaser: debug init, systematic bring-up 2020-09-25 20:54:59 +00:00
Robert Jördens fec2f8b763 phaser: increase slack for iotest 2020-09-24 10:59:22 +00:00
Robert Jördens a65239957f ad53xx: distinguish errors 2020-09-24 10:52:03 +02:00
Robert Jördens 6e6480ec21 phaser: tweak slacks and errors, identify trf 2020-09-24 08:38:30 +00:00
Robert Jördens 03d5f985f8 phaser: another artiq-python signed integer quirk 2020-09-23 15:40:54 +00:00
Robert Jördens ef65ee18bd dac34h84: unflip spectrum, clear nco 2020-09-23 08:35:56 +00:00
Robert Jördens 50b4eb4840 Merge branch 'master' into phaser
* master: (26 commits)
  fastino: documentation and eem pass-through
  kasli2: forward sma_clkin to si5324
  test: relax test_dma_playback_time on Zynq
  rpc: fixed _write_bool
  fastino: document/cleanup
  build_soc: remove assertion that was used for test runs
  metlino_sayma_ttl: Fix RTIO frequency & demo code (#1516)
  Revert "test: temporarily disable test_async_throughput"
  build_soc: rename identifier_str to gateware_identifier_str
  test: relax loopback gate timing
  test: temporarily disable test_async_throughput
  test: relax test_pulse_rate on Zynq
  test: skip NonexistentI2CBus if I2C is not supported
  build_soc: override identifier_str only for gateware
  examples: add Metlino master, Sayma satellite with TTLOuts via FMC
  sayma_amc: add support for 4x DIO output channels via FMC
  fmcdio_vhdci_eem: fix pin naming
  build_soc: add identifier_str override option
  RPC: optimization by caching
  test: improved test_performance
  ...
2020-09-22 16:02:25 +00:00
Robert Jördens c55f2222dc fastino: documentation and eem pass-through
* Repeat information about matching log2_width a few times
  in the hope that people read it. #1518
* Pass through log2_width in kasli_generic json. close #1481
* Check DAC value range. #1518
2020-09-22 17:58:53 +02:00
Robert Jördens ad096f294c phaser: add hitl test exercising the complete API 2020-09-22 15:35:19 +00:00
Robert Jördens 85d16e3e5f phaser: tweaks 2020-09-22 15:27:38 +00:00
Robert Jördens 5c76f5c319 tester: add phaser 2020-09-22 14:36:49 +00:00
Robert Jördens fd5e221898 phaser: dac and trf register maps, init code 2020-09-22 14:08:39 +00:00
Robert Jördens 3e036e365a phaser: nco, settings and init tweaks 2020-09-22 09:52:49 +00:00
Robert Jördens fdb2867757 phaser: fewer iotest patterns 2020-09-21 17:06:26 +02:00
Robert Jördens d730851397 phaser: elaborate init sequence, more tests 2020-09-21 15:05:29 +00:00
Robert Jördens f0959fb871 phaser: iotest early, check_alarms 2020-09-17 14:13:58 +00:00
Robert Jördens b15e388b5f ad53xx: distinguish errors 2020-09-17 14:13:10 +00:00
Sebastien Bourdeauducq 29c940f4e3 kasli2: forward sma_clkin to si5324 2020-09-17 16:53:43 +08:00
Robert Jördens 868a9a1f0c phaser: new multidds 2020-09-16 14:06:38 +00:00
Robert Jördens c18f515bf9 phaser: rework rtio channels, sync_dly, init() 2020-09-16 12:23:07 +00:00
Robert Jördens f3b0398720 phaser: n=2, m=16, sync_dly 2020-09-16 09:19:15 +00:00
Robert Jördens 9b58b712a6 phaser: doc tweaks 2020-09-15 12:35:26 +00:00
Robert Jördens ff57813a9c phaser: init [wip] 2020-09-15 08:46:47 +00:00
Robert Jördens 07418258ae phaser: init [wip] 2020-09-15 08:46:10 +00:00
Robert Jördens 3a79ef740b phaser: work around integer size 2020-09-15 08:46:10 +00:00
Robert Jördens b449e7202b phaser: rework docs 2020-09-15 08:46:10 +00:00
Robert Jördens b619f657b9 phaser: doc tweaks 2020-09-12 19:59:49 +02:00
Robert Jördens c3728678d6 phaser: document, elaborate comments, some fixes 2020-09-12 17:35:14 +00:00
Robert Jördens e505dfed5b phaser: refactor coredevice driver 2020-09-12 14:17:40 +00:00
Robert Jördens fdd2d6f2fb phaser: SI methods 2020-09-12 11:02:37 +00:00
Sebastien Bourdeauducq bff611a888 test: relax test_dma_playback_time on Zynq 2020-09-11 11:21:45 +08:00
Robert Jördens 4e24700205 phaser: spelling 2020-09-09 16:52:52 +00:00
Robert Jördens 8aaeaa604e phaser: share_lut 2020-09-07 16:06:35 +00:00
Robert Jördens e69bb0aeb3 phaser: add comment about get_dac_data 2020-09-07 16:06:16 +00:00
pca006132 6195b1d3a0 rpc: fixed _write_bool
Closes #1519
2020-09-04 13:49:22 +08:00
Robert Jördens 56aa22caeb fastino: document/cleanup
* added documentation on `update`/`hold` mechanism
* mask machine unit values
* cleanup coredevice driver

close #1518
2020-09-03 17:44:26 +02:00
Astro 1b475bdac4 build_soc: remove assertion that was used for test runs 2020-09-03 20:24:18 +08:00
Harry Ho 458a411320
metlino_sayma_ttl: Fix RTIO frequency & demo code (#1516) 2020-09-03 15:08:31 +08:00
Sebastien Bourdeauducq 47e88dfcbe Revert "test: temporarily disable test_async_throughput"
This reverts commit f0289d49ab.
2020-09-03 14:19:55 +08:00
Astro 002a71dd8d build_soc: rename identifier_str to gateware_identifier_str 2020-09-02 00:00:57 +08:00
Sebastien Bourdeauducq 4398a2d5fa test: relax loopback gate timing 2020-09-01 17:50:09 +08:00
Sebastien Bourdeauducq f0289d49ab test: temporarily disable test_async_throughput
M-Labs/artiq-zynq#104
2020-09-01 17:49:40 +08:00
Sebastien Bourdeauducq 8d5dc0ad2a test: relax test_pulse_rate on Zynq 2020-09-01 17:08:26 +08:00
Sebastien Bourdeauducq f294d039b3 test: skip NonexistentI2CBus if I2C is not supported 2020-09-01 16:47:04 +08:00
Astro 91df3d7290 build_soc: override identifier_str only for gateware 2020-09-01 10:46:39 +08:00
Harry Ho 3d84135810 examples: add Metlino master, Sayma satellite with TTLOuts via FMC 2020-08-31 16:21:45 +08:00
Harry Ho dfbf3311cb sayma_amc: add support for 4x DIO output channels via FMC 2020-08-31 16:21:45 +08:00
Harry Ho 1ad9deaf91 fmcdio_vhdci_eem: fix pin naming 2020-08-31 16:21:45 +08:00
Astro 45ae6202c0 build_soc: add identifier_str override option
Signed-off-by: Stephan Maka <stephan@spaceboyz.net>
2020-08-31 11:48:58 +08:00
Robert Jördens 272dc5d36a phaser: documentation 2020-08-28 16:36:44 +00:00
pca006132 b2572003ac RPC: optimization by caching
This reduced the calls needed for socket send/recv.
2020-08-28 14:58:34 +08:00
pca006132 69f0699ebd test: improved test_performance
1. Added tests for small payload.
2. Added statistics.
2020-08-28 14:58:34 +08:00
Sebastien Bourdeauducq 7cf974a6a7 comm_kernel: fix typo 2020-08-28 12:25:23 +08:00
Robert Jördens 68bfa04abb phaser: trf readback strobe spi changes 2020-08-27 15:31:42 +00:00
Robert Jördens 96fc248d7c phaser: synchronize multidds to frame 2020-08-27 14:28:19 +00:00
Robert Jördens c10ac2c92a phaser: add trf, duc, interfaces, redo body assembly, use more natrual iq ordering (i lsb) 2020-08-27 14:26:09 +00:00
Robert Jördens e5e2392240 phaser: wire up multidds 2020-08-26 17:12:41 +00:00
Robert Jördens d1be1212ab phaser: coredevice shim, dds [wip] 2020-08-26 15:10:50 +00:00
pca006132 26bc5d2405 Updated release notes 2020-08-26 14:17:06 +08:00
pca006132 aac2194759 Ported rpc changes to or1k 2020-08-26 14:17:06 +08:00
pca006132 7181ff66a6 compiler: improved rpc performance for list and array
1. Removed duplicated tags before each elements.
2. Use numpy functions to speedup parsing.
2020-08-26 14:17:06 +08:00
pca006132 cfddc13294 test: fixed test_performance
Added more tests and use normal rpc instead of async rpc.

Async RPC does not represent the real throughput which is limited by the
hardware and the network. Normal RPC which requires a response from the
remote is closer to real usecases.
2020-08-26 14:17:06 +08:00
Robert Jördens 20fcfd95e9 phaser: coredevice shim, readback fix 2020-08-24 15:46:31 +00:00
Robert Jördens bcefb06e19 phaser: ddb template, split crc 2020-08-24 14:51:50 +00:00
Robert Jördens 11c9def589 phaser: readback delay, test fastlink 2020-08-24 14:49:36 +00:00
Paweł Kulik eb350c3459 Drive SFP0 TX_DISABLE low during startup (as was in Kasli v1.1). Fixes Ethernet on SFP modules with pullup on this line.
Signed-off-by: Paweł Kulik <pawel.kulik@creotech.pl>
2020-08-24 21:39:53 +08:00
Robert Jördens 63e4b95325 fastlink: rework crc injection 2020-08-23 19:41:13 +00:00
Robert Jördens a27a03ab3c fastlink: fix crc vs data width 2020-08-23 19:02:50 +00:00
Robert Jördens 7e584d0da1 fastino: use fastlink 2020-08-22 11:56:23 +00:00
Robert Jördens 3e99f1ce5a phaser: refactor link 2020-08-22 11:56:23 +00:00
Robert Jördens a34a647ec4 phaser: refactor fastlink 2020-08-22 11:56:23 +00:00
Robert Jördens aa0154d8e2 phaser: initial 2020-08-22 11:56:23 +00:00
Sebastien Bourdeauducq 5f6aa02b61 gui: unbreak background 2020-08-14 13:14:45 +08:00
David Nadlinger 69718fca90 gui: Improve fuzzy-select heuristics
Even though the code already used non-greedy wildcards before,
it would not find the shortest match, as earlier match starts
would still take precedence.

This could possibly be sped up a bit in CPython by doing
everything inside re using lookahead-assertion trickery, but the
current code is already imperceptibly fast for hundreds of
choices.
2020-08-14 02:13:45 +01:00
pca006132 a46573e97a Revert "test: set uart log level to INFO for DMA tests"
This reverts commit b05cbcbc24.
2020-08-13 12:44:33 +08:00
pca006132 b05cbcbc24 test: set uart log level to INFO for DMA tests 2020-08-13 12:24:57 +08:00
Sebastien Bourdeauducq 48008eaf5f test: omit unavailable math functions on OR1K 2020-08-12 15:01:13 +08:00
Sebastien Bourdeauducq d8cd5023f6 runtime: expose more libm functions 2020-08-12 13:36:06 +08:00
David Nadlinger c6f0c4dca4 test/coredevice: Ignore jagged 2D array embedding test for now 2020-08-10 00:23:38 +01:00
David Nadlinger daf57969b2 compiler: Do not expand strings into TInt(8)s in array() 2020-08-09 23:46:45 +01:00
David Nadlinger 778f2cf905 compiler: Fix numpy.full, implement for >1D 2020-08-09 23:46:45 +01:00
David Nadlinger 53d64d08a8 compiler: Fix multi-dim slice error message test, tweak wording 2020-08-09 23:14:56 +01:00
David Nadlinger d35f659d25 compiler: Add additional math fns available from Rust libm 2020-08-09 20:09:43 +01:00
David Nadlinger a39bd69ca4 compiler: Implement numpy.rint() using llvm.round() 2020-08-09 19:44:58 +01:00
David Nadlinger ae47d4c0ec test/coredevice: Add host/device consistency checks for NumPy math 2020-08-09 19:15:43 +01:00
David Nadlinger 8e262acd1e compiler: Slight array op implementation cleanup [nfc]
array_unaryop_funcs was never used; since the mangled names
are unique, a single dictionary would be nicer for overrides
anyway.s
2020-08-09 18:58:01 +01:00
David Nadlinger 33d931a5b7 compiler: Implement multi-dimensional indexing of arrays
This generates rather more code than necessary, but has
the advantage of automatically handling incomplete
multi-dimensional subscripts which still leave arrays
behind.
2020-08-09 17:08:43 +01:00
David Nadlinger b00ba5ece1 compiler: Support explicit array(…, dtype=…) syntax 2020-08-09 17:08:43 +01:00
David Nadlinger ad34df3de1 compiler: Support numpy.float
This would previously crash the compiler.
2020-08-09 17:08:43 +01:00
David Nadlinger 8783ba2072 compiler/firmware: RPCs for ndarrays 2020-08-09 17:08:43 +01:00
David Nadlinger 5472e830f6 compiler: Assume array()s are always rectangular 2020-08-09 03:54:42 +01:00
David Nadlinger 8eddb9194a test/lit: Add smoke test for math function broadcasting 2020-08-09 03:54:42 +01:00
David Nadlinger 1c645d8857 compiler: Unbreak quoting of 1D ndarrays
Lists and arrays no longer have the same representation all
the way through codegen, as used to be the case.

This could/should be made more efficient later, eliding the
temporary copies.
2020-08-09 03:54:42 +01:00
David Nadlinger df8f1c5c5a compiler: Annotate math functions nounwind/nowrite 2020-08-09 03:54:42 +01:00
David Nadlinger cc00ae9580 compiler: Implement broadcasting of math functions 2020-08-09 03:54:42 +01:00
David Nadlinger be7d78253f compiler: Implement 1D-/2D- array transpose
Left generic transpose (shape order inversion) for now, as that
would be less ugly if we implement forwarding to Python function
bodies for array function implementations.

Needs a runtime test case.
2020-08-09 03:54:42 +01:00
David Nadlinger faea886c44 compiler: Implement array vs. scalar broadcasting 2020-08-09 03:54:42 +01:00
David Nadlinger 56a872ccc0 compiler: Insert array binop shape check in caller for location information 2020-08-09 03:54:42 +01:00
David Nadlinger ef260adca8 compiler: Implement matrix multiplication
LLVM will take care of optimising the loops. This was still
unnecessarily painful; implementing generics and implementing
this in ARTIQ Python looks very attractive right now.
2020-08-09 03:54:42 +01:00
David Nadlinger 0da4a61d99 compiler: Fix method name typo [nfc] 2020-08-09 03:54:42 +01:00
David Nadlinger 78afa2ea8e compiler: Support MatMult in inferencer
Still needs actual codegen support.
2020-08-09 03:54:42 +01:00
David Nadlinger 4d48470320 compiler: Support common numpy.* math functions
Relies on the runtime to provide the necessary
(libm-compatible) functions.

The test is nifty, but a bit brittle; if this breaks in the
future because of optimizer changes, do not hesitate to convert
this into a more pedestrian test case.
2020-08-09 03:54:41 +01:00
David Nadlinger d37503f21d compiler: T{C -> External}Function, clarify docs [nfc] 2020-08-09 03:54:41 +01:00
David Nadlinger da255bee1b compiler: Implement element type coercion for arrays
So far, this is not exposed to the user beyond implicit conversions.

Note that all the implicit conversions, such as triggered by adding
arrays of mismatching types, or dividing integer arrays, are currently
emitted in a maximally inefficient way, where a temporary copy is first
made for the type conversion. The conversions would more sensibly be
implemented during the per-element operations to save on the extra
copies, but the current behaviour fell out of the rest of the IR
generator structure without extra changes.
2020-08-09 03:54:41 +01:00
David Nadlinger 4426e4144f compiler: Implement unary plus/minus for arrays
Implementation is needlessly generic to anticipate
coercion/transcendental functions.
2020-08-09 03:54:41 +01:00
David Nadlinger 0d8fbd4f19 test/lit: Add a test for matrix binary operations
No reason to believe other operations won't work the same.
(More exhaustive tests to follow using embedding for comparison
against NumPy.)
2020-08-09 03:54:41 +01:00
David Nadlinger 7bdd6785b7 test/lit: Basic ndarray smoke tests for all binops 2020-08-09 03:54:41 +01:00
David Nadlinger 4d002c7934 compiler: Explain use of rpc_tag() in array ops, formatting [nfc] 2020-08-09 03:54:41 +01:00
David Nadlinger a7e855b319 compiler.types: Change invalid default value [nfc]
This wasn't actually ever used, but was a dict instead of a set.
2020-08-09 03:54:41 +01:00
David Nadlinger 48fb80017f compiler: Implement basic element-wise array operations 2020-08-09 03:54:41 +01:00
David Nadlinger 9af6e5747d compiler: Factor rpc_tag() out of llvm_ir_generator 2020-08-09 03:54:41 +01:00
David Nadlinger e77c7d1c39 compiler: Add inferencer support for array operations 2020-08-09 03:54:41 +01:00
David Nadlinger ef57cad1a3 compiler: Test ndarray element assignment 2020-08-09 03:54:41 +01:00
David Nadlinger a9a975e5d4 language: Allow instantating TArray using bare ints 2020-08-09 03:54:41 +01:00
David Nadlinger 504b8f0148 language: Export TArray 2020-08-09 03:54:41 +01:00
David Nadlinger dea3c0c572 compiler: Don't store redundant ndarray buffer length, match list layout
This adds `elt` to _TPointer and the ir.Offset IR instruction,
which is like GetElem but without the final load.
2020-08-09 03:54:41 +01:00
David Nadlinger e82357d180 compiler: Fix inferencer tests after adding TArray.num_dims 2020-08-09 03:54:41 +01:00
David Nadlinger cb1cadb46a compiler: Fix/test 1D array construction from generic iterables 2020-08-09 03:54:41 +01:00
David Nadlinger 38c17622cc compiler: Axis-wise iteration of ndarrays
Matches NumPy. Slicing a TList reallocates, this doesn't; offsetting
couldn't be handled in the IR without introducing new semantics
(the Alloc kludge; could/should be made its own IR type).
2020-08-09 03:54:41 +01:00
David Nadlinger c95a978ab6 compiler: Iteration for 1D ndarrays 2020-08-09 03:54:41 +01:00
David Nadlinger bc17bb4d1a compiler: Parametrize TArray in number of dimensions 2020-08-09 03:54:41 +01:00
David Nadlinger 632c5bc937 compiler: Add ndarray .shape access 2020-08-09 03:54:41 +01:00
David Nadlinger 40f59561f2 compiler: Add test for length of empty arrays [nfc]
This makes sure we are actually emitting this as an 1D array
(like NumPy does).
2020-08-09 03:54:41 +01:00
David Nadlinger d882f8a3f0 compiler: Implement len() for ndarrays 2020-08-09 03:54:41 +01:00
David Nadlinger 575be2aeca compiler: Basic support for creation of multidimensional arrays
Breaks all uses of array(), as indexing is not yet implemented.
2020-08-09 03:54:41 +01:00
David Nadlinger 56010c49fb compiler/inferencer: Detect rectangular array()s
Still needs support through all the rest of the compiler, and
support for higher-dimensional arrays.

Alternatively, we could always assume ndarrays of ndarrays
are rectangular (i.e. ban array/list element types), and
detect mismatch at runtime. This might turn out to be
preferrable to be able to construct matrices from rows/columns.

`array()` is disallowed for no particularly good reason but
numpy API compatibility.
2020-08-09 03:54:41 +01:00
David Nadlinger 6ea836183d test/lit: Move some list tests to appropriate module [nfc] 2020-08-09 03:54:41 +01:00
pmldrmota 1df62862cd
AD9910: Write correct number of bits to POW register (#1498)
* coredevice.ad9910: Add return type hints to conversion functions

* coredevice.ad9910: Make set_pow write correct number of bits
The AD9910 expects 16 bits. Thus, if writing 32 bits to the POW register, the chip would likely enter a locked-up state.

* coredevice.ad9910: Correct data alignment in write_16

Co-authored-by: Robert Jördens <rj@quartiq.de>

* coredevice.ad9910: Add function to read from 16 bit registers

Co-authored-by: drmota <peter.drmota@physics.ox.ac.uk>
Co-authored-by: Robert Jördens <rj@quartiq.de>
2020-08-07 10:10:44 +02:00
Sebastien Bourdeauducq 504f72a02c rtio: remove legacy i_overflow_reset CSR 2020-08-06 17:52:32 +08:00
Sebastien Bourdeauducq 5f36e49f91 test_rtio: make DMA test generic wrt TTL channel 2020-08-06 16:36:14 +08:00
pca006132 3bfd372c20 compiler: linker discard local symbols.
Fixes exception backtrace problem for ARM.
2020-08-06 16:07:28 +08:00
Sebastien Bourdeauducq e3c5775584 test: skip CacheTest.test_borrow on Zynq 2020-08-06 10:54:30 +08:00
Sebastien Bourdeauducq 9c9dc3d0ef manual: Kasli now supports 10/100 Ethernet 2020-08-01 10:35:37 +08:00
David Nadlinger ae999db8f6 compiler: Revert function call lifetime tracking fix
This reverts commits f8d1506922
and cf19c9512d.

While the commit just fixes a clear typo in the implementation,
it turns out the original algorithm isn't flexible enough to
capture functions that transitively return references to
long-lived data. For instance, while cache_get() is special-cased
in the compiler to be recognised as returning a value of Global()
lifetime, a function just forwarding to it (as seen in the
embedding tests) isn't anymore.

A separate issue is also that this makes implementing functions
that take lists and return references to global data in user code
impossible, which central parts of the Oxford codebase rely on.

Just reverting for now to unblock master; a fix is easily designed,
but needs testing.
2020-07-30 16:40:39 +01:00
Sebastien Bourdeauducq 709026d945 test: relax device_to_host_rate 2020-07-30 17:46:22 +08:00
Sebastien Bourdeauducq 455e4859b7 simplify versioneer
Original version is very complex and still has a number of problems.
2020-07-30 00:54:07 +08:00
Sebastien Bourdeauducq 5fd0d0bbb6 gui: work around quamash bug with python 3.8 2020-07-28 12:08:47 +08:00
David Nadlinger cf19c9512d RELEASE_NOTES: Add entry for compiler lifetime tracking fix
I contemplated putting this in the "Breaking changes" section,
as it might break user code that has avoided being hit by
memory corruption from the use-after free by chance (even
though it was always an accepts-illegal bug).
2020-07-28 00:54:20 +01:00
David Nadlinger f8d1506922 compiler: Fix lifetime tracking for function call return values
GitHub: Fixes #1497.
2020-07-28 00:33:28 +01:00
cw-mlabs e4b16428f5 wrpll: fix run signal 2020-07-27 13:02:02 +08:00
cw-mlabs 8dd9a6d024 wrpll: fix scl signal 2020-07-27 12:59:32 +08:00
Charles Baynham 9b44ec7bc6 parameters: Allow forcing a NumberValue to return a float
Signed-off-by: Charles Baynham <charles.baynham@npl.co.uk>
2020-07-27 12:25:51 +08:00
David Nadlinger 1c72585c1b compiler: Handle None-returning function calls used as values
GitHub: Fixes #1493.
2020-07-25 02:20:53 +01:00
David Nadlinger 57e759a1ed compiler: Consistently use llunit through llvm_ir_generator [nfc] 2020-07-25 02:20:52 +01:00
Sebastien Bourdeauducq 2a2f5c4d58 comm_analyzer: make header error flag more general 2020-07-20 19:39:19 +08:00
Sebastien Bourdeauducq 553a49e194 test_moninj: set loop_out as output 2020-07-19 17:59:43 +08:00
Sebastien Bourdeauducq 8510bf4e55 test_analyzer: configure loop_out as output 2020-07-16 19:28:58 +08:00
pca006132 eb28d7be3a firmware/rpc: fixed typo 2020-07-16 15:15:47 +08:00
pca006132 f78d673079 firmware/rpc: added `#[repr(C)]` for structs.
Previously the structs are in repr(Rust) which has no layout guarantee.
2020-07-16 15:11:17 +08:00
Robert Jördens e31ee1f0b3 firmware/i2c: rewrite I2C implementation
* Never drive SDL or SDA high. They are specified to be open
  collector/drain and pulled up by resistive pullups. Driving
  high fails miserably in a multi-master topology (e.g. with
  a USB I2C interface). It would only ever be implemented to
  speed up the bus actively but that's tricky and completely
  unnecessary here.
* Make the handover states between the I2C protocol phases (start, stop,
  restart, write, read) well defined. Add comments stressing those
  pre/postconditions.
* Add checks for SDA arbitration failures and stuck SCL.
* Remove wrong, misleading or redundant comments.
2020-07-15 16:43:07 +08:00
Sebastien Bourdeauducq 4340a5cfc1 rtio/dma: fix previous commit 2020-07-12 10:14:22 +08:00
Sebastien Bourdeauducq f2e0d27334 rtio/dma: remove dead/broken code 2020-07-12 10:13:18 +08:00
Sebastien Bourdeauducq 901be75ba4 sayma_rtm: fix Si5324 reset
Closes #1483
2020-07-11 09:51:01 +08:00
Sebastien Bourdeauducq 8719bab726 Revert "i2c: duplicate TCA9548 control byte"
This reverts commit f265976df6.
2020-07-08 19:02:02 +08:00
Sebastien Bourdeauducq f273a9aacc artiq_ddb_template: remove SFP LEDs on hw 2.0+ 2020-07-08 18:15:36 +08:00
Sebastien Bourdeauducq 2d1f1fff7f kasli_generic: do not attempt to use SFP LED for RTIO on 2.0+ 2020-07-08 18:14:44 +08:00
Sebastien Bourdeauducq 85b5a04acf test: print transfer rates in MiB/s 2020-07-07 17:28:47 +08:00
Sebastien Bourdeauducq 13501115f6 test: remove watchdog test (#1458) 2020-07-07 17:28:47 +08:00
Donald Sebastian Leung f265976df6 i2c: duplicate TCA9548 control byte 2020-07-03 16:45:05 +08:00
David Nadlinger 3f0cf6e683 runtime: Stop kernel CPU before restarting comms CPU on panic
Before, the system would enter a boot loop when a panic occurred
while the kernel CPU was active (and panic_reset == 1), as
kernel::start() for the startup kernel would panic.
2020-07-01 17:29:05 +08:00
Sebastien Bourdeauducq 95807234d9 compiler: use binutils for ARM
This is mostly due to Windoze, where installing anything is a PITA and the LLVM tools won't be available soon.
2020-06-28 17:33:03 +08:00
Sebastien Bourdeauducq 906256cc02 manual: remove reference to conda install script 2020-06-26 10:50:11 +08:00
Sebastien Bourdeauducq 5d58a195c0 manual: clarify board package installation 2020-06-26 10:49:31 +08:00
Sebastien Bourdeauducq fb6a8899f4 manual: use conda env creation command 2020-06-26 10:47:55 +08:00
Sebastien Bourdeauducq 89c53c35e8 dashboard: style 2020-06-26 10:12:03 +08:00
David Nadlinger f36692638c dashboard: Add "Quick Open" dialog for experiments on global shortcut
This is similar to functionality in Sublime Text, VS Code, etc.
2020-06-26 10:11:33 +08:00
Sebastien Bourdeauducq 91c93e1ad8 manual: add note about additional packages 2020-06-20 19:32:13 +08:00
Sebastien Bourdeauducq 4ad46e0e40 update Conda installation method 2020-06-20 19:26:31 +08:00
David Nadlinger 966ed5d013 master/scheduler: Fix priority/due date precedence order when waiting to prepare
See test case – previously, the highest-priority pending run would
be used to calculate the timeout, rather than the earliest one.

This probably managed to go undetected for that long as any unrelated
changes to the pipeline (e.g. new submissions, or experiments pausing)
would also cause _get_run() to be re-evaluated.
2020-06-19 23:45:52 +01:00
David Nadlinger 7955b63b00 master: Always write results to HDF5 once run stage is reached
Previously, a significant risk of losing experimental results would
be associated with long-running experiments, as any stray exceptions
while run()ing the experiment – for instance, due to infrequent
network glitches or hardware reliability issue – would cause no
HDF5 file to be written. This was especially troublesome as long
experiments would suffer from a higher probability of unanticipated
failures, while at the same time being more costly to re-take in
terms of wall-clock time.

Unanticipated uncaught exceptions like that were enough of an issue
that several Oxford codebases had come up with their own half-baked
mitigation strategies, from swallowing all exceptions in run() by
convention, to always broadcasting all results to uniquely named
datasets such that the partial results could be recovered and written
to HDF5 by manually run recovery experiments.

This commit addresses the problem at its source, changing the worker
behaviour such that an HDF5 file is always written as soon as run()
starts.
2020-06-18 17:47:26 +01:00
David Nadlinger d87042597a master/worker_impl: Factor out "completed" message sending [nfc]
Just reduces the visual complexity/potential for typos a bit, and
we already have put_exception_report().
2020-06-18 01:30:46 +01:00
charlesbaynham 2429a266f6
ad9912: Fix typing problem on ad9912 (#1466)
Closes #1463

FTW and phase word were ambiguously typed, resulting in failure to compile
2020-06-16 20:17:22 +02:00
charlesbaynham ce7e92a75e
docs: Add docs for RTIO SED sequencing (#1461)
Signed-off-by: Charles Baynham <charles.baynham@npl.co.uk>
2020-06-15 18:43:34 +02:00
Harry Ho 1a17d0c869 zotino: add USER LED test 2020-06-11 16:03:56 +08:00
Harry Ho 6156bd4088 fastino: add tests using DACs and USER LEDs 2020-06-11 14:55:46 +08:00
Sebastien Bourdeauducq a18d2468e9 test: do not build libartiq_support in lit.cfg 2020-06-10 17:15:24 +08:00
Robert Jördens 9822b88d9b
ad9910: fix asf range (#1450)
* ad9910: fix asf range

The ASF is a 14-bit word. The highest possible value is 0x3fff, not
0x3ffe. `int(round(1.0 * 0x3fff)) == 0x3fff`.

I don't remember and understand why this was 0x3ffe since the beginning.
0x3fff was already used as a default in `set_mu()`

Signed-off-by: Robert Jördens <rj@quartiq.de>

* RELEASE_NOTES: ad9910 asf scale change

Co-authored-by: David Nadlinger <code@klickverbot.at>
2020-05-29 11:13:26 +02:00
Sebastien Bourdeauducq cb76f9da89 metlino: fix CSR collisions
Closes #1425
2020-05-29 15:59:44 +08:00
Sebastien Bourdeauducq bd9eec15c0 metlino: increase number of DRTIO links
Seems OK with Vivado 2019.2.
2020-05-29 15:59:16 +08:00
Sebastien Bourdeauducq d5c1eaa16e runtime: remove stack alignment requirement
I suppose this was for TMPU, but was never finished.
2020-05-29 15:37:23 +08:00
Sebastien Bourdeauducq 02900d79d0 firmware: fix typos 2020-05-29 15:21:07 +08:00
Sebastien Bourdeauducq d8b5bcf019 sayma_amc: support uTCA backplane for DRTIO 2020-05-29 14:58:49 +08:00
Sebastien Bourdeauducq 8b939b7cb3 sayma_amc: remove Master (obsoleted by Metlino) 2020-05-29 14:40:49 +08:00
Charles Baynham 5db2afc7a7 dashboard: Release notes for #1453 2020-05-26 18:16:35 +08:00
Charles Baynham 692c466838 Use logger formatting 2020-05-26 17:59:55 +08:00
Charles Baynham 8858ba8095 dashboard: Restart applets if required
Restart applets that are already running if a ccb call updates their spec

Signed-off-by: Charles Baynham <charles.baynham@npl.co.uk>
2020-05-26 17:59:55 +08:00
Marius Weber 2538840756
Coredevice Input Validation (#1447)
* Input validation and masking of SI -> mu conversions (close #1446)

Signed-off-by: Marius Weber <marius.weber@physics.ox.ac.uk>

* Update RELEASE_NOTES

Signed-off-by: Marius Weber <marius.weber@physics.ox.ac.uk>

Co-authored-by: Robert Jördens <rj@quartiq.de>
2020-05-17 15:09:11 +02:00
Marius Weber b3b6cb8efe
ad53xx improvements (#1445)
* ad53xx: voltage_to_mu() validation & documentation (closes #1443, #1444)
The voltage input (float) is checked for validity. If we need more
speed, we may want to check the DAC-code for over/underflow instead.

Signed-off-by: Marius Weber <marius.weber@physics.ox.ac.uk>

* ad53xx documentation: voltage_to_mu is only valid for 16-bit DACs

Signed-off-by: Marius Weber <marius.weber@physics.ox.ac.uk>

* AD53xx: add voltage_to_mu method (closes #1341)

Signed-off-by: Marius Weber <marius.weber@physics.ox.ac.uk>

* ad53xx: improve voltage_to_mu performance
Interger comparison is faster than floating point math.

Signed-off-by: Marius Weber <marius.weber@physics.ox.ac.uk>

* AD53xx: voltage_to_mu method now uses attribute values

Signed-off-by: Marius Weber <marius.weber@physics.ox.ac.uk>

* Fixup RELEASE_NOTES.rst

Signed-off-by: Marius Weber <marius.weber@physics.ox.ac.uk>

* ad53xx: documentation improvements

voltage_to_mu return value
14-bit DAC support

Signed-off-by: Marius Weber <marius.weber@physics.ox.ac.uk>
2020-05-08 19:23:43 +02:00
Sebastien Bourdeauducq 4e9a529e5a kasli: integrate WRPLL 2020-05-07 21:34:02 +08:00
Sebastien Bourdeauducq 60e5f1c18e kasli: DRTIO support for Kasli 2 2020-05-07 20:09:43 +08:00
Sebastien Bourdeauducq 1f2182d4c7 kasli: default to hardware v2 2020-05-07 19:15:03 +08:00
Sebastien Bourdeauducq 35f1814235 kasli: implement virtual LEDs 2020-05-07 19:07:43 +08:00
Sebastien Bourdeauducq b83afedf43 kasli: light up ERROR LED on panic 2020-05-07 19:06:10 +08:00
Sebastien Bourdeauducq 4982fde898 firmware: I2C I/O expander support 2020-05-05 21:38:17 +08:00
Sebastien Bourdeauducq ef4e5bc69b firmware: Kasli I2C EEPROM cleanup 2020-05-05 21:29:29 +08:00
Sebastien Bourdeauducq 85e92ae28c compiler: use more LLVM tools on ARM (#733) 2020-04-28 16:21:50 +08:00
Sebastien Bourdeauducq 7e400a78f4 kasli: compile tester for hw 2.0 by default 2020-04-28 16:07:56 +08:00
Sebastien Bourdeauducq 140a26ad7e compiler: ld -> ld.lld 2020-04-28 16:07:26 +08:00
Sebastien Bourdeauducq 4228e0205c compiler: link with lld on ARM (#733) 2020-04-28 15:00:24 +08:00
Sebastien Bourdeauducq 3a7819704a rtio: support direct 64-bit now CSR in KernelInitiator 2020-04-26 16:04:32 +08:00
Sebastien Bourdeauducq 251a0101a6 compiler: support disabling now-pinning 2020-04-26 12:38:43 +08:00
Sebastien Bourdeauducq d19f28fa84 kasli: v2 clocking WIP, remove SFP LEDs from RTIO 2020-04-23 23:02:18 +08:00
Sebastien Bourdeauducq 9bc43b2dbf kasli: support EEPROM on v2 2020-04-23 23:00:36 +08:00
Sebastien Bourdeauducq 77e6fdb7a7 artiq_flash: cleanup Sayma RTM management, support flashing AMC with RTM disconnected 2020-04-14 18:22:06 +08:00
Robert Jördens ea79ba4622 ttl_serdes: detect edges on short pulses
Edges on pulses shorter than the RTIO period were missed because the
reference sample and the last sample of the serdes word are the same.

This change enables detection of edges on pulses as short as the
serdes UI (and shorter as long as the pulse still hits a serdes sample
aperture).

In any RTIO period, only the leading event corresponding to the first
edge with slope according to sensitivity is registerd. If the channel is
sensitive to both rising and falling edges and if the pulse is contained
within an RTIO period, or if it is sensitive only to one edge slope and
there are multiple pulses in an RTIO period, only the leading event is
seen. Thus this possibility of lost events is still there. Only the
conditions under which loss occurs are reduced.

In testing with the kasli-ptb6 variant, this also improves resource
usage (a couple hundred LUT) and timing (0.1 ns WNS).
2020-04-13 13:21:03 +02:00
Sebastien Bourdeauducq e8b73876ab comm_kernel: add Zynq runtime identifier 2020-04-12 17:25:14 +08:00
Sebastien Bourdeauducq de57039e6e comm_kernel: cleanup 2020-04-12 16:02:36 +08:00
Sebastien Bourdeauducq 9dc24f255e comm_kernel: remove dead code 2020-04-12 15:06:46 +08:00
Sebastien Bourdeauducq fb0ade77a9 firmware: fix non-DRTIO build 2020-04-10 17:23:17 +08:00
Sebastien Bourdeauducq ec7b2bea12 sayma: round FTW like Urukul in JDCGSyncDDS 2020-04-08 15:00:33 +08:00
Sebastien Bourdeauducq 0f4be22274 sayma: add simple sychronized DDS for testing 2020-04-08 14:13:54 +08:00
Sebastien Bourdeauducq 3c823a483a sayma: improve DAC sync messaging (again) 2020-04-06 22:36:43 +08:00
Sebastien Bourdeauducq 4d601c2102 sayma: improve DAC sync messaging 2020-04-06 22:36:03 +08:00
Sebastien Bourdeauducq 61d4614b61 sayma: fix/cleanup DRTIO-DAC sync interaction 2020-04-06 22:34:05 +08:00
Sebastien Bourdeauducq facc0357d8 drtio: make sure receive buffer is drained after ping reply 2020-04-06 22:33:15 +08:00
Sebastien Bourdeauducq ffd3172e02 sayma: move SYSREF DDMTD to RTM (#795) 2020-04-06 00:01:28 +08:00
Sebastien Bourdeauducq 8f608fa2fa examples/sines_urukul_sayma: adapt for sayma v2, use 1 DAC only 2020-04-05 16:51:40 +08:00
Etienne Wodey 90d08988b2 language/environment: BooleanValue: fix type detection
Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
2020-04-04 15:37:04 +08:00
Etienne Wodey 9b03a365ed language/environment: cast argument processor default values early
Fixes #1434. Also add unit tests for some argument processors.

Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
2020-04-04 15:37:04 +08:00
Sebastien Bourdeauducq 371d923385 manual: nixpkgs 20.03 2020-04-04 13:05:46 +08:00
Sebastien Bourdeauducq 9294efabc0 manual: Kasli can get MAC address from EEPROM 2020-03-14 12:19:43 +08:00
Sebastien Bourdeauducq 4a8d361ace soc: optimize programmable identifier 2020-03-12 23:09:13 +08:00
Sebastien Bourdeauducq 9e66dd7075 soc: reprogrammable identifier 2020-03-12 22:23:08 +08:00
Robert Jördens 380de177e7 rtio: fix wide output after RTIO refactoring
fixes 3d0c3cc1cf
2020-03-05 17:55:27 +00:00
Robert Jördens e803830b3b fastino: support wide RTIO interface and channel groups 2020-03-05 17:55:04 +00:00
Sebastien Bourdeauducq 8dbf30b23e manual: mention integrated Kasli JTAG 2020-03-02 18:42:01 +08:00
Sebastien Bourdeauducq 8451e58fbe ad9912: fix ftw width docstring 2020-02-27 02:11:12 +08:00
Paweł K 2a909839ff
artiq_flash: added option of specifying another username when connecting through SSH. (#1429)
Signed-off-by: Paweł Kulik <pawel.kulik@creotech.pl>
2020-02-19 19:44:11 +08:00
Sebastien Bourdeauducq 6d26def3ce sayma: drive filtered_clk_sel on master variant 2020-02-06 22:28:49 +08:00
Sebastien Bourdeauducq 52ec849008 sayma: fix sysref_delay_dac 2020-02-05 19:04:01 +08:00
Sebastien Bourdeauducq c7de1f2e6b metlino: drive clock muxes 2020-02-05 00:06:34 +08:00
Sebastien Bourdeauducq bf9f4e380a si5324: program I2C mux on Metlino 2020-02-03 18:07:59 +08:00
Sebastien Bourdeauducq ffb24e9fff artiq_flash: use correct proxy bitstream for Metlino 2020-02-03 18:07:26 +08:00
Sebastien Bourdeauducq 5f8e20b1a1 artiq_sinara_tester: fix device_db filename 2020-01-31 10:26:58 +08:00
Sebastien Bourdeauducq dfa033eb87 wrpll: new collector from Weida/Tom 2020-01-24 10:31:52 +08:00
Sebastien Bourdeauducq dee16edb78 wrpll: DDMTD sampler double latching 2020-01-22 19:16:26 +08:00
Sebastien Bourdeauducq f4d8f77268 turn kasli_tester into a frontend tool 2020-01-21 16:13:04 +08:00
Sebastien Bourdeauducq bfcbffcd8d update smoltcp
This disables the 'log' features which does not compile, and may break net_trace. To be investigated later.
2020-01-21 13:58:23 +08:00
Sebastien Bourdeauducq 82cdb7f933 typo 2020-01-21 10:07:13 +08:00
Robert Jördens 248230a89e fastino: style 2020-01-20 13:25:00 +01:00
Robert Jördens c45a872cba fastino: fix init, set_cfg 2020-01-20 13:25:00 +01:00
Robert Jördens 2c4e5bfee4 fastino: add [WIP] 2020-01-20 13:25:00 +01:00
Sebastien Bourdeauducq 8f9948a1ff kasli_sawgmaster: add basemod programming example 2020-01-20 20:14:24 +08:00
Sebastien Bourdeauducq e427aaaa66 basemod_att: fix imports 2020-01-20 20:14:24 +08:00
Sebastien Bourdeauducq 62a52cb086 sayma: do not pollute the log with DAC status on success 2020-01-20 20:14:24 +08:00
Sebastien Bourdeauducq 6b428ef3be sayma: initialize DAC before testing jesd::ready 2020-01-20 20:14:24 +08:00
Robert Jördens 7ab0282234 adf5355: style 2020-01-20 13:13:08 +01:00
Robert Jördens 9368c26d1c mirny: add to manual 2020-01-20 13:13:08 +01:00
Etienne Wodey da531404e8 artiq_ddb_template: add Mirny support
Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
2020-01-20 13:13:08 +01:00
Robert Jördens 01a6e77d89 mirny: add
* This targets unrelease CPLD gateware (https://github.com/quartiq/mirny/issues/1)
* includes initial coredevice driver, eem shims, and kasli_generic tooling
* addresses the ARTIQ side of #1130
* Register abstraction to be written

Signed-off-by: Robert Jördens <rj@quartiq.de>
2020-01-20 13:13:08 +01:00
Sebastien Bourdeauducq ec03767dcf sayma: improve DAC status report 2020-01-20 18:22:06 +08:00
Sebastien Bourdeauducq 5c299de3b4 sayma: print DAC status on JESD not ready error 2020-01-20 18:21:29 +08:00
Sebastien Bourdeauducq 45efee724e sayma: add JESD204 PHY done diagnostics 2020-01-20 12:47:31 +08:00
Sebastien Bourdeauducq 6c3e71a83a wrpll: cleanup 2020-01-18 09:43:43 +08:00
Sebastien Bourdeauducq 344f8bd12a wrpll: collector patch from Weida 2020-01-18 09:42:58 +08:00
Sebastien Bourdeauducq 833f428391 sayma: fix hmc542 to/from mu 2020-01-16 09:10:32 +08:00
Sebastien Bourdeauducq 6c948c7726 sayma: RF switch control is active-low on Basemod, invert 2020-01-16 08:59:52 +08:00
Sebastien Bourdeauducq 50302d57c0 wrpll: more careful I2C timing 2020-01-14 20:03:46 +08:00
Sebastien Bourdeauducq 105dd60c78 wrpll: ADPLLProgrammer mini test bench and fixes 2020-01-14 16:52:25 +08:00
Sebastien Bourdeauducq 3242e9ec6c wrpll: loop test 2020-01-13 22:31:57 +08:00
Sebastien Bourdeauducq 8ec0f2e717 wrpll: implement ADPLLProgrammer 2020-01-13 22:30:11 +08:00
Sebastien Bourdeauducq d5895b8999 wrpll: adpll -> set_adpll 2020-01-13 20:46:36 +08:00
Sebastien Bourdeauducq e7ef23d30c wrpll: use CONFIG_CLOCK_FREQUENCY and rtio_frequency in trim_dcxos 2020-01-13 20:44:15 +08:00
Sebastien Bourdeauducq ea3bce6fe3 wrpll: wait for settling time after setting ADPLL 2020-01-13 20:43:34 +08:00
Sebastien Bourdeauducq d685619bcd wrpll: collector code modifications from Weida 2020-01-13 20:42:41 +08:00
Sebastien Bourdeauducq 9d7196bdb7 update copyright year 2020-01-13 19:33:44 +08:00
Sebastien Bourdeauducq e87d864063 wrpll: print ADPLL offsets 2020-01-13 19:32:30 +08:00
Sebastien Bourdeauducq 8edbc33d0e wrpll: calculate initial ADPLL offsets 2020-01-13 19:29:10 +08:00
Sebastien Bourdeauducq 9dd011f4ad firmware: remove bitrotten Sayma code 2020-01-13 18:47:54 +08:00
Sebastien Bourdeauducq 583a18dd5f firmware: expose fmod to kernels. Closes #1417 2020-01-10 14:33:02 +08:00
David Nadlinger d8c81d6d05 compiler: Other types microoptimisations
Interestingly enough, these actually seem to give a measurable
speedup (if small – about 1% improvement out of 6s whole-program
compile-time in one particular test case).

The previous implementation of is_mono() had also interesting
behaviour if `name` wasn't given; it would test only for the
presence of any keys specified via keyword arguments,
disregarding their values. Looking at uses across the current
ARTIQ codebase, I could neither find a case where this would
have actually been triggered, nor any rationale for it.

With the short-circuited implementation from this commit,
is_mono() now checks name/all of params against any specified
conditions.
2020-01-01 08:49:19 +00:00
David Nadlinger 2c34f0214b compiler: Short-circuit Type.unify() with identical other type
This considerably improves performance; ~15% in terms of total
artiq_run-to-kernel-compiled duration in one test case.
2020-01-01 08:49:19 +00:00
Robert Jördens eebae01503 artiq_client: add back quiet-verbose args for submission
close #1416
regression introduced in 3fd6962
2019-12-31 13:00:26 +01:00
Sebastien Bourdeauducq 3f32d78c0e wrpll: simple ADPLL test 2019-12-31 12:12:29 +08:00
Sebastien Bourdeauducq bb04b082a7 wrpll: clarify comment 2019-12-31 12:12:29 +08:00
David Nadlinger 1e864b7e2d coredevice/suservo: Add separate methods for setting only the IIR offset 2019-12-30 20:02:22 +00:00
Sebastien Bourdeauducq a666766f38 wrpll: add ADPLL offset registers 2019-12-30 22:19:42 +08:00
Sebastien Bourdeauducq 5c6e394928 ddmtd: add collector 2019-12-30 22:17:44 +08:00
Sebastien Bourdeauducq 642a305c6a wrpll: remove unnecessary delay
Counting now happens in the sys domain with no CDC between counter and CPU.
2019-12-30 20:01:06 +08:00
Sebastien Bourdeauducq f57f235dca wrpll: new frequency meter
As per Mattermost discussion with Tom.
2019-12-30 19:47:57 +08:00
Sebastien Bourdeauducq 9e15ff7e6a wrpll: improve DDMTD deglitcher 2019-12-30 16:56:06 +08:00
Sebastien Bourdeauducq dfad27125e runtime: relax/fix TCP keepalive settings (#1125) 2019-12-23 19:58:10 +08:00
Sebastien Bourdeauducq b5e1bd3fa2 coredevice: simplify/cleanup network connection code
This removes:
* host-side keepalive, which turns out not to be required
* custom connection timeout (the default is OK)
* SSH tunneling support (doesn't seem to be actually used anywhere)
2019-12-23 19:53:49 +08:00
David Nadlinger e8b9fcf0bb
doc/manual/developing: Clarify Nix PYTHONPATH usage
PYTHONPATH should still contain all the other directories
(obvious once you've made that mistake once, of course).
2019-12-23 00:50:03 +00:00
David Nadlinger af31c6ea21 coredevice: Don't use `is` to compare with integer literal
This works on CPython, but is not guaranteed to do so, and
produces a warning since 3.8 (see https://bugs.python.org/issue34850).
2019-12-22 05:46:41 +00:00
Sebastien Bourdeauducq fb2076a026 basemod_att: add dB functions, document 2019-12-21 14:56:41 +08:00
Sebastien Bourdeauducq b2480f0edc artiq_flash: update actions documentation 2019-12-21 14:18:28 +08:00
Sebastien Bourdeauducq d4e039cede basemod: add coredevice driver 2019-12-21 14:18:10 +08:00
Sebastien Bourdeauducq 106d25b32a kasli_sawgmaster: fix drtio_is_up 2019-12-21 14:17:52 +08:00
Sebastien Bourdeauducq 8759c8d360 shiftreg: fix get method 2019-12-21 14:17:22 +08:00
Sebastien Bourdeauducq c3030f4ffb kasli_sawgmaster: update device_db for BaseMod 2019-12-20 19:59:15 +08:00
Sebastien Bourdeauducq cab8c8249e coredevice/shiftreg: add get method 2019-12-20 18:58:50 +08:00
Sebastien Bourdeauducq b7f1623197 sayma_rtm: connect attenuator shift registers in series 2019-12-20 18:58:31 +08:00
Sebastien Bourdeauducq c5137eeb62 firmware: remove legacy hmc542 code 2019-12-20 15:25:55 +08:00
Sebastien Bourdeauducq 1c9cbe6285 sayma_rtm: add basemod attenuators on RTIO 2019-12-20 15:25:55 +08:00
David Nadlinger 8f518c6b05 compiler: Allow `None` in type hints
Similar to how Python itself interprets None as type(None),
make it translate to TNone in ARTIQ compiler type hints.
2019-12-19 09:36:45 +08:00
David Nadlinger 594ff45750 compiler: Revert support for `None` as `TNone`
This was mistakenly included in fb2b634c4a, and broke the test
case verifying that using None as an ARTIQ type annotation in fact
generates an error message.
2019-12-18 13:23:40 +00:00
David Nadlinger fb2b634c4a compiler, language: Implement @kernel_from_string
With support for polymorphism (or type erasure on pointers to
member functions) being absent in the ARTIQ compiler, code
generation is vital to be able to implement abstractions that
work with user-provided lists/trees of objects with uniform
interfaces (e.g. a common base class, or duck typing), but
different concrete types.

@kernel_from_string has been in production use for exactly
this use case in Oxford for the better part of a year now
(various places in ndscan).

GitHub: Fixes #1089.
2019-12-18 10:51:04 +08:00
Sebastien Bourdeauducq 6ee15fbcae sayma_rtm: basemod RF switches 2019-12-18 10:33:29 +08:00
David Nadlinger d3508b014f firmware: Add whitespace between panic handler location and message 2019-12-17 19:59:59 +00:00
David Nadlinger 0279a60a55 examples: Add README
This will be displayed by GitHub below the directory listing, and was
inspired by observing new users disregard the examples/ tree entirely
(even though the experiments and device DBs within would have cleared
up their getting-started confusion) due to the perceived complexity
wall induced by the wealth of subdirectories.
2019-12-17 13:35:19 +00:00
Sebastien Bourdeauducq 5fefdcc324 manual: clarify XY applet setup example 2019-12-15 10:41:58 +08:00
Sebastien Bourdeauducq 8d13aeb96c test: run test_help for browser and dashboard 2019-12-12 10:34:58 +08:00
Sebastien Bourdeauducq ac09f3a5da artiq_browser: fix command line argument handling. Closes #1404 2019-12-11 16:18:56 +08:00
Sebastien Bourdeauducq 52112d54f9 kasli_generic: expose peripheral_processors dictionary. Closes #1403 2019-12-10 10:30:06 +08:00
Sebastien Bourdeauducq 6f52540569 wrpll: fix previous commit 2019-12-09 20:13:55 +08:00
Sebastien Bourdeauducq 13486f3acf wrpll: swap helper/main si549 frequencies 2019-12-09 19:49:34 +08:00
Sebastien Bourdeauducq 150a02117c sayma_rtm: drive clk_src_ext_sel 2019-12-09 19:47:50 +08:00
Sebastien Bourdeauducq 307a6ca140 gth_ultrascale: make OBUFDS_GTE3 work
https://www.xilinx.com/support/answers/67919.html
2019-12-09 18:13:22 +08:00
Sebastien Bourdeauducq f7a5df8d81 wrpll: add diagram from Weida 2019-12-09 17:41:44 +08:00
Sebastien Bourdeauducq 4919fb8765 wrpll: print DDMTD helper tags 2019-12-09 17:39:22 +08:00
Sebastien Bourdeauducq 0d4eccc1a5 wrpll: improve debug output 2019-12-09 17:23:09 +08:00
Sebastien Bourdeauducq f633c62e8d wrpll: speed up si549 i2c access 2019-12-09 17:22:58 +08:00
Sebastien Bourdeauducq 14e09582b6 wrpll: work around si549 not working when lsdiv=2 2019-12-09 16:20:08 +08:00
Sebastien Bourdeauducq 439576f59d wrpll: fix Si549 initialization delays 2019-12-09 16:13:57 +08:00
Sebastien Bourdeauducq 2b5213b013 wrpll: constrain clocks 2019-12-09 12:26:44 +08:00
Sebastien Bourdeauducq 05e2e1899a wrpll: update OBUFDS_GTE2 comment
Seems O can fan out simultaneously to transceiver and fabric.
Kasli is using ODIV2 for no particular reason.
2019-12-09 11:58:54 +08:00
Sebastien Bourdeauducq 4148efd2ee wrpll: implement filters and connect to Si549 2019-12-09 11:47:29 +08:00
Sebastien Bourdeauducq d43fe644f0 wrpll: stabilize DDMTDSamplerGTP 2019-12-09 11:47:14 +08:00
Sebastien Bourdeauducq 0499f83580 wrpll: helper clock sanity check 2019-12-08 23:46:33 +08:00
Sebastien Bourdeauducq 46a776d06e sayma: introduce WRPLL on RTM 2019-12-08 15:30:00 +08:00
Sebastien Bourdeauducq f35f658bc5 artiq_flash: rework RTM management 2019-12-08 15:29:31 +08:00
Sebastien Bourdeauducq bcd061f141 artiq_flash: RTM is a regular DRTIO satellite, can be used with all variants 2019-12-08 15:12:04 +08:00
Sebastien Bourdeauducq 883310d83e sayma_rtm: si5324 -> cdrclkc 2019-12-08 14:26:05 +08:00
Sebastien Bourdeauducq 57a5bea43a sayma_rtm: support setting RTIO frequency 2019-12-08 11:45:31 +08:00
Sebastien Bourdeauducq da9237de53 wrpll: support differential DDMTD inputs 2019-12-07 18:18:57 +08:00
Paweł Kulik 3851a02a3a Added option of flashing only RTM gateware.
Signed-off-by: Paweł Kulik <pawel.kulik@creotech.pl>
2019-12-07 09:31:19 +08:00
Paweł Kulik 14e250c78f Enabled internal pullup for CML SYSREF outputs, otherwise there is no signal on them.
Signed-off-by: Paweł Kulik <pawel.kulik@creotech.pl>
2019-12-07 09:30:24 +08:00
Sebastien Bourdeauducq 7098854b0f wrpll: share DDMTD counter 2019-12-04 19:05:56 +08:00
Robert Jördens 05c5fed07d suservo: stray comma 2019-12-03 08:38:07 +00:00
Robert Jördens 56074cfffa suservo: support operating with one urukul
implemented by wiring up the second Urukul to dummy pins

Signed-off-by: Robert Jördens <rj@quartiq.de>
2019-12-02 11:30:20 +01:00
Robert Jördens 86e1924493 kasli_generic: support external reference on masters 2019-11-30 07:34:41 +00:00
Sebastien Bourdeauducq eb271f383b wrpll: add DDMTD cores 2019-11-28 22:03:50 +08:00
Sebastien Bourdeauducq 39d5ca11f4 si549: increase I2C frequency 2019-11-28 22:03:26 +08:00
Sebastien Bourdeauducq 87894102e5 si549: use recommended i2c read sequence 2019-11-28 17:49:02 +08:00
Sebastien Bourdeauducq 2e55e39ac7 wrpll: use spaces to indent 2019-11-28 17:40:25 +08:00
Sebastien Bourdeauducq 354d82cfe3 wrpll: drive helper clock domain 2019-11-28 17:40:00 +08:00
Sebastien Bourdeauducq 4a03ca928d artiq_flash: sayma fixes 2019-11-28 17:38:29 +08:00
Sebastien Bourdeauducq 68cab5be8c si549: cleanups 2019-11-28 16:36:59 +08:00
Sebastien Bourdeauducq bcd2383c9d wrpll: si549 initialization 2019-11-27 22:58:08 +08:00
Sebastien Bourdeauducq 4832bfb08c wrpll: i2c functions, select_recovered_clock placeholder 2019-11-27 21:21:00 +08:00
Sebastien Bourdeauducq 449d2c4f08 libboard_misoc: fix !has_i2c 2019-11-27 21:04:28 +08:00
Robert Jördens e0687b77f5 si5324: 10 MHz ext_ref_frequency
* close #1254
* tested on innsbruck2 kasli variant
* sponsored by Uni Innsbruck/AQT

Signed-off-by: Robert Jördens <rj@quartiq.de>
2019-11-22 18:29:12 +01:00
Sebastien Bourdeauducq c536f6c4df sayma_amc: output ddmtd_rec_clk 2019-11-20 19:16:04 +08:00
Sebastien Bourdeauducq ae50da09c4 drtio/gth_ultrascale: support OBUFDS_GTE3 2019-11-20 19:15:50 +08:00
Sebastien Bourdeauducq fe0c324b38 sayma: integrate si549 core 2019-11-20 17:37:16 +08:00
Sebastien Bourdeauducq fa41c946ea wrpll: si549 fixes 2019-11-20 17:04:24 +08:00
Sebastien Bourdeauducq c5dbab1929 gateware: move wrpll to drtio 2019-11-20 14:43:08 +08:00
gthickman 56d4b70e01 ad9910 osk (#1387)
* updated adoo10.py for RAM mode frequency control

* updated docstrings for set_cfr1() in ad9910.py

* fixed typo in ad9910.py

* added docstrings to ad9910.py

* removed OSK-related changes in AD9910, to be included in a separate branch.

* updated AD9910 set_cfr1 for control of OSK mode parameters

* updated AD9910 set_cfr1() for control of OSK mode parameters.
2019-11-18 15:57:26 +01:00
Fabian Schmid f73e2a3d30 doc: clarify urukul attenuator behavior
Closes #1386

Signed-off-by: Fabian Schmid <fabian.schmid@mpq.mpg.de>
2019-11-18 15:56:00 +01:00
Sebastien Bourdeauducq f330e285fb DEVELOPER_NOTES: update board lockfile info 2019-11-18 15:26:51 +08:00
Sebastien Bourdeauducq 9f459f37dc doc: NDSP URLs, mention contributions can be added to list
Closes #1389
2019-11-18 13:03:44 +08:00
Sebastien Bourdeauducq ac8a5b60c0 doc: add sipyco to mock modules 2019-11-18 08:37:44 +08:00
Sébastien Bourdeauducq b7292f0195
RELEASE_NOTES: fix rst formatting further 2019-11-15 15:59:24 +08:00
Sébastien Bourdeauducq cf6a7f243f
RELEASE_NOTES: fix rst formatting 2019-11-15 15:56:17 +08:00
Sebastien Bourdeauducq 57979da59a RELEASE_NOTES: add ARTIQ-6 section 2019-11-15 13:49:54 +08:00
Sebastien Bourdeauducq 3adc799785 update GUI background 2019-11-15 13:49:09 +08:00
Sebastien Bourdeauducq eefc6ae80d update release notes 2019-11-15 13:07:16 +08:00
Sebastien Bourdeauducq 310a627e16 doc: mention toptica-lasersdk-artiq conda package 2019-11-14 23:53:13 +08:00
Sebastien Bourdeauducq 9b6b683d87 update MAJOR_VERSION 2019-11-14 17:16:50 +08:00
Sebastien Bourdeauducq 6bb931a17b manual: point to beta Nix channel 2019-11-14 17:04:46 +08:00
Sebastien Bourdeauducq 29d84f5655 add beta version marker 2019-11-14 16:56:03 +08:00
Sebastien Bourdeauducq db13747279 fix device_db alias corner case bugs. Closes #1140 2019-11-14 16:22:45 +08:00
Sebastien Bourdeauducq 4707aef45c split out artiq-comtools 2019-11-14 15:21:51 +08:00
Sebastien Bourdeauducq 7a92f443c2 doc: fix heading 2019-11-14 12:22:59 +08:00
Sebastien Bourdeauducq 3f10363b01 install-with-conda: explain board packages further 2019-11-14 12:07:16 +08:00
Sebastien Bourdeauducq 4416378d21 frontend: add --version to common tools 2019-11-14 11:42:31 +08:00
Garrett f8a7e278b8 removed OSK-related changes in AD9910, to be included in a separate branch. 2019-11-12 19:07:05 +01:00
Garrett 3a19ba7e62 added docstrings to ad9910.py 2019-11-12 19:07:05 +01:00
Garrett 4ad3651022 fixed typo in ad9910.py 2019-11-12 19:07:05 +01:00
Garrett 6d34eb3bb0 updated docstrings for set_cfr1() in ad9910.py 2019-11-12 19:07:05 +01:00
Garrett 61ca46ec3f updated adoo10.py for RAM mode frequency control 2019-11-12 19:07:05 +01:00
Sebastien Bourdeauducq fd7081830c remove fire_and_forget (moved to sipyco) 2019-11-12 19:43:04 +08:00
Sebastien Bourdeauducq e65303cfe9 RELEASE_NOTES: sipyco 2019-11-11 12:24:50 +08:00
Sebastien Bourdeauducq 3fd6962bd2 use sipyco (#585) 2019-11-10 15:55:17 +08:00
Sebastien Bourdeauducq 6644903843 bootloader: fix imports 2019-11-06 14:45:55 +08:00
Sebastien Bourdeauducq 5279bc275a urukul: rework EEPROM synchronization. Closes #1372 2019-11-05 18:56:10 +08:00
David Nadlinger bc3b55b1a8 gateware/eem: Force IOB=TRUE on Urukul SYNC output
Without this, the final register in the SYNC signal TTLClockGen
isn't (always) placed in the I/O tile, leading to more jitter
than necessary, and causing "double window" artefacts. See
sinara-hw/Urukul#16 for more details.

(Patch based on work by Weida Zhang, testing by various members
of the community in Oxford and elsewhere.)
2019-11-05 17:14:07 +08:00
Sebastien Bourdeauducq b25a17fa37 netboot: support slave FPGA loading 2019-11-05 16:28:49 +08:00
Sebastien Bourdeauducq 307f39e900 remoting: fix multiuser access. Closes #1383 2019-11-05 15:46:07 +08:00
Sebastien Bourdeauducq 9dc82bd766 bootloader: add no_flash_boot config option to force network boot 2019-11-05 15:31:08 +08:00
Sebastien Bourdeauducq e2f9f59472 artiq_flash: fix flashing Sayma RTM from package 2019-11-05 15:19:01 +08:00
Sebastien Bourdeauducq 98854473dd sayma_amc: use all transceivers on master (#1230) 2019-11-02 12:12:32 +08:00
Sebastien Bourdeauducq 29b4d87943 firmware: add cargosha256.nix 2019-11-01 10:28:41 +08:00
Sebastien Bourdeauducq 5362f92b39 bootloader: disable minimum stack space check in linker script
* The value varies greatly whether netboot is enabled or not.
* There is no simple solution to detect has_ethmac in the linker script and set the value accordingly.
* The space check is an imperfect solution that will be superseded by stack pointer limits.
* Left commented out so we can re-enable it manually during development if stack corruption is suspected.
2019-11-01 10:25:14 +08:00
Sebastien Bourdeauducq deadfead2a bootloader: fix !has_ethmac 2019-11-01 10:19:08 +08:00
Sebastien Bourdeauducq 42af76326f kasli: enlarge integrated CPU SRAM for DRTIO masters
Required by the bootloader netboot support.
2019-11-01 10:15:13 +08:00
Sebastien Bourdeauducq a78e493b72 firmware: load slave FPGA in bootloader 2019-10-31 12:42:40 +08:00
Sebastien Bourdeauducq 389a8f587a slave_fpga: modularize 2019-10-31 11:50:53 +08:00
Sebastien Bourdeauducq 9a35a2ed81 test_frontends: update 2019-10-30 22:02:16 +08:00
Sebastien Bourdeauducq bc050fdeec bootloader: treat zero-length firmware in flash as no firmware 2019-10-30 21:46:06 +08:00
Sebastien Bourdeauducq 228e44a059 sayma: enable Ethernet on DRTIO satellite variant
So that netboot can be used in bootloader.
2019-10-30 21:39:00 +08:00
Sebastien Bourdeauducq dc71039934 sayma, metlino: increase integrated_sram_size on Ethernet-enabled variants 2019-10-30 21:36:00 +08:00
Sebastien Bourdeauducq 3042476230 artiq_netboot: remove unnecessary import 2019-10-30 21:29:33 +08:00
Sebastien Bourdeauducq c96de7454d remove artiq_devtool 2019-10-30 21:27:24 +08:00
Sebastien Bourdeauducq 88dbff46f4 add netboot tool 2019-10-30 21:24:51 +08:00
Sebastien Bourdeauducq 462cf5967e bootloader: add netboot support 2019-10-30 21:23:42 +08:00
Robert Jördens 1f15e55021 comm_analyzer: don't assume every message has data
close #1377
2019-10-28 15:35:44 +01:00
David Nadlinger 611bcc4db4 compiler: Cache expensive target data layout queries
On one typical experiment, this shaves about 3 seconds (~25%)
off the overall kernel compilation time.

GitHub: Closes #1370.
2019-10-28 11:09:25 +00:00
David Nadlinger 5d7f22ffa4 compiler: Remove provision for unused four-parameter llptr_to_var() form [nfc]
`var_type` was presumably intended to convert to a target type,
but wasn't actually acted on in the function body (nor was it
used anywhere in the codebase).
2019-10-28 11:02:46 +00:00
Sebastien Bourdeauducq f2f7170d20 hmc7043: use recommend I/O standards
https://github.com/sinara-hw/Sayma_RTM/issues/116#issuecomment-544187952
2019-10-21 22:56:10 +08:00
Sebastien Bourdeauducq 47a83c71f1 firmware: more readable network addresses message 2019-10-21 14:00:14 +08:00
Sebastien Bourdeauducq 818d6b2f5a bootloader: fix compilation problems 2019-10-21 13:28:17 +08:00
Sebastien Bourdeauducq 8f76a3218e firmware: move i2c to libboard_misoc, enable IPv6 in bootloader, share network settings 2019-10-21 12:58:52 +08:00
Sebastien Bourdeauducq 1c5e749036 satman: remove compilation warning without JESD DACs 2019-10-21 12:53:54 +08:00
Sebastien Bourdeauducq d26d80410e runtime: refactor network settings 2019-10-19 17:56:35 +08:00
Sebastien Bourdeauducq 6d5dcb4211 runtime: enable IPv6. Closes #349 2019-10-19 17:20:33 +08:00
Sebastien Bourdeauducq 05e8f24c24 sayma2: JESD204 synchronization 2019-10-18 23:28:47 +08:00
Sebastien Bourdeauducq 62b49882b9 examples/kc705: fix dds_test 2019-10-17 07:37:00 +08:00
Sebastien Bourdeauducq a8f85860c4 coreanalyzer: AD9914 fixes (#1376) 2019-10-17 07:29:33 +08:00
Sebastien Bourdeauducq d42ff81144 examples/sayma_master: update device_db 2019-10-16 18:49:25 +08:00
Sebastien Bourdeauducq 8fa3c6460e sayma_amc: set direction of external TTL buffer according to RTIO PHY OE 2019-10-16 18:48:50 +08:00
Sebastien Bourdeauducq 37d0a5dc19 rtio/ttl: expose OE 2019-10-16 18:48:20 +08:00
Sebastien Bourdeauducq bc060b7f01 style 2019-10-16 18:18:11 +08:00
Sebastien Bourdeauducq 40d64fc782 sayma: remove standalone examples (no longer supported) 2019-10-16 17:54:39 +08:00
Sebastien Bourdeauducq 21a1c6de3f sayma: use SFP0 for DRTIO master 2019-10-16 17:53:40 +08:00
Sebastien Bourdeauducq 6cf06fba7b examples: use default IP addresses for boards 2019-10-16 16:18:30 +08:00
Tim Ballance c64c8b4ddc manual: RTIO sequence error notes (#1311) 2019-10-12 10:04:37 +08:00
David Nadlinger 371388ecbe doc: Re-fix ARTIQ type hint formatting (#714)
This adapts the previous monkey patch for the changed location of the
attribute rendering code in Sphinx 2.0.
2019-10-11 17:44:38 +01:00
Sebastien Bourdeauducq 9c5ff4fc04 manual: Nix bug 2709 fixed in Nix 2.3 2019-10-10 11:29:48 +08:00
Sebastien Bourdeauducq 3aade3b59a manual: now building for nixpkgs 19.09 2019-10-10 10:55:44 +08:00
Sebastien Bourdeauducq 314d9b5d06 kasli: default to 125MHz frequency for DRTIO
This is the consistent and most common option. Sayma will also eventually move to it.
2019-10-08 12:59:52 +08:00
Sebastien Bourdeauducq 4df2c5d1fb sayma: prepare for SYSREF align
We will try DDMTD on the AMC first, as this is simpler and perhaps will work on v2 after the power supply fixes.
2019-10-08 12:30:47 +08:00
Sebastien Bourdeauducq 5ee81dc643 satman: define constants for JdacBasicRequest reqnos 2019-10-08 10:27:04 +08:00
Sebastien Bourdeauducq 4b3baf4825 firmware: run PRBS and STPL JESD204 tests 2019-10-08 00:10:36 +08:00
Sebastien Bourdeauducq 03007b896e sayma_amc: sma -> mcx 2019-10-07 20:31:35 +08:00
Sebastien Bourdeauducq ebd5d890f1 satman: check for JESD ready 2019-10-06 23:10:57 +08:00
Sebastien Bourdeauducq 90e3b83e80 hmc7043: turn on AMC_FPGA_SYSREF1
Florent's JESD core won't work at all without.
2019-10-06 22:49:00 +08:00
Sebastien Bourdeauducq 97a0dee3e8 jesd204: remove ibuf_disable
We use the MOSFET to mute the HMC7043 noise on hardware v2 instead.
2019-10-06 22:26:31 +08:00
Sebastien Bourdeauducq 1bc7743e03 sayma: fix hmc7043 output settings for v2 hardware 2019-10-06 21:50:29 +08:00
Sebastien Bourdeauducq a421820a32 sayma: initialize DACs over DRTIO 2019-10-06 21:42:45 +08:00
Sebastien Bourdeauducq f8e4cc37d0 sayma_rtm: reset and detect DACs 2019-10-06 20:15:27 +08:00
Sebastien Bourdeauducq f62dc7e1d4 sayma: refactor JESD DAC channel groups 2019-10-06 20:15:09 +08:00
Sebastien Bourdeauducq c4c884b8ce ad9154: simplify, focus on AD9154 config and do not include JESD 2019-10-06 20:07:02 +08:00
Sebastien Bourdeauducq fdba0bfbbc satman: move now-unrelated hmc830_7043 init away from DRTIO transceiver init 2019-10-06 19:22:46 +08:00
Sebastien Bourdeauducq 1c6c22fde9 sayma_amc: HMC830_REF moved to RTM side 2019-10-06 18:15:37 +08:00
Sebastien Bourdeauducq ad63908aff hmc830_7043: enable_fpga_ibuf -> unmute 2019-10-06 18:13:59 +08:00
Sebastien Bourdeauducq 5ad65b9d30 hmc830_7043: remove clock_mux 2019-10-06 18:13:27 +08:00
Sebastien Bourdeauducq e6ff44301b sayma_amc: cleanup (v2.0 only) 2019-10-06 18:11:43 +08:00
Sebastien Bourdeauducq e9b81f6e33 remove serwb
DRTIO is a better solution
2019-10-06 18:10:23 +08:00
Sebastien Bourdeauducq 7cd02d30b7 sayma_rtm_drtio: replace sayma_rtm 2019-10-06 17:59:53 +08:00
Sebastien Bourdeauducq b3b85135a3 sayma_rtm_drtio: add DDMTD core, move specific cores out of SatelliteBase 2019-10-06 17:59:11 +08:00
Sebastien Bourdeauducq 346c985347 sayma_rtm_drtio: use artiq_sayma folder 2019-10-06 17:30:08 +08:00
Sebastien Bourdeauducq e2a924449d artiq_flash: use DRTIO RTM gateware 2019-10-06 17:28:14 +08:00
Sebastien Bourdeauducq 4198033657 sayma_rtm_drtio: cleanup (v2.0 only) 2019-10-06 16:42:34 +08:00
Sebastien Bourdeauducq 5612b31860 sayma_rtm_drtio: add HMC clock chip and DAC control 2019-10-06 16:15:24 +08:00
Sebastien Bourdeauducq a8cf4c2b18 sayma_rtm: hwrev v2.0 by default 2019-10-06 13:25:30 +08:00
Sebastien Bourdeauducq 1bc5d44a7c artiq_flash: do not flash RTM gateware on Sayma variants that don't need it 2019-10-06 13:15:50 +08:00
Sebastien Bourdeauducq bb5ff46f7d Merge branch 'wrpll' 2019-10-05 10:24:11 +08:00
Sebastien Bourdeauducq 7b95814cf5 sayma_amc: refactor, add SimpleSatellite variant 2019-10-05 10:24:06 +08:00
Sebastien Bourdeauducq 58b7bdcecc sayma_amc: refactor RTM FPGA code 2019-10-05 10:24:06 +08:00
Sebastien Bourdeauducq 96fc4a21e8 sayma_amc: remove dummy FPGA pin assignment testing code 2019-10-05 10:24:06 +08:00
Tim Ballance ada3b39f4e Fix ad9910 ram mode asf scale error in polar mode 2019-10-04 20:14:41 +02:00
Tim Ballance 448080e71d Fix ad9910 ram mode asf scale error
RAM mode amplitude to ASF conversion should be << 18 rather than << 16
2019-10-04 20:14:41 +02:00
Sebastien Bourdeauducq 6aa68e1715 sayma_rtm2: select filtered clock from Si5324 2019-10-04 22:56:16 +08:00
Sebastien Bourdeauducq 6cb0f5de59 sayma_amc: enable DRTIO switching 2019-10-04 22:55:23 +08:00
Sebastien Bourdeauducq 0cf8a46bbd sayma_amc2: select filtered clock from Si5324 2019-10-04 21:28:26 +08:00
Sebastien Bourdeauducq 6f533727cb artiq_flash: use regular bscan_spi_xcku040 for Sayma
The modified version is no longer necessary on v2 boards, and breaks flash bank 1.
2019-10-04 17:50:45 +08:00
Sebastien Bourdeauducq 4c1fe1de0d environment: implement HasEnvironment.call_child_method (#1366) 2019-09-30 23:58:36 +08:00
Charles Baynham 0b1fb255a9 tools: Wrap Task _do() calls in a generic exception handler
Signed-off-by: Charles Baynham <charles.baynham@npl.co.uk>
2019-09-20 23:00:59 +08:00
Charles Baynham e50a6d5aaf worker_impy: ignore newline at start of experiment docstring 2019-09-20 22:10:49 +08:00
Robert Jördens f0e87d2e59 grabber: remove unused code 2019-09-20 15:26:12 +02:00
Sebastien Bourdeauducq 4e77be0511 firmware: add Cargo.lock header that newer cargo wants 2019-09-17 15:22:14 +08:00
Sebastien Bourdeauducq 694b85f37a doc: only one hydra build for conda packages 2019-09-13 09:43:12 +08:00
Charles Baynham b7abf2fb53 pyon: Handle inf in decoding 2019-09-12 09:46:05 +08:00
Sebastien Bourdeauducq 38fca01189 artiq_ddb_template: add su-servo support (#1343) 2019-09-11 15:52:25 +08:00
Sebastien Bourdeauducq 991c686d72 kasli_generic,eem: print RTIO channels in hex like artiq_ddb_template 2019-09-11 15:51:53 +08:00
Robert Jördens f4dd7e5e29 kasli_tester: init urukul channel before calibrating
Otherwise the DDS is not initialized and with a cold system it fails to
find IO_UPDATE edges.

Signed-off-by: Robert Jördens <rj@quartiq.de>
2019-09-11 07:16:35 +00:00
Sebastien Bourdeauducq 7492a59f6d kasli_generic: add SUServo support (#1343) 2019-09-11 11:12:48 +08:00
David Nadlinger 6d6f66338b runtime: Update core config panic_reset command suggestion message 2019-09-10 19:31:19 +01:00
Charles Baynham ddd34e5a9c influx_schedule: log repo_rev along with other info
Signed-off-by: Charles Baynham <charles.baynham@npl.co.uk>
2019-09-10 13:46:28 +02:00
Sebastien Bourdeauducq 98caaebade consistent use of 'class name' terminology to select a class within an experiment file. Closes #1348 2019-09-09 15:16:33 +08:00
Sebastien Bourdeauducq 21021beb08 kasli: remove opticlock (moved to kasli_generic) 2019-09-09 15:03:10 +08:00
Sebastien Bourdeauducq 436662be52 ddb_template: add Novogorny support 2019-09-09 15:00:45 +08:00
Sebastien Bourdeauducq 69c2acd9d7 ddb_template: sampler cnv is ttl not spi 2019-09-09 14:57:42 +08:00
Sebastien Bourdeauducq cfb5ef5548 kasli_generic: add Novogorny support 2019-09-09 14:54:34 +08:00
Sebastien Bourdeauducq 0b9168994f Revert "dashboard: Sort TTL moninj channels by name"
This reverts commit b3db3ea6fc.

Closes #1288
2019-09-06 11:17:10 +08:00
Charles Baynham d31f30a436 influxdb_schedule: fix typo in parameter name 2019-09-05 17:42:56 +02:00
Charles Baynham 7ac8feea19 influxdb_schedule: Handle all exceptions 2019-09-05 17:42:56 +02:00
Sebastien Bourdeauducq 1fb317778a eem/grabber: allow third EEM to be specified 2019-08-29 18:58:12 +08:00
Astro 90e8e074cd firmware: turn errors into &str for remote_i2c as well
should resolve breakage on a few targets/variants introduced by PR #1351
2019-08-29 09:05:47 +08:00
Astro 71b3c66af9 firmware: conditionally compile has_si5324
avoids unused warnings where this module is not used.
2019-08-29 09:04:54 +08:00
Sebastien Bourdeauducq 959679d8b7 wrpll: add I2CMasterMachine 2019-08-27 18:02:05 +08:00
Sebastien Bourdeauducq c03c35f375 Revert "compiler: armv7-unknown-linux-gnueabihf -> armv7-linux-gnueabihf"
rustc insists on -unknown.

This reverts commit cf47fa44d8.
2019-08-26 11:23:00 +08:00
Sebastien Bourdeauducq cf47fa44d8 compiler: armv7-unknown-linux-gnueabihf -> armv7-linux-gnueabihf 2019-08-26 11:12:49 +08:00
Sebastien Bourdeauducq 98cd9a539c compiler: support Cortex A9 target 2019-08-26 10:46:22 +08:00
Astro afe162ceca firmware: don't unwrap() but propagate pca9548 errors 2019-08-17 09:15:26 +08:00
Astro a8aabd3815 firwmare: turn i2c errors into &str 2019-08-17 09:15:26 +08:00
Astro 8fc5ce902f firmware: let kasli obtain default hardware_addr from i2c_eeprom 2019-08-17 09:15:26 +08:00
Astro d666f3d573 firmware: factor out mod pca9548 from si5324
orepares for further i2c devices.
2019-08-17 09:15:26 +08:00
Sebastien Bourdeauducq 1fd2322662 wrpll/thls: implement global writeback 2019-08-15 23:16:17 +08:00
Sebastien Bourdeauducq 24082b687e wrpll/filters: clean up and make compatible with thls 2019-08-15 17:58:22 +08:00
Sebastien Bourdeauducq 9331fafab0 wrpll/filters: new code from Weida 2019-08-15 17:24:40 +08:00
Sebastien Bourdeauducq 5c3974c265 wrpll/thls: fix opcode decoding 2019-08-15 17:12:48 +08:00
Sebastien Bourdeauducq 19620948bf wrpll/thls: implement signed numbers 2019-08-15 17:04:17 +08:00
Sebastien Bourdeauducq efc43142a6 wrpll/thls: implement min/max 2019-08-15 16:42:59 +08:00
Sebastien Bourdeauducq 44969b03ad wrpll/thls: rework instruction decoding 2019-08-15 15:55:13 +08:00
Sebastien Bourdeauducq 2776c5b16b wrpll/thls: support mulshift 2019-08-15 15:07:13 +08:00
Robert Jördens e9b78b62db kasli_tester/zotino: always alternate voltage sign
Before the voltages on a second Zotino would start 2.1, 1.9, 2.2, 1.8
..., 3.6, 0.4 and overlap with the voltages on the first.
Now the voltages are 2.1, -2.1, 2.2, -2.2, ..., 3.6, -3.6 which allows
quick identification of card/channel and easy prediction when deploying.
2019-08-06 17:38:55 +02:00
Sebastien Bourdeauducq 5f8acb3f96 manual: fix location of shell-dev.nix (#1346) 2019-08-05 13:34:35 +08:00
Sebastien Bourdeauducq f861459ace wrpll: add filter algorithms (WIP) 2019-08-02 13:23:16 +08:00
David Nadlinger 99e490f9ff coredevice/suservo: Slightly reword get_adc[_mu]() docstring for clarity
This hopefully suggests a bit better that the value is the last one
fetched by the servo (i.e. needs the servo active to update), rather
than somehow requesting a new sample to be taken.
2019-07-30 12:22:08 +01:00
David Nadlinger 4446ebf9ca README: Fix link to manual 2019-07-30 11:28:12 +01:00
Robert Jördens 3f0657f2a8 artiq_influxdb_schedule: add schedule logger
Signed-off-by: Robert Jördens <rj@quartiq.de>
2019-07-26 14:47:18 +02:00
Sebastien Bourdeauducq 7a5dcbe60e wrpll/thls: support processor start/stop 2019-07-24 18:51:33 +08:00
Sebastien Bourdeauducq b8870997d0 doc: clarify TTL direction control with buffered cards 2019-07-24 10:04:45 +08:00
Sebastien Bourdeauducq 623446f82c wrpll/thls: simple simulation demo 2019-07-20 18:50:57 +08:00
Sebastien Bourdeauducq 831b3514d3 wrpll/thls: stop at return statement 2019-07-19 16:27:29 +08:00
Sebastien Bourdeauducq 930291f606 update conda channel URL 2019-07-19 16:11:03 +08:00
Sebastien Bourdeauducq e95b7b9d4b manual: fix typos 2019-07-18 09:30:21 +08:00
Sebastien Bourdeauducq 75e8d54c27 install-with-conda: remove unnecessary import 2019-07-18 00:52:31 +08:00
Sebastien Bourdeauducq 2ffc843790 update installation instructions 2019-07-18 00:51:47 +08:00
David Nadlinger 280915d54f coredevice/suservo: Adjust T_CYCLE to match gateware
See GitHub #1338.
2019-07-17 00:20:22 +01:00
Sebastien Bourdeauducq 34222b3f38 wrpll: encode thls program 2019-07-09 17:56:14 +08:00
Sebastien Bourdeauducq 5f461d08cd wrpll: add simple thls compiler 2019-07-09 16:07:31 +08:00
Robert Jördens f7e10759dc suservo: note requirement to stop servo when accessing state
As already mentioned in the gateware.

One alternative would be to detect address collisions and
stall the read for one cycle.

Note that there will in general not be a consistent view of the servo
state unless the servo is stopped.

close #1337
2019-07-08 18:37:42 +02:00
Sebastien Bourdeauducq e4fff390a8 si590 -> si549
Had mistaken the part numbers.
2019-07-07 09:39:55 +08:00
Sebastien Bourdeauducq dceb5ae501 wrpll: Si590 I2C mux, CDC 2019-07-05 23:42:37 +08:00
Sebastien Bourdeauducq f8dba7ae35 rtio: use BlindTransfer from Migen 2019-07-05 18:46:18 +08:00
Robert Jördens 4d01410ce5 install-with-conda: notes on proxy 2019-07-04 14:04:32 +02:00
Robert Jördens 8407c526e8 install-with-conda: de-prioritize conda-forge 2019-07-04 11:19:55 +02:00
Sebastien Bourdeauducq 5a9bb0ecba runtime: fix incorrect 'RTIO clock failed' report 2019-06-24 23:33:13 +08:00
David Nadlinger 8bf9640185 coredevice/suservo: Fix output IIR state width in docstring 2019-06-21 11:27:39 +02:00
David Nadlinger 34f48f57cc coredevice/suservo: Fix {get,set}_y_mu() scaling
Previously, Channel.set_y(1) would set the output to -1 instead.
2019-06-21 11:27:39 +02:00
Sebastien Bourdeauducq f6edceb23d kasli_tester: cleanup/fix test skipping 2019-06-21 16:00:14 +08:00
whitequark b8b9fa51bd libdyld: accept objects with no rela relocations. 2019-06-17 06:43:34 +00:00
David Nadlinger 0353966ef7 gateware/suservo: Sign-extend data on RTIO read-back
See GitHub #1327 for original patch by Brad Bondurant.
2019-06-14 23:46:16 +01:00
David Nadlinger 720838a23e gateware/suservo: Avoid magic number for activation delay width
Mostly for documentation purposes; 8 bits ought to be enough for
everyone.
2019-06-14 23:45:40 +01:00
Robert Jördens 53789ba9aa tester: handle urukul switch differences 2019-06-14 10:54:00 +00:00
Robert Jördens 6655e567df ddb_template: urukul fixes
* fix/add sw (ad9912 and ad9910)
* allow pll_n to be changed
2019-06-14 10:53:03 +00:00
Sebastien Bourdeauducq 53c778ae2d runtime: fix previous commit 2019-06-14 15:53:01 +08:00
Sebastien Bourdeauducq a947867887 runtime: support Kasli Si5324 bypass via rtio_clock=e 2019-06-14 15:48:05 +08:00
Sebastien Bourdeauducq 66a66b03b4 style 2019-06-14 15:29:16 +08:00
Sebastien Bourdeauducq 87ce24e867 runtime: refactor startup and RTIO clocking initialization 2019-06-14 15:26:30 +08:00
Sebastien Bourdeauducq 43e58c939c sayma: drop MasterDAC
This seemed like a good idea then, but it introduces complexity, corner cases, and additional testing difficulties.

Now Sayma works fine with Kasli as a master, which is simpler.
2019-06-14 14:06:16 +08:00
Sebastien Bourdeauducq b04e15741b drop SI5324_SAYMA_REF 2019-06-14 14:03:48 +08:00
Sebastien Bourdeauducq 995a4428e7 attempt to fix disappearing 'question' issue template (2) 2019-06-14 11:37:00 +08:00
Sebastien Bourdeauducq 6b20d50639 attempt to fix disappearing 'question' issue template 2019-06-14 11:36:03 +08:00
Sebastien Bourdeauducq c68581537b remove outdated releasing instructions (#1326) 2019-06-14 11:31:41 +08:00
Sebastien Bourdeauducq 2183dcf23e update contributing and issue instructions 2019-06-14 11:31:41 +08:00
Robert Jördens 636b4cae5a tester: urukul single-eem mode 2019-06-13 12:48:42 +00:00
Robert Jördens 591de0e579 ddb_template: support urukul single-eem mode 2019-06-13 12:19:12 +00:00
Robert Jördens 967d192cbe ddb_template: wrong copy paste comma 2019-06-13 11:30:22 +00:00
Sebastien Bourdeauducq 8853cf8df9 dashboard: work around disappearing TTL/DDS panel bug. Closes #1307 2019-06-13 18:41:42 +08:00
Sebastien Bourdeauducq 1a898c423a aqctl_corelog: filter log messages. Closes #1316 2019-06-13 18:17:52 +08:00
Sebastien Bourdeauducq 836dc9b927 RELEASE_NOTES: remove '5.0' section (#1326) 2019-06-13 18:15:50 +08:00
Sebastien Bourdeauducq 834d03527b examples/dds_setter: fix RTIO underflow 2019-06-13 18:07:39 +08:00
Sebastien Bourdeauducq e3c58d5872 remove outdated kc705 examples 2019-06-13 18:06:26 +08:00
Sebastien Bourdeauducq 5008302f88 add major version file (#1326) 2019-06-13 14:00:44 +08:00
Sebastien Bourdeauducq 74e4b01201 urukul: document consequences of incorrect CPLD clock settings 2019-06-11 11:12:12 +08:00
Brad Bondurant adf3df2bb5 suservo coredevice driver: mask ftw to avoid erroneous sign extension 2019-06-03 21:40:04 +02:00
Sebastien Bourdeauducq 704b5c6305 manual: stop using cloud mathjax
cloudflare also uses cookies.
2019-05-22 19:17:14 +08:00
Sebastien Bourdeauducq bc2cfd77f5 metlino: add EEMs 2019-05-19 18:16:00 +08:00
Sebastien Bourdeauducq cdef50c0dd sayma_amc: Urukul v1.3 2019-05-19 16:54:38 +08:00
Sebastien Bourdeauducq 34c61db790 artiq_flash: fix Metlino support 2019-05-19 16:37:40 +08:00
Sebastien Bourdeauducq 88b6496c8c artiq_flash: add Metlino support 2019-05-19 16:30:10 +08:00
Sebastien Bourdeauducq 9dcaae6395 metlino: use variant output directory 2019-05-19 16:24:51 +08:00
Sebastien Bourdeauducq b4779969d0 metlino: work around vivado bug (#1230) 2019-05-19 11:27:27 +08:00
Sebastien Bourdeauducq 874542f33f add Metlino support 2019-05-19 10:57:43 +08:00
hartytp cfe1f56f73
suservo: add some more comments to the RTServoMem to clarify the RTIO interface (#1323) 2019-05-17 16:12:35 +01:00
Sebastien Bourdeauducq d9fc2847c1 manual: fix typo 2019-05-15 07:28:38 +08:00
David Nadlinger 84b91ee8bd master/scheduler: Document Deleter semantics [nfc]
From looking at the code, it wasn't obvious to me that this is
supposed to handle multiple calls to delete(). This is the case,
however, when for instance Scheduler.delete()ing a run, which
will then also be deleted again from AnalyzeStage.
2019-05-14 22:37:16 +01:00
David Nadlinger 76d4598971 manual/management_system: Reference RTIO manual with diagram; unify terminology
Other parts of the manual speak of "executing" RTIO events instead
of "triggering" them.
2019-05-14 20:35:06 +01:00
David Nadlinger d4275ea1e0 manual/rtio: Update Syncrhonization section following sync() removal 2019-05-14 20:27:06 +01:00
Marius Weber 1e01e6b834 Scheduler documentation: interaction between experiments (#1320) 2019-05-14 20:38:54 +08:00
hartytp c2b4f0cfe3
sync_struct: catch ConnectionErrors in _receive_cr (#1319) 2019-05-10 12:53:51 +01:00
hartytp bbcd1db025
sync_struct: replace ConnectionError subclasses with ConnectionError (#1318) 2019-05-10 12:48:12 +01:00
hartytp 30fe624fe5
sync_struct: flake8 [nfc] (#1317) 2019-05-10 12:42:06 +01:00
Sebastien Bourdeauducq 1a3d71760d consolidate kasli example folders 2019-05-10 12:17:38 +08:00
Sebastien Bourdeauducq f551491a84 remove sayma_masterdac example 2019-05-10 12:13:07 +08:00
Sebastien Bourdeauducq 72f7f8386f remove old Kasli device databases (#1289) 2019-05-10 12:11:42 +08:00
Sebastien Bourdeauducq f11bf43283 update README 2019-05-09 17:36:35 +08:00
Sebastien Bourdeauducq 86f462f40e artiq_ddb_template: add edge counter support 2019-05-09 17:20:13 +08:00
Sebastien Bourdeauducq fda3cb2482 kasli_generic: add edge counter support 2019-05-09 17:19:11 +08:00
Robert Jördens ead9a42842 kasli: remove VLBAIMaster, VLBAISatellite variants 2019-05-08 15:58:25 +00:00
Robert Jördens 0c9b810501 kasli: remove PTB/PTB2/LUH/HUB variants
see sinara-systems and nix-scripts repos
2019-05-08 15:51:18 +00:00
Robert Jördens 1d2cc60e0d kasli_generic: support ext_ref 2019-05-08 15:51:18 +00:00
Sebastien Bourdeauducq 086180812c manual: update link to nix-scripts repository. Closes #1314 2019-05-08 15:04:38 +08:00
Sebastien Bourdeauducq 7e7f463d11 manual: fix fs.com link 2019-05-07 22:19:23 +08:00
Sebastien Bourdeauducq 4e230bb768 manual: update core device section on Kasli 2019-05-07 20:19:13 +08:00
Sebastien Bourdeauducq 4fab405b36 manual: ligher mock for artiq.gui.applets. Closes #1293 2019-05-07 20:03:13 +08:00
Sebastien Bourdeauducq 948ea396c0 remove old buildbot kc705 device-db 2019-05-07 17:28:06 +08:00
Sebastien Bourdeauducq fa19b30313 remove old conda build recipes 2019-05-07 17:26:38 +08:00
Sebastien Bourdeauducq 3209197b0b artiq_flash: do not needlessly look for artifacts 2019-05-07 17:20:13 +08:00
Sebastien Bourdeauducq a1c97ec4dd kasli_tester: support selection of TTL output to use as stimulus 2019-05-07 16:58:00 +08:00
Sebastien Bourdeauducq 51c123bad8 manual: more polite conda warning 2019-04-27 09:35:09 +08:00
Sebastien Bourdeauducq b13961f246 manual: shorter nix-env command 2019-04-27 09:34:28 +08:00
Sebastien Bourdeauducq 4cc9bd33ce test: only test_rpc_timing actually requires ARTIQ_LOW_LATENCY 2019-04-24 11:22:07 +08:00
Sebastien Bourdeauducq 9ffb6867e2 manual: add links to NDSP docs 2019-04-23 14:24:39 +08:00
Sebastien Bourdeauducq 5bef72dbd6 manual: list NDSPs and their packages 2019-04-23 00:39:27 +08:00
Sebastien Bourdeauducq be99496124 manual: give more explanations about board packages 2019-04-23 00:09:48 +08:00
Sebastien Bourdeauducq d958b20bb8 remove asyncserial dependency 2019-04-20 10:51:29 +08:00
Sebastien Bourdeauducq 119f64243f manual: add warning about conda 2019-04-20 10:49:39 +08:00
Sebastien Bourdeauducq bb39eedf5b fix previous commit 2019-04-20 10:44:07 +08:00
Sebastien Bourdeauducq 93f4f31f45 devices.ctlmgr -> master.ctlmgr 2019-04-20 00:25:44 +08:00
Sebastien Bourdeauducq 2ada5227f0 update documentation after moving controllers out-of-tree (#887) 2019-04-20 00:21:54 +08:00
Sebastien Bourdeauducq deffb77a7e manual: fix TTL class reference 2019-04-20 00:17:10 +08:00
Sebastien Bourdeauducq 56033b60a7 move thorlabs_tcube out of tree (#887) 2019-04-20 00:09:58 +08:00
Sebastien Bourdeauducq 5613565293 remove lda docs 2019-04-19 23:55:23 +08:00
Sebastien Bourdeauducq eaec519ac8 move lda out of tree (#887) 2019-04-19 23:43:14 +08:00
Sebastien Bourdeauducq d4781e9a8a aqctl_corelog: add simulation mode 2019-04-19 23:42:37 +08:00
Sebastien Bourdeauducq 62e9b2d85e move novatech409b out of tree (#887) 2019-04-19 21:56:16 +08:00
Sebastien Bourdeauducq 4c1fb0c2a1 move korad_ka3005p out of tree (#887) 2019-04-19 19:47:41 +08:00
Sebastien Bourdeauducq 73d6078883 use IP instead of hostname for kc705-1
Makes it easier to run tests in the Windows VM
2019-04-18 22:59:32 +08:00
David Nadlinger 4d215cf541 firmware: Add Si5324 config for 125 MHz ext ref
PLL divider settings as suggested by DSPLLsim 5.1.
2019-04-15 22:22:19 +01:00
David Nadlinger dc7a642b26 test/lit: Make abs() integration test slightly more interesting
I had accidentally not included this local diff in the PR that was
merged as commit cdaf554736.

Doesn't include tests for any of the interesting edge cases yet
(nans, infinities, signed zero, int.min), some of which might be
handled differently than by the host Python. In particular, the
select condition should logically use copysign(arg, 1) for the
comparison (i.e., always clear the sign bit), but currently the
chance of anyone running FP-heavy algorithms where this would
matter on the core device is close to zero [1].

[1] Sign of your choice.
2019-04-14 04:12:40 +01:00
Sebastien Bourdeauducq b4b9ec50b5 nixpkgs 18.09 -> 19.03 2019-04-13 18:46:33 +08:00
David Nadlinger cdaf554736 compiler: Implement abs() for scalars
GitHub: Fixes #1303.
2019-04-13 13:39:16 +08:00
David Nadlinger 25e7e0c177 manual: Core device is typically "core", not "coredevice" 2019-04-13 01:25:51 +01:00
Sebastien Bourdeauducq 97b7ed557b sayma_amc: do not use SFP0 (now used for Ethernet) 2019-04-12 18:47:18 +08:00
Sebastien Bourdeauducq b8e2b82adb manual: fix openocd comment 2019-04-02 10:44:41 +08:00
Sebastien Bourdeauducq 4f6367d1c1 manual: fix matplotlib installation command 2019-04-02 10:41:40 +08:00
David Nadlinger cd7a5a3683 firmware: Fix kernel RPC handling of zero-size values (e.g. empty arrays) 2019-03-31 18:33:44 +01:00
David Nadlinger b4ddf4c86b firmware: Make "unexpected reply from kernel CPU" log messages unique
This makes it easier to localize issues based on the log output.
2019-03-31 18:31:56 +01:00
David Nadlinger 236b30ac5f coredevice: Add test for recent kernel RPC fixes
This covers all three (de)serialisation fixes.
2019-03-31 18:25:56 +01:00
David Nadlinger 88fd5c8440 compiler: Fix crash in escape analysis for assigning string literals 2019-03-31 17:10:27 +01:00
David Nadlinger 990e0b7dd9 compiler: Fix comparison of tuples of lists 2019-03-31 17:10:27 +01:00
David Nadlinger baf102dbb2 compiler: Fix comparison of nested lists 2019-03-31 17:10:27 +01:00
David Nadlinger 8e225433a5 firmware: Fix kernel RPC strings size (memory corruption)
Test case to follow.
2019-03-31 17:10:27 +01:00
David Nadlinger b8ff627be9 firmware: Fix kernel RPC tuple size calculation (memory corruption)
Test case to follow.
2019-03-31 17:10:27 +01:00
David Nadlinger fc95183e04 coredevice: Fix host-side serialization of (nested) lists
Test case to follow.
2019-03-31 17:10:27 +01:00
David Nadlinger f9af058b96 compiler: Quote tuples as TTuple values
Previously, they would end up being TInstances,
rendering them useless.
2019-03-31 23:40:21 +08:00
Sebastien Bourdeauducq 3634cfac86 typo 2019-03-31 22:27:07 +08:00
Sebastien Bourdeauducq 4580f3dac8 test/lit: support overriding libartiq_support.so 2019-03-31 22:26:09 +08:00
Chris Ballance 4499ef1748 kasli: only add moninj core if there are probes to monitor 2019-03-24 14:09:52 +08:00
Sebastien Bourdeauducq 5d31cf2268 sayma_rtm2: si5324_clkout -> cdr_clk_clean 2019-03-23 13:48:36 +08:00
Sebastien Bourdeauducq 560849e693 sayma_amc: add DRTIO transceiver on rtm_amc_link for v2 hardware 2019-03-23 13:41:22 +08:00
Sebastien Bourdeauducq bbb8c00518 sayma_amc: default to satellite variant 2019-03-23 13:37:55 +08:00
Sebastien Bourdeauducq 18fbe0b081 sayma_rtm_drtio: support v2 hardware 2019-03-23 13:31:28 +08:00
Sebastien Bourdeauducq c7205ad82f sayma_rtm: preliminary v2 support 2019-03-23 12:37:03 +08:00
Sebastien Bourdeauducq d07c6fcfea ad9910: handle unprogrammed EEPROM and numpy corner cases 2019-03-22 14:28:47 +08:00
Chris Ballance 7cdcaf0d00 tests: fix coredevice tests after implementing scheduler defaults 2019-03-22 07:27:55 +08:00
Sebastien Bourdeauducq 33b28f6e56 sayma_amc: add placeholder code to use DDMTD signals on v2 hardware 2019-03-21 17:37:22 +08:00
Sebastien Bourdeauducq 2ec5a58c59 sayma_amc: si5324_clkout -> cdr_clk_clean 2019-03-21 14:09:33 +08:00
Chris Ballance af785b9a9c artiq_compile: fix after adding scheduler defaults
Closes #1290
2019-03-21 09:56:19 +08:00
Sebastien Bourdeauducq 8d2c1be44f artiq_flash: ignore rtm_gateware on Sayma for variant autodetection 2019-03-17 15:57:50 +08:00
Sebastien Bourdeauducq c2622297bd urukul: use board_data instead of user_data to store calibration in EEPROM 2019-03-15 17:57:35 +08:00
Sebastien Bourdeauducq a01425bc9c kasli_tester: do not attempt to synchronize AD9912 Urukul 2019-03-15 17:13:29 +08:00
Sebastien Bourdeauducq adcd79ecb3 explain how to get nixpkgs version in issue template 2019-03-14 13:43:43 +08:00
Sebastien Bourdeauducq e61320d409 improve system-related questions in issue template 2019-03-14 13:24:35 +08:00
Chris Ballance fcf8828cb6 fix tests, artiq_run after implementing scheduler defaults (#1290) 2019-03-13 17:20:30 +01:00
Sebastien Bourdeauducq 5e7c83c9cf artiq_ddb_template: enable Urukul synchronization from EEPROM 2019-03-13 15:42:51 +08:00
Sebastien Bourdeauducq e504262b67 kasli_tester: calibrate Urukul synchronization and write to EEPROM 2019-03-13 15:36:05 +08:00
Sebastien Bourdeauducq 346299e7f8 kasli_tester: enable EEPROM for Urukul synchronization 2019-03-13 15:35:23 +08:00
Sebastien Bourdeauducq 04e0c23e78 ad9910: support reading synchronization values from EEPROM 2019-03-13 15:34:47 +08:00
Sebastien Bourdeauducq 852048dce4 artiq_ddb_template: create Urukul EEPROM device 2019-03-13 15:34:23 +08:00
Sebastien Bourdeauducq 964a349a19 add Kasli I2C driver 2019-03-13 15:33:50 +08:00
Chris Ballance 8a5789d616 RELEASE_NOTES: mention methods to set experiment pipeline/priority/flush defaults 2019-03-12 10:54:15 +01:00
Chris Ballance c56c3e5588 dashboard: add support for experiment pipeline/priority/flush defaults 2019-03-12 10:54:15 +01:00
Chris Ballance 8659c769cb master/language: add methods to set experiment pipeline/priority/flush defaults 2019-03-12 10:54:15 +01:00
Sebastien Bourdeauducq b2177eff81 kasli_tester: run test_i2c_switch 2019-03-11 21:06:28 +08:00
Sebastien Bourdeauducq 227c729f56 fix permissions 2019-03-11 20:43:28 +08:00
David Nadlinger b3db3ea6fc dashboard: Sort TTL moninj channels by name
With growing system complexity, the moninj channel index is
no longer a very intuitive ordering for typical end users.
2019-03-11 03:30:14 +01:00
David Nadlinger 5fd92a6175 gui: Fix crash when quickly opening/closing applets
Quickly closing/reopening applets (e.g. quickly clicking the checkbox
on an entire folder of applets) would previously lead to an occasional
KeyError on the self.dock_to_item access in on_dock_closed, as close()
would be invoked more than once.

The geometry/checked state handling can potentially be cleaned up
further, but at least this avoid the crash.
2019-03-10 20:57:10 +00:00
Sebastien Bourdeauducq e47ba4b35e kasli_generic: fix identifier string 2019-03-08 19:57:20 +08:00
Sebastien Bourdeauducq b219f8b5c7 artiq_flash: autodetect variant 2019-03-08 19:47:24 +08:00
Sebastien Bourdeauducq fc9d4c7bdc artiq_flash: fix sayma master detection 2019-03-08 19:36:35 +08:00
Sebastien Bourdeauducq 25bcebd1f6 artiq_flash: not all boards are development boards 2019-03-08 19:35:20 +08:00
Sebastien Bourdeauducq 3be5112363 manual: document artiq_flash -H dependency 2019-03-08 19:31:33 +08:00
Sebastien Bourdeauducq ed2d8dfa7a artiq_flash: resolve openocd symbolic links
On NixOS, openocd may be a symlink in /run/current-system/sw/bin when installed system-wide.
2019-03-08 12:43:06 +08:00
Sebastien Bourdeauducq b2bee3da96 manual: use artiq-env package with nix-env
The wrapper hack used by nix-env when installing a Python library directly breaks when Python subprocesses are created.
2019-03-06 23:02:03 +08:00
Sebastien Bourdeauducq 6ff7fce4bd manual: document some nix issues 2019-03-06 11:57:31 +08:00
Sebastien Bourdeauducq bffb1cf141 manual: suggest faster and less memory-intensive nix-env command
Simple "nix-env -i" is slow and runs out of memory on old computers.
https://github.com/NixOS/nix/issues/421
2019-03-05 21:23:04 +08:00
Sebastien Bourdeauducq 24a3b31f22 manual: use $ for shell prompts consistently 2019-03-04 11:06:20 +08:00
Sebastien Bourdeauducq 26dd4e5160 manual: document how to switch to nixpkgs release 2019-03-04 11:03:27 +08:00
Sebastien Bourdeauducq 0d86702503 manual: cleanup 2019-03-04 11:02:28 +08:00
Sebastien Bourdeauducq f65bcbcbb2 manual: clean up build and make compatible with python 3.7 2019-02-26 17:11:16 +08:00
Sebastien Bourdeauducq 0d05d4b813 artiq_client: python 3.7 compatibility 2019-02-26 17:09:38 +08:00
Sebastien Bourdeauducq ec966de007 thorlabs_tcube: cleanup 2019-02-26 16:50:19 +08:00
Sebastien Bourdeauducq ceead218bc manual: update metadata 2019-02-26 16:48:24 +08:00
Sebastien Bourdeauducq 4db115aef3 remove old nix instructions (merged into manual) 2019-02-26 16:46:01 +08:00
Sebastien Bourdeauducq 62c7f75a9e sayma_amc: support hardware revisions 2019-02-25 23:49:45 +08:00
Sebastien Bourdeauducq d45249197c siphaser: improve ultrascale clock routing 2019-02-25 23:00:01 +08:00
Sebastien Bourdeauducq de3992bbdd kasli: remove HUST variants (supported by kasli_generic) 2019-02-23 15:44:17 +08:00
Sebastien Bourdeauducq 791f830ef6 kasli_generic: support DRTIO 2019-02-23 15:41:05 +08:00
Sebastien Bourdeauducq d39338d59f artiq_ddb_template: fix --satellite 2019-02-23 15:27:18 +08:00
Sebastien Bourdeauducq d79a6ee41c artiq_ddb_template: fix pll_vco indentation 2019-02-22 23:50:30 +08:00
Sebastien Bourdeauducq 62985fbd29 binaries -> board-support 2019-02-22 23:18:01 +08:00
Sebastien Bourdeauducq 1c35c051a5 kasli: remove variants supported by generic builder 2019-02-22 23:08:49 +08:00
Sebastien Bourdeauducq 05b128469f artiq_ddb_template: support setting Urukul pll_vco 2019-02-22 22:59:20 +08:00
Sebastien Bourdeauducq cd60803f21 device_ddb_template: add Sampler, Zotino, Grabber and SFP LED support 2019-02-22 20:07:15 +08:00
Sebastien Bourdeauducq 269f0a4d6f artiq_ddb_template: add Urukul support 2019-02-22 19:33:27 +08:00
Sebastien Bourdeauducq 8049c52d06 frontend: add artiq_ddb_template (WIP, TTL only) 2019-02-22 17:19:48 +08:00
Sebastien Bourdeauducq 8edc2318ab style 2019-02-22 17:19:20 +08:00
Robert Jördens aee8965897 ad9910: add ram conversion tooling and unittests
Signed-off-by: Robert Jördens <rj@quartiq.de>
2019-02-21 15:59:52 +00:00
Robert Jördens ec6588174b ad9910: add ram operation unittests
Signed-off-by: Robert Jördens <rj@quartiq.de>
2019-02-21 15:14:32 +00:00
Robert Jördens b57cad77ad ad9910: make ram read work for short segments
also cleanup and style

Signed-off-by: Robert Jördens <rj@quartiq.de>
2019-02-21 14:47:58 +00:00
Sebastien Bourdeauducq 2a60914cb9 manual: revamp developing section 2019-02-21 00:57:22 +08:00
Sebastien Bourdeauducq 62bfccc264 manual: add info about upgrade/rollback with Nix 2019-02-20 19:45:24 +08:00
Sebastien Bourdeauducq 87a1ea6587 manual: minor polishing 2019-02-20 19:45:09 +08:00
Sebastien Bourdeauducq 84619adbab manual: revamp installation instructions 2019-02-20 18:30:25 +08:00
Sebastien Bourdeauducq 7c0353b4be install-artiq: more polite comments 2019-02-20 11:24:25 +08:00
Astro 5557491cc7 manual: fix wavedrom extension json syntax
The leading empty line seems to be required by Sphinx 1.8.3.

The arguments must be strict JSON when prerendering for a target that is
not "html". Browser JSON parsing may have been more lenient.

Signed-off-by: Stephan Maka <stephan@spaceboyz.net>
2019-02-20 11:18:39 +08:00
Sebastien Bourdeauducq 596d3e20d7 dashboard,browser: do not call get_user_config_dir() in argparse
This caused two problems when building the docs:
* the path printed in the docs depends on the machine where they are built
* it pollutes ~/.config, and also breaks Nix builds
2019-02-19 15:43:04 +08:00
Sebastien Bourdeauducq 40a0cf806d support overriding versioneer 2019-02-17 14:49:52 +08:00
Sebastien Bourdeauducq 861ad0a62c remove nix scripts (moved to dedicated repository) 2019-02-17 14:49:52 +08:00
David Nadlinger 1cd0f5a552 conda: Bump migen/misoc commits to fix Sayma build 2019-02-17 09:27:18 +08:00
Sebastien Bourdeauducq bcda53ee2f nix: revert local mods 2019-02-14 20:14:19 +08:00
Sebastien Bourdeauducq a486756890 nix: remove unnecessary fetchsvn 2019-02-14 20:12:33 +08:00
David Nadlinger 944a3b34c3
doc: Fix typo in getting_started_rtio
GitHub: Fixes #1276.
2019-02-13 17:16:02 +00:00
Sebastien Bourdeauducq 322861225e nix: use filterSource 2019-02-14 00:08:43 +08:00
Sebastien Bourdeauducq f657c44e3d nix: fix typo 2019-02-13 20:52:33 +08:00
Sebastien Bourdeauducq af9988c79c nix: fix hydra channel 2019-02-13 20:50:08 +08:00
Sebastien Bourdeauducq 0b08baef10 nix: attempt to create hydra channel properly 2019-02-13 20:29:31 +08:00
Sebastien Bourdeauducq aa17037193 nix: do not make conda-board package depend on a specific ARTIQ version numbers 2019-02-13 12:19:57 +08:00
Sebastien Bourdeauducq 30fb7c1049 conda: add installation script for Hydra packages 2019-02-13 11:59:15 +08:00
Sebastien Bourdeauducq bd22c8e200 nix: name consistency 2019-02-13 00:22:01 +08:00
Sebastien Bourdeauducq ea2956bcb8 nix: allow overriding artiq-board build command 2019-02-12 19:32:58 +08:00
Sebastien Bourdeauducq 6ad2e13515 kasli: add generic builder (WIP) 2019-02-12 19:18:09 +08:00
Sebastien Bourdeauducq 2104a93f78 build_soc: allow overriding SoC class name 2019-02-12 18:33:52 +08:00
Sebastien Bourdeauducq ff4e4f15ed kasli: expose base SoC classes 2019-02-12 18:33:27 +08:00
Sebastien Bourdeauducq 74c16e038e nix: fix edb12a6a5d 2019-02-11 20:10:19 +08:00
Sebastien Bourdeauducq 3a84790c44 nix: build kc705 nist_clock packages 2019-02-11 19:27:50 +08:00
Sebastien Bourdeauducq edb12a6a5d nix: revert accidentally committed local modification 2019-02-11 19:24:02 +08:00
Sebastien Bourdeauducq ed030704d2 nix: place board binaries where artiq_flash looks for them 2019-02-11 19:05:33 +08:00
Sebastien Bourdeauducq c32bf770ab nix: give openocd a better name to distinguish from nixpkgs version 2019-02-11 12:28:58 +08:00
whitequark 0a84dd38c1 Add missing test from d6eb2b02. 2019-02-10 07:25:53 +00:00
David Nadlinger 01c3000ef3 master: Print offending key on HDF5 dataset type error
This helps debugging the cause of TypeErrors arising from types
not handled by the HDF5 serializer, as the backtrace doesn't
otherwise include any useful information.
2019-02-09 20:50:38 +00:00
David Nadlinger 56b2e0c262 artiq_influxdb: Support append() in dataset _Mock
This went undetected as append mods were not actually in use
in any part of the codebase previously.
2019-02-09 20:50:38 +00:00
David Nadlinger bf84226c7d language: Support appending to datasets 2019-02-09 20:50:38 +00:00
David Nadlinger 820326960e test: Add basic experiment dataset interface tests 2019-02-09 20:50:38 +00:00
Sébastien Bourdeauducq dc14f8258f
nix: fix README.rst 2019-02-10 01:16:19 +08:00
Sébastien Bourdeauducq e3cf4fd342
nix: another attempt at getting github .rst formatter to behave 2019-02-10 01:13:54 +08:00
Sébastien Bourdeauducq 566f5094d9
nix: more .rst struggles 2019-02-10 01:07:55 +08:00
Sébastien Bourdeauducq d83251098a
nix: fix user instructions formatting 2019-02-10 01:04:28 +08:00
Sebastien Bourdeauducq 3a21794b79 nix: update user instructions 2019-02-10 01:01:16 +08:00
Sebastien Bourdeauducq f673ce276f nix: consistent naming of board artifacts 2019-02-09 18:55:50 +08:00
Sebastien Bourdeauducq 8194f74252 nix: build board conda package 2019-02-09 18:06:36 +08:00
Sebastien Bourdeauducq 7c6abfb2ce nix: cleanup 2019-02-09 17:58:46 +08:00
Sebastien Bourdeauducq ee611c5c30 nix: build gateware 2019-02-09 15:07:16 +08:00
Sebastien Bourdeauducq 2aab84453d nix: commit missing file 2019-02-09 14:44:32 +08:00
Sebastien Bourdeauducq a52234b5ff nix: build firmware on hydra 2019-02-09 14:29:37 +08:00
Sebastien Bourdeauducq 13c4d935a2 nix/artiq-board: build tester variant 2019-02-09 14:23:36 +08:00
Sebastien Bourdeauducq e424927049 nix: use nixpkgs cargo
This simplifies the code and avoids multiplication of cargo versions.
This installs cargo 1.27, but it is compatible enough with artiq rustc
1.28 not to cause any problems for our purposes.
2019-02-09 14:19:34 +08:00
Sebastien Bourdeauducq 7584639acd nix/artiq-board: cleanup 2019-02-09 13:41:16 +08:00
Sebastien Bourdeauducq 07ac42505b nix: add firmware derivation (WIP) 2019-02-09 10:36:20 +08:00
Sebastien Bourdeauducq f0f50bf1dc nix: cleanup 2019-02-09 10:24:22 +08:00
Robert Jördens 2de1eaa521 dashboard: reconnect to core moninj
* handle disconnects like core device address changes and do a
  disconnect/connect iteration
* after connection failure wait 10 seconds and try again
* this addresses the slight regression from release-2
  to release-3 where the moninj protocol was made stateful
  (#838 and #1125)
* it would be much better to fix smoltcp/runtime to no loose the
  connection under pressure (#1125)
* the crashes reported in #838 look more like a race condition
* master disconnects still require dashboard restarts

Signed-off-by: Robert Jördens <rj@quartiq.de>
2019-02-08 23:52:16 +08:00
Sebastien Bourdeauducq 7994c294af nix: set up hydra to provide conda package 2019-02-08 23:14:32 +08:00
Sebastien Bourdeauducq 1cfd26dc2e kasli: add UNSW variant 2019-02-08 17:51:51 +08:00
Sebastien Bourdeauducq 306d9cf5d0 nix: work around lack of PYTHON environment variable in conda build 2019-02-08 15:50:24 +08:00
Sebastien Bourdeauducq 744ef03fa1 conda: remove --install-lib workaround 2019-02-08 15:50:02 +08:00
Sebastien Bourdeauducq 6f1bb5c351 nix: add experimental derivation to build conda package deterministically 2019-02-08 15:23:31 +08:00
Sebastien Bourdeauducq 3e8fe3f29d suservo: fix permissions 2019-02-08 14:54:02 +08:00
David Nadlinger ef934ad958 Add test/release notes for command-less controllers
See eaa1b44b00 for the actual change.
2019-02-07 21:51:15 +00:00
Chris Ballance eaa1b44b00 ctlmgr: ignore controllers without a "command" field
Allow controllers to be specified without a "command" field. The user takes
responsibility for ensuring the controller is running: the controller manager
does not attempt to ping the controller. This is useful when one has a common
controller shared between several masters.
2019-02-07 21:50:29 +00:00
hartytp 0ebff04ad7 SUServo: apply bit masks to servo memory writes to prevent overflows
Signed-off-by: TPH <thomas.harty@physics.ox.ac.uk>
2019-02-07 17:04:11 +01:00
hartytp f6142816b8
Revert "SUServo: remove references to non-existent a0 parameter" (#1270)
This reverts commit f3aab2b89156bbc1b12f847093a87a8933293df2.

Signed-off-by: TPH <thomas.harty@physics.ox.ac.uk>
2019-02-07 15:57:43 +00:00
hartytp fe63c9b366
SUServo: remove references to non-existent a0 parameter (#1268)
Signed-off-by: Thomas Harty <thomas.harty@physics.ox.ac.uk>
2019-02-07 15:29:32 +00:00
hartytp df6c1fca2c
SUServo: flake8 [NFC] (#1267)
Signed-off-by: Thomas Harty <thomas.harty@physics.ox.ac.uk>
2019-02-07 15:13:44 +00:00
hartytp 87e85bcc14 suservo: fix coefficient data writing
Signed-off-by: Thomas Harty <thomas.harty@physics.ox.ac.uk>
2019-02-07 14:47:11 +01:00
whitequark d6eb2b023a compiler: monomorphize casts first, but more carefully.
This reverts 425cd7851, which broke the use of casts to define
integer width.

Instead of it, two steps are taken:
  * First, literals are monomorphized, leading to predictable result.
  * Second, casts are monomorphized, in a top-bottom way. I.e.
    consider the expression `int64(round(x))`. If round() was visited
    first, the intermediate precision would be 32-bit, which is
    clearly undesirable. Therefore, contextual rules should take
    priority over non-contextual ones.

Fixes #1252.
2019-02-07 06:24:32 +00:00
David Nadlinger 0da799fa46 conda: Require recent aiohttp
artiq_influxdb doesn't work with aiohttp 0.17 (anymore), as the
ClientSession API changed. I have not looked up precisely which
is the first version that works, but 3.x has been out for almost
a year and is available on the Anaconda/conda-forge channels.
2019-02-06 23:39:32 +00:00
Sebastien Bourdeauducq b56c7cec1e kasli: use 100MHz RTIO and 800MHz Urukul frequencies on Berkeley target
Urukul sync is not reliable at 125/1000
2019-02-05 11:24:45 +08:00
Sebastien Bourdeauducq d0b6f92b11 nix: bump jesd204b 2019-02-04 19:31:09 +08:00
Sebastien Bourdeauducq 2f7364563c nix: fix breakage introduced by nixpkgs 6f05dea3 2019-02-04 19:28:36 +08:00
Sebastien Bourdeauducq 5a7460a38e kasli: add sync delays to device_db_berkeley 2019-02-01 22:14:03 +08:00
Sebastien Bourdeauducq ea431b6982 sayma_rtm: use 150MHz RTIO freq for DDMTD 2019-01-31 20:43:44 +08:00
Sebastien Bourdeauducq ec230d6560 sayma: move SYSREF DDMTD to the RTM
Put RTM Si5324 into bypass mode before running.
Needs rework to cut RTM Si5324 reset trace.
Needs rework to fix LVDS termination on RTM R310/R313 and R314/R315.
Needs uFL jumper cables between RTM "REF LO DIAG" and "CRD AUX CLKIN" (sic).
2019-01-31 20:39:33 +08:00
Sebastien Bourdeauducq 8119000982 sayma_rtm_drtio: use Si5324 soft reset
Needs easy board rework to cut trace at pin 1 of Si5324.
The Si5324 contains an internal pull-up on that pin.

Allows using Si5324 + HMC7043 chips at the same time.

Allows the Si5324 bypass hack for DDMTD experiments on the RTM.
2019-01-31 19:43:54 +08:00
Sebastien Bourdeauducq 82106dcd95 si5324: add bypass function 2019-01-31 19:38:55 +08:00
Sebastien Bourdeauducq 8bbd4207d8 si5324: use consistent bitmask 2019-01-31 19:35:56 +08:00
Sebastien Bourdeauducq bdb6678cec nix: bump migen 2019-01-31 15:13:17 +08:00
Sebastien Bourdeauducq d3c608aaec jesd204sync: reset and check lock status of DDMTD helper PLL in firmware 2019-01-31 15:11:16 +08:00
Sebastien Bourdeauducq fa3b40141d hmc830_7043: document sayma clock muxes 2019-01-31 15:10:11 +08:00
Sebastien Bourdeauducq ec8560911f siphaser: bugfixes
* Fix integer overflow in degree computation
* Add some phase slips after the first transition to get out of the jitter zone and avoid intermittent short windows
2019-01-30 16:56:38 +08:00
Sebastien Bourdeauducq c591009220 sayma: report TSC phase of SYSREF (TSC LSBs on SYSREF rising edge) in SYSREF sampler
Better visibility, better diagnostics, allows some changing of SYSREF frequency while keeping the same gateware.
2019-01-29 23:30:01 +08:00
Sebastien Bourdeauducq 9d0d02a561 jesd204sync: increase tolerance for coarse->final target in calibrate_sysref_target
There is plenty of slack (it only needs to meet timing at the RTIO frequency).
2019-01-29 16:48:55 +08:00
Sebastien Bourdeauducq ed6aa29897 jesd204sync: print more information on test_slip_ddmtd error 2019-01-29 16:47:29 +08:00
Sebastien Bourdeauducq 2e8decbce3 kasli_sawgmaster: generate a HMC830 clock with Urukul 2019-01-29 15:06:45 +08:00
Sebastien Bourdeauducq 9ae57fd51e sayma: pass rtio_clk_freq to DDMTD core 2019-01-29 15:06:45 +08:00
Robert Jördens 90c9fa446f test: add array transfer test
200 kB/s, more than a factor of 10 slower than the bare string transfer

Signed-off-by: Robert Jördens <rj@quartiq.de>
2019-01-28 14:30:44 +00:00
Sebastien Bourdeauducq 7a5d28b73d jesd204sync: test SYSREF period 2019-01-28 19:11:38 +08:00
Sebastien Bourdeauducq 1a42e23fb4 jesd204sync: print DDMTD SYSREF final alignment delta 2019-01-28 18:39:16 +08:00
Sebastien Bourdeauducq eebff6d77f jesd204sync: fix max_phase_deviation 2019-01-28 18:38:18 +08:00
Sebastien Bourdeauducq b9e3fab49c jesd204sync: improve messaging 2019-01-28 18:37:46 +08:00
Sebastien Bourdeauducq 145f08f3fe jesd204sync: update SYSREF S/H limit deviation tolerance
Follows the increased DDMTD resolution.
2019-01-28 18:21:31 +08:00
Sebastien Bourdeauducq ba21dc8498 jesd204sync: improve messaging 2019-01-28 18:08:20 +08:00
Sebastien Bourdeauducq 3acee87df2 firmware: improve DDMTD resolution using dithering/averaging 2019-01-28 16:04:04 +08:00
Sebastien Bourdeauducq cfe66549ff jesd204sync: cleanup DDMTD averaging code 2019-01-28 14:14:50 +08:00
Sebastien Bourdeauducq 2b0d63db23 hmc830_7043: support 125MHz RTIO 2019-01-28 13:44:08 +08:00
Sebastien Bourdeauducq bdd4e52a53 ad9154: support 125MHz RTIO 2019-01-28 13:43:52 +08:00
Sebastien Bourdeauducq 47312e55d3 sayma: set RTIO_FREQUENCY in MasterDAC 2019-01-28 13:43:28 +08:00
Sebastien Bourdeauducq 443d6d8688 sayma_amc: pass RTIO clock frequency to SiPhaser 2019-01-28 09:49:03 +08:00
Sebastien Bourdeauducq 3b6f47886e firmware: print more info on DDMTD stability error 2019-01-27 23:06:11 +08:00
Sebastien Bourdeauducq 74fdd04622 firmware: test DDMTD stability 2019-01-27 20:39:12 +08:00
Sebastien Bourdeauducq 81b0046f98 ddmtd: add deglitchers 2019-01-27 20:38:41 +08:00
Sebastien Bourdeauducq 8254560577 sayma: properly determine SYSREF coarse calibration target 2019-01-27 16:00:36 +08:00
Sebastien Bourdeauducq 214394e3b0 sayma: reimplement DAC SYSREF autocalibration 2019-01-27 15:28:39 +08:00
Sebastien Bourdeauducq fdbf1cc2b2 sayma: rework DAC SYSREF margin validation
Previous code did not work when delay range was not enough for two rotations.
This removes autocalibration, to be done later. Uses hardcoded value for now.
2019-01-27 14:17:54 +08:00
Sebastien Bourdeauducq 7e5c062c2c firmware: bypass channel divider for HMC7043 DCLK 2019-01-27 11:49:34 +08:00
Sebastien Bourdeauducq f73ffe44f9 firmware: implement DDMTD-based SYSREF/RTIO alignment (draft)
Mostly works and usually gets the DAC synchronized at 2.4GHz with Urukul across DRTIO.

Needs cleanup and optimization/characterization.
2019-01-27 09:51:24 +08:00
Sebastien Bourdeauducq 8632b553d2 ddmtd: use IOB register to sample input 2019-01-27 09:50:02 +08:00
Sebastien Bourdeauducq d1ef036948 kasli_sawgmaster: initialize SAWG phase according to RTIO TSC 2019-01-27 09:49:31 +08:00
Sebastien Bourdeauducq 9966e789fc sayma: simplify Ultrascale LVDS T false path
Recommended by Xilinx.
2019-01-25 23:40:48 +08:00
Sebastien Bourdeauducq 359fb1f207 sayma: fix DDMTD STA 2019-01-25 23:39:19 +08:00
Sebastien Bourdeauducq cb04230f86 sayma: SYSREF setup/hold validation demonstration
This also removes the standalone target as the ISERDES used
for setup/hold check requires the fine RTIO clock, which in turn
requires a DRTIO transceiver due to the Ultrascale TPWS bug.
2019-01-25 16:58:58 +08:00
Sebastien Bourdeauducq 3356717316 sayma: DDMTD SYSREF measurement demonstration 2019-01-25 16:00:31 +08:00
Sebastien Bourdeauducq 4941fb3300 sayma: 2.4GHz DAC clocking (4X interpolation)
* gets another clock divider out of the way
* gets one cycle within range of the HMC7043 analog delay alone
* SYSREF/RTIO alignment removed, to be replaced with DDMTD-based scheme
2019-01-25 13:47:04 +08:00
Sebastien Bourdeauducq cc9420d2c8 hmc7043: fix divider programming 2019-01-25 11:48:50 +08:00
Robert Jördens 8c5a502591 ad53xx: ignore F3 (reserved)
Signed-off-by: Robert Jördens <rj@quartiq.de>
2019-01-24 15:50:46 +01:00
Sebastien Bourdeauducq bbac92442f sayma: check hmc7043 slip period 2019-01-24 20:13:43 +08:00
Sebastien Bourdeauducq a92cc91dcb kasli_sawgmaster: correctly tune DDS and SAWG 2019-01-24 19:37:14 +08:00
Sebastien Bourdeauducq f8b39b0b9a sayma: enable 2X DAC interpolation
Seems to work just fine and gets one clock divider out of the way.
2019-01-24 18:28:01 +08:00
Sebastien Bourdeauducq 07b5b0d36d kasli: adapt Master target to new hardware 2019-01-24 18:27:15 +08:00
Sebastien Bourdeauducq 31592fc8e4 nix: install flash proxy bitstreams with OpenOCD 2019-01-24 16:47:37 +08:00
Sebastien Bourdeauducq 0a0e8c3c93 nix: bump migen/misoc 2019-01-24 16:20:02 +08:00
Sebastien Bourdeauducq 3917a0ef46 nix: support reusing dev environment in build scripts 2019-01-23 21:59:39 +08:00
Sebastien Bourdeauducq 154269b77a kasli: fix HUST satellite Urukul 2019-01-23 17:59:43 +08:00
Sebastien Bourdeauducq 3b5fd3ac11 kasli_tester: fix grabber test 2019-01-23 17:59:25 +08:00
Sebastien Bourdeauducq 330c5610e9 ad9912: fix imports 2019-01-23 17:59:08 +08:00
Sebastien Bourdeauducq 390f05f762 firmware: use smoltcp release 2019-01-23 16:15:05 +08:00
Sebastien Bourdeauducq d7e6f104d2 kasli: add HUST variants 2019-01-23 14:11:51 +08:00
Sebastien Bourdeauducq 81f2b2c864 kasli: remove unpopulated Tester EEMs
* matches hardware and avoids issues with programs that process the DDB (e.g. kasli_tester)
* shortens compilation times
2019-01-23 12:14:44 +08:00
Sebastien Bourdeauducq 01f1df7e50 nix: fix version strings in artiq-dev environment 2019-01-23 11:21:09 +08:00
Robert Jördens b692981c8e ad9910: add note about red front panel led
Signed-off-by: Robert Jördens <rj@quartiq.de>
2019-01-22 12:49:42 +01:00
Sebastien Bourdeauducq a0eba5b09b satman: support Grabber 2019-01-22 19:36:13 +08:00
Sebastien Bourdeauducq 2e3555de85 firmware: fix compilation error with more than 1 Grabber 2019-01-22 19:35:46 +08:00
Sebastien Bourdeauducq 9ee5fea88d kasli: support optional SATA port for DRTIO 2019-01-22 18:06:48 +08:00
Robert Jördens 91e375ce6a ad9910: don't reset the input divide-by-two
suspected of causing weird PLL lock timout errors
https://freenode.irclog.whitequark.org/m-labs/2019-01-22#1548148750-1548143221;

Signed-off-by: Robert Jördens <rj@quartiq.de>
2019-01-22 09:37:20 +00:00
Sebastien Bourdeauducq 2174935231 nix: update package descriptions 2019-01-22 15:06:42 +08:00
Robert Jördens 81ff3d4b29 ad9912: add some slack after init 2019-01-21 17:10:58 +00:00
Sebastien Bourdeauducq 4869636a55 nix: remove broken version strings 2019-01-21 23:55:25 +08:00
Sebastien Bourdeauducq 79ffd1e0bf nix: enable pythonparser and artiq unittests 2019-01-21 23:42:10 +08:00
Sebastien Bourdeauducq a9678dd9f2 test_frontends: always skip GUI programs
The "import PyQt5" hack breaks on nix/hydra.
2019-01-21 23:41:07 +08:00
Sebastien Bourdeauducq e024fa89e5 nix: disable maintainer entries for now
Causes problem with hydra when building against release nixpkgs,
where the sb0 maintainer entry is not present yet.
2019-01-21 22:53:57 +08:00
Sebastien Bourdeauducq 84f7d006e8 ad9910: add precision about tune_io_update_delay/tune_sync_delay order 2019-01-21 19:40:55 +08:00
Sebastien Bourdeauducq 30051133b7 urukul: fix typos 2019-01-21 19:40:55 +08:00
Sebastien Bourdeauducq 30b2f54baa kasli_tester: skip Zotino test when no Zotino is present 2019-01-21 18:11:41 +08:00
Sebastien Bourdeauducq bff8c8cb05 kasli: add Berkeley variant 2019-01-21 17:44:17 +08:00
Sebastien Bourdeauducq a987d2b2e5 kasli_tester: skip Grabber test when no Grabber is present 2019-01-21 17:43:48 +08:00
Sebastien Bourdeauducq bc532e0088 nix: add libuuid to artiq-dev
Required by ISE.
2019-01-21 17:43:00 +08:00
David Nadlinger 4ba4e9c540 test_scheduler: Test for hang when exiting with running experiments
The respective code path in artiq.master.scheduler._mk_worker_method
wasn't previously covered.
2019-01-20 19:45:50 +00:00
David Nadlinger 0dab7ecd73 master: Include RID in worker exception messages
This helps when debugging unexpected shutdown problems
after the fact.
2019-01-20 19:45:50 +00:00
David Nadlinger e24e893303 master/scheduler: Fix misleading indentation [nfc] 2019-01-20 19:45:47 +00:00
David Nadlinger 8aac5f7695 manual/management_system: Cross-reference frontend tools 2019-01-20 19:33:02 +00:00
David Nadlinger 5c62648ed6 manual: Minor grammar fixes 2019-01-20 19:26:43 +00:00
David Nadlinger e165a9a352 sync_struct: Factor action strings out into enum and document them [nfc] 2019-01-19 20:19:17 +00:00
David Nadlinger c213ab13ba sync_struct: Notifier.{read -> raw_view}, factor out common dict update code [nfc] 2019-01-19 20:19:17 +00:00
David Nadlinger bd71852427 sync_struct: Tweak variable name to avoid confusion with `init` mod action [nfc] 2019-01-19 20:19:17 +00:00
David Nadlinger 90c144a685 test_pc_rpc: Remove leftover debug print [nfc]
This tidies up the test suite output, and we have verbose asserts
to show further information on breakage, should it occur.
2019-01-19 20:18:33 +00:00
Sebastien Bourdeauducq a2ff2cc173 sayma_amc: use more selective IOBUFDS false path 2019-01-19 11:47:50 +08:00
Robert Jördens 40187d1957 ad9910: support configurable refclk divider and pll bypass
for #1248

* also always keep refclk input divider (by two) reset
2019-01-18 12:23:53 +00:00
Robert Jördens 385916a9a4 ad9912: support configurable clk_div 2019-01-18 12:16:08 +00:00
Robert Jördens 2bea5e3d58 urukul: support configurable refclk divider
for #1248
2019-01-18 12:09:32 +00:00
Sebastien Bourdeauducq a467b8f851 nix: update metadata 2019-01-18 10:29:18 +08:00
Sebastien Bourdeauducq 1e3ef15446 nix: make versioneer work 2019-01-18 10:29:18 +08:00
Robert Jördens 4e142dfbeb doc/installing: cleanup and fixes
* fix broken and old URLs to anaconda/miniconda
* append conda-forge, do not prepend it (consistent with conda-forge
  instructions and does not blindly prefer packages in conda-forge over
  packages in defaults)
* shorten m-labs repo
2019-01-16 12:40:58 +01:00
Sebastien Bourdeauducq 689714965b monkey_patches: disable for Python >= 3.6.7
3.6 >=7 are fixed
3.7.0 is incompatible with the monkey patches and they do more harm than good
3.7 >=1 are fixed
2019-01-15 20:29:20 +08:00
David Nadlinger 05f6dafb2c RELEASE_NOTES: Mention new edge counter RTIO PHY 2019-01-15 10:55:07 +00:00
David Nadlinger 1c71ae636a examples: Add edge counters to kasli_tester variant
This enables test_edge_counter on the CI system.
2019-01-15 10:55:07 +00:00
David Nadlinger 67a6882e91 examples: Fix kasli_tester device_db offset comments 2019-01-15 10:55:07 +00:00
David Nadlinger a565f77538 Add gateware input event counter 2019-01-15 10:55:07 +00:00
TPH 3c0e3e5910 issue template: remind users to update the docs 2019-01-15 11:35:38 +01:00
Sebastien Bourdeauducq b8a230a67e nix: update quamash (#1245) 2019-01-14 00:03:14 +08:00
Sebastien Bourdeauducq 4cb9f77fd8 sayma_amc: fix Master timing constraints 2019-01-13 13:53:07 +08:00
David Nadlinger 6c52359e59 coredevice: Add _mu suffix to AD991x ref_time arguments
GitHub: Fixes #1243.
2019-01-12 17:34:35 +00:00
David Nadlinger 24b1b9a480 Add smoke test for frontend commands
This ensures that at least --help works for all the commands,
preventing regressions like that in f3323a35d5.
2019-01-12 13:50:53 +00:00
whitequark 425cd7851e compiler: first monomorphize ints, then casts.
Fixes #1242.
2019-01-12 13:40:12 +00:00
whitequark 49682d0159 Improve Python 3.7 compatibility.
async is now a full (non-contextual) keyword.

There are two more instances:
   - artiq/frontend/artiq_client.py
   - artiq/devices/thorlabs_tcube/driver.py

It is not immediately clear how to fix those, so they are left for
later work.
2019-01-12 13:17:59 +00:00
David Nadlinger cd725a8352 manual: Slightly untangle rtio input paragraph [nfc]
This is just an attempt at making the explanation slightly
easier to skim, based on user feedback.
2019-01-12 12:15:21 +00:00
David Nadlinger f3323a35d5 artiq_influxdb: Unbreak after verbosity_args rename
This fixes commit f2c1d32e54.
2019-01-12 12:02:22 +00:00
David Nadlinger 48fc175a6b coredevice.ttl: More imperative mood in docstrings [nfc]
This follows Python conventions (PEP257) and unifies the style with
other comments.
2019-01-12 12:01:55 +00:00
Drew f2c1d32e54 frontend: add --version flag to cmd line args (#1181) 2019-01-12 09:47:47 +08:00
David Nadlinger 3e84ec2bf1 coredevice.ad9910: Fix phase tracking ref_time passing
This is difficult to test without hardware mocks or some
form of phase readback, but the symptom was that e.g.
`self.dds.set(…, ref_time=now_mu() - 1)` would fail
periodically, that is, whenever bit 32 of the timestamp
would be set (which would be turned into the sign bit).

This is a fairly sinister issue, and is probably a compiler
bug of some sort (either accepts-invalid or wrong type inference).
2019-01-12 00:47:38 +00:00
David Nadlinger b3ef6e2253 doc: Minor typo fix/rewording in drtio.rst 2019-01-12 00:13:24 +00:00
Drew 66861e6708 test_pc_rpc: fix equality bug (#1188) (#1239)
Fixes bug from 5108ed8. Truth value of multi-element numpy array is
not defined. Completes #1186 and fixes/amends #1188.

Signed-off-by: Drew Risinger <drewrisinger@users.noreply.github.com>
2019-01-11 10:15:44 +08:00
Robert Jördens 101671fbbf core_analyzer: support uniform VCD time intervals
close #1236

Signed-off-by: Robert Jördens <rj@quartiq.de>
2019-01-10 19:35:09 +01:00
Drew 58e872e7b5 doc: document artiq_coreanalyzer usage. (#1233) 2019-01-10 13:01:36 +08:00
Drew 99a0f61b35 artiq_client: remove custom input validation for built-in argparse (#1185) 2019-01-10 12:58:11 +08:00
Drew 721c6f3bcc pc_rpc: fix handling of type annotations 2019-01-10 12:13:22 +08:00
Robert Jördens 088530604e test_ad9910: relax tests
* tune_sync_delay: the opposite IO_UPDATE to SYNC_CLK alignment may not be perfectly
mis-aligned
* set_mu_speed: seems to be slower on the buildbot

Signed-off-by: Robert Jördens <rj@quartiq.de>
2019-01-09 17:27:42 +00:00
Robert Jördens 19748fe495 ad9910: fix RTIO fine timestamp nudging
Previously the TSC was truncated to an even coarse RTIO periods before doing
the setting SPI xfer. Afterwards the the IO update pulse would introduce
at least one but less than two RTIO cycles. Ultimately the RTIO TSC was
truncated again to even. If the SPI xfer takes an odd number of RTIO
periods, then a subsequent xfer would collide.

close #1229

Signed-off-by: Robert Jördens <rj@quartiq.de>
2019-01-09 17:22:57 +00:00
Robert Jördens b25ab1fc88 ad9910: add more slack in tune_sync_delay
close #1235

Signed-off-by: Robert Jördens <rj@quartiq.de>
2019-01-09 16:07:31 +00:00
Sebastien Bourdeauducq f8a94725e9 manual: add precision about sequence errors 2019-01-09 18:58:22 +08:00
Sebastien Bourdeauducq 9b213b17af sayma_amc: forward RTM UART in Master variant as well 2019-01-09 18:57:57 +08:00
Sebastien Bourdeauducq c7b18952b8 sayma_amc: work around Ultrascale LVDS Toutbuf_delay_td_pad 2019-01-09 13:47:08 +08:00
Sebastien Bourdeauducq 62599c5f91 firmware: use consistent terminology 2019-01-09 13:46:18 +08:00
Drew b3b0b6f0a5 artiq_influxdb: clarify argparse groups (#1212)
Make names of argparse group variables relate to what they're doing.
Meets Flake8.

Signed-off-by: Drew Risinger <drewrisinger@users.noreply.github.com>
2019-01-09 11:40:55 +08:00
David Nadlinger 101ed5d534 examples: Fix DRTIO destination indices (#1231)
Using the default routing table, links numbers and destinations
are offset by 1, as destination 0 is local RTIO.
2019-01-09 11:40:15 +08:00
Drew 40370c4d45 Docs: fix build warnings (#1234)
* ad9910: finish CONT_RECIRCULATE -> CONT_RAMPUP

Found while building docs. Forgot to refactor strings.

Signed-off-by: Drew Risinger <drewrisinger@users.noreply.github.com>

* spi2: reformat update_xfer_duration_mu docstring

update_xfer_duration_mu docstring threw warning while building docs,
didn't use consistent indent in warning.

Signed-off-by: Drew Risinger <drewrisinger@users.noreply.github.com>
2019-01-09 11:39:23 +08:00
David Nadlinger 4fb434674d coredevice: Fix ad9910 __all__ exports 2019-01-08 18:55:26 +00:00
Sebastien Bourdeauducq 0d3e7ba805 nix: add zlib in artiq-dev
Needed by the Vivado installer.
2019-01-08 20:47:09 +08:00
Sebastien Bourdeauducq 887cb110a7 firmware: fix default DRTIO routing table 2019-01-08 20:46:53 +08:00
David Nadlinger cadde970e1 urukul: Expand CPLD sync_sel explanation [nfc] 2019-01-08 02:37:58 +00:00
David Nadlinger 7bcdeb825b ad9910: Add inverse FTW/ASF conversions 2019-01-08 02:18:14 +00:00
David Nadlinger 4d793d7149 ad9910: Truncate phase word to 16 bits
This avoids overflowing into the asf portion of the register.
2019-01-08 02:18:14 +00:00
Sebastien Bourdeauducq 332bd6090f satman: wait for CPLL/QPLL lock after setting drtio_transceiver::stable_clkin 2019-01-07 17:09:19 +08:00
Sebastien Bourdeauducq 3217488824 add Sayma RTM DRTIO target 2019-01-07 00:13:47 +08:00
Sebastien Bourdeauducq b5501aaf00 firmware: program I2C switch on Sayma RTM 2019-01-06 14:54:52 +08:00
Sebastien Bourdeauducq 66b3132c28 sayma_amc: fix RTIO TSC instantiation 2019-01-06 14:54:32 +08:00
Sebastien Bourdeauducq 6e43c41103 firmware: support building without SDRAM 2019-01-05 23:41:30 +08:00
Sebastien Bourdeauducq cf9447ab77 rtio/cri: remove unneeded CSR management 2019-01-05 23:40:45 +08:00
Sebastien Bourdeauducq 2c3510497b firmware: fix not(has_spiflash) build 2019-01-05 23:40:03 +08:00
Sebastien Bourdeauducq d6fea22174 manual: update firmware/gateware build/flashing instructions. Closes #1223 2019-01-05 12:38:54 +08:00
Sebastien Bourdeauducq 2100a8b1f1 sayma_amc: more fighting with vivado timing analyzer 2019-01-05 12:25:30 +08:00
Drew 94cdad6c1d artiq_flash: change docs from old `-m` arg to `-V` (#1224) (#1227)
`-m` argument is deprecated. Changed to newer `-V` argument
Closes #1224

Signed-off-by: Drew Risinger <drewrisinger@users.noreply.github.com>
2019-01-05 10:22:12 +08:00
Drew Risinger b58d59a9e7 pyon: fix grammar in module docstring.
Signed-off-by: Drew Risinger <drewrisinger@users.noreply.github.com>
2019-01-04 19:31:08 +00:00
Drew 3e5cea5d89 Docs: instructions to check if in plugdev group 2019-01-04 19:30:13 +00:00
Sebastien Bourdeauducq a93fdb8c9d drtio: disable all destinations in gateware at startup
Otherwise, kernels fail to get a RTIODestinationUnreachable exception when attempting
to reach a DRTIO destination that has never been up.
2019-01-04 23:42:12 +08:00
Sebastien Bourdeauducq 62d7c89c48 sayma_amc: use high-resolution TTL on SMAs (#792) 2019-01-03 20:50:38 +08:00
Sebastien Bourdeauducq 0972d61e81 ttl_serdes_ultrascale: use GTH clock domains 2019-01-03 20:50:04 +08:00
Sebastien Bourdeauducq f007895fad drtio/gth_ultrascale: fix rtiox clock domain 2019-01-03 20:49:38 +08:00
Sebastien Bourdeauducq 10ebf63c47 jesd204_tools: get the Vivado timing analyzer to behave 2019-01-03 20:22:35 +08:00
Sebastien Bourdeauducq d6a3172a3e update copyright year 2019-01-03 20:21:34 +08:00
Sebastien Bourdeauducq 4af8fd6a0d ttl_serdes_ultrascale: fix Input 2019-01-03 20:14:54 +08:00
Sebastien Bourdeauducq 175f8b8ccc drtio/gth_ultrascale: generate multiplied RTIO clock from BUFG_GT (#792) 2019-01-03 20:14:18 +08:00
Sebastien Bourdeauducq 77126ce5b3 kasli: use hwrev 1.1 by default for DRTIO examples 2019-01-02 23:04:20 +08:00
Sebastien Bourdeauducq ab9ca0ee0a kasli: use 150MHz for DRTIO by default (Sayma compatibility) 2019-01-02 23:03:57 +08:00
Sebastien Bourdeauducq cc58318500 siphaser: autocalibrate skew using RX synchronizer
* removes the hardcoded, (poorly) manually determined skew value
* does not need si5324_clkout_fabric anymore (broken on Sayma RTM due to wrong IO voltage)
2019-01-02 22:29:27 +08:00
Sebastien Bourdeauducq f5cda3689e sayma_amc: enable DRTIO on master SATA connector for MasterDAC variant 2019-01-02 16:46:16 +08:00
Sebastien Bourdeauducq e85df13127 nix: update docs 2019-01-02 16:34:29 +08:00
Sebastien Bourdeauducq ec52a1003d nix: add jesd204b 2019-01-02 16:34:11 +08:00
Sebastien Bourdeauducq d42d607547 nix: add microscope 2019-01-02 16:13:08 +08:00
Sebastien Bourdeauducq 7a6bdcb041 nix: fix m-labs URLs 2019-01-02 16:04:25 +08:00
Sebastien Bourdeauducq 48793b7ecf nix: reorganize .nix files 2019-01-01 23:39:38 +08:00
Sebastien Bourdeauducq e2799803cb nix: do not install development packages in user environment 2019-01-01 23:35:55 +08:00
Sebastien Bourdeauducq 1e7ba3227f nix: add development environment 2019-01-01 22:26:32 +08:00
Sebastien Bourdeauducq 421ad9c916 nix: bump llvmlite 2018-12-22 14:01:52 +08:00
Sebastien Bourdeauducq e80d80f133 manual: move to correct directory for building rust crates. Closes #1222 2018-12-21 10:37:08 +08:00
Drew d60b95f481 tdr.py: typo (#1220) 2018-12-18 18:47:09 +00:00
Robert Jördens a7d4d3bda9 ad9910: CONT_RECIRCULATE -> CONT_RAMPUP 2018-12-17 13:25:00 +00:00
Sebastien Bourdeauducq 35bdf26f01 Merge branch 'ad9910-ram' 2018-12-17 21:16:44 +08:00
David Nadlinger e608d6ffd3 coredevice, firmware: Add rtio_input_timestamped_data
Integration tests to follow as part of an RTIO counter phy that
makes use of this.
2018-12-15 00:35:04 +00:00
David Nadlinger 8e30c4574b firmware: Treat timestamps consistently as signed [nfc]
This matches other functions and the ARTIQ Python side, but
isn't actually an ABI change.
2018-12-15 00:02:18 +00:00
Sebastien Bourdeauducq 38ce7ab8ff sync_struct: handle TimeoutError as subscriber disconnection. Closes #1215 2018-12-13 06:58:54 +08:00
Sebastien Bourdeauducq c09ab8502c nix: cleanup 2018-12-13 06:57:10 +08:00
Joachim Schiele 73941d4661 nix: add rustc, migen and misoc
This allows firmware compilation.
2018-12-12 22:24:55 +00:00
Robert Jördens 79eadb9465 ad9910: add RAM mode methods
* also refactor the CFR1 access into a method

c.f. #1154

Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-12-11 14:54:16 +00:00
Robert Jördens 6df4ae934f eem: name the servo submodule
This allows the migen namer to derive names for the ADC return clock
domain in the case of multiple SUServos

close #1201

Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-12-11 11:36:40 +01:00
Robert Jördens efd400b02c ad9910: style [nfc]
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-12-11 11:36:25 +01:00
David Nadlinger d4c393b2a8 firmware/ksupport: Update `cfg(not(has_rtio))` stub signatures
This fixes up 8caea0e6d3,
but it is unclear whether anyone even uses a `not(has_rtio)`
configuration at this point.
2018-12-11 01:22:48 +00:00
Robert Jördens d90eb3ae88 ad9910: add read64()
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-12-07 21:27:00 +00:00
Robert Jördens baf88050fd urukul: expand attenuator HITL unittests
* read back with cleared backing state
* individual channel settings
* check backing state

Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-12-07 21:06:12 +00:00
Kaifeng cc143d5fec kasli_tester: add support for windows platform. (#1204) 2018-12-05 14:06:45 +01:00
Sebastien Bourdeauducq 6aa341bc44 test_loopback_gate_timing: fix lat_offset 2018-12-02 20:52:32 +08:00
Sebastien Bourdeauducq 421834fa3e compiler: document Target.little_endian 2018-12-02 19:07:18 +08:00
Sebastien Bourdeauducq 981a77834a compiler: use default triple to determine data_layout for JIT 2018-12-02 18:52:13 +08:00
Sebastien Bourdeauducq d931967e5c fix previous commits 2018-12-02 18:32:03 +08:00
Sebastien Bourdeauducq dd03fdfd1a typo 2018-12-02 18:26:54 +08:00
Sebastien Bourdeauducq 8940009e1a compiler: pass data_layout string to llvm.create_target_data before determining endianness 2018-12-02 18:26:19 +08:00
Sebastien Bourdeauducq 2e66788c6c compiler: support little endian target when storing now 2018-12-02 17:40:34 +08:00
Sebastien Bourdeauducq ad39c76a56 conda: fix llvmlite dependency 2018-12-02 06:40:00 +08:00
Sebastien Bourdeauducq 7e14f3ca4e compiler,gateware: atomic now stores 2018-12-02 05:06:46 +08:00
Sebastien Bourdeauducq fd00021a52 ctlmgr: do not raise exceptions in Controllers.__setitem__. Closes #1198 2018-12-01 18:09:58 +08:00
Sebastien Bourdeauducq 7f55376c75 test_loopback_gate_timing: print input timing for debugging 2018-12-01 18:09:53 +08:00
Sebastien Bourdeauducq dce4f036db grabber: work around windows numpy int peculiarity (same as a81c12de9) 2018-11-30 18:41:14 +08:00
Sebastien Bourdeauducq 156afb48ee language: fix syscall arg handling 2018-11-30 17:59:24 +08:00
Paweł K 57caa7b149 artiq_flash: add command to erase flash memory (#1197) 2018-11-28 12:33:32 +02:00
Sebastien Bourdeauducq 3fd95b86c2 typo 2018-11-26 17:54:55 +08:00
Sebastien Bourdeauducq 5c162ed5e6 manual: document usage of DRTIO switching. Closes #1156 2018-11-26 17:53:28 +08:00
Sebastien Bourdeauducq 0507101e31 manual/drtio: update output internal description (SED, 'destination' switching terminology) 2018-11-26 16:50:09 +08:00
Sebastien Bourdeauducq c56c0ba41f rtio/dds: use write-only RT2WB
This saves one address bit and prevents issues with AD9914 and 8-bit addresses.
2018-11-26 07:38:15 +08:00
Sebastien Bourdeauducq 09141e5bee rtio/wishbone: support write-only interface 2018-11-26 07:38:06 +08:00
Sebastien Bourdeauducq 450a035f9e suservo: move overflowing RTIO address bits into data 2018-11-26 06:54:20 +08:00
Sebastien Bourdeauducq ae8ef18f47 rtlink: sanity-check parameters 2018-11-26 01:14:02 +08:00
Sebastien Bourdeauducq b32e89444c Merge branch 'master' into new 2018-11-26 01:02:19 +08:00
Sebastien Bourdeauducq af9ea1f324 gui: update background 2018-11-26 01:01:36 +08:00
Robert Jördens a81c12de94 urukul: work around windows numpy int peculiarity
"OverflowError: Python int too large to convert to C long" otherwise

opticlock#74

Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-25 16:56:45 +01:00
Sebastien Bourdeauducq 58ea111b8b create 5.0.dev 2018-11-20 18:40:12 +08:00
Sebastien Bourdeauducq bf50dcf76d conda: use misoc release 2018-11-20 17:15:53 +08:00
Sebastien Bourdeauducq 8f9858be4c ad9914: remove automatic continuous phase compensation (like Urukul) 2018-11-19 22:00:20 +08:00
Sebastien Bourdeauducq 22a223bf82 examples/master: clean up remnants of early urukul tests 2018-11-19 21:42:41 +08:00
Sebastien Bourdeauducq f5befba5c9 conda: bump misoc (attempt to WA conda problem) 2018-11-19 13:24:28 +08:00
Sebastien Bourdeauducq 53e79f553f Merge branch 'master' into new 2018-11-19 11:54:50 +08:00
Sebastien Bourdeauducq b5cdb1c1e0 try to work around conda problem 2018-11-18 22:32:17 +08:00
Sebastien Bourdeauducq a3e0b1c5b4 ad9914,spi2: add warnings about driver state and DMA. Closes #1113 2018-11-17 22:10:20 +08:00
Sebastien Bourdeauducq 78d4b3a7da gateware/targets: expose variant lists
This allows writing scripts that build all variants.
2018-11-17 22:10:20 +08:00
Sebastien Bourdeauducq 69e699c7bd ttl: compensate for SED latency in input gating
Closes #1137
2018-11-17 22:10:20 +08:00
Robert Jördens 3ad68f65c5 urukul: make get_att_mu() not alter state
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-16 14:56:26 +00:00
Robert Jördens d1eee7c0ea ad9910: ensure sync is driven when required
close #1194

Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-16 13:21:01 +00:00
Sebastien Bourdeauducq 1b841805f6 Merge branch 'master' into new 2018-11-16 15:20:32 +08:00
Sebastien Bourdeauducq de9d21ffc8 nix: use fetchFromGitHub for llvmlite 2018-11-16 15:14:20 +08:00
Sebastien Bourdeauducq d3483c1d26 kasli: fix SDRAM read delay reset/wrap issue. Closes #1149 2018-11-15 19:40:35 +08:00
Robert Jördens 494ffca4d3 gui,scan: add CenterScan Scannable variant
* parametrized by center/span/step instead of
  start/stop/npoints which is more convenient in some applications
* no scan widget support so far

Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-15 13:30:43 +08:00
Robert Jördens f77a75ab17 test_ad9910: robustify w.r.t. profile synchronization
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-14 08:42:27 +01:00
Robert Jördens c3178c2cab ad9910: profile support
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-14 08:30:28 +01:00
Robert Jördens d0cadfeb4b ad9910: more idiomatic register names
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-14 07:55:01 +01:00
Robert Jördens a52d1be140 urukul: expose PROFILE setting
* add documentation
* add unittest

Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-14 07:43:56 +01:00
Robert Jördens 2af6edb8f5 eem: fix reset/sync in suservo
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-13 13:00:54 +00:00
whitequark 248c1cf7dc firmware: fix another TOCTTOU race in sync/async RPC code. 2018-11-13 00:58:20 +08:00
whitequark 68aad3e482 firmware: fix TOCTTOU race in sync/async RPC code.
Before this commit, the main loop in session code was laid like:

  1. process_kern_queued_rpc
  2. process_host_message
  3. process_kern_message

If a host message (such as an RPC reply) caused the kernel to exit,
then any async RPCs would not complete, since RunFinished immediately
shuts down the kernel.

Fix this by reordering 1 and 2.
2018-11-13 00:57:09 +08:00
whitequark dd829afebd firmware: fix another TOCTTOU race in sync/async RPC code. 2018-11-12 15:42:07 +00:00
whitequark 583bba8777 Revert "firmware: workaround for RPC failures"
This reverts commit 59033d2588.
2018-11-12 15:36:36 +00:00
whitequark 0edae64afb firmware: fix TOCTTOU race in sync/async RPC code.
Before this commit, the main loop in session code was laid like:

  1. process_kern_queued_rpc
  2. process_host_message
  3. process_kern_message

If a host message (such as an RPC reply) caused the kernel to exit,
then any async RPCs would not complete, since RunFinished immediately
shuts down the kernel.

Fix this by reordering 1 and 2.
2018-11-12 15:30:59 +00:00
Sebastien Bourdeauducq 59033d2588 firmware: workaround for RPC failures 2018-11-12 19:51:54 +08:00
Sebastien Bourdeauducq 84a6b3d09b runtime: fix DMA recording after now-pinning 2018-11-10 14:14:55 +08:00
Robert Jördens a4997c56cf ad9910: simplify edge detection logic
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-09 18:54:34 +00:00
Robert Jördens e927551827 manual: add highfinesse-net port 2018-11-09 19:39:25 +01:00
Robert Jördens 14b6b63916 ad9910: rewire io_delay tuning
This now reliably locates the SYNC_CLK-IO_UPDATE edge by doing two
scans at different delays between start and stop IO_UPDATE.
It also works well when one delay is very close to the edge.
And it correctly identifies which (start or stop) pulse hit or crossed
the SYNC_CLK edge.

for #1143

Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-09 18:38:27 +00:00
Sebastien Bourdeauducq 1f7858b80b test/dsp: fix rtio_output 2018-11-09 22:11:44 +08:00
Sebastien Bourdeauducq e509ab8553 test/dsp: use absolute import path
Avoids "ImportError: attempted relative import with no known parent package"
when doing a simple "python -m unittest test_XXX.py".
2018-11-09 22:10:46 +08:00
Robert Jördens fe3d6661eb manual: kasli device name for zadig on windows
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-09 15:00:59 +01:00
Robert Jördens 38c6878d49 urukul: mention min/max attenuation
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-09 13:32:05 +01:00
Robert Jördens e565ca6b82 urukul: slow down att write to datasheet limit
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-09 13:23:06 +01:00
Robert Jördens 998be50f07 urukul: handle MSB in att_reg
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-09 13:21:14 +01:00
Sebastien Bourdeauducq c990b5e4f1 Merge remote-tracking branch 'origin/master' into new 2018-11-08 20:21:56 +08:00
Sebastien Bourdeauducq a0cc7311ad test: tighten test_pulse_rate 2018-11-08 20:17:55 +08:00
Sebastien Bourdeauducq 0bee43aa58 sawg: use new rtio_output() API 2018-11-08 20:16:30 +08:00
Sebastien Bourdeauducq bec25cbaa0 suservo: use new rtio_output() API 2018-11-08 20:13:14 +08:00
Sebastien Bourdeauducq e8d58b35b4 spi2: use new rtio_output() API 2018-11-08 20:12:30 +08:00
Sebastien Bourdeauducq d18546550e grabber: use new rtio_output() API 2018-11-08 19:15:50 +08:00
Sebastien Bourdeauducq 2549e623c1 ad9914: use new rtio_output() API 2018-11-08 19:15:44 +08:00
David Nadlinger 9740032a94 firmware: Fix dma_record_output_wide 2018-11-08 11:06:43 +00:00
Sebastien Bourdeauducq f74dda639f drtio: 8-bit address 2018-11-08 18:36:20 +08:00
Sebastien Bourdeauducq 8caea0e6d3 gateware,runtime: optimize RTIO kernel interface further
* now pinning (TODO: atomicity)
* for inputs, merge request and timeout registers
2018-11-08 18:29:24 +08:00
Robert Jördens fcb611d1d2 test_ad9910: don't expect large SYNC_IN delay margins
sinara-hw/Urukul#16

Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-07 18:18:35 +01:00
Sebastien Bourdeauducq aadf5112b7 rtio: remove incorrect comment 2018-11-08 00:02:44 +08:00
Sebastien Bourdeauducq fae95e73ad ttl: use optimized rtio_output API 2018-11-07 23:41:43 +08:00
Sebastien Bourdeauducq 3d0c3cc1cf gateware,runtime: optimize RTIO output interface
* reduce address to 8 bits
* merge core, channel and address into 32-bit pre-computable "target"
* merge we register into data register
2018-11-07 23:39:58 +08:00
Robert Jördens e6efe830c4 ad9910: rewire sync delay tuning
* search from wide window end
* decouple margins and minimum window size
* add note about kasli jitter

Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-07 14:52:03 +00:00
Sebastien Bourdeauducq ad0254c17b Merge branch 'switching125' into new 2018-11-07 22:03:18 +08:00
Sebastien Bourdeauducq efd735a6ab Revert "drtio: monitor RTIOClockMultiplier PLL (#1155)"
This reverts commit 469a66db61.
2018-11-07 22:01:03 +08:00
Robert Jördens 6c00ab57c0 test_ad9910: relax SYNC window
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-06 19:31:38 +01:00
Robert Jördens 172633c7da test_ad9910: default to a useful seed
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-06 17:35:57 +01:00
Robert Jördens 0b2661a34d ad9910: robustify SYNC window finding
don't integrate too long, find the window tip fast and early
a couple 100 SYNC pulses are sufficient

Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-06 12:41:21 +00:00
Robert Jördens ba4bf6e59b kasli: don't pass rtio pll feedback through bufg
UG472: "The MMCM performance increases because the
feedback clock is not subjected to noise on the core supply since it
never passes through a block powered by this supply."

Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-06 11:58:55 +00:00
Robert Jördens b6e4961b0f kasli: lower RTIO clock jitter
* high bandwidth since the si5324 is good
* no low power ibufgds
* drop bufg between ibufgds and pll
* increase pll vco frequency to 1.5 GHz

Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-06 11:43:19 +00:00
Robert Jördens e17e458c58 ptb2: add sync to urukul0 for ad9910 usage
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-06 10:06:51 +00:00
Robert Jördens 73b7124091 test_ad9910: print sync scan for debugging
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-06 10:04:21 +01:00
Sebastien Bourdeauducq 9a3d81ffee kasli: fix tester clk_sel 2018-11-06 14:49:21 +08:00
Sebastien Bourdeauducq fb12df7e01 Revert "kasli_tester: urukul0 mmcx clock defunct"
This reverts commit 68220c316d.
2018-11-06 14:33:21 +08:00
Robert Jördens 31f68ddf6c Merge branch 'urukul-sync'
* urukul-sync: (29 commits)
  urukul: flake8 [nfc]
  ad9910: flake8 [nfc]
  urukul/ad9910 test: remove unused import
  test_urukul: relax speed
  urukul,ad9910: print speed metrics
  kasli: add PTB2 (external clock and SYNC)
  kasli: add sync to LUH, HUB, Opticlock
  kasli_tester: urukul0 mmcx clock defunct
  test_ad9910: relax ifc mode read
  tests: add Urukul-AD9910 HITL unittests including SYNC
  ad9910: add init bit explanation
  test: add Urukul CPLD HITL tests
  ad9910: fiducial timestamp for tracking phase mode
  ad9910: add phase modes
  ad9910: fix pll timeout loop
  tester: add urukul sync
  ptb: back out urukul-sync
  ad9910: add IO_UPDATE alignment and tuning
  urukul: set up sync_in generator
  ad9910: add io_update alignment measurement
  ...

close #1143
2018-11-05 19:54:30 +01:00
Robert Jördens 6fb18270a2 urukul: flake8 [nfc]
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:45:24 +01:00
Robert Jördens 832690af9a ad9910: flake8 [nfc]
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:44:51 +01:00
Robert Jördens 6d525e2f9a urukul/ad9910 test: remove unused import
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:40:57 +01:00
Robert Jördens 36c5a7cd04 test_urukul: relax speed
works fine at < 3µs here but needs <5 µs on buildbot-kasli-tester

Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:37:20 +01:00
Robert Jördens 89fecfab50 urukul,ad9910: print speed metrics
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:37:18 +01:00
Robert Jördens 32d538f72b kasli: add PTB2 (external clock and SYNC)
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:37:16 +01:00
Robert Jördens d8a5951a13 kasli: add sync to LUH, HUB, Opticlock
for #1143, also add missing LUH device db

Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:37:14 +01:00
Robert Jördens 68220c316d kasli_tester: urukul0 mmcx clock defunct
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:37:11 +01:00
Robert Jördens 89fadab63d test_ad9910: relax ifc mode read
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:37:08 +01:00
Robert Jördens f522e211ba tests: add Urukul-AD9910 HITL unittests including SYNC
for #1143

Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:37:06 +01:00
Robert Jördens 9fb850ae75 ad9910: add init bit explanation
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:37:02 +01:00
Robert Jördens bc04da15c5 test: add Urukul CPLD HITL tests
for #1143

Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:37:00 +01:00
Robert Jördens 141cc7d99f ad9910: fiducial timestamp for tracking phase mode
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:36:58 +01:00
Robert Jördens 2f6d3f79ff ad9910: add phase modes
* simplified and cross-referenced the explanation of the different
  phase modes.
* semantically and functionally merged absolute and tracking/coherent
  phase modes.
* simplified numerics to calculate phase correction
* added warning about possible inconsistency with DMA and default
  phase mode
* restricted __all__ imports
* moved continuous/relative phase offset tracking from an instance
  variable to a "handle" returned by set()/set_mu() in order to avoid
  state inconsistency with DMA (#1113 #1115)

for #1143

Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:36:55 +01:00
Robert Jördens d3ad2b7633 ad9910: fix pll timeout loop
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:36:53 +01:00
Robert Jördens 4269d5ad5c tester: add urukul sync
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:36:52 +01:00
Robert Jördens 60d3bc63a7 ptb: back out urukul-sync
... for backwards compatibility.

Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:36:50 +01:00
Robert Jördens 06139c0f4d ad9910: add IO_UPDATE alignment and tuning
for #1143

Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:36:48 +01:00
Robert Jördens 1066430fa8 urukul: set up sync_in generator
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:36:46 +01:00
Robert Jördens 4bbd833cfe ad9910: add io_update alignment measurement
for #1143

Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:36:44 +01:00
Robert Jördens 7b92282012 ad9910: add docs for sync tuning, refactor
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:36:42 +01:00
Robert Jördens 8a47a6b2fb ad9910: disable sync_clk output
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:36:40 +01:00
Robert Jördens 65e2ebf960 ad9910: add sync delay control, auto tuning
* expose multi device sync functionality
* sync delay configuration interface
* auto-tuning of sync delay from device_db seed

for #1143

Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:36:37 +01:00
Robert Jördens 8dbf5f87fd ad9910: simplify io_update pulsing on init, set_mu
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:36:35 +01:00
Robert Jördens 0b3b07a7da ad9910: add power down method
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:36:34 +01:00
Robert Jördens 3538444876 urukul: add sync_in to eem0-7 name
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:36:32 +01:00
Robert Jördens 0433e8f4fe urukul: add sync_in generator
for #1143

Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:36:30 +01:00
Robert Jördens f62c1ff0bb TTLClockGen: expose acc_width
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:36:27 +01:00
Robert Jördens f755a4682a device_db_ptb: fix zotino clr
Signed-off-by: Robert Jördens <rj@quartiq.de>
2018-11-05 19:36:24 +01:00
David Nadlinger abad916383 RELEASE_NOTES: Fix typo 2018-11-03 20:33:19 +08:00
David Nadlinger 8b5df9c151 RELEASE_NOTES: TTL timeline cursor API changes 2018-11-03 20:33:19 +08:00
David Nadlinger f79b9d9e1e ttl: Expand input gate/count API docstrings 2018-11-03 20:33:19 +08:00
David Nadlinger f02ceee626 language: Clarify now_mu() docstring [nfc] 2018-11-03 20:33:19 +08:00
David Nadlinger e7d3f36b91 doc: Fix ancient trigger code in slides
These examples were already broken before my recent changes to the
artiq.coredevice.ttl API.
2018-11-03 20:33:19 +08:00
David Nadlinger 5d2e3f975f coredevice: Add get_rtio_counter_mu() docstring [nfc] 2018-11-03 20:33:19 +08:00
David Nadlinger d6fcc0529f coredevice: Imperative mood in docstrings [nfc]
This follows Python conventions (PEP257) and unifies the style with
other comments.
2018-11-03 20:33:19 +08:00
David Nadlinger cbdef0225c ttl: Add target RTIO time argument to timestamp/count functions
Software-based tracking of timestamps is problematic (e.g. when
using DMA, see GitHub #1113).
2018-11-03 20:33:19 +08:00
David Nadlinger 2a0e1dabfb ttl: Remove unused attribute [nfc] 2018-11-03 20:33:19 +08:00
David Nadlinger 17a5fb2dce ttl: Remove error-prone sync() calls
These methods are problematic, as with DMA in the picture, the
timestamp member variables did not necessarily reflect the last
submitted event timestamp (see GitHub #1113).

sync() is only very rarely used in typical experimental code, so
the methods are removed without a transition period.
Core.wait_until() can be used to busy-wait for a specified RTIO
timestamp value on the core device CPU instead.
2018-11-03 20:33:19 +08:00
David Nadlinger 11e8c9d5f7 coredevice: Add Core.wait_until_mu()
(This supersedes TTLOut.sync(), see see GitHub #1113.)
2018-11-03 20:33:19 +08:00
David Nadlinger cbfbe24d7a ttl: Remove broken TTLClockGen.sync
The code currently doesn't compile because of a typo in the timestamp
field name. However, tracking event timestamps in software is
problematic anyway (e.g. with DMA, see GitHub #1113), so just remove
`sync()` altogether.
2018-11-03 20:33:19 +08:00
Sebastien Bourdeauducq 7f11411127 RELEASE_NOTES: 3.7 2018-11-03 20:17:28 +08:00
Sebastien Bourdeauducq bc4a8157c0 kasli: add tsinghua2 2018-11-01 18:26:37 +08:00
David Nadlinger 91f0d640e2
.github: Match suggested commit message format to established convention
This changes the suggested format for commit messages to match the
convention actually used here (no square brackets).
2018-10-25 22:01:14 +01:00
Robert Jördens 89a961fb00 urukul, ad9912, ad9910: expose CFG RF switch better
* conincident setting of multiple switches
* per channel setting
2018-10-24 13:04:46 +02:00
Drew 4e04b6b4dd [template]: fix 3_question.md template use of ":"
Question.md didn't display on ARTIQ new issue page.
Solution: Cannot use ":" in Markdown header

Signed-off-by: Drew Risinger <drewrisinger@users.noreply.github.com>
2018-10-23 23:01:58 +08:00
Drew 761d30d998 [template]: Reorder pull request template
PR template wasn't in a logical order, hard for maintainers to read. Reorganized.
Fix directory where docs are built from.

Signed-off-by: Drew Risinger <drewrisinger@users.noreply.github.com>
2018-10-23 23:01:22 +08:00
Sebastien Bourdeauducq 0b43ec4719 conda: bump migen 2018-10-21 14:33:14 +08:00
Sebastien Bourdeauducq 48a142ed63 use FutureWarning instead of DeprecationWarning
DeprecationWarning is disabled by default and too easy to ignore.
2018-10-21 12:14:51 +08:00
Sebastien Bourdeauducq 9793632282 enviromnment: rename 'save' in set_dataset to 'archive'. Closes #1171 2018-10-21 12:08:34 +08:00
Marius Weber 029f9d983a Tpz fixes (#1178)
*   flake8
*   fix TPZ constructor after move to asyncio
*   Tcube fix docummentation in set_channel_enable_state
2018-10-20 20:49:15 +08:00
Drew a84c6c6d74 Add issue & pull request templates (#1163) 2018-10-20 20:43:19 +08:00
Sebastien Bourdeauducq c52a6ca8e9 typo (#1179) 2018-10-20 20:40:07 +08:00
Florent Kermarrec 3318925f4e firmware/liboard_misoc/sdram: use similar loops on read_level_scan and read_level for consistent results 2018-10-16 09:40:39 +02:00
Sebastien Bourdeauducq 6357a50d33 kasli: update nudt variant 2018-10-15 18:04:57 +08:00
David Nadlinger e3cfbfed06 master: Add minimal docstring to worker_impl [nfc] 2018-10-14 10:41:32 +08:00
David Nadlinger 64b9a377da master: Factor RIDCounter out into own module, explain worker_db module [nfc]
The docstrings are quite minimal still, but should already
help with navigating the different layers when getting
accustomed with the code base.

RIDCounter was moved to its own module, as it isn't really
related to the other classes (used from master only).
2018-10-14 10:41:32 +08:00
David Nadlinger 4641ddf002 master: Remove unused import [nfc] 2018-10-14 10:41:32 +08:00
Robert Jördens 661dd00c4c ad9912: phase offset is 14 bit LSB aligned
c.f. sinara-hw/Urukul#15
2018-10-11 15:16:08 +02:00
hartytp 08074d5275 Urukul: add support for hardware v1.3 clocking options 2018-10-10 09:26:35 +02:00
Sebastien Bourdeauducq 469a66db61 drtio: monitor RTIOClockMultiplier PLL (#1155)
Debugging by Tom Harty
2018-10-08 14:50:02 +02:00
Robert Jördens 9cf88329b2 CONTRIBUTING: correct default licensing 2018-10-08 11:20:37 +02:00
hartytp 1a1b454ed9 Urukul: flake8 (NFC) 2018-10-08 10:09:49 +01:00
Robert Jördens 5de319d76a bit2bin: don't print string terminator 2018-10-08 10:13:03 +02:00
hartytp 9a509e5070 Zotino: increase delay after register read in init method to avoid underflows 2018-10-06 21:45:17 +08:00
Sebastien Bourdeauducq 86fe6b0594 kasli: add NUDT variant 2018-10-04 23:20:09 +08:00
Sebastien Bourdeauducq a89bd6b684 kasli: swap Urukul EEMs for Tester
Updated to Urukul 1.3.
2018-10-04 23:19:31 +08:00
Sebastien Bourdeauducq 9f96b6bcda kasli: use 125MHz DRTIO freq for testing 2018-10-04 10:41:01 +08:00
Sebastien Bourdeauducq 969a305c5a Merge branch 'master' into switching125 2018-10-04 10:08:42 +08:00
Robert Jördens d0ee2c2955 opticlock: external 100 MHz 2018-09-28 19:05:18 +02:00
Drew Risinger 0fef2afccb make.bat: fix typo 2018-09-27 23:22:19 +08:00
Drew Risinger fad7128a52 Create Docs Makefile for Windows. #1159
Allows building Sphinx documentation on Windows,
(not just Linux as previously).
Closes #1159.
2018-09-27 23:22:19 +08:00
Sebastien Bourdeauducq 3b3fddb5a4 kasli: add mitll2 2018-09-27 23:21:52 +08:00
Sebastien Bourdeauducq 998a468983 examples: add grabber to device databases 2018-09-27 16:09:25 +08:00
Sebastien Bourdeauducq c71e442929 documentation improvements
Based on PR #1101 by @drewrisinger
2018-09-26 12:12:37 +08:00
Sebastien Bourdeauducq b92350b0f6 drtio: monitor RTIOClockMultiplier PLL (#1155)
Debugging by Tom Harty
2018-09-26 10:52:08 +08:00
Chris Ballance 53c7a5f2c6 dashboard: fix TTL moninj level display 2018-09-26 10:32:08 +08:00
Sebastien Bourdeauducq 212892d92f style 2018-09-26 10:13:33 +08:00
Robert Jördens 20cddb6a25 tester: handle no available ttl outputs 2018-09-24 09:19:28 +00:00
Sebastien Bourdeauducq 73f0de7c79 sayma: DRTIO master fixes 2018-09-20 11:15:45 +08:00
Sebastien Bourdeauducq 1b7f403a4b drtio: remove remote RTIO PHY resets 2018-09-20 11:10:32 +08:00
Sebastien Bourdeauducq 53a979e74d rtio: cleanup resets 2018-09-20 10:58:38 +08:00
Sebastien Bourdeauducq 251d90c3d5 drtio: clear read request in satellite only after reply has been fully sent
Otherwise, chan_sel become invalid before the end of the packet, which
can cause the interconnect to invalidate i_timestamp and i_data which results
in corruption of the end of the packet.
2018-09-20 08:53:45 +08:00
Sebastien Bourdeauducq 69d060b639 drtio: fix satellite i_status handling 2018-09-19 20:57:21 +08:00
Sebastien Bourdeauducq b86b6dcc09 drtio: add switching input test 2018-09-19 17:50:29 +08:00
Sebastien Bourdeauducq 08be176369 drtio: fix satellite i_status handling 2018-09-19 17:50:18 +08:00
Sebastien Bourdeauducq 3d965910f7 Revert "drtio: implement per-destination underflow margins"
This reverts commit 142c952e3d.
2018-09-19 17:05:48 +08:00
Sebastien Bourdeauducq 142c952e3d drtio: implement per-destination underflow margins 2018-09-19 17:03:15 +08:00
Sebastien Bourdeauducq 62642957cd runtime: fix DRTIO aux channel race condition 2018-09-19 11:16:21 +08:00
David Nadlinger b482f5feae firmware: Use larger ARP cache
This works around a problematic interaction between ARP cache
expiry in smoltcp (with its 3 seconds timeout before a discovery
request is sent) and our TCP keepalive settings, where the timeout
is reached before the keepalive had a chance to be sent.

GitHub: Closes #1150.
2018-09-18 14:46:52 +00:00
Sebastien Bourdeauducq 970d1bf147 drtio: add switching unittest 2018-09-18 15:27:52 +08:00
Sebastien Bourdeauducq eda15a596c drtio: add buffering to repeater 2018-09-18 15:27:25 +08:00
Sebastien Bourdeauducq 2b44786f73 drtio: add repeater input support 2018-09-17 23:45:27 +08:00
whitequark c33f74dabe firmware: derive Clone for Mutex. 2018-09-15 15:24:44 +00:00
Sebastien Bourdeauducq c8cd830118 drtio: implement get_rtio_destination_status for kernels 2018-09-15 19:11:22 +08:00
Sebastien Bourdeauducq f7ad7a99e3 firmware: set DEST_COUNT to 0 without routing 2018-09-15 19:10:52 +08:00
Sebastien Bourdeauducq 3cbdf2fbac kasli: cleanup drtio blink example 2018-09-15 18:43:27 +08:00
Sebastien Bourdeauducq d38755feff drtio: implement destination state checks on operations 2018-09-15 15:55:45 +08:00
whitequark 1990ab35d3 firmware: implement mutexes. 2018-09-15 07:35:35 +00:00
Sebastien Bourdeauducq cd61ee858c kasli: fix satellite TSC instantiation 2018-09-15 14:06:54 +08:00
Sebastien Bourdeauducq 7565d816e4 frontend: remove artiq_pcap. Closes #1152 2018-09-15 12:09:37 +08:00
Sebastien Bourdeauducq eaeab0c9bd frontend: add artiq_rtiomon 2018-09-15 12:09:32 +08:00
Sebastien Bourdeauducq c0c413196a frontend: remove artiq_pcap. Closes #1152 2018-09-15 12:08:06 +08:00
Sebastien Bourdeauducq f097b4104c satman: not(has_drtio_routing) fixes 2018-09-15 12:06:47 +08:00
Sebastien Bourdeauducq 0017cb756e frontend: add artiq_rtiomon 2018-09-15 10:44:59 +08:00
Sebastien Bourdeauducq 2f010e0109 runtime: improve moninj aux error logging 2018-09-15 10:44:41 +08:00
Sebastien Bourdeauducq 20ed393c1e style 2018-09-15 10:43:50 +08:00
Sebastien Bourdeauducq f8c6fa5ad6 typo 2018-09-15 10:43:36 +08:00
Sebastien Bourdeauducq 65da1fee4a firmware: fix build without DRTIO 2018-09-14 20:38:41 +08:00
Sebastien Bourdeauducq d19550daf8 firmware: simplify drtioaux function names 2018-09-14 20:32:09 +08:00
Sebastien Bourdeauducq ae72e3a51e firmware: add support for moninj and kern_hwreq over DRTIO switching 2018-09-14 20:26:39 +08:00
Sebastien Bourdeauducq 1ef39a98a7 drtio: implement per-destination buffer space 2018-09-13 16:16:32 +08:00
Sebastien Bourdeauducq e95638e0a7 style 2018-09-13 15:54:28 +08:00
Sebastien Bourdeauducq 042b0065de runtime: print destination up message for local RTIO 2018-09-13 14:10:52 +08:00
Sebastien Bourdeauducq fa872c3341 firmware: implement DRTIO destination survey 2018-09-13 12:00:29 +08:00
Sebastien Bourdeauducq 6cf3db3485 satman: forward RTIO resets 2018-09-12 23:02:54 +08:00
Sebastien Bourdeauducq 5a9cc004f2 drtio: receive and print unsolicited aux packets
Helps with debugging and prevents the aux channel from getting stuck after packets arrive after the timeout.
2018-09-12 22:57:21 +08:00
Sebastien Bourdeauducq 0befec7d26 drtio: improve repeater error reports 2018-09-12 20:54:01 +08:00
Sebastien Bourdeauducq 420e1cb1d0 cri: fix firmware routing table access 2018-09-12 18:08:16 +08:00
Sebastien Bourdeauducq e36a8536d7 runtime: better handling of aux timeouts 2018-09-12 17:31:23 +08:00
Sebastien Bourdeauducq 5bcd40ff59 cri: fix routing table depth 2018-09-12 17:30:55 +08:00
Sebastien Bourdeauducq edf403b837 drtio: improve error reporting 2018-09-12 15:44:34 +08:00
Sebastien Bourdeauducq 95432a4ac1 drtio: remove old debugging features 2018-09-12 13:01:27 +08:00
Sebastien Bourdeauducq 8227037a84 examples: add kasli_drtioswitching 2018-09-11 22:20:18 +08:00
Sebastien Bourdeauducq 41972d6773 drtio: rt_packet_satellite CRI fixes 2018-09-11 22:19:55 +08:00
Sebastien Bourdeauducq 051bafbfd9 drtio: ensure 2 cycles between frames on the link
This gives time for setting chan_sel before cmd on CRI.
2018-09-11 22:18:42 +08:00
Sebastien Bourdeauducq 251b9a2b0d drtio: do not lock up master when satellite repeatedly fails to answer buffer space reqs 2018-09-11 22:17:57 +08:00
Sebastien Bourdeauducq 5439abaa9d satman: fix error messages 2018-09-11 20:10:52 +08:00
Sebastien Bourdeauducq 36e3fedfc6 runtime: print routing table at boot 2018-09-11 20:10:33 +08:00
Sebastien Bourdeauducq e6bd835b5d satman: fix rank setting 2018-09-11 20:04:51 +08:00
Sebastien Bourdeauducq 2679a35082 firwmare: propagate DRTIO routing table and rank all the way 2018-09-11 18:28:17 +08:00
Sebastien Bourdeauducq c0c5867f9e satman: increase stack size
Prevents crashing when running the routing code.

Will have to be shrunk back on Sayma RTM.
2018-09-11 18:23:51 +08:00
Sebastien Bourdeauducq a23af67f2b satman: print better debugging information on exception 2018-09-11 18:23:36 +08:00
Sebastien Bourdeauducq f5b386c0d8 firmware: fix routing table formatting 2018-09-11 18:22:45 +08:00
Sebastien Bourdeauducq b38c57d73b firmware: send DRTIO routing table to satellite 2018-09-11 14:12:41 +08:00
Sebastien Bourdeauducq 3d29a7ed14 firmware: add fmt::Display to RoutingTable 2018-09-11 11:27:56 +08:00
Sebastien Bourdeauducq 2fff96802b runtime: remove support for building without RTIO 2018-09-10 23:09:02 +08:00
Sebastien Bourdeauducq 19a14b68b1 runtime: program DRTIO routing table into gateware 2018-09-10 22:48:56 +08:00
Sebastien Bourdeauducq 264078baba style 2018-09-10 22:29:35 +08:00
Sebastien Bourdeauducq e01efbcb8a runtime: merge sync_tsc and wait_tsc_ack 2018-09-10 22:17:00 +08:00
Sebastien Bourdeauducq 4d889c0c4e firmware: improve DRTIO log messages 2018-09-10 21:40:02 +08:00
Sebastien Bourdeauducq 663432adbd satman: load TSCs of downstream devices 2018-09-10 20:34:33 +08:00
Sebastien Bourdeauducq bc1d3fda6a satman: ping repeater links
Tested OK on hardware.
2018-09-10 20:17:13 +08:00
Sebastien Bourdeauducq 31bef9918e firmware: fix drtio_routing compatibility with master and satellite 2018-09-10 20:16:42 +08:00
Sebastien Bourdeauducq 7ec45efdcf kasli: add missing cri_con to Satellite 2018-09-10 20:16:09 +08:00
Sebastien Bourdeauducq 014cfd8dbd firmware: add drtioaux routing packets 2018-09-09 22:44:25 +08:00
Sebastien Bourdeauducq 7ae44f3417 firmware: add routing table (WIP) 2018-09-09 21:49:28 +08:00
Sebastien Bourdeauducq 496d1b08fd kasli: enable routing in Master 2018-09-09 21:48:12 +08:00
Sebastien Bourdeauducq ec302747e0 kasli: add DRTIO repeaters 2018-09-09 16:27:39 +08:00
Sebastien Bourdeauducq d5577ec0d0 cri: add routing table support 2018-09-09 16:26:48 +08:00
Sebastien Bourdeauducq df61b85988 drtio: fix imports 2018-09-09 14:11:32 +08:00
Robert Jördens 312256a18d grabber: fix frame size off-by-1 2018-09-07 16:55:43 +02:00
Sebastien Bourdeauducq ec62eb9373 drtio: minor cleanup 2018-09-07 17:51:38 +08:00
Robert Jördens 4d73fb5bc9 grabber: only advance when DVAL 2018-09-06 11:01:08 +02:00
Sebastien Bourdeauducq 87e0384e97 drtio: separate aux controller
This helps with managing CSR groups and heterogeneous (satellite/repeaters) DRTIO cores.
2018-09-05 17:56:58 +08:00
Sebastien Bourdeauducq 92be9324df add missing files 2018-09-05 16:09:02 +08:00
Sebastien Bourdeauducq 2884d595b3 drtio: add rt_controller_repeater 2018-09-05 16:08:40 +08:00
Sebastien Bourdeauducq 839f748a1d drtio: add external TSC to repeater 2018-09-05 15:55:20 +08:00
Sebastien Bourdeauducq 5f20d79408 drtio: add timeout on satellite internal CRI buffer space request 2018-09-05 14:12:11 +08:00
Sebastien Bourdeauducq 1450e17a73 sayma: adapt to TSC and DRTIOSatellite changes 2018-09-05 12:10:41 +08:00
Sebastien Bourdeauducq 19ae9ac1b1 kc705: adapt to TSC changes 2018-09-05 12:07:28 +08:00
Sebastien Bourdeauducq 3d531cc923 kasli: adapt to TSC and DRTIOSatellite changes 2018-09-05 12:06:47 +08:00
Sebastien Bourdeauducq 4e4398afa6 analyzer: adapt to TSC changes 2018-09-05 12:06:20 +08:00
Sebastien Bourdeauducq 15b16695c6 frontend: add artiq_route 2018-09-04 19:04:27 +08:00
Robert Jördens bf36786d45 kasli_tester: clean up grabber test 2018-09-04 10:59:19 +00:00
Robert Jördens 47eb37e212 VLBAI{Master,Slave}: align rtio channels with PTB 2018-09-04 10:39:45 +00:00
Sebastien Bourdeauducq 778f1de121 drtio: add TSC sync and missed command detection to rt_packet_repeater 2018-09-03 18:26:13 +08:00
hartytp c55460f59f suservo: fix doc typo 2018-09-03 11:48:40 +02:00
Sebastien Bourdeauducq 00fabee1ca drtio: fix rt_packet_repeater timeout 2018-09-03 09:57:15 +08:00
Sebastien Bourdeauducq f3fe818049 rtio: refactor TSC to allow sharing between cores 2018-09-03 09:48:12 +08:00
Sebastien Bourdeauducq 0fe2a6801e drtio: forward destination with channel 2018-09-02 15:50:23 +08:00
Sebastien Bourdeauducq 6768dbab6c drtio: add buffer space support to rt_packet_repeater 2018-09-02 14:38:37 +08:00
Sebastien Bourdeauducq 88b7529d09 drtio: share CDC 2018-09-02 14:37:29 +08:00
Sebastien Bourdeauducq 078c862618 drtio: add repeater (WIP, write only) 2018-09-01 21:07:55 +08:00
Sebastien Bourdeauducq 6057cb797c drtio: reorganize tests 2018-08-31 16:28:33 +08:00
Sebastien Bourdeauducq 4f963e1e11 drtio: minor cleanup 2018-08-30 15:15:32 +08:00
Sebastien Bourdeauducq ce6e390d5f drtio: expose internal satellite CRI 2018-08-30 12:41:09 +08:00
Robert Jördens e7dba34475 kasli/tester: fill all 12 EEM 2018-08-29 18:09:09 +00:00
Robert Jördens b58ec2d78e artiq_flash: treat all variants ending in `satellite` as such 2018-08-29 17:53:48 +00:00
Robert Jördens fbf05db5ab kasli: add VLBAI Master and Satellite 2018-08-29 17:53:48 +00:00
Robert Jördens 9584c30a1f kasli: DRTIO Base: flexible rtio_clk_freq 2018-08-29 17:53:48 +00:00
Robert Jördens eb9e9634df siphaser: support 125 MHz rtio clk
keep the phase shift increment/decrement at 1/(56*8) rtio_clk
cycles
2018-08-29 17:53:48 +00:00
Robert Jördens ccc58a0f84 satman: add 125 MHz Si5324 settings
from cjbe
2018-08-29 17:53:48 +00:00
Sebastien Bourdeauducq aa64e6c1c6 cri: add buffer space request protocol 2018-08-29 15:16:43 +08:00
whitequark a5cd7d2761 doc: update manual/developing.rst. 2018-08-28 20:00:32 +00:00
Sebastien Bourdeauducq ba6094c3e5 test: relax network transfer rates
Due to lower Kasli system clock frequency.
2018-08-27 16:47:48 +08:00
Sebastien Bourdeauducq ea71a0491b conda: bump misoc. Closes #1057 2018-08-27 13:37:46 +08:00
Sebastien Bourdeauducq c9d8bd1566 Merge branch 'nix' 2018-08-24 19:03:52 +08:00
Sebastien Bourdeauducq 7f523e7e50 nix: add shell starter 2018-08-24 19:03:25 +08:00
whitequark 0e7419450e firmware: update smoltcp.
This adds TCP window scaling support.
2018-08-20 00:26:40 +00:00
Sebastien Bourdeauducq 23ea8c81f3 nix: update pythonparser 2018-08-19 21:18:40 +08:00
Sebastien Bourdeauducq 9b6ea47b7a kasli: use SFP LEDs to show DRTIO link status. Closes #1073 2018-08-19 13:04:41 +08:00
Sebastien Bourdeauducq d6992f6a0c conda: work around 'received dictionary as spec' conda bug 2018-08-18 23:15:59 +08:00
Sebastien Bourdeauducq d1d26e2aa3 hmc7043: add explanation about HMC_SYSREF_DIV 2018-08-18 11:43:40 +08:00
Sebastien Bourdeauducq f75a317446 hmc7043: automatically determine output groups 2018-08-18 11:43:23 +08:00
Sebastien Bourdeauducq c498b28f88 hmc7043: disable FPGA_ADC_SYSREF 2018-08-18 11:42:57 +08:00
Sebastien Bourdeauducq a7810502f6 artiq_coremgmt: add option to specify core device address directly 2018-08-18 10:58:40 +08:00
Sebastien Bourdeauducq fc09144baa artiq_coremgmt: remove unnecessary DeviceManager 2018-08-18 10:46:08 +08:00
Sebastien Bourdeauducq 167e97efd2 sayma: support external RTM clocking 2018-08-17 22:57:54 +08:00
Sebastien Bourdeauducq 041dc0f64a jesd204: update core to v0.10
Closes #727
Closes #1127
2018-08-17 22:50:07 +08:00
Sebastien Bourdeauducq 5c3e834c4d ad9154: retry DAC initialization on STPL or PRBS failure
Works around #1127
2018-08-17 20:52:55 +08:00
Sebastien Bourdeauducq 66e33a66d6 test: enable TTL loopback tests on Kasli 2018-08-17 13:35:55 +08:00
Sebastien Bourdeauducq d707d2f4fe test: relax TTL timing requirements to support DIO EEM 2018-08-17 13:35:16 +08:00
Sebastien Bourdeauducq 1ba12e1cdb gui/log: print messages in tooltips
This helps reading long messages in small log windows.
2018-08-17 13:21:38 +08:00
Sebastien Bourdeauducq 341437ea50 nix: remove outputcheck and lit 2018-08-17 13:20:56 +08:00
Sebastien Bourdeauducq e978430c54 nix: add warnings to README 2018-08-17 12:27:17 +08:00
Sebastien Bourdeauducq 233c841f2e nix: remove bogus version string 2018-08-17 12:19:38 +08:00
Sebastien Bourdeauducq 3d332ccc0b nix: update README 2018-08-17 12:19:16 +08:00
Sebastien Bourdeauducq 4155853482 nix: add Clang back 2018-08-16 13:03:55 +08:00
Sebastien Bourdeauducq 2c55f2ce4b nix: install binutils-or1k 2018-08-16 10:06:23 +08:00
Sebastien Bourdeauducq 2e6c0b6a6d nix: propagate artiq subdependencies 2018-08-16 10:06:03 +08:00
Sebastien Bourdeauducq ac9dcb7497 nix: fix and update binutils-or1k 2018-08-16 10:05:07 +08:00
Sebastien Bourdeauducq 57bd3e4109 nix: also use latest python3 for llvmlite 2018-08-16 10:01:48 +08:00
Sebastien Bourdeauducq c3759379bd nix: upgrade pyqtgraph and switch it to Qt5 2018-08-16 09:53:15 +08:00
Sebastien Bourdeauducq 477dcdbad4 nix: use latest python3 2018-08-16 09:39:21 +08:00
Sebastien Bourdeauducq 73cf071b1a nix: update LLVM and llvmlite, remove clang (not needed for running) 2018-08-16 00:33:52 +08:00
Sebastien Bourdeauducq 0b1ce0ea32 nix: use original pyqtgraph and pyserial 2018-08-16 00:25:55 +08:00
Sebastien Bourdeauducq 487720d13b nix: remove sphinx (used for building doc, not running ARTIQ) 2018-08-16 00:25:01 +08:00
Sebastien Bourdeauducq 7003835062 nix: update license 2018-08-16 00:21:51 +08:00
David Nadlinger 2463e5667d compiler: Fix attribute writeback with skipped fields
offset wasn't advanced for skipped fields previously,
leading to memory corruption/unaligned accesses at runtime.
2018-08-14 13:34:32 +01:00
Stewart Mackenzie ec97d63617 nix: separated buildtime & runtime dependencies 2018-08-13 10:30:58 +00:00
Sebastien Bourdeauducq c172ec6de9 artiq_flash: target Kasli by default 2018-08-13 12:13:21 +08:00
Sebastien Bourdeauducq 34329cf366 artiq_flash: target Kasli by default 2018-08-13 12:12:36 +08:00
David Nadlinger 0e32a165c2 satman: Fix build with Rust 1.28
The build was broken in 2648b1b7a1.
2018-08-13 00:12:27 +01:00
whitequark e285fe0d56 test: tighten required TransferTest timings.
smoltcp performs significantly better with LTO.
2018-08-12 20:17:37 +00:00
whitequark 46bd96abd1 artiq_devtool: make kasli-tester the default configuration. 2018-08-12 19:17:45 +00:00
whitequark 38d60100ff firmware: optimize dma_record_output.
This removes a number of bounds checks and adds a fast path for
outputting exactly one word to DMA, which is the most common
operation.
2018-08-12 19:17:45 +00:00
whitequark bdd18de2c1 firmware: globally enable LTO.
This used to crash with earlier rustc versions, but doesn't anymore,
and gives significant speedup (e.g. 2x on test_dma_record_time).
2018-08-12 19:17:45 +00:00
whitequark 2648b1b7a1 firmware: migrate to Rust 1.28.0.
This also updates / is a prerequisite for updating smoltcp.

Rationale for changes made:
  * compiler_builtins is now shipped in the rust prefix.
  * rustc's libpanic_unwind no longer works for us because it
    has a hard dependency on Box (and it's a horrible hack);
    fortunately, we only ever needed a personality function
    from it.
  * panic and oom handlers are now set in a completely different
    way.
  * allocators are quite different (and finally stable).
  * NLL caused internal compiler errors in runtime, so code using
    NLL was rewritten to not rely on it and it was turned off.
2018-08-12 19:17:45 +00:00
Sebastien Bourdeauducq d2e47844dd nix: fixes 2018-08-12 21:20:02 +08:00
Stewart Mackenzie e48d440fd4 Problem: ARTIQ setup via conda or src is complex
Solution: Provide a single command to download, compile and install
dependencies.
2018-08-12 13:04:40 +00:00
Sebastien Bourdeauducq 738d2c6bcb hmc7043: REFSYNCIN → RFSYNCIN 2018-08-11 12:07:17 +08:00
Sebastien Bourdeauducq bc3e715a8f examples: fix kasli_tester 2018-08-11 10:51:42 +08:00
whitequark fab6e5cdff compiler: skip functional values in attribute writeback.
Fixes #1088.
2018-08-10 12:02:49 +00:00
Sebastien Bourdeauducq 052e400f12 test: skip test_dma_playback_time on Kasli (#946) 2018-08-09 18:08:21 +08:00
Sebastien Bourdeauducq 957645a7e7 examples: move kasli tester out of kasli_basic 2018-08-09 18:07:44 +08:00
Sebastien Bourdeauducq bbc98410e4 test: dds → ad9914dds
Prevent confusion with Urukul.
2018-08-09 16:55:09 +08:00
Sebastien Bourdeauducq bf78e0c7d2 test: fix handling of missing devices 2018-08-09 16:51:12 +08:00
Robert Jördens a061ba2505 grabber/kasli_basic: add grabber test
close #1121
2018-08-08 12:43:44 +02:00
Robert Jördens f7678cc24a grabber: refactor state machine 2018-08-07 18:07:46 +02:00
Robert Jördens 6cd2432e30 grabber: log all resolution changes
close #1120
2018-08-07 16:21:21 +02:00
Robert Jördens 99a15ca0c6 grabber: rationalize derived traits 2018-08-07 16:21:21 +02:00
Sebastien Bourdeauducq 49f7a1610f sayma: use GTP_CLK1 only for all variants (#1080) 2018-08-07 20:53:14 +08:00
Sebastien Bourdeauducq e2a49ce368 drtio: support external IBUFDS_GTE3 2018-08-07 20:52:45 +08:00
Sebastien Bourdeauducq 8b8e1844f0 kasli_sawgmaster: roughly match Urukul and Sayma amplitudes 2018-08-07 20:07:21 +08:00
Sebastien Bourdeauducq 9ce6233926 kasli: fix SYSU TTL directions 2018-08-07 19:29:28 +08:00
Sebastien Bourdeauducq 8aa88cfe70 kasli_sawgmaster: add Urukul-Sayma example 2018-08-07 19:29:28 +08:00
Robert Jördens 474bc7b65b browser: handle windows file urls for feeding h5py
close #1014
2018-08-07 12:57:01 +02:00
whitequark 93af5d2a03 compiler: handle async RPC as last statement in try block.
Fixes #1107.
2018-08-07 07:06:53 +00:00
whitequark 7bd7b6592a rpc_proto: serialize keywords correctly.
Fixes #1109.
2018-08-07 06:47:09 +00:00
whitequark 259f1576c3 Fix tests after a74958f0. 2018-08-07 06:06:49 +00:00
whitequark a74958f01f ksupport: raise RuntimeError on reraise with no inflight exception.
Fixes #1123.
2018-08-07 05:53:13 +00:00
Sebastien Bourdeauducq 2008d02f4d runtime: use different default IP and MAC for different kinds of boards
This helps reduce conflicts when having many boards on a development network.
2018-08-07 10:30:50 +08:00
Sebastien Bourdeauducq bbe36b94f7 ad9154: enable sync in init 2018-08-06 19:02:27 +08:00
Sebastien Bourdeauducq 7f0b2ff594 jesd204sync: work around HMC7043 poor behavior with combined delays
The HMC7043 outputs poorly controlled signals when adjusting
two delays at once. This commit puts the DAC in one-shot SYSREF mode,
and only triggers synchronizations when SYSREF is stable.
2018-08-06 17:43:17 +08:00
Sebastien Bourdeauducq f32f0126e2 Revert "ad9154: use continuous sync mode"
The HMC7043 is not really glitchless.

This reverts commit bd968211de.
2018-08-06 16:59:53 +08:00
Sebastien Bourdeauducq 65f198bdee kasli: use tester EEMs for DRTIO, add Urukul-Sayma sync example 2018-08-06 16:53:13 +08:00
Sebastien Bourdeauducq bd968211de ad9154: use continuous sync mode 2018-08-06 00:27:10 +08:00
Sebastien Bourdeauducq b023865b42 sayma: instantiate dummy IBUFDS_GTE3 on unused but driven Si5324 clock pins
Solve same problem as e83ee3a0 but channels cannot be independently disabled.
2018-08-05 23:02:41 +08:00
Sebastien Bourdeauducq e83ee3a07a hmc7043: disable GTP_CLK1 when not in use
Termination and biasing are not active at the FPGA when IBUFDS_GTE3 is
not instantiated, and driving a clock then leads to overvoltage.
2018-08-03 10:03:52 +08:00
Chris Ballance 6fc8439399 tweak moninj to allow old dashboard with new firmware 2018-08-02 19:34:14 +08:00
Chris Ballance 04cbc3237b test_moninj: test injection monitoring 2018-08-02 19:34:14 +08:00
Chris Ballance 47740c8930 share moninj injection state between dashboards
Previously if one dashboard overrode a channel this was not visible on
any other dashboard - the channel appeared to operate normally.
2018-08-02 19:34:14 +08:00
Robert Jördens 7d6a1b528d ad9912: add ftw_to_frequency 2018-08-02 11:19:12 +00:00
Robert Jördens e518a1f1d0 ad53xx: also increase slack after control readback 2018-08-02 11:19:12 +00:00
whitequark 5871d13da8 firmware: actually compact in config::compact().
Fixes #1116.
2018-08-01 16:27:48 +00:00
David Nadlinger 829fca6112 pyon: Correctly deserialize bare NaNs
This also fixes (non-numpy) lists containing NaNs.

Previously, accidentally storing a NaN in a dataset would
bring down large parts of the system.
2018-07-30 11:08:56 +01:00
David Nadlinger 08ee91beb2 ad9910: Clarify chip_select range [nfc]
`assert 3 <= chip_select <= 7` is rather opaque without looking
at the CPLD source code otherwise.
2018-07-30 11:08:17 +01:00
David Nadlinger 6b89106578 ad53xx: Avoid sporadic RTIOUnderflow in init()
I observed sporadic RTIO underflows on Kasli before, by ~2.5 µs,
so 5 µs extra slack should be plenty. No underflows since.
2018-07-28 23:45:48 +01:00
Sebastien Bourdeauducq c00eb181fc conda: bump jesd204b 2018-07-28 13:17:44 +08:00
Sebastien Bourdeauducq e4d48a78eb drtio: wait for remote to ack TSC synchronization
Sayma takes a long time after TSC sync to align SYSREF, and this caused two issues:
1. Aux packets getting lost and causing error reports
2. DRTIO links reported up and kernels proceeding despite the DACs not being properly synced.
2018-07-26 20:28:17 +08:00
Sebastien Bourdeauducq 83de8b2ba2 drtio: add ping timeout during link init 2018-07-26 20:27:53 +08:00
Sebastien Bourdeauducq 446f791180 firmware: simplify SYSREF DRTIO alignment 2018-07-26 19:37:59 +08:00
Sebastien Bourdeauducq f8c17528e7 satman: use new SYSREF code 2018-07-26 16:26:57 +08:00
Sebastien Bourdeauducq 32c95ac034 sayma: automated DAC SYSREF phase calibration 2018-07-26 16:23:55 +08:00
Sebastien Bourdeauducq dbcf2fe9b4 firmware: remove 'chip found' messages on Sayma 2018-07-26 16:07:37 +08:00
Sebastien Bourdeauducq d523d03f71 sayma: automated FPGA SYSREF phase offset calibration 2018-07-26 14:53:28 +08:00
Sebastien Bourdeauducq 0a9d3638ee config: add write_int 2018-07-26 14:49:32 +08:00
Sebastien Bourdeauducq 19c51c644e grabber: cleanup GRABBER_STATE 2018-07-24 19:08:51 +08:00
Sebastien Bourdeauducq fb96c1140e grabber: add coredevice driver 2018-07-24 18:06:44 +08:00
Sebastien Bourdeauducq b38c685857 grabber: fix pix.stb 2018-07-24 11:32:32 +08:00
Sebastien Bourdeauducq 60a7e0e40d grabber: use usual order of ROI coordinates in cfg addresses 2018-07-24 10:55:13 +08:00
Sebastien Bourdeauducq 015c592ab7 conda: bump jesd204b 2018-07-21 15:49:40 +08:00
Sebastien Bourdeauducq 7b75026391 grabber: add MultiReg to transfer ROI boundaries 2018-07-21 13:40:12 +08:00
Sebastien Bourdeauducq 4a4d0f8e51 grabber: fix missing variable rename 2018-07-21 13:39:46 +08:00
Sebastien Bourdeauducq 3638a966e1 kasli: add false path between RTIO and CL clocks 2018-07-21 13:26:13 +08:00
Sebastien Bourdeauducq 031de58d21 grabber: complete RTIO PHY, untested 2018-07-21 13:25:47 +08:00
Sebastien Bourdeauducq e3ba4b9516 grabber: minor ROI engine cleanup, export count_len, cap count width to 31 2018-07-21 13:25:13 +08:00
Sebastien Bourdeauducq 766d87f626 doc: artiq_coreconfig → artiq_coremgmt config. Closes #1111 2018-07-20 11:59:07 +08:00
Sebastien Bourdeauducq cab0ba408d fmcdio_vhdci_eem: cleanup and document 2018-07-20 09:57:03 +08:00
Sebastien Bourdeauducq d152506ecb sayma: update fmcdio_vhdci_eem demo 2018-07-19 15:47:20 +08:00
Sebastien Bourdeauducq 8dfcd463aa fmcdio_vhdci_eem: naming consistency 2018-07-19 15:46:04 +08:00
Sebastien Bourdeauducq fe93a454d6 fmcdio_vhdci_eem: fix direction shift register permutation and polarity 2018-07-19 15:16:21 +08:00
Sebastien Bourdeauducq e71cbe53a6 firmware: cleanup Cargo.lock 2018-07-18 10:37:43 +08:00
Sebastien Bourdeauducq 31f4f8792a sayma: add Urukul and Zotino to example device_db 2018-07-18 10:31:55 +08:00
Sebastien Bourdeauducq 25170a53e5 sayma: add back Urukul and Zotino 2018-07-18 10:27:54 +08:00
Sebastien Bourdeauducq 5e62910a8d examples: add Sayma VHDCI DIO 2018-07-17 23:28:05 +08:00
Sebastien Bourdeauducq 8b9a8be12a fmcdio_vhdci_eem: add dirctl word computation functions 2018-07-17 23:27:29 +08:00
Sebastien Bourdeauducq 82145b1263 examples: sayma_drtio → sayma_masterdac 2018-07-17 20:32:30 +08:00
Sebastien Bourdeauducq c7d96c2223 conda: bump migen 2018-07-17 20:30:23 +08:00
Sebastien Bourdeauducq 7fe76426fe fmcdio_vhdci_eem: commit missing part of previous commit 2018-07-17 20:30:13 +08:00
Sebastien Bourdeauducq d4d12e264d fmcdio_vhdci_eem: refactor
This allows access to the pin allocation from kernels, which becomes useful
to configure the direction shift register.
2018-07-17 20:13:59 +08:00
Sebastien Bourdeauducq 4fdc20bb11 sayma: disable Urukul and Zotino for now
Ultrascale I/Os are being a pain as usual and the SPI core won't compile.
2018-07-17 20:08:21 +08:00
Sebastien Bourdeauducq 8335085fd6 fmcdio_vhdci_eem: fix cc pins 2018-07-17 19:50:34 +08:00
Sebastien Bourdeauducq 8f7c0c1646 fmcdio_vhdci_eem: fix iostandard 2018-07-17 19:40:34 +08:00
Sebastien Bourdeauducq d724bd980c sayma: add EEMs to Master 2018-07-17 18:58:23 +08:00
Sebastien Bourdeauducq a0f2d8c2ea gateware: add FMCDIO/EEM adapter definitions 2018-07-17 18:58:16 +08:00
Sebastien Bourdeauducq 3645a6424e sayma: fix Master build 2018-07-17 18:56:33 +08:00
Sebastien Bourdeauducq 9b016dcd6d eem: support specifying I/O standard
Xilinx FPGAs require different LVDS I/O standard names depending on I/O bank voltage.
2018-07-17 18:55:17 +08:00
Sebastien Bourdeauducq 3168b193e6 kc705: remove Zotino and Urukul
* use Kasli instead for using EEMs
* code required outdated VHDCI adapter 1.0
2018-07-17 17:48:57 +08:00
Sebastien Bourdeauducq 13984385a8 firmware: version → ident 2018-07-15 17:40:17 +08:00
Sebastien Bourdeauducq b2695d03ed sayma: remove with_sawg from Master variant 2018-07-15 17:38:29 +08:00
Sebastien Bourdeauducq 123e7bc054 pyon: sort string dicts by key when pretty-printing. Closes #1010 2018-07-15 17:38:09 +08:00
Sebastien Bourdeauducq b27fa8964b add variant in identifier string
Also add without-sawg suffixes on Sayma.

Closes #1060
Closes #1059
2018-07-15 17:21:17 +08:00
Sebastien Bourdeauducq b6c70b3cb0 eem: add Zotino monitoring. Closes #1095 2018-07-15 15:35:04 +08:00
Sebastien Bourdeauducq 8bcba82b65 grabber: reset *_good signals on end of frame
This reduces the amount of time the ROI engine produces invalid output after
being reconfigured.
2018-07-15 15:34:00 +08:00
Sebastien Bourdeauducq ea7f925852 Revert "worker_db: Only warn on repeated archive read if dataset changed"
Breaks numpy arrays.

This reverts commit 141fcaaa8a.
2018-07-13 10:41:06 +08:00
Sebastien Bourdeauducq 46fb5adac3 grabber: fix frequency counter formula 2018-07-12 20:14:38 +08:00
Sebastien Bourdeauducq 82def6b535 grabber: add frequency counter
Cameras are a bit obscure about what they output, this can help with troubleshooting.
2018-07-12 17:05:18 +08:00
Sebastien Bourdeauducq 29c35ee553 hmc7043: fix dumb mistake in previous commit 2018-07-12 13:01:41 +08:00
Sebastien Bourdeauducq 8802b930de hmc7043: add delay after init
Delay required at step 9 of the "Typical Programming Sequence" (page 24 of the datasheet)
2018-07-12 12:37:12 +08:00
Sebastien Bourdeauducq c66f9483f8 hmc7043: wait after changing delays
Allows for the SPI transaction to finish, and for the delay to stabilize.
2018-07-12 12:33:53 +08:00
Sebastien Bourdeauducq 1c191a62bf sayma: tune SYSREF phases 2018-07-12 12:33:35 +08:00
Sebastien Bourdeauducq 773240bef4 hmc7043: test GPO before using
Based on code by David.
2018-07-12 11:30:24 +08:00
David Nadligner 141fcaaa8a worker_db: Only warn on repeated archive read if dataset changed
In larger experiments, it is quite natural for the same dataset
to be read from multiple unrelated components. The only situation
where multiple reads from an archived dataset are problematic is
when the valeu actually changes between reads. Hence, this commit
restricts the warning to the latter situation.
2018-07-12 10:15:42 +08:00
Sebastien Bourdeauducq 4843832329 hmc7043: check phase status on init. Closes #1055
Troubleshooting by David.
2018-07-11 19:45:24 +08:00
Sebastien Bourdeauducq 9397fa7f5a hmc7043: unstick SYSREF FSM (#1055)
Troubleshooting by David.

Additionally, register 7D is broken.
Checking phase init state has to be done through another means.
2018-07-11 19:11:01 +08:00
Sebastien Bourdeauducq 88fb9ce4d6 sayma_rtm: add hmc7043_gpo monitoring 2018-07-11 19:04:29 +08:00
Sebastien Bourdeauducq 29e5c95afa sayma_rtm: minor cleanup 2018-07-11 19:02:59 +08:00
Sebastien Bourdeauducq 7f05e0c121 sayma_rtm: remove UART loopback
RTM power supply issues are fixed now, plus this will get in the way of satman support.
2018-07-11 19:00:18 +08:00
Sebastien Bourdeauducq f8ceea20d0 grabber: add new ROI engine (untested) 2018-07-10 17:06:17 +08:00
Sebastien Bourdeauducq d82beee540 grabber: make parser EOP a pulse 2018-07-10 17:04:07 +08:00
Sebastien Bourdeauducq 701c93d46c grabber: add false path constraints 2018-07-10 14:28:23 +08:00
Sebastien Bourdeauducq 6a77032fa5 grabber: use BUFR/BUFIO
Less jitter and frees up BUFGs.
2018-07-10 13:30:38 +08:00
Sebastien Bourdeauducq 208dc7c218 grabber: prevent glitches in last_x/last_y cdc 2018-07-10 12:56:37 +08:00
Sebastien Bourdeauducq c4e3c66265 grabber: add clock constraint 2018-07-10 12:37:32 +08:00
Sebastien Bourdeauducq d51294649e conda: bump migen/misoc 2018-07-10 12:26:24 +08:00
David Nadlinger 768b970deb Fixup 4359a437 (tuples of lists), add regression tests 2018-07-10 01:18:51 +01:00
David Nadlinger edc314524c test_embedding: Remove unused reference to `led` device 2018-07-10 01:11:47 +01:00
Sebastien Bourdeauducq 4f56710e4b grabber: add parser, report detected frame size in core device log 2018-07-10 02:06:37 +08:00
Robert Jördens 37e303dafc gitmodules: remove empty file 2018-07-09 19:32:29 +02:00
Robert Jördens 2d4af509c2 readthedocs.yml: drop (out of date, not working) 2018-07-09 19:31:27 +02:00
David Nadlinger 4359a43732 compiler: Indirection status of TTuple depends on elements
For instance, TTuple(TList(TInt32())) has indirections, while
TTuple(TInt32()) does not.

This fixes memory corruption with RPCs that return tuples of lists.

Signed-off-by: David Nadlinger <code@klickverbot.at>
2018-07-09 18:49:50 +08:00
Sebastien Bourdeauducq d2c8e62cb7 test_rtio: relax ClockGeneratorLoopback performance requirements 2018-07-09 18:07:25 +08:00
Sebastien Bourdeauducq 423929a125 test: relax min transfer rates from 2MB/s to 1.9MB/s 2018-07-09 18:00:24 +08:00
Sebastien Bourdeauducq 9153c4d8a3 use tokenize.open() to open Python source files
Fixes encoding issues especially with device databases modified in obscure editors.
2018-07-07 17:04:56 +08:00
Sebastien Bourdeauducq 4420046502 kasli_tester: support mixed AD9910/AD9912 systems 2018-07-06 15:43:38 +08:00
Sebastien Bourdeauducq ac3f360c26 kasli_tester: fix AD9912 support 2018-07-06 15:43:25 +08:00
Sebastien Bourdeauducq 509562ddbf kasli: add WIPM target 2018-07-06 15:41:28 +08:00
Robert Jördens 4eb26c0050 hmc7043: enable group 5 2018-07-03 14:16:31 +02:00
Sebastien Bourdeauducq 16b917be5d doc: add reminder of what positive slack means. Closes #1084 2018-07-02 16:23:12 +08:00
Sebastien Bourdeauducq 540bdae99c grabber: enable DIFF_TERM on inputs 2018-07-01 09:28:51 +08:00
Sebastien Bourdeauducq 0483b8d14c sayma_drtio: ditto 2018-06-28 17:03:32 +08:00
Sebastien Bourdeauducq 04d6ff45c8 kasli_sawgmaster: reset SAWGs
Most importantly this resets the phase accumulators.
2018-06-28 17:01:48 +08:00
Sebastien Bourdeauducq 729ce58f98 sayma: use GTP_CLK1 to clock DRTIO satellite transceiver
This is required to get constant skew between the DRTIO transceiver clock
(which then generates the RTIO clock) and the siphaser reference clock.

Both the Si5324 and the RTM clock tree have non-deterministic in-to-out skew
at 150MHz due to dividers.
2018-06-28 11:23:40 +08:00
Sebastien Bourdeauducq a65721d649 sayma: put RTM clock tree into the siphaser loop
* Fixes one bug where siphaser was one Si5324 output and the rest of the
system was clocked by the other. With the Si5324 settings we have, skew
between the outputs is not controlled.
* Puts the coaxial cable between AMC and RTM into the siphaser loop.
2018-06-27 21:46:55 +08:00
Sebastien Bourdeauducq d49716dfac satman: tune Sayma SYSREF phases 2018-06-27 18:09:35 +08:00
Sebastien Bourdeauducq 46c044099c hmc7043,satman: verify alignment of SYSREF slips 2018-06-27 17:36:13 +08:00
Sebastien Bourdeauducq 7dfd70c502 hmc7043: make margin_{minus,plus} consistent with ad9154 2018-06-27 17:35:26 +08:00
Sebastien Bourdeauducq 4bbdd43bdf hmc7043: do not freeze if SYSREF slip fails 2018-06-27 17:32:56 +08:00
Sebastien Bourdeauducq a8a2ad68d3 runtime: tune Sayma SYSREF phases 2018-06-27 17:31:29 +08:00
apatura-iris e9a1e10221 Update installing.rst
Added comment to clarify that ``artiq-main`` is the conda environment.
2018-06-27 08:18:50 +02:00
apatura-iris 5e5cdf0e67 Update installing.rst
The file 99-openocd.rules as downloaded from githubusercontent.com seems to be outdated and does now work on Ubuntu 16.04. The version that ships with OpenOCD has an additional ``TAG+="uaccess"`` in the rules file and works fine. Thus I suggest to use the file that is bundled with OpenOCD.
2018-06-27 08:18:50 +02:00
Sebastien Bourdeauducq 811882943b artiq_flash: RTM gateware is not required for master variant 2018-06-25 18:28:55 +08:00
Sebastien Bourdeauducq c750de2955 sayma: add many-port pure DRTIO master 2018-06-25 18:21:22 +08:00
Sebastien Bourdeauducq 84b3d9ecc6 bootloader: also check firmware CRC in SDRAM (#1065) 2018-06-23 11:28:12 +08:00
Sebastien Bourdeauducq 68530fde07 sayma: generate 100MHz from Si5324 on standalone and master targets
* Allow switching between DRTIO satellite and standalone without
  touching the hardware.
* Allow operating standalone and master without an additional RF
  signal generator.
2018-06-23 10:44:38 +08:00
whitequark b6dd9c8bb0 runtime: support builds without RTIO DMA.
Fixes #1079.
2018-06-23 00:56:21 +00:00
whitequark 12fde6d34b artiq_coremgmt: fix typo.
Fixes #1056.
2018-06-23 00:36:59 +00:00
Sebastien Bourdeauducq 51a5d8dff9 examples: add Kasli SAWG master 2018-06-22 18:57:49 +08:00
Sebastien Bourdeauducq f87da95e57 jesd204: use jesd clock domain for sysref sampler
RTIO domain is still in reset during calibration.
2018-06-22 17:13:01 +08:00
Sebastien Bourdeauducq 76fc63bbf7 jesd204: use separate controls for reset and input buffer disable 2018-06-22 11:38:18 +08:00
Sebastien Bourdeauducq d9955fee76 jesd204: make sure IOB FF is used to sample SYSREF at FPGA 2018-06-22 11:00:56 +08:00
Sebastien Bourdeauducq 60b22217ce sayma: set DRTIO master HMC830_REF to 100MHz 2018-06-22 10:10:09 +08:00
Sebastien Bourdeauducq e6d1726754 sayma: add RTIO log to DRTIO master 2018-06-22 00:05:22 +08:00
Sebastien Bourdeauducq 83428961ad sayma: add SAWG and JESD to DRTIO master 2018-06-22 00:04:22 +08:00
Sebastien Bourdeauducq c1db02a351 drtio/gth_ultrascale: disable IBUFDS_GTE3 until stable_clkin
Precaution against HMC7043 noise issues.
2018-06-21 22:56:07 +08:00
Sebastien Bourdeauducq 8b3c12e6eb sayma: clock DRTIO master transceiver from HMC7043 2018-06-21 22:34:44 +08:00
Sebastien Bourdeauducq de7d64d482 sayma: clock JESD204 from GTP CLK2
This frees up GTP CLK1, which is routable to the SFP quads, for DRTIO.
2018-06-21 22:33:53 +08:00
Sebastien Bourdeauducq b28ff587c5 sayma: add sysref sampler to DRTIO master 2018-06-21 22:28:34 +08:00
Sebastien Bourdeauducq 07bcdfd91e hmc7043: stricter check of FPGA SYSREF margin 2018-06-21 22:26:49 +08:00
Sebastien Bourdeauducq e29536351d drtio: resync SYSREF when TSC is loaded 2018-06-21 17:00:32 +08:00
Sebastien Bourdeauducq 5a2a857a2f firmware: clean up SYSREF phase management 2018-06-21 16:23:41 +08:00
Sebastien Bourdeauducq 05e908a0fd hmc7043: align SYSREF with RTIO 2018-06-21 15:54:42 +08:00
Sebastien Bourdeauducq 9741654cad hmc7043: style 2018-06-21 15:54:42 +08:00
Sebastien Bourdeauducq 45e8263208 hmc7043: do not configure phases during initial init
They are determined later on.
2018-06-21 15:54:42 +08:00
whitequark 7cc3da4faf firmware: do not lose the ".dirty" suffix in build versions.
Fixes #1074.
2018-06-21 05:18:51 +00:00
whitequark 095ee28fd9 runtime: fix size values for bytes and bytearray RPCs.
Fixes #1076.
2018-06-21 00:51:56 +00:00
whitequark 9260cdb2e8 compiler: support conversion of list to bytearray and bytes.
Fixes #1077.
2018-06-21 00:40:45 +00:00
Sebastien Bourdeauducq 5a91f820fd examples: change Sayma sines frequency to 9MHz
Well within Red Pitaya bandwidth.
2018-06-20 22:40:07 +08:00
Sebastien Bourdeauducq 9288301543 examples: add DRTIO sines 2018-06-20 22:39:40 +08:00
Sebastien Bourdeauducq 28fb0fd754 sayma: add SYSREF sampler gateware 2018-06-20 17:48:35 +08:00
Sebastien Bourdeauducq 814d0583db hmc7043: improve smoothness of sysref phase control 2018-06-20 17:40:48 +08:00
Sebastien Bourdeauducq 9142a5ab8a rtio: expose coarse timestamp in RTIO and DRTIO satellite cores 2018-06-20 17:39:54 +08:00
Sebastien Bourdeauducq 5272c11704 typo 2018-06-20 17:05:20 +08:00
Sebastien Bourdeauducq 0c32d07e8b ad9154: new sysref scan
Print margins around the pre-defined fixed phase.
Also report error if margins are too small.

The fixed phase is also changed by this commit (the value 88 is
from before the new HMC7043 initialization code, and is probably wrong).
2018-06-20 00:15:58 +08:00
Sebastien Bourdeauducq 4803ca3799 examples/sayma_drtio: add SAWG channels 2018-06-19 23:50:26 +08:00
Sebastien Bourdeauducq 3d0e92aefd hmc7043: check that chip is disabled at startup 2018-06-19 23:49:17 +08:00
Sebastien Bourdeauducq 740e6863c3 hmc7043: add delay after releasing hardware reset 2018-06-19 23:48:48 +08:00
Sebastien Bourdeauducq 75b6cea52f sayma: add SAWG to DRTIO satellite 2018-06-19 19:12:10 +08:00
Sebastien Bourdeauducq eb3259b847 firmware: reduce number of DAC initialization attempts
Faster startup when one DAC is broken.
2018-06-19 19:10:23 +08:00
Sebastien Bourdeauducq 1d594d0c97 firmware: make DAC initialization failures non-fatal
This allows using RTMs with one broken DAC for development.
2018-06-19 19:09:38 +08:00
Sebastien Bourdeauducq 158b5e3083 satman: program Allaki 2018-06-19 18:09:05 +08:00
Sebastien Bourdeauducq 574892a4e5 firmware/serwb: cleanup and improve messaging 2018-06-19 15:11:03 +08:00
Sebastien Bourdeauducq c862471165 typo 2018-06-19 14:35:24 +08:00
Sebastien Bourdeauducq 433273dd95 sayma: support RTM FPGA, HMC830 and HMC7043 in DRTIO master and satellite 2018-06-19 14:33:48 +08:00
Sebastien Bourdeauducq 476cfa0f53 si5324: improve lock messaging 2018-06-19 14:29:57 +08:00
Sebastien Bourdeauducq 6403a0d5d1 sayma_amc: update without-sawg description 2018-06-19 13:52:05 +08:00
Sebastien Bourdeauducq d29b3dd588 hmc830: compile-time configurable reference frequency 2018-06-19 13:47:32 +08:00
Sebastien Bourdeauducq 6f3ed81626 targets/sayma_rtm: fix description 2018-06-18 17:46:53 +08:00
Robert Jördens 21a48711ec i2c: refactor common operations 2018-06-18 09:34:09 +00:00
Sebastien Bourdeauducq 0e640a6d6f hmc7043: fix SYSREF to meet s/h at FPGA (#794) 2018-06-18 17:04:12 +08:00
Robert Jördens 6272052d15 ad9154: don't drive the bsm with txen pins 2018-06-18 10:04:42 +02:00
Robert Jördens 32484a62de sayma_amc: remove unused imports 2018-06-17 13:09:44 +02:00
Sebastien Bourdeauducq 4f0c918dd3 slave_fpga: improve messaging 2018-06-17 00:27:27 +08:00
Robert Jördens 53ab255c00 sayma_amc: enable slave fpga loading (#813) 2018-06-16 12:47:26 +02:00
Robert Jördens f9910ab242 i2c: support selecting multiple or no channels
closes #1054
2018-06-15 19:36:37 +02:00
Robert Jördens 40baa8ecba hmc7043: disable ch 10 and 11 group 2018-06-15 15:34:31 +00:00
Robert Jördens 70fd369e2f conda: bump migen (sayma lvds diff term) 2018-06-15 17:28:49 +02:00
Robert Jördens edfae3c4ba hmc7043: make fpga fabric clocks lvds
2 V common and 1.9 Vpp swing
is brutal to the banks (HP 1.8V AMC and RT 1.8V RTM)
2018-06-15 14:24:33 +00:00
Robert Jördens f385add8b1 slave_fpga: disable cclk and din drive when done
to guard against accidental contention (old rtm gateware
but #813 rework done)
2018-06-13 16:26:48 +00:00
Robert Jördens 1029ac870b sayma_rtm: don't drive txen pins
pins disabled by config
necessary for using that pin as DIN (#813)
2018-06-13 16:11:30 +00:00
Sebastien Bourdeauducq 68d16fc292 serwb: support single-ended signals
Low-speed PHY only.
2018-06-13 21:28:21 +08:00
Robert Jördens f8627952c8 conda: fix migen build string 2018-06-12 20:25:28 +02:00
Robert Jördens a9a25f2605 sayma_rtm: drive ref_lo_clk_sel, and set clk muxes early 2018-06-12 20:00:12 +02:00
Robert Jördens aff7fa008f Revert "artiq_flash/sayma: check for DONE after load"
This reverts commit 2de5b0cf25.

would make artiq uninstallable on windows as win buildbot is broken
2018-06-12 19:14:43 +02:00
Robert Jördens 2de5b0cf25 artiq_flash/sayma: check for DONE after load 2018-06-13 00:47:43 +08:00
Thomas Harty b90a8fcc82 Merge branch 'master' of https://github.com/m-labs/artiq 2018-06-12 14:55:22 +01:00
ion 28ecf81c6c Sayma: HMC7043 init and detect no longer need results. 2018-06-12 13:10:26 +01:00
ion c8935f7adf Sayma: bypass dividers where possible to minimize noise (nb this changes the output skew). 2018-06-12 12:56:04 +01:00
hartytp 7a0140ecb2
Sayma HMC830: update interface and register writes. (#1068)
* Break the HMC830 init into separate functions for general purpose (but, integer-N) init, setting dividers and checking lock

* Use 1.6mA ICP (which the loop filter was optimized for)

* Go through the data sheet carefully and set all registers to the correct value (e.g. ensure that all settings are correctly optimized for integer-N usage)

* Change divider values (now using 100MHz PFD, which should give lower noise in theory)
2018-06-12 12:37:17 +01:00
Robert Jördens a9d97101fc slave_fpga: add another check 2018-06-12 10:24:04 +02:00
Robert Jördens a143e238a8 savel_fpga: get rid of unneeded config 2018-06-12 10:24:04 +02:00
Robert Jördens 4912f53ab4 slave_fpga: board_misoc 2018-06-12 10:24:04 +02:00
hartytp cb6e44b23a Sayma: disable unused HMC7043 outputs. 2018-06-12 16:18:20 +08:00
Robert Jördens 0b086225a9 sawg: don't use Cat() for signed signals
c.f. #1039 #1040 #1022 #1058 #1044
2018-06-09 07:33:47 +00:00
Robert Jördens 5b73dd8604 sawg: accurate unittest rtio freq 2018-06-08 17:22:13 +02:00
Robert Jördens 6a7983cf89 conda: bump misoc
closes #1039
closes #1040
closes #1022
closes #1058
closes #1044
2018-06-08 17:11:01 +02:00
Robert Jördens 735e4e8561 pcu: spelling 2018-06-08 14:39:22 +00:00
Robert Jördens e5f6750171 sawg: cleanup double assign 2018-06-08 14:31:55 +00:00
Florent Kermarrec 53e9e475d0 serwb: transmit zeroes when nothing to transmit (for prbs), improve rx idle detection 2018-06-08 16:10:31 +02:00
Florent Kermarrec 7296a76f18 serwb: move common datapath code to datapath.py, simplify flow control 2018-06-08 12:37:08 +02:00
Florent Kermarrec 89797d08ed serwb: revert to 125MHz linerate (until we understand why 1gbps version breaks between builds) 2018-06-07 15:13:56 +02:00
Robert Jördens b4c2b148d1 sawg: don't use Mux for signed signals
migen#75
2018-06-06 15:51:14 +00:00
Sebastien Bourdeauducq 28f31323a3 conda: bump migen (again) 2018-06-06 23:35:26 +08:00
Sebastien Bourdeauducq f427d45144 conda: bump migen 2018-06-06 22:58:32 +08:00
Florent Kermarrec 009db5eda9 serwb: revert 1gbps linerate 2018-06-06 16:20:20 +02:00
Sebastien Bourdeauducq cae92f9b44 kasli: add Tsinghua variant 2018-06-06 19:03:45 +08:00
Robert Jördens 38971d130a comm_analyzer: fix data without any spi reads
closes #1050
2018-06-06 12:21:42 +02:00
Robert Jördens e21b7965b9 sayma_amc: change test patterns for 'without-sawg' 2018-06-06 08:02:52 +00:00
Sebastien Bourdeauducq 0d1b36c89b jesd204: bump 2018-06-06 11:47:54 +08:00
whitequark 38dac16041 compiler: don't crash when quoting builtin functions.
Fixes #1051.
2018-06-05 23:27:23 +00:00
Sebastien Bourdeauducq c28fe47164 conda: fix misoc version 2018-06-05 21:11:57 +08:00
Sebastien Bourdeauducq af88c4c93e clean up hmc7043 reset 2018-06-05 20:41:48 +08:00
Thomas Harty 988054f4bb Sayma: fix mistake in HMC7043 init code. 2018-06-05 19:22:04 +08:00
Thomas Harty bd1ac7cf3b Configure HMC7043 to give deterministic phase differences between its outputs 2018-06-05 19:22:04 +08:00
Thomas Harty ac5c4913ec Sayma RTM: hold hmc7043 in reset/mute state during init. 2018-06-05 19:22:04 +08:00
Florent Kermarrec b82158a2de firmware/ad9154: add stpl test 2018-06-05 02:08:57 +02:00
Chris Ballance 07d4145a35 correct documented siphaser VCO frequency [NFC] 2018-06-04 20:53:43 +08:00
Florent Kermarrec 925b47b077 firmware/ad9154: reset the dac between each configuration attempt 2018-06-04 14:03:26 +02:00
Robert Jördens bb87976d4f suservo: docstring fixes, revert parametrization of r_rtt 2018-06-04 07:27:17 +00:00
Robert Jördens 07a1425e51
SUservo EEM docs
add documentation to eem.SUServo. Change parameterization of t_rtt to include delays on Sampler, as this seems simpler and more robust to changing RTIO frequencies in the future.

c.f. #1046
2018-06-04 08:51:28 +02:00
whitequark d686d33093 runtime: print hex dumps around PC/EA in case of exception.
For #1026.
2018-06-01 21:17:59 +00:00
whitequark 985fd7377b artiq_rpctool: use inspect.formatargspec instead of a NIH formatter.
Fixes #1029.
2018-06-01 19:18:14 +00:00
whitequark f1a80f12f8 doc: note that coreanalyzer lacks SAWG support.
Closes #1035.
2018-06-01 18:47:37 +00:00
Robert Jördens 62deffa7d2 opticlock: fix core device name 2018-06-01 15:39:23 +00:00
Robert Jördens f50aef1a22 suservo: extract boilerplate
closes #1041
2018-06-01 15:37:07 +00:00
Robert Jördens 5de2d06568 ad53xx/zotino: do not clear power down on overtemp 2018-06-01 13:17:13 +00:00
Robert Jördens 2c344686d9 ad53xx/zotino: enable overtemp shutdown and readback control 2018-06-01 13:06:52 +00:00
Robert Jördens b56d37eb63 manual: fix table 2018-06-01 14:22:15 +02:00
Robert Jördens 87d3ac9d25 suservo: swap transfer function parametrization
The integrator is now parametrized through its gain and not the PI
corner frequency. The integrator gain limit is given in absolute gain
units and not relative to the proportional gain.

close #1033
2018-06-01 09:38:18 +00:00
Sebastien Bourdeauducq e408241233 sawg: work around compiler not accepting delay_mu(int32) 2018-06-01 15:42:37 +08:00
Sebastien Bourdeauducq f5d55c6902 sawg: add 1 coarse RTIO cycle between spline resets
This keeps all events in the same SED lane and limits the number of SED lanes required.

Closes #1038
2018-06-01 15:15:24 +08:00
Robert Jördens 22506e849f suservo: clarify timings
close #1027
2018-06-01 06:35:38 +00:00
Robert Jördens a42f774440 suservo: document offset range limits
close #1034
2018-05-31 16:55:44 +00:00
Robert Jördens 36dcea3edf suservo: refactor y_mu_to_full_scale as portable
close #1032
2018-05-31 16:44:14 +00:00
Robert Jördens e136709cac suservo: document gain state
close #1030
2018-05-31 16:36:53 +00:00
Robert Jördens 5dbdc5650c suservo: document set_config and get_status more
close #1028
2018-05-31 16:32:05 +00:00
Robert Jördens e1b0fcc24e suservo: add documentation on settings and setup
close #1015
2018-05-31 16:21:09 +00:00
Robert Jördens 9b5a46dffd suservo: fix restart counter assertion
c.f. #788
2018-05-31 15:56:11 +00:00
Robert Jördens 58f71e34fc doc: add hut2 and lasersdk controller default ports 2018-05-31 14:23:57 +00:00
Sebastien Bourdeauducq 38b5128222 conda: bump jesd204 2018-05-30 23:39:22 +08:00
Paweł 44c7a028cb Added second argument to DIO.add_STD in master and satellite variant of kasli (now builds properly) 2018-05-30 22:49:40 +08:00
Sebastien Bourdeauducq 8fd57e6ccb kasli_tester: add Sampler and Zotino support 2018-05-29 22:36:42 +08:00
Sebastien Bourdeauducq d1df18ae6a monkey_patches: work around Python issue 33678. Closes #1016 2018-05-29 17:51:41 +08:00
whitequark 2e09307d8d firmware: use writeln instead of write in UART logger. 2018-05-29 03:16:52 +00:00
Sebastien Bourdeauducq 560889372f firmware: grabber support 2018-05-29 10:26:36 +08:00
Chris Ballance b860302a9a firmware: fix typo in UART logger 2018-05-28 17:25:23 +00:00
whitequark 2b7d98eb04 firmware: enable all log levels when creating UART logger.
The default is all off.
2018-05-28 16:49:25 +00:00
Sebastien Bourdeauducq ad099edf63 kasli: integrate grabber 2018-05-28 22:43:40 +08:00
Sebastien Bourdeauducq 563e434e15 eem: finalize grabber support 2018-05-28 22:43:06 +08:00
Sebastien Bourdeauducq 2612fd1e72 rtio: add grabber deserializer and WIP PHY encapsulation 2018-05-28 22:42:27 +08:00
Florent Kermarrec e21f14c0b3 serwb/phy: typo (KUSSerdes --> KUSerdes) 2018-05-28 10:41:11 +02:00
Sebastien Bourdeauducq c2890c6cf0 kasli_tester: initialize DDS channels 2018-05-28 14:24:39 +08:00
Robert Jördens b20a8c86b0 kasli: don't bother with grabber ttls for now
not used on target cameras
2018-05-28 07:31:00 +02:00
Sebastien Bourdeauducq 80c69da17e eem: add Grabber IOs and CC 2018-05-28 11:16:23 +08:00
Sebastien Bourdeauducq 4d3f763865 move kasli_opticlock to kasli_basic 2018-05-28 11:02:44 +08:00
Sebastien Bourdeauducq cc0ddf9d72 artiq_flash: do not check variants anymore
Not very useful and adds to the maintainance when building new Kasli systems.
2018-05-28 10:59:01 +08:00
Sebastien Bourdeauducq bb248970df style 2018-05-28 10:40:05 +08:00
Robert Jördens 56cfe77c91 environment: spelling 2018-05-27 20:36:11 +02:00
Robert Jördens b09d07905c kasli: add LUH/PTB/HUB variants
and refactor/simplify variant selection
2018-05-27 18:33:27 +00:00
whitequark db4d1878d3 compiler: remove debug print. 2018-05-25 09:37:18 +00:00
whitequark da851d8b7b conda: fix installation path in artiq-board. 2018-05-25 08:41:55 +00:00
whitequark bc86ade160 conda: add ignore_prefix_files in the outputs section too. 2018-05-25 08:41:19 +00:00
whitequark c3c9ffcd4f conda: override --install-lib, not --prefix. 2018-05-25 06:45:46 +00:00
whitequark 223b984385 Fix non-exception-safe finally: handlers.
Fixes #1013.
2018-05-25 04:23:32 +00:00
whitequark 44910efd0a conda: remove lib/python3.5 from artiq package paths as well.
Following c9287cfc.
2018-05-25 02:23:18 +00:00
whitequark fbf2c9a2fb compiler: hoist loads of kernel invariants to function entry block.
Addresses intraprocedural cases of #1007.
2018-05-25 02:18:13 +00:00
whitequark 12d1b9819c compiler: handle direct calls to class methods.
Fixes #1005.
2018-05-25 02:02:18 +00:00
whitequark c9287cfc69 conda: put `noarch: python` on correct artiq-board package.
Fixes #989.
2018-05-24 21:09:50 +00:00
Florent Kermarrec bcb9c3d09d firmware/serwb: move prbs_test outside of wait_init, add wishbone_test 2018-05-24 16:53:47 +02:00
Florent Kermarrec bca2969957 sayma_rtm: add RTMScratch module to test remote Wishbone accesses 2018-05-24 16:53:10 +02:00
Florent Kermarrec 7642254d83 Merge branch 'master' of http://github.com/m-labs/artiq 2018-05-24 16:51:23 +02:00
Florent Kermarrec 353767bfdb firmware/hmc830: add VCO subsystem register 6 programming (suggested by hartytp, tested on hardware without regression) 2018-05-24 16:49:49 +02:00
Sebastien Bourdeauducq 19efd8b13e kasli: refactor EEM code 2018-05-24 18:41:54 +08:00
Florent Kermarrec ad89c42acc firmware/serwb: automatically adjust prbs test delay to prbs test cycles, increase prbs test cycles 2018-05-24 10:20:55 +02:00
Florent Kermarrec 19e5280824 firmware/ad9154: cleanup DAC init
- Split dac_setup in dac_reset, dat_detect & dac_setup.
- Only do one reset/detection.
- Configure before doing SYSREF scan (otherwise scan don't work at the first scan after power up).
- Do the spi_setup in each function.
2018-05-24 09:34:00 +02:00
Florent Kermarrec fa3b48737b firmware/hmc830: Added magic word to HMC830 init sequence (from gkasprow & marmeladapk) 2018-05-24 09:23:00 +02:00
Robert Jördens 9715f774ac artiq_influxdb: controller (add ping()) 2018-05-22 22:12:25 +00:00
whitequark 7aacc04f0c language: scan functions are not supported on core device.
Closes #1009.
2018-05-22 21:33:35 +00:00
whitequark dfb4a437f5 manual: mention TRACE log level. 2018-05-22 21:32:00 +00:00
whitequark b55ce66a1b Reinstate accidentally removed aqctl_corelog.
Closes #1008.
2018-05-22 21:31:34 +00:00
whitequark 0c6f618056 manual: update to reflect the new artiq_coremgmt tool. 2018-05-22 18:56:04 +00:00
whitequark ce3c8fcd3e compiler: add source location to SSA arguments.
Fixes #1006.
2018-05-22 18:14:14 +00:00
Robert Jördens fcd12e3472 suservo: work around #1007 2018-05-22 17:36:41 +00:00
Robert Jördens 9a86dfe70d units: add mHz 2018-05-22 17:36:02 +00:00
Robert Jördens 4e863b32a1 coredevice: configurable initial backing state
Several core device drivers maintain a copy of some device state.
Since this copy is not transferred between experiments this backing state
can be different from device state when a new experiment is started.

This commit adds support for injecting initial backing state into
experiments via the device database and sets initial backing state where
known.

ad53xx (zotino): spi2 xfer_duration
novogorny: pgia gains
sampler: pgia gains, spi2 pgia and adc xfer_duration
suservo: pgia gains, spi2 pgia xfer_duration
urukul: cpld cfg (partial: rf_sw), attenuator register
spi2: div/length for xfer_duration

close #1003
2018-05-21 18:55:06 +02:00
Sebastien Bourdeauducq 4e5fe672e7 kasli: add tester target 2018-05-21 17:43:39 +08:00
Sebastien Bourdeauducq 2e6b81d59a kasli_tester: reset core device 2018-05-21 15:35:29 +08:00
Sebastien Bourdeauducq 8513f0b0d4 minor cleanup 2018-05-21 15:35:00 +08:00
whitequark 9b4ad8b5af compiler: implement local variable demotion. 2018-05-19 17:05:34 +00:00
whitequark fd110e9848 compiler: sort predecessors in IR dump output.
Makes diffs more useful.
2018-05-19 17:02:08 +00:00
whitequark dc1c4ebf1d compiler: use ARTIQ_IR_NO_LOC variable to control IR dump output.
Useful e.g. in tests or for running diff on irgen output.
2018-05-19 17:02:08 +00:00
whitequark 21a0f26cd1 compiler: do not emit nonstandard !unconditionally* LLVM metadata.
This metadata was added by an LLVM patch that was removed because
it was unsound.
2018-05-19 16:58:03 +00:00
Sebastien Bourdeauducq f953bee79e kasli_test: add RF switch control 2018-05-18 23:48:29 +08:00
Sebastien Bourdeauducq f457b59985 kasli_tester: bail out when run from ARTIQ master 2018-05-18 23:30:52 +08:00
Sebastien Bourdeauducq 3cbcb3bff6 move mitll, sysu and ustc device_dbs to kasli_basic 2018-05-18 23:20:40 +08:00
Sebastien Bourdeauducq bdfd993818 kasli_tester: add Urukul support 2018-05-18 23:18:03 +08:00
Sebastien Bourdeauducq 72aef5799e kasli/ustc: use TTLOut 2018-05-18 22:55:28 +08:00
Sebastien Bourdeauducq 9a4408a570 add Kasli TTL tester 2018-05-18 22:52:53 +08:00
Sebastien Bourdeauducq b10d3ee4b4 make RTIO clock switch optional and simplify
Kasli no longer has an internal RTIO clock.
Switching clocks dynamically is no longer supported.
2018-05-18 17:41:34 +08:00
Sebastien Bourdeauducq 8a988d0feb kasli: remove leftover debug print 2018-05-18 17:25:23 +08:00
Sebastien Bourdeauducq 37bd0c2566 kasli: add USTC target 2018-05-18 16:15:07 +08:00
Sebastien Bourdeauducq 73f8e61478 kasli_sysu: fix TTL directions in example device_db 2018-05-18 16:13:50 +08:00
Sebastien Bourdeauducq 826a85950b manual: add warning about developing section being for developers 2018-05-18 14:18:36 +08:00
Sebastien Bourdeauducq 6476219296 frontend: fix permissions 2018-05-18 00:10:46 +08:00
Robert Jördens bfff755295 urukul: do IO_RST also when blind 2018-05-17 14:48:49 +00:00
whitequark 5744d97d59 firmware: adjust backtrace addresses correctly. 2018-05-17 08:13:55 +00:00
Sebastien Bourdeauducq d4f074b1e1 firmware: fix Allaki addressing. Closes #993 2018-05-17 16:02:21 +08:00
whitequark 3b61b7c30b compiler: fix tests after 4d06c1d8. 2018-05-16 21:53:53 +00:00
whitequark 31c6c79204 firmware: implement an edge profiler.
It doesn't work extremely well, and the results can be somewhat
confusing, and it needs a libunwind patch, but it's the best I could
do and it seems still useful.
2018-05-16 21:53:53 +00:00
Robert Jördens 99f7672c79 ad53xx: tweak spi readback 2018-05-16 19:08:27 +02:00
Sebastien Bourdeauducq a640041844 firmware: improve ad9154/hmc830/hmc7043 messaging 2018-05-16 23:15:17 +08:00
Sebastien Bourdeauducq fedf7f0c87 firmware/ad9154: cleanup sysref scan and run everytime 2018-05-16 23:01:19 +08:00
Sebastien Bourdeauducq 1364cd2948 firmware/hmc830_7043: break out HMC830 SPI mode selection 2018-05-16 22:46:45 +08:00
Sebastien Bourdeauducq 0aadd3a361 firmware/hmc830_7043: improve messaging 2018-05-16 22:46:45 +08:00
whitequark 4d06c1d84b coredevice.CommKernel: modernize. NFC. 2018-05-16 14:40:14 +00:00
whitequark ca93b94aea firmware: move config requests to management protocol.
They were only in session protocol because of historical reasons.
2018-05-16 14:32:49 +00:00
whitequark a39f8d6634 artiq_devtool: use CommMgmt instead of shelling out to artiq_coremgmt.
(Which no longer exists.)

This also fixes `artiq_devtool hotswap` to work without
an `artiq_devtool connect` running in background.
2018-05-16 14:08:32 +00:00
whitequark d446a3293e frontend: merge core{config,log,boot,debug,profile} into coremgmt. 2018-05-16 14:08:32 +00:00
Sebastien Bourdeauducq b81b20caf8 conda: use h5py 2.8
For some reason, conda installs 2.7 by default, which causes messages such as:
/home/sb/miniconda3/envs/py35/lib/python3.5/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
2018-05-16 16:25:44 +08:00
Florent Kermarrec f77bcbebb5 serwb/test_serwb_core: fix 2018-05-16 08:34:53 +02:00
Florent Kermarrec 77fc5c599f serwb/test: update 2018-05-15 23:52:58 +02:00
Florent Kermarrec 3873d09692 serwb: rewrite high-speed phys by splitting clocking/tx/rx, scrambling is now always enabled. 2018-05-15 23:52:41 +02:00
Florent Kermarrec f8a9dd930b serwb/genphy: add device parameter (not used here, but this way all the phys share the same parameters), scrambling is also now always enabled. 2018-05-15 23:51:14 +02:00
Florent Kermarrec 2c627cd061 serwb/scrambler: simplify and set scrambler input data to 0 when sink.stb == 0 2018-05-15 23:49:17 +02:00
Florent Kermarrec 7fe49a78d2 firmware/runtime/session: fix compilation when no rtio core 2018-05-15 23:47:47 +02:00
whitequark 8128a814f6 firmware: update dependencies. 2018-05-15 18:17:32 +00:00
whitequark 1b0384c513 firmware: fix satman build. 2018-05-15 16:35:05 +00:00
whitequark 07b713fdad firmware: use upstream log_buffer. 2018-05-15 15:19:20 +00:00
whitequark 9f5b76253c firmware: remove some unnecessary unwraps. 2018-05-15 15:05:19 +00:00
whitequark e5796e26e1 firmware: remove unused #![feature(untagged_unions)]. 2018-05-15 15:05:19 +00:00
whitequark b54926134c firmware: update the signature of #[lang="panic_fmt"]. 2018-05-15 15:05:19 +00:00
Florent Kermarrec c18a73d45f sayma_amc/rtm: use new serwb low-speed phy 2018-05-15 16:40:50 +02:00
Florent Kermarrec 913d1e8e12 serwb: add generic low-speed phy (125Mhz linerate, same phy for ultrascale/7-series) 2018-05-15 16:39:39 +02:00
Florent Kermarrec 520aade8fe serwb/scrambler: cleanup/fix potential bug 2018-05-15 16:30:52 +02:00
whitequark 9347f6e00c firmware: use a dedicated error type in the scheduler.
After this commit, error handling does not normally allocate
(session::Error::{Load,Unexpected} still allocate, but those two
are very rare).

Good riddance to libstd_artiq.
2018-05-15 14:19:44 +00:00
whitequark 479cb9a857 firmware: use dedicated error types for every protocol and thread.
Good riddance to io::Error::Unrecognized.
2018-05-15 13:27:23 +00:00
whitequark 514eab3d39 Update Rust to 1.26.0. 2018-05-15 12:47:51 +00:00
whitequark 26faaad2b7 firmware: remove io::Result<T, E> in favor of Result<T, impl Fail>.
This doesn't yet use impl Fail since std_artiq::io::Error doesn't
impl it.
2018-05-15 08:29:03 +00:00
whitequark 140ca729aa firmware: rename io::Error::{UnexpectedEof→UnexpectedEnd}.
We don't even have files.
2018-05-15 08:27:45 +00:00
whitequark ce0593315b firmware: move {ProtoRead,ProtoWrite} to the root of libio. 2018-05-15 08:16:09 +00:00
whitequark 4416c04ae1 firmware: use the failure crate in libio. 2018-05-15 07:40:13 +00:00
whitequark 9e8f8bb669 firmware: extract io::Cursor into its own file.
Also remove unused io::CursorError.
2018-05-15 06:24:04 +00:00
whitequark a4ab236af3 firmware: simplify some `use`s. 2018-05-14 19:24:14 +00:00
whitequark d93aa13fd6 firmware: use upstream compiler_builtins again.
I've fixed i128 in LLVM, so there is no need in our fork anymore.
2018-05-14 19:11:57 +00:00
whitequark 5ead27f2e1 firmware: eliminate uses of std_artiq::io::{Read,Write} from runtime. 2018-05-14 19:11:57 +00:00
whitequark cf33ba748d firmware: eliminate non-io uses of std_artiq from runtime.
Just replace these with references to alloc.
2018-05-14 19:11:57 +00:00
Robert Jördens a100c73dfe suservo: support pure-I 2018-05-14 18:48:27 +00:00
whitequark ae50196186 firmware: rename libproto to libproto_artiq.
libproto_artiq only has ARTIQ-specific protocols.
2018-05-14 18:09:44 +00:00
whitequark 02b8426f60 firmware: rename libboard to libboard_misoc.
By analogy with libbuild_misoc. Hopefully one day it actually gets
moved to misoc...
2018-05-14 18:09:44 +00:00
whitequark 1ff42683d9 firmware: merge libamp into libboard_artiq.
All gateware interfaces live in libboard_artiq, but libamp predates
libboard_artiq.
2018-05-14 17:33:25 +00:00
whitequark 764386c9e3 firmware: split libdrtioaux into libproto and libboard_artiq modules.
All other protocol code lives in libproto, and all other gateware
interfaces live in libboard_artiq.
2018-05-14 17:26:59 +00:00
whitequark 6a10d54432 firmware: migrate rpc_proto to new libio.
This closes an old and horrible issue in that some code in ksupport
may implicitly try to allocate and we'll never know until it crashes
at runtime inside liballoc_stub.

This also removes liballoc_stub.
This also removes ReadExt and WriteExt from libproto.
Hooray!
2018-05-14 17:26:59 +00:00
whitequark 9a1bd66d2c compiler: add test for int64(round(1.0)). 2018-05-14 15:57:27 +00:00
Sebastien Bourdeauducq 019c92aa02 manual: fix title underline warning 2018-05-14 23:49:01 +08:00
Sebastien Bourdeauducq e121a81f21 ad9914: fix frequency_to_xftw and xftw_to_frequency 2018-05-14 23:49:00 +08:00
Sebastien Bourdeauducq 80df86f700 ad9914: set_mu_x -> set_x_mu 2018-05-14 23:49:00 +08:00
whitequark 09617c9f5e firmware: migrate session_proto to new libio. 2018-05-14 15:17:32 +00:00
whitequark e9c88e32e6 firmware: migrate moninj_proto to new libio. 2018-05-14 15:17:32 +00:00
whitequark e292c8ab65 firmware: migrate mgmt_proto to new libio. 2018-05-14 15:17:32 +00:00
Robert Jördens 0c1caf0744 suservo: clean up and beautify example 2018-05-14 15:22:47 +02:00
Robert Jördens 4ddb29fa02 suservo: document class arguments 2018-05-14 15:22:47 +02:00
whitequark 976bb5e935 firmware: migrate analyzer_proto to new libio. 2018-05-14 12:51:59 +00:00
whitequark 2999756493 firmware: impl std_artiq::io::{Read,Write} for io::{Read,Write}. 2018-05-14 12:51:59 +00:00
whitequark bfc8fd0807 firmware: add io::Error::Unrecognized variant and use it in drtioaux. 2018-05-14 12:51:59 +00:00
Robert Jördens 504d37b66b suservo: add SI units functions and document
m-labs/artiq#788
2018-05-14 12:26:49 +00:00
Robert Jördens 4993ceec35 sampler: unroll conversion for speed 2018-05-14 12:26:49 +00:00
Robert Jördens d71e4e60a9 suservo: use addition for offset 2018-05-14 12:26:49 +00:00
Robert Jördens 27f975e7bb kasli: eem DifferentialInputs need DIFF_TERM
cleanup some formatting on the way
2018-05-14 12:26:49 +00:00
Robert Jördens 2a47b934ea suservo: remove adc return clock gating 2018-05-14 12:26:49 +00:00
Robert Jördens 74c0b4452b suservo: clkout and sdo[b-d] are inverted 2018-05-14 12:26:49 +00:00
Robert Jördens 04240cdc08 suservo: sampler channels are reversed 2018-05-14 12:25:09 +00:00
whitequark 7e299563df firmware: mark many functions in libio as #[inline]. 2018-05-14 11:22:56 +00:00
whitequark 368d6f9bfb satman: remove useless _Unwind_Resume. 2018-05-14 11:22:56 +00:00
whitequark 42420e094a satman: don't unwrap so much in process_aux_packet.
This shrinks the code by almost 4K.
2018-05-14 11:22:56 +00:00
Sebastien Bourdeauducq ba1d137d19 ad9914: fix FTW write in regular resolution mode 2018-05-14 18:47:23 +08:00
whitequark 56a29b91fc firmware: implement ConsoleLogger, use it in satman. 2018-05-14 10:45:11 +00:00
whitequark 5d43d457d2 satman: eliminate heap. 2018-05-14 10:05:02 +00:00
whitequark 46c8afc56c firmware: implement libio and use in in drtioaux. 2018-05-14 10:02:39 +00:00
whitequark d543c9aa63 firmware: backtrace_artiq → unwind_backtrace.
This crate isn't ARTIQ-specific.
2018-05-14 07:33:00 +00:00
Sebastien Bourdeauducq b04c7abde8 ad9914: fix kernel_invariants 2018-05-14 14:02:11 +08:00
Sebastien Bourdeauducq 56a18682a7 ad9914: minor fixes 2018-05-14 10:37:50 +08:00
Sebastien Bourdeauducq 194d6462ee ad9914: fix set_mu 2018-05-14 00:19:09 +08:00
hartytp 00cb31b804 sampler: remove v_ref parameter (#988) 2018-05-13 18:00:57 +02:00
Sebastien Bourdeauducq 3027951dd8 integrate new AD9914 driver
moninj, analyzer, docs, examples, tests.
2018-05-13 23:29:35 +08:00
Sebastien Bourdeauducq 663d8e66ba ad9914: optimize extended-resolution mode 2018-05-13 23:01:06 +08:00
Sebastien Bourdeauducq c8d91b297d coredevice: add new ad9914 driver 2018-05-13 22:30:33 +08:00
whitequark f383a470fe satman: do not debug print unexpected aux packets.
This shrinks firmware by 2.8K.
2018-05-13 13:43:39 +00:00
whitequark aa42a69849 libdrtioaux: always inline read/write helpers.
This shrinks Packet::{read_from,write_to} by 1K.
2018-05-13 13:39:14 +00:00
whitequark 32522be413 satman: use 1K log buffer and 4K stack.
This reduces memory requirements in half.
2018-05-13 13:28:00 +00:00
whitequark ee4c475cf3 gateware: fix Sayma satellite build.
RTIO clock multiplier was removed from Sayma in 32f22f4c.
2018-05-13 13:10:39 +00:00
Sebastien Bourdeauducq 4ed9fdbf27 conda: bump misoc 2018-05-12 22:58:48 +08:00
Sebastien Bourdeauducq 8c1390e557 kasli: use 62.5MHz clock for siphaser reference (#999) 2018-05-12 22:58:03 +08:00
Sebastien Bourdeauducq 2426fea3f2 siphaser: support external reference for the freerunning 150MHz 2018-05-12 22:57:11 +08:00
Sebastien Bourdeauducq 6796413a53 serwb: remove unnecessary shebang line 2018-05-12 22:49:44 +08:00
Florent Kermarrec f5208ff2f3 serwb/core: reduce buffering, use buffered=True 2018-05-12 12:03:58 +02:00
Florent Kermarrec fdc953e569 serwb/etherbone: recuce buffering 2018-05-12 12:03:11 +02:00
Florent Kermarrec 6e67e6d0b1 serwb: revert some changes (was breaking simulation) 2018-05-12 11:59:46 +02:00
Florent Kermarrec 0a6d4ccd85 serwb/phy: improve/cleanup init 2018-05-12 01:35:34 +02:00
Florent Kermarrec b6ab59fb80 serwb/phy: increase timeout 2018-05-12 01:32:55 +02:00
Florent Kermarrec e09dbc89bc serwb: remove idelaye3 en_vtc (was not done correctly, we'll add direct software control) 2018-05-12 01:32:16 +02:00
Florent Kermarrec 6b4bbe31f7 firmware/ad9154: use fixed hmc7043 sysref phase (found with scan) 2018-05-12 00:12:59 +02:00
Florent Kermarrec 3c49eba0a0 firmware/hmc830_7043: put hmc7043 in sleep mode before hmc830 initialization
hmc7043 seems to generate broadband noise when not initialized. This allows isolating issues. If hmc830 still does not always lock correctly, then this is not related to hmc7043 broadband noise.
2018-05-12 00:06:49 +02:00
Florent Kermarrec cd4477864a serwb: fix case when rtm fpga is not loaded, lvds input can be 0 or 1 2018-05-11 23:31:25 +02:00
Sebastien Bourdeauducq 2e3bf8602f serwb: reduce buffering. Closes #997 2018-05-11 14:13:41 +08:00
Sebastien Bourdeauducq da1a61b8cf conda: bump misoc. Closes #995 2018-05-09 21:27:28 +08:00
Sebastien Bourdeauducq 13618c7d6e conda: bump migen 2018-05-09 21:03:58 +08:00
Sebastien Bourdeauducq 2cece47b10 firmware/si5324: fix compilation warning 2018-05-09 20:00:08 +08:00
Sebastien Bourdeauducq 6b811c1a8b sayma: fix runtime/rtm gateware address conflict 2018-05-09 19:47:29 +08:00
Florent Kermarrec 9de08f85c6 firmware/ad9154: reduce verbosity of dac_sysref_cfg 2018-05-09 10:57:00 +02:00
Robert Jördens f055bf88f6 suservo: add clip flags (#992) 2018-05-09 07:16:15 +00:00
Florent Kermarrec 60fd362d57 serwb: fix rx_comma detection 2018-05-07 23:54:35 +02:00
Robert Jördens bfa7637760 conda: bump llvmlite-artiq dependency (ncurses) 2018-05-07 10:15:45 +02:00
Robert Jördens 7d4a103a43 opticlock, suservo: set default kasli hw_rev 2018-05-07 09:07:18 +02:00
whitequark c646409dbe firmware: fix order of bits clocked into hmc542.
Fixes #993.
2018-05-05 03:12:25 +00:00
whitequark 917a4185eb Unbreak 9dc7efef. 2018-05-05 03:00:30 +00:00
whitequark fd2b8d5f8f firmware: raise hmc542 log level to INFO. 2018-05-05 02:59:49 +00:00
whitequark a148729bf8 artiq_flash, artiq_devtool: add support for ssh -J option. 2018-05-05 02:50:01 +00:00
whitequark 9704fb837f firmware: fix warnings in ad9154 driver. 2018-05-05 01:55:42 +00:00
whitequark 8a70c18d1e firmware: add debug output to hmc542 driver. 2018-05-05 01:53:30 +00:00
whitequark 68ef09ed73 firmware: stop profiler before rebooting too. 2018-05-05 01:52:44 +00:00
whitequark 9dc7efefe4 compiler: transparently handle Windows newlines in RunTool. 2018-05-05 01:43:00 +00:00
whitequark 4f29d9134f firmware: update log_buffer.
Fixes #986.
2018-05-05 01:18:59 +00:00
whitequark 5ebc626cf4 artiq_coreprofile: fix an inverted option. 2018-05-05 00:49:42 +00:00
whitequark b1d349cc1b firmware: implement a sampling profiler.
Does not yet support constructing call graphs.
2018-05-05 00:44:40 +00:00
whitequark 9857dfcd7d firmware: add irq::Exception to libboard. 2018-05-04 18:41:03 +00:00
Sebastien Bourdeauducq 0b4d06c7a9 worker: keep sys.modules untouched until the end of examine() 2018-05-02 12:50:37 +08:00
Sebastien Bourdeauducq 8079aa6d20 worker: python docs recommend not replacing sys.modules 2018-05-02 12:48:50 +08:00
Sebastien Bourdeauducq 8c69d939fb worker: restore sys.modules in examine() (#976) 2018-05-02 12:32:35 +08:00
Sebastien Bourdeauducq 8d66d53e06 Revert "tools/file_import: restore sys.modules. Closes #976"
This reverts commit b48e782dd6.
2018-05-02 12:14:56 +08:00
Sebastien Bourdeauducq 5f0cfadb30 rtio/sed: add unittest for sequence number rollover 2018-05-02 12:04:30 +08:00
Sebastien Bourdeauducq 4120105e3a rtio/sed: fix output network cmp_wrap 2018-05-02 12:04:03 +08:00
Sebastien Bourdeauducq bce8fa3ec5 rtio/sed: add replace unittest at the top level (#978) 2018-05-02 10:58:18 +08:00
Sebastien Bourdeauducq 83fb431cd0 rtio/sed: pass sequence numbers through the FIFOs. Closes #978 2018-05-02 10:57:57 +08:00
Florent Kermarrec 05955bfd79 sayma_rtm: use bufio for sys4x (needed since we are using a -1 speedgrade) 2018-05-01 22:16:35 +02:00
Sebastien Bourdeauducq b48e782dd6 tools/file_import: restore sys.modules. Closes #976 2018-05-01 22:15:47 +08:00
Florent Kermarrec 84e1f05559 sayma_rtm: make cd_sys4x clock domain reset_less 2018-05-01 16:11:26 +02:00
whitequark 84e598de69 conda: fix build number for llvmlite-artiq (again). 2018-05-01 09:08:17 +00:00
whitequark 6cb9c8a9c1 conda: fix build number for llvmlite-artiq. 2018-05-01 09:04:15 +00:00
whitequark 623614f835 Update LLVM to 6.0.0 and Rust to 1.25.0. 2018-05-01 08:57:37 +00:00
Florent Kermarrec 64c8eee28d serwb/phy/master: fix slave ready detection by filtering possible glitches on rx data (seems to happen when RTM fpga is not loaded) 2018-04-30 23:59:56 +02:00
Robert Jördens 5a683ddd1f Revert "kasli: force hw_rev for the different targets"
This reverts commit 17d7d7856a.

Would require filtering it in misoc or better
removing the argparse option.
2018-04-28 23:24:41 +02:00
Robert Jördens 17d7d7856a kasli: force hw_rev for the different targets 2018-04-28 21:30:29 +02:00
whitequark f7e08ec46b Unbreak f35f1001. 2018-04-28 01:03:08 +00:00
whitequark 5170848cd6 conda: artiq-board should be noarch, like artiq itself.
Fixes #989.
2018-04-28 00:56:11 +00:00
whitequark f35f100110 compiler: don't crash printing locations of specialized functions.
Fixes #987.
2018-04-28 00:49:25 +00:00
Robert Jördens 8812824fb2 suservo: speed up example, interlock mem 2018-04-27 17:17:17 +00:00
Robert Jördens ae80bab180 urukul: reg based io-update is a kernel 2018-04-27 16:42:09 +00:00
Robert Jördens 5d3c76fd50 sayma_rtm: use bitstream opts in migen 2018-04-27 15:43:32 +00:00
Robert Jördens 5f00326c65 suservo: coeff mem write port READ_FIRST 2018-04-27 15:43:32 +00:00
Robert Jördens 73fa572275 suservo: documentation, small API changes 2018-04-27 16:53:22 +02:00
Florent Kermarrec 4e2d9abaf7 firmware/ad9154: combine analog and digital delay of hmc7043 for sysref scan 2018-04-27 14:32:03 +02:00
Robert Jördens fe9834bac4 suservo: update 'technology preview' example [wip]
Still with mostly undocumented and unstable API.
2018-04-27 12:04:17 +00:00
Robert Jördens 307cd07b9d suservo: lots of gateware/ runtime changes
tested/validated:

* servo enable/disable
* dds interface, timing, io_update, mask_nu
* channel control (en_out, en_iir, profile)
* profile configuration (coefficients, delays, offsets, channel)
* adc timings and waveforms measured
* asf state readback
* adc readback

individual changes below:

suservo: correct rtio readback

suservo: example, device_db [wip]

suservo: change rtio channel layout

suservo: mem ports in rio domain

suservo: sck clocked from rio_phy

suservo: cleanup, straighten out timing

suservo: dds cs polarity

suservo: simplify pipeline

suservo: drop unused eem names

suservo: decouple adc SR from IIR

suservo: expand coredevice layer

suservo: start the correct stage

suservo: actually load ctrl

suservo: refactor/tweak adc timing

suservo: implement cpld and dds init
2018-04-27 13:50:26 +02:00
Robert Jördens 01f762a8f5 urukul/ad9910: support blind init
urukul: always set io_update attribute
to silence compiler warning w.r.t. kernel_invariants
2018-04-27 13:48:40 +02:00
Florent Kermarrec 3802c7badb firmware/ad9154: add sysref scan/conf for jesd sc1 2018-04-27 13:20:20 +02:00
Florent Kermarrec 8212e46f5e sayma_amc: filter jesd refclk/sysref with jreset (hmc7043 can generate noise when unconfigured see sinara issue #541) 2018-04-27 13:04:37 +02:00
Sebastien Bourdeauducq 28ccca412a doc: automatic artiq_flash proxy 2018-04-26 10:50:23 +08:00
Robert Jördens edbc7763e0 urukul: allow no io_update_device 2018-04-25 17:32:36 +00:00
Robert Jördens 8a1151b54f suservo: example device db 2018-04-25 17:14:25 +00:00
Robert Jördens f9b2c32739 suservo: add pgia spi channel 2018-04-25 17:14:25 +00:00
Robert Jördens c83305065a suservo: add servo/config/status register 2018-04-25 15:59:06 +00:00
Robert Jördens 105068ad90 suservo: fix restart timing 2018-04-25 15:19:49 +00:00
Robert Jördens c304b6207a suservo: drop adc idelays 2018-04-25 14:59:50 +00:00
Robert Jördens b44d6517d1 suservo: use 125 MHz SDR ADC
* easier timing
* natural sampling on rising edge
* timing, signal robustness
* adjust the servo iteration timing
2018-04-25 14:32:23 +00:00
Robert Jördens 37c186a0fc suservo: refactor, constrain
* remove DiffMixin, move pad layout handling to pads
* add input delay constraints, IDELAYs
2018-04-25 13:44:52 +00:00
Robert Jördens d0258b9b2d suservo: set input delays 2018-04-24 15:30:25 +00:00
Robert Jördens fe75064c1e suservo: cleanup rtio interface 2018-04-24 13:08:40 +00:00
Robert Jördens 3942c2d274 suservo: fix clkout cd drive 2018-04-24 10:18:32 +00:00
Robert Jördens f74998a5e0 suservo: move arch logic to top, fix tests 2018-04-23 21:11:26 +00:00
Robert Jördens 4903eb074c suservo: use BUFIO/BUFH for ADC 2018-04-23 18:30:19 +00:00
Robert Jördens e36deab0a8 suservo/adc: try to help vivado extract srls 2018-04-23 18:30:19 +00:00
Robert Jördens 929ed4471b kasli/SUServo: use suservo, implement urukul_qspi
m-labs/artiq#788
2018-04-23 18:30:18 +00:00
Robert Jördens 4c1e356f67 suservo: add pads rewiring layer for eems 2018-04-23 18:30:18 +00:00
Robert Jördens 99dd9c7a2a suservo: fix rtio interface width 2018-04-23 18:30:18 +00:00
Robert Jördens d5eea962ec suservo: fix cnv_b diff 2018-04-23 18:30:12 +00:00
Robert Jördens c8fd63754a suservo: add unittests
m-labs/artiq#788
2018-04-23 18:25:59 +00:00
Robert Jördens 934c41b90a gateware: add suservo
from
fe4b60b902

m-labs/artiq#788
2018-04-23 18:24:59 +00:00
Sebastien Bourdeauducq 4fe09fddd5 examples/kc705_nist_clock: update to new ad53xx driver 2018-04-22 15:03:30 +08:00
Sebastien Bourdeauducq c47d3ec8c8 zotino: use None as default for ldac and clr
This is also what AD53xx does.
2018-04-22 15:03:01 +08:00
Sebastien Bourdeauducq d2d02ae353 artiq_coredebug: fix permissions 2018-04-22 15:02:17 +08:00
whitequark 3b054855ec firmware: add allocator debug feature, invoked by artiq_coredebug frontend. 2018-04-21 19:39:46 +00:00
whitequark 873324d52b firmware: don't truncate queued RPCs (fixes #985). 2018-04-21 19:39:46 +00:00
whitequark 58967f14fd compiler: do not try to re-coerce fully coerced numerics. 2018-04-21 18:25:52 +00:00
whitequark 742e273441 Commit missing part of b4e3c30d. 2018-04-20 15:27:27 +00:00
whitequark 0d5fd1e83d runtime: fix race condition in log extraction code paths (#979).
The core device used to panic if certain combinations of borrows
of the log buffer happened. Now they all use .try_borrow_mut().
2018-04-20 15:26:00 +00:00
whitequark b4e3c30d8c compiler: desugar x != y into not x == y (fixes #974). 2018-04-20 12:20:45 +00:00
Robert Jördens a4f1877085 CONTRIBUTING: add checklist for code contributions 2018-04-17 23:26:00 +02:00
Robert Jördens 1b2a4bcbab doc: add out-of-tree controller ports
* newfocus8742 (https://github.com/quartiq/newfocus8742)
* ptb-drivers (https://github.com/quartiq/ptb-drivers)
* picam (https://github.com/quartiq/picam)
2018-04-17 23:26:00 +02:00
Florent Kermarrec fe689ab4f2 firmware/serwb: add link test, use info! instead of debug! for link settings (useful to analyze logs from others boards) 2018-04-17 19:24:22 +02:00
Florent Kermarrec 439d2bf2bc sayma/serwb: adapt, full reset of rtm on link reset 2018-04-17 19:24:03 +02:00
Florent Kermarrec 8edf4541d6 serwb: adapt test 2018-04-17 19:21:53 +02:00
Florent Kermarrec 20ccc9d82f serwb/core/phy: move scrambler in phy, add link test, revert delay min/max checks 2018-04-17 19:21:21 +02:00
Florent Kermarrec ebfac36223 serwb/scrambler: dynamic enable/disable 2018-04-17 19:20:06 +02:00
Florent Kermarrec 816a6f2ec7 serwb/phys: remove phy_width (revert linerate to 1Gbps) 2018-04-17 19:19:18 +02:00
Sebastien Bourdeauducq c86d41edc6 conda: update migen+misoc 2018-04-18 00:58:34 +08:00
Sebastien Bourdeauducq 48b48e44dd kasli/mitll: fix demo 2018-04-17 20:15:38 +08:00
Sebastien Bourdeauducq 79f4892e22 kasli/mitll: fix RTIO channel numbers 2018-04-17 20:15:17 +08:00
Sebastien Bourdeauducq eac447278f kasli: add MITLL variant 2018-04-17 19:00:11 +08:00
Sebastien Bourdeauducq 756e120c27 kasli/sysu: add comments 2018-04-17 18:46:55 +08:00
Sebastien Bourdeauducq 142561c4bd conda: bump misoc 2018-04-17 18:46:35 +08:00
Florent Kermarrec 1acd7ea1db sayma/serwb: re-enable scrambling 2018-04-17 00:49:36 +02:00
Florent Kermarrec ca01c8f1cb sayma: reduce serwb linerate to 500Mbps 2018-04-16 23:19:15 +02:00
Florent Kermarrec 825a2158ba serwb: add phy_width parameter to allow reducing linerate to 500Mbps or 250Mbps 2018-04-16 23:19:14 +02:00
Sebastien Bourdeauducq f96f597ecb doc: update Sinara information 2018-04-12 15:16:33 +08:00
whitequark 1ef673c2d4 conda: split build/run requirements for artiq-board.
Build requirements for packages in the outputs section seem to be
ignored.
2018-04-08 02:34:34 +00:00
whitequark 4e21a13be0 conda: put requirements on correct artiq-board package.
Fixes #975.
2018-04-07 23:32:38 +00:00
Florent Kermarrec bb90fb7d59 sayma/serwb: remove scrambling (does not seems to work on sayma for now...) 2018-04-07 15:57:57 +02:00
Florent Kermarrec 6aa8e2c433 serwb/test: replace valid/ready with stb/ack 2018-04-07 15:55:57 +02:00
Florent Kermarrec 73dbc0b6b6 serwb/test: adapt to new version 2018-04-07 15:09:29 +02:00
Florent Kermarrec e15f8aa903 sayma/serwb: enable scrambling 2018-04-07 14:52:37 +02:00
Florent Kermarrec 9d0e8c27ff serwb/scrambler: add flow control 2018-04-07 14:51:17 +02:00
Florent Kermarrec 2f8bd022f7 sayma_rtm: remove sys0p2x clock 2018-04-07 03:10:34 +02:00
Florent Kermarrec 1fd96eb0fd serwb: replace valid/ready with stb/ack 2018-04-07 03:06:19 +02:00
Florent Kermarrec c8a08375f8 serwb: replace valid/ready with stb/ack 2018-04-07 03:03:44 +02:00
Florent Kermarrec 73b727cade serwb: new version using only sys/sys4x clocks domains, scrambling deactivated. 2018-04-07 02:59:14 +02:00
Florent Kermarrec dd21c07b85 targets/sayma_rtm: fix serwb 2 ... 2018-04-03 18:59:05 +02:00
Florent Kermarrec 7488703f23 targets/sayma_rtm: fix serwb 2018-04-03 18:57:00 +02:00
Florent Kermarrec aef0153a8f targets/sayma: adapt to new serwb clocking 2018-04-03 18:53:39 +02:00
Florent Kermarrec 3248caa184 gateware/serwb: move all clocking outside of serwb, use existing sys/sys4x clocks 2018-04-03 18:48:08 +02:00
Sebastien Bourdeauducq efbe915b24 conda: support satellite in board package 2018-04-03 19:36:40 +08:00
Sebastien Bourdeauducq dd1c5c61d0 conda: error out if command in build.sh fails 2018-04-03 19:36:31 +08:00
Sebastien Bourdeauducq d0f6123f5c conda: bump misoc again 2018-04-03 15:55:53 +08:00
Sebastien Bourdeauducq 2ca3fda898 conda: bump misoc. Closes #891 2018-04-03 14:29:29 +08:00
Sebastien Bourdeauducq f0771765c1 rtio: move CRI write comment to more appropriate location 2018-03-29 23:55:00 +08:00
Sebastien Bourdeauducq e83863a8da conda: bump migen 2018-03-29 12:35:41 +08:00
Sebastien Bourdeauducq 493d2a653f siphaser: add false path between sys_clk and mmcm_freerun_output 2018-03-29 10:55:41 +08:00
Sebastien Bourdeauducq 4229c045f4 kasli: fix DRTIO master clock constraint 2018-03-29 10:20:31 +08:00
Sebastien Bourdeauducq 3d89ba2e11 sayma: remove debug leftover 2018-03-29 10:20:17 +08:00
Sebastien Bourdeauducq 605292535c kasli: ignore OSERDESE2->ISERDESE2 timing path on DRTIO targets as well 2018-03-29 10:12:02 +08:00
Sebastien Bourdeauducq 416232cb64 runtime: do not reset RTIO PHY on core.reset(). Closes #971 2018-03-28 10:51:07 +08:00
Sebastien Bourdeauducq 5ca59467fd ad53xx: make LDAC and CLR optional 2018-03-26 22:45:01 +08:00
whitequark bab6723ff2 Revert "gateware: don't run tests if there is no migen."
This reverts commit 4804cfef9b.
2018-03-26 03:33:52 +00:00
whitequark 4804cfef9b gateware: don't run tests if there is no migen.
This allows us to skip testing gateware on Windows.
2018-03-26 03:26:34 +00:00
whitequark 87c2f119a5 artiq_devtool: add load action. 2018-03-25 20:29:51 +00:00
Sebastien Bourdeauducq 8d62ea2288 examples: fix KC705 ad53xx 2018-03-25 11:19:54 +08:00
Sebastien Bourdeauducq c3f763e217 dashboard: also create monitoring widgets for the Zotino class 2018-03-25 11:19:40 +08:00
Sebastien Bourdeauducq d6a63ad165 RELEASE_NOTES: formatting 2018-03-25 11:19:25 +08:00
Robert Jördens a20dfd9c00 examples/master: ad5360 -> zotino 2018-03-24 16:46:59 +01:00
Robert Jördens 774030698e doc: title underline 2018-03-24 16:07:53 +01:00
Robert Jördens 0505e9124f kc705: port device_db, ad53xx/zotino example 2018-03-24 16:05:26 +01:00
Robert Jördens 3a0dfb7fdc ad53xx: port monitor, moninj dashboard, kc705 target 2018-03-24 16:04:02 +01:00
Robert Jördens a8f0ee1c86 ad53xx: refactor offset_to_mu(), fix docs 2018-03-24 15:45:42 +01:00
Robert Jördens b0c8097025 ad53xx: remove channel index AND
It's incorrect since it doesn't respect the number of channels
of any of those chips (none has 64 channels).
2018-03-24 15:39:06 +01:00
Robert Jördens 77bcc2c78f zotino: style, use attributes to set SPI config 2018-03-24 15:37:34 +01:00
Robert Jördens 22557294ac RELEASE_NOTES: ad53xx, zotino 2018-03-24 15:20:04 +01:00
Robert Jördens 9bc2ce84fc doc: ad5360 -> ad53xx, add zotino 2018-03-24 15:18:08 +01:00
Robert Jördens 2cf414a480 ad53xx: move 8 bit shift out of ad53xx protocol funcs
That's specific to the SPI bus, not to the ad53xx.
2018-03-24 15:15:56 +01:00
Robert Jördens 08326c5727 ad53xx: style [nfc] 2018-03-24 14:10:20 +01:00
Robert Jördens 68e433a3a8 opticlock/device_db: resurrect novogorny
deleted in a992a67
2018-03-24 13:46:45 +01:00
hartytp a992a672d9 coredevice/zotino: add (#969)
* Replace ad5360 driver with a ad53xx driver, designed to have a nicer interface
Add Zotino driver and add to opticlock target for Kasli
Test Zotino on hw:
 - Verify all timings on the hardware with a scope
 - Verify that we can correctly set and read back all registers in a loop (checks for SI and driver issues)
 - check we can set LEDs correctly
 - check calibration routine + all si unit functions with a good DVM
 - look at DAC transitions on a scope (while triggering of a TTL) on persist to check there are no LDAC glitches etc
To do: update examples and e.g. KC705 device db.
2018-03-24 13:41:18 +01:00
Robert Jördens 1553fc8c7d sed: reset `valid` in output sorter 2018-03-23 11:11:11 +00:00
Sebastien Bourdeauducq 0635907699 artiq_flash: fix cmdline formatting 2018-03-22 19:10:29 +08:00
Sebastien Bourdeauducq 46d5af31a1 artiq_flash: enclose filename in curly braces before passing to OpenOCD
Closes #927
2018-03-22 17:20:48 +08:00
Sebastien Bourdeauducq eeedcfbdd7 artiq_flash: do not suppress useful backtrace information 2018-03-22 17:11:21 +08:00
Sebastien Bourdeauducq f2cc2a5ff2 firmware: reset local RTIO PHYs on startup (#958) 2018-03-22 16:29:31 +08:00
Sebastien Bourdeauducq 40e2ced85e manual: fix core_drivers_reference 2018-03-22 13:26:45 +08:00
Sebastien Bourdeauducq 9eb0218389 RELEASE_NOTES: add sections for major releases 2018-03-22 13:26:28 +08:00
Sebastien Bourdeauducq 102e3983b5 manual: reorganize core drivers 2018-03-22 12:06:01 +08:00
Sebastien Bourdeauducq 1b91339865 manual: fix text role 2018-03-22 12:05:47 +08:00
Sebastien Bourdeauducq 06f24c6aa2 RELEASE_NOTES: update 2018-03-22 11:46:41 +08:00
Robert Jördens 770b0a7b79 novogorny: conv -> cnv
* parity with sampler
* also add novogorny device to opticlock
2018-03-21 18:38:42 +00:00
Robert Jördens 82c4f0eed4 sampler: fix channel gain retrieval 2018-03-21 14:22:13 +01:00
Robert Jördens 12d699f2a8 suservo: add sampler example 2018-03-21 12:21:53 +00:00
Robert Jördens 97918447a3 sampler: add coredevice driver 2018-03-21 12:21:53 +00:00
Robert Jördens 1afce8c613 kasli: simplify single eem pin formatting 2018-03-21 13:08:42 +01:00
Robert Jördens d48b8f3086 kasli: fix sampler sdr/cnv pins 2018-03-21 09:28:00 +00:00
Robert Jördens 80903cead7 novogorny: streamline gain setting method, style [nfc] 2018-03-21 08:53:26 +00:00
Robert Jördens f5a1001114 suservo: add device database and artiq_flash variant 2018-03-21 08:53:26 +00:00
Robert Jördens 1fb5907362 kasli: add SUServo variant (Sampler-Urukul Servo) 2018-03-21 08:53:26 +00:00
Robert Jördens f74d5772f4 sampler: add wide eem definition 2018-03-21 08:53:26 +00:00
Sebastien Bourdeauducq 32f22f4c9c sayma: disable SERDES TTL entirely
Timing closure becomes very random, even at 4X.
2018-03-21 13:03:48 +08:00
Sebastien Bourdeauducq f8c2d54e75 ttl_serdes_ultrascale: configurable SERDES ratio. Also try X4 on Sayma 2018-03-21 13:01:38 +08:00
Sebastien Bourdeauducq 9c2d343052 sayma: use SERDES RTIO TTL
This is not enabled on the standalone design as it breaks timing.
2018-03-21 10:53:52 +08:00
Robert Jördens 9ad1fd8f25 urukul: add comment and doc about the AD9910 MASTER_RESET 2018-03-20 17:40:03 +01:00
Robert Jördens f17c0abfe4 urukul: don't pulse DDS_RST on init
closes m-labs/artiq#940

Apparently, if the DDS are reset, every other time they don't work
properly.
2018-03-20 16:10:26 +00:00
Robert Jördens a185e8dc52 urukul: fix MASK_NU offset 2018-03-20 16:10:11 +00:00
Robert Jördens f4719ae24b sdram: clean up console output 2018-03-20 15:42:49 +01:00
Robert Jördens 206664afd9 sdram: compact read_level output 2018-03-20 10:16:05 +00:00
Robert Jördens 495625b99d bootloader: repeat memory test 4 times 2018-03-20 09:57:49 +00:00
Robert Jördens 6fb0cbfcd3 sdram: clean up, make read_level robust to wrap around
* fix a few rust warnings
* also do eye scans on kintex
2018-03-20 09:57:49 +00:00
Robert Jördens 3abb378fbe i2c: unused variable 2018-03-20 09:56:26 +00:00
Sebastien Bourdeauducq c8020f6bbd ttl_serdes_generic: fix/upgrade test 2018-03-20 16:46:57 +08:00
Sebastien Bourdeauducq a5825184b7 add ttl_serdes_ultrascale (untested) 2018-03-20 16:07:23 +08:00
Sebastien Bourdeauducq fad066f1aa ttl_serdes_7series: cleanup indentation
Inconsistent with other code and confuses text editors.
2018-03-20 15:50:04 +08:00
Robert Jördens 276b0c7f06 sdram: reject read delay wrap arounds 2018-03-20 00:28:41 +01:00
Robert Jördens 65379b1f7a conda: bump migen, misoc
* xilinx ODDR2 SRTYPE
* flterm leak
* I/ODELAY VTC/reset sequencing
* sayma SDRAM clock buffer LOC
2018-03-19 19:58:52 +01:00
Robert Jördens 4b3f408143 sdram: simplify read level scan 2018-03-19 18:41:56 +00:00
Robert Jördens 845784c180 kusddrphy: use first and last tap that yield many valid reads 2018-03-19 17:54:26 +00:00
Robert Jördens ed2e0c8b34 sayma/sdram/scan: test each tap 1024 times 2018-03-20 00:59:31 +08:00
hartytp a27b5d88c2 Novogorny driver, remove unused imports (#964)
* Novogorny driver, remove unused imports

* more unused imports

* oops, one final one!
2018-03-19 11:58:14 +01:00
Robert Jördens 7a7ff6d2dd
Merge pull request #963 from hartytp/kasli_zotino_sampler
Add Zotino and Sampler functions to Kasli. Add Zotino to Kasli EEM 7 …
2018-03-19 10:52:50 +01:00
Thomas Harty 37d431039d Fix typos.
Reduce ififo depth to 4 for Zotino.
2018-03-19 09:42:18 +00:00
whitequark c86df8e13e firmware: try to unstuck the I2C bus if it gets stuck.
Fixes #957.
2018-03-19 06:23:23 +00:00
Thomas Harty c4fa44bc62 Add Zotino and Sampler functions to Kasli. Add Zotino to Kasli EEM 7 on OptiClock. 2018-03-18 00:25:43 +00:00
Robert Jördens f39b7b33e8 ad5360: whitespace [nfc] 2018-03-17 18:51:17 +01:00
Robert Jördens 2eadb08f8c
Merge pull request #962 from hartytp/ad5360
Fix AD5360 after migration to SPI2
2018-03-17 18:48:34 +01:00
ion c1439bfd3b Fix AD5360 after migration to SPI2 2018-03-17 11:37:11 +00:00
whitequark c4bfc83b38 conda: mark the artiq-build output package as noarch, not toplevel.
This also changes `noarch: python` to `noarch: generic` since
this is semantically correct; the bitstream/firmware packages
contain no Python code.

Fixes #960.
2018-03-15 23:17:05 +00:00
whitequark 4b5a78e231 compiler: do not pass files to external tools while they are opened.
This fixes access violations on Windows that are present both with
input and output files. For some reason, Cygwin-compiled binutils
did not exhibit this problem, but MSYS-compiled binutils do.

Fixes #961.
2018-03-15 22:21:29 +00:00
whitequark 5cb2602021 artiq_devtool: flash gateware if -g is passed. 2018-03-15 08:33:53 +00:00
whitequark 9ea7d7a804 firmware: allow building without system UART. 2018-03-14 18:34:31 +00:00
whitequark 158ceb0881 artiq_devtool: add kasli target. 2018-03-14 18:13:13 +00:00
Sebastien Bourdeauducq a315ecd10b rtio/ttl_serdes_7series: reset IOSERDES (#958) 2018-03-14 09:01:29 +08:00
Robert Jördens 2fdc180601 dsp/fir: outputs reset_less (pipelined) 2018-03-13 17:11:50 +00:00
Sebastien Bourdeauducq 2edf65f57b drtio: fix satellite minimum_coarse_timestamp clock domain (#947) 2018-03-13 00:20:57 +08:00
Sebastien Bourdeauducq 999ec40e79 bootloader: print gateware ident 2018-03-13 00:11:25 +08:00
Sebastien Bourdeauducq 2caeea6f25 update copyright year 2018-03-13 00:09:13 +08:00
Sebastien Bourdeauducq 1d081ed6c2 drtio: print diagnostic info on satellite write underflow (#947) 2018-03-12 23:41:19 +08:00
Florent Kermarrec eb6e59b44c sayma_rtm: fix serwb timing constraints (was causing the gated clock warning) 2018-03-12 11:25:29 +01:00
Chris Ballance 6dfebd54dd ttl_serdes_7series: use correct IBUFDS_INTERMDISABLE port names 2018-03-12 10:37:33 +08:00
Sebastien Bourdeauducq 44277c5b7e conda: bump migen/misoc 2018-03-11 10:11:42 +08:00
Robert Jördens a04bd5a4fd spi2: xfers take one more cycle until ~busy 2018-03-09 20:48:17 +01:00
Florent Kermarrec 5af4609053 libboard/sdram: limit write leveling scan to "512 - initial dqs taps delay" on ultrascale 2018-03-09 19:06:47 +01:00
Florent Kermarrec a95cd423cc libboard/sdram: add gap for write leveling 2018-03-09 18:53:57 +01:00
Sebastien Bourdeauducq fc3d97f1f7 drtio: remove spurious multichannel transceiver clock constraints
They used to cause (otherwise harmless) Vivado critical warnings.
2018-03-09 22:46:27 +08:00
Sebastien Bourdeauducq caf7b14b55 kasli: generate fine RTIO clock in DRTIO targets, separate RTIO channel code 2018-03-09 22:36:16 +08:00
Sebastien Bourdeauducq e65e2421a3 conda: bump migen/misoc 2018-03-09 22:35:40 +08:00
Florent Kermarrec 8f6f83029c libboard/sdram: add write/read leveling scan 2018-03-09 13:50:51 +01:00
Florent Kermarrec b0b13be23b libboard/sdram: rename read_delays to read_leveling 2018-03-09 09:23:20 +01:00
Sebastien Bourdeauducq 3fbcf5f303 drtio: remove TSC correction (#40) 2018-03-09 10:36:17 +08:00
Sebastien Bourdeauducq e38187c760 drtio: increase default underflow margin. Closes #947 2018-03-09 00:49:24 +08:00
Sebastien Bourdeauducq 37f5f0d38d examples: add DMA to Sayma DRTIO 2018-03-09 00:49:24 +08:00
Florent Kermarrec 8475c21c46 firmware/libboard/sdram: kusddrphy now use time mode for odelaye3/idelaye3, now reloading dqs delay_value (500ps) with software 2018-03-08 10:00:00 +01:00
Sebastien Bourdeauducq 8bd15d36c4 drtio: fix error CSR edge detection (#947) 2018-03-08 16:28:25 +08:00
Sebastien Bourdeauducq 0adbbd8ede drtio: reset aux packet gateware after locking to recovered clock
Closes #949
2018-03-08 15:41:13 +08:00
Sebastien Bourdeauducq 8bd85caafb examples: fix Sayma DRTIO ref_period 2018-03-08 15:09:33 +08:00
Robert Jördens 37ec97eb28 ad9910/2: add sw invariant only when passed 2018-03-07 21:32:59 +01:00
Robert Jördens 82831a85b6 kasli/opticlock: add eem6 phys 2018-03-07 21:32:59 +01:00
Robert Jördens 5cc1d2a1d3 conda: bump migen, misoc
* flterm leak
* kasli version
* sayma ddram
* ethernet clocking
* fifo dout reset_less
2018-03-07 17:17:30 +01:00
Robert Jördens 3a6566f949 rtio: judicious spray with reset_less=True
Hoping to reduce rst routing difficulty and easier RTIO timing closure.
2018-03-07 14:57:18 +00:00
Robert Jördens b0282fa855 spi2: reset configuration in rio_phy 2018-03-07 14:42:11 +00:00
Robert Jördens 7afb23e8be runtime: demote dropped and malformed packets msgs to debug 2018-03-07 14:28:21 +01:00
Robert Jördens 4af7600b2d Revert "LaneDistributor: try equivalent spread logic"
This reverts commit 8b70db5f17.

Just a shot into the dark.
2018-03-07 11:34:51 +00:00
Robert Jördens a6d1b030c1 RTIO: use TS counter in the correct CD
artiq/m-labs#938
2018-03-07 11:34:42 +00:00
Robert Jördens 8b70db5f17 LaneDistributor: try equivalent spread logic 2018-03-07 11:34:42 +00:00
Robert Jördens 2cbd597416 LaneDistributor: style and signal consolidation [NFC] 2018-03-07 11:34:42 +00:00
Sebastien Bourdeauducq 916197c4d7 siphaser: cleanup 2018-03-07 11:15:44 +08:00
Sebastien Bourdeauducq 74d1df3ff0 firmware: implement si5324 skew calibration 2018-03-07 10:57:30 +08:00
Sebastien Bourdeauducq f7aba6b570 siphaser: fix phase_shift_done CSR 2018-03-07 10:57:30 +08:00
Sebastien Bourdeauducq acfd9db185 siphaser: minor cleanup 2018-03-07 10:57:30 +08:00
Sebastien Bourdeauducq e6e5236ce2 firmware: fix si5324 select_recovered_clock 2018-03-07 10:57:30 +08:00
Sebastien Bourdeauducq 7d98864b31 sayma: enable siphaser 2018-03-07 10:57:30 +08:00
Sebastien Bourdeauducq c2d2cc2d72 runtime: fix setup_si5324_as_synthesizer 2018-03-07 10:57:30 +08:00
Sebastien Bourdeauducq a6e29462a8 sayma: enable multilink DRTIO 2018-03-07 10:57:30 +08:00
Sebastien Bourdeauducq c34d00cbc9 drtio: implement Si5324 phaser gateware and partial firmware support 2018-03-07 10:57:30 +08:00
Robert Jördens 994ceca9ff sayma_amc: disable slave fpga gateware loading 2018-03-06 17:27:43 +01:00
Robert Jördens f4dad87fd9 coredevice: add pcf8574a driver
I2C IO expander with 8 quasi-bidirectional pins
2018-03-06 14:27:19 +01:00
Robert Jördens 62af7fe2ac Revert "kasli/opticlock: use plain ttls for channels 8-23"
This reverts commit bd5c222569eb68d624a5ac1e9f2542f6ee553f83.

No decrease in power consumption or improvement in timing.
2018-03-06 14:27:19 +01:00
Robert Jördens fd3cdce59a kasli/opticlock: use plain ttls for channels 8-23 2018-03-06 14:27:19 +01:00
Robert Jördens 50298a6104 ttl_serdes_7series: suppress diff_term in outputs 2018-03-06 14:27:19 +01:00
Robert Jördens e356150ac4 ttl_simple: support differential io 2018-03-06 14:27:19 +01:00
Robert Jördens 956098c213 kasli: add second urukul, make clk_sel drive optional 2018-03-06 14:26:27 +01:00
Robert Jördens 07de7af86a kasli: make second eem optional in urukul 2018-03-06 14:26:26 +01:00
Robert Jördens 257bef0d21 slave_fpga: print more info 2018-03-06 14:26:26 +01:00
Sebastien Bourdeauducq c25560baec sed: more LaneDistributor comments 2018-03-06 20:56:35 +08:00
Sebastien Bourdeauducq f40255c968 sed: add comments about key points in LaneDistributor 2018-03-06 20:51:09 +08:00
Florent Kermarrec 5b3d6d57e2 drtio/gth: power down rx on restart (seems to make link initialization reliable) 2018-03-06 11:49:28 +01:00
Florent Kermarrec 64b05f07bb drtio/gth: use parameters from Xilinx transceiver wizard 2018-03-06 11:02:15 +01:00
Florent Kermarrec 45f1e5a70e drtio/gth: cleanup import 2018-03-06 10:56:07 +01:00
Sebastien Bourdeauducq a274af77d5 runtime: fix compilation without DRTIO 2018-03-05 00:43:42 +08:00
Sebastien Bourdeauducq 432e61bbb4 drtio: add kernel API to check for link status. Closes #941 2018-03-05 00:23:55 +08:00
Sebastien Bourdeauducq 6aaa8bf9d9 drtio: fix link error generation 2018-03-04 23:20:13 +08:00
Sebastien Bourdeauducq d747d74cb3 test: fix test_dma 2018-03-04 23:19:06 +08:00
Sebastien Bourdeauducq 928d5dc9b3 drtio: raise RTIOLinkError if operation fails due to link lost (#942) 2018-03-04 01:02:53 +08:00
Sebastien Bourdeauducq ba74013e3e runtime: add a missing overflow flag reset 2018-03-03 13:16:21 +08:00
Sebastien Bourdeauducq abfbadebb5 doc: DMA can also raise RTIOUnderflow 2018-03-03 13:14:34 +08:00
Robert Jördens ddcc68cff9 sayma_amc: move bitstream options to migen
close #930
2018-03-02 18:13:03 +08:00
Sebastien Bourdeauducq 5e074f83ac examples: update kasli sysu 2018-03-02 16:05:12 +08:00
Sebastien Bourdeauducq 29d42f4648 artiq_flash: add kasli sysu 2018-03-02 15:49:41 +08:00
Sebastien Bourdeauducq a9daaad77b kasli: add SYSU variant and device_db 2018-03-02 14:44:31 +08:00
Robert Jördens 1c57d27ae2 slave_fpga: use sayma_rtm magic 2018-03-01 18:32:19 +01:00
Robert Jördens de63e657b8 kasli/si5324: lock to 100 MHz with highest available bandwidth 2018-03-01 14:49:53 +01:00
Robert Jördens abd160d143 slave_fpga: check DONE before loading 2018-03-01 19:53:34 +08:00
Robert Jördens a04a36ee36 firmware: move wait for write completion to read() 2018-03-01 11:37:33 +01:00
Robert Jördens a6ae08d8b8 firmware/spi: work around cs_polarity semantics
The semantics differ between the RTIO and CSR interface.
2018-03-01 11:19:18 +01:00
Robert Jördens cc70578f1f remove old spi RTIO Phy 2018-03-01 11:19:18 +01:00
Robert Jördens 1329e1a23e RELEASE_NOTES: add note about spi2 port 2018-03-01 11:19:18 +01:00
Robert Jördens ec5b81da55 kc705: switch backplane spi to spi2 2018-03-01 11:19:18 +01:00
Robert Jördens 6fbe0d8ed8 hmc830: be explicit about SPI mode selection 2018-03-01 11:19:18 +01:00
Robert Jördens a7720d05cd firmware, sayma: port converter_spi to spi2
* ksupport/nrt_bus
* port ad9154, hmc830, hmc7043
* port local_spi and drtio_spi
* port kernel_proto libdrtioaux, satman
* change sayma_rtm gateware over
* add spi2 NRTSPIMaster
* remove spi NRTSPIMaster
* change sayma device_db
* change HMC830 to open mode and explicitly sequence open mode
2018-03-01 11:19:18 +01:00
Robert Jördens 68278e225d slave_fpga: check for INIT low 2018-03-01 17:28:01 +08:00
whitequark 14f6fa6699 firmware: fix a warning. 2018-03-01 01:25:55 +00:00
whitequark d051cec0dd firmware: remove useless module. 2018-03-01 01:22:52 +00:00
Robert Jördens 54984f080b artiq_flash: flash RTM firmware
based on whitequark's work in f95fb27

m-labs/artiq#813
2018-02-28 19:29:01 +01:00
Robert Jördens 0c49201be7 firmware: add slave fpga serial load support
based on whitequark's work in f95fb27

m-labs/artiq#813
2018-02-28 19:27:52 +01:00
Robert Jördens 1f999c7f5f sayma_amc: expose RTM fpga load pins as GPIOs 2018-02-28 18:44:36 +01:00
Robert Jördens cedecc3030 Revert "firmware: Sayma RTM FPGA bitstream loading prototype (#813)."
This reverts commit f95fb273f1.

Will be replaced with a bitbang/GPIO based version.
2018-02-28 18:43:56 +01:00
whitequark f95fb273f1 firmware: Sayma RTM FPGA bitstream loading prototype (#813). 2018-02-28 16:46:23 +00:00
Florent Kermarrec 2896dc619b drtio/transceiver/gth: fix multilane 2018-02-28 14:15:40 +01:00
Robert Jördens 5046d6a529 ad9912/10: add a bit more slack to init() 2018-02-27 23:14:44 +01:00
Robert Jördens f97163cdee examples/master: sync device_db with kc705_nist_clock 2018-02-27 19:40:00 +01:00
whitequark 916b10ca94 examples: spi → spi2. 2018-02-27 18:36:45 +00:00
whitequark b81855cce7 conda: don't use globs in file list. 2018-02-27 16:07:01 +00:00
Sebastien Bourdeauducq 386aa75aaa kasli: control SFP1 and SFP2 LEDs in DRTIO satellite to match master 2018-02-27 23:18:18 +08:00
Sebastien Bourdeauducq 5d81877b34 kasli: implement multi-link DRTIO on SFP1 and SFP2 of master 2018-02-27 23:15:20 +08:00
whitequark 2f9d01295c conda: fix YAML syntax. 2018-02-27 14:03:50 +00:00
whitequark 771ba66055 conda: include all files in output package. 2018-02-27 13:40:02 +00:00
Florent Kermarrec 1f0d955ce4 drtio/transceiver/gtp: implement tx multi lane phase alignment sequence 2018-02-27 12:32:25 +01:00
Sebastien Bourdeauducq e565d3fa59 kasli: add analyzer and RTIO log to DRTIO master target 2018-02-27 18:09:07 +08:00
Robert Jördens 1de2da5644 conda: bump migen/misoc 2018-02-26 14:16:05 +01:00
Robert Jördens a35e4fe055 conda: bump jesd204b-0.5 2018-02-26 12:48:48 +01:00
Robert Jördens 760724c500 kasli/device_db: fix i2c switch addr 2018-02-26 11:37:12 +01:00
Robert Jördens b466a569bf coredevice: export spi2 2018-02-24 09:49:31 +01:00
Robert Jördens ddb3d2fe14 DEVELOPER_NOTES: fix devtool autodoc 2018-02-23 15:16:14 +01:00
Sebastien Bourdeauducq 98489d9739 conda: bump migen/misoc (#854) 2018-02-23 21:46:51 +08:00
Florent Kermarrec 5b0f9cc6fd drtio/transceiver/gth: fix single transceiver case 2018-02-23 12:15:47 +01:00
Robert Jördens cff85ee13b novogorny: simplify and fix coefficient 2018-02-23 10:09:44 +01:00
Florent Kermarrec b4ba71c7a4 drtio/transceiver/gth: implement tx multi lane phase alignment sequence (fix merge issue...) 2018-02-23 08:37:05 +01:00
Florent Kermarrec 820c834251 drtio/transceiver/gth: implement tx multi lane phase alignment sequence 2018-02-22 22:14:15 +01:00
Robert Jördens bc5e949bb4 novogorny: fix gain register length 2018-02-22 18:45:55 +00:00
Robert Jördens 1452cd7447 novogorny: add coredevice driver and test with Kasli
m-labs/artiq#687
2018-02-22 17:19:51 +01:00
Robert Jördens 74517107f0 ad9912: add slack after prodid read 2018-02-22 17:19:51 +01:00
Robert Jördens 3b7971d15d kasli: spelling 2018-02-22 17:19:51 +01:00
Robert Jördens 771bf87b56 kc705: port amc101_dac/spi0 and sma_spi to spi2 2018-02-22 17:19:51 +01:00
whitequark 21b1757bfd Fix e8d21adf3.
As usual, conda documentation does not provide a clear explanation
of what the options do...
2018-02-22 13:26:42 +00:00
whitequark e8d21adf30 conda: turn off binary prefix detection everywhere.
This just adds garbage to logs and serves no useful purpose.
2018-02-22 12:55:47 +00:00
whitequark 8938b69559 conda: simplify recipes.
conda-build appears to no longer require the workaround with
environ.get("GIT_*", "") to work.
2018-02-22 12:45:27 +00:00
Robert Jördens d4a10dcbd4 urukul: fix example 2018-02-22 11:28:50 +01:00
Robert Jördens e8d4db1ccf coreanalyzer: add spi2 support
m-labs/artiq#926
2018-02-22 11:28:46 +01:00
Robert Jördens f8e6b4f4e3 ad5360: port to spi2
* kc705 nist_clock target gateware
* coredevice driver
* moninj code
* test/example/device_db

This is untested as we don't have a AD5360 board right now.
Will be tested with Zotino v1.1

m-labs/artiq#926
2018-02-22 10:25:46 +01:00
whitequark d83ae0bc6a conda: use the outputs section to dynamically name packages. 2018-02-22 09:25:22 +00:00
Sebastien Bourdeauducq c3b8fe06eb conda/artiq-board: use 'firmware' to encompass runtime and satman 2018-02-22 15:30:26 +08:00
Sebastien Bourdeauducq 96423882f2 fix 4d6619f3b 2018-02-22 15:27:54 +08:00
whitequark 10c02afd9c conda: merge all board packages except sayma_rtm into one.
Fixes #923.
2018-02-22 07:22:33 +00:00
Sebastien Bourdeauducq fa0d929b4d drtio: reorganize RX synchronizers 2018-02-22 15:21:23 +08:00
Sebastien Bourdeauducq e5de5ef473 kasli: use deterministic RX synchronizer
Could not reproduce the "fully broken bitstream" bug.
2018-02-22 15:18:09 +08:00
Sebastien Bourdeauducq 4d6619f3bc satman: send ResetAck 2018-02-22 15:17:44 +08:00
Robert Jördens a5ad1dc266 kc705: fix sdcard miso pullup 2018-02-21 19:41:05 +01:00
Robert Jördens 0d8145084d test_spi: move to new spi2 core 2018-02-21 19:41:05 +01:00
Robert Jördens 898bad5abc spi2: fixes 2018-02-21 19:41:05 +01:00
Florent Kermarrec 5eda894db4 firmware/libboard/sdram: increase read_delays dead zone to 32 on KU 2018-02-21 19:36:37 +01:00
Sebastien Bourdeauducq be704b1533 RELEASE_NOTES: mention short options for artiq_flash 2018-02-22 01:32:12 +08:00
whitequark 96f697ec96 firmware: update compiler_builtins to unbreak __gtdf2.
Fixes #883.
2018-02-21 15:21:48 +00:00
Robert Jördens a63fd306af urukul: use spi2
* switch kc705 and kasli targets to spi2 gateware on urukul
* rewrite urukul, ad9912, ad9910
* update example experiments, device_dbs
2018-02-21 15:00:28 +00:00
Robert Jördens 37a0d6580b spi2: add RTIO gateware and coredevice driver
1006218997
2018-02-21 13:37:36 +00:00
Robert Jördens 91a4a7b0ee kasli: free run si5324 on opticlock for now 2018-02-21 13:37:29 +00:00
Robert Jördens 7a1d71502a ttl_serdes_7series: drive IBUF and INTERM disables from serdes 2018-02-21 13:37:29 +00:00
Robert Jördens 476e4fdd56 ttl_serdes_7series: disable IBUF and INTERM when output 2018-02-21 13:37:29 +00:00
Florent Kermarrec afc16a67b6 firmware/liboard/sdram.rs: iterate read multiple times in read_delays to avoid false positives 2018-02-21 14:15:35 +01:00
whitequark 86ceee570f compiler: reject calls with unexpected keyword arguments.
Fixes #924.
2018-02-21 11:37:12 +00:00
Sebastien Bourdeauducq 7986391422 manual: update Kasli section 2018-02-21 12:04:14 +08:00
Sebastien Bourdeauducq 6c4681e7d2 manual: fix minor errors 2018-02-21 11:57:57 +08:00
Sebastien Bourdeauducq 932fa884cc conda: add recipes for Kasli DRTIO 2018-02-21 11:15:01 +08:00
Sebastien Bourdeauducq eed64a6d6b conda: fix openocd dependency 2018-02-21 10:35:31 +08:00
Sebastien Bourdeauducq f060d6e1b3 drtio: increase A7 clock aligner check period 2018-02-20 18:50:35 +08:00
Sebastien Bourdeauducq 738654c783 drtio: support remote RTIO resets 2018-02-20 18:48:54 +08:00
Sebastien Bourdeauducq f15b4bdde7 style 2018-02-20 18:47:59 +08:00
Sebastien Bourdeauducq 7d9c7ada71 drtio: fix test infinite loop 2018-02-20 17:42:00 +08:00
Sebastien Bourdeauducq ad2c9590d0 drtio: rewrite/fix reset and link bringup/teardown 2018-02-20 17:26:43 +08:00
Robert Jördens bfabf3c906 conda: bump migen (9c3a301) 2018-02-19 13:07:17 +00:00
Robert Jördens 7e02d8245c kasli: false paths
* don't bother with the round trip OSERDESE2 -> ... -> pad -> ... ->
  ISERDESE2
* clock groups with derived clocks c.f. migen 9c3a301
2018-02-19 13:05:11 +00:00
Sebastien Bourdeauducq 0f4549655b sayma: use Xilinx RX synchronizer
Cannot be used on Kasli, this breaks the bitstream entirely (nothing on UART).
2018-02-19 17:49:53 +08:00
Sebastien Bourdeauducq 52049cf36a drtio: add Xilinx RX synchronizer 2018-02-19 17:49:43 +08:00
Sebastien Bourdeauducq 3bc575bee7 drtio: add missing define for Sayma master 2018-02-19 17:11:21 +08:00
Sebastien Bourdeauducq 7376ab0ff8 drtio: fix Sayma after 83abdd28 2018-02-19 17:10:55 +08:00
Florent Kermarrec f5831af535 drtio/transceiver/gtp_7series_init: don't reset gtp rx on power down 2018-02-19 10:03:19 +01:00
Florent Kermarrec 89a158c0c9 drtio/transceiver/gtp_7series_init: remove dead code 2018-02-19 10:02:23 +01:00
Florent Kermarrec 782051f474 drtio/transceiver/gtp_7series_init: add no retiming on gtp resets 2018-02-19 09:59:50 +01:00
Sebastien Bourdeauducq 01fa6c1c2e reorganize examples 2018-02-19 15:46:08 +08:00
Sebastien Bourdeauducq 4b4090518b drtio: clean up remnants of removed debug functions 2018-02-19 15:14:32 +08:00
Sebastien Bourdeauducq c329c83676 kasli: fix disable_si5324_ibuf no_retiming 2018-02-19 12:19:05 +08:00
Sebastien Bourdeauducq a93decdef2 kasli: disable DRTIO IBUFDS_GTE2 until Si5324 is initialized 2018-02-19 00:48:37 +08:00
Sebastien Bourdeauducq 94c20dfd4d drtio: fix misleading GenericRXSynchronizer comment 2018-02-19 00:47:54 +08:00
Sebastien Bourdeauducq 83abdd283a drtio: signal stable clock input to transceiver 2018-02-18 22:29:30 +08:00
Robert Jördens c87636ed2b si5324: fix cfb21ca 2018-02-18 11:38:20 +01:00
Robert Jördens caedcd5a15 ad9912: cleanup, document init() 2018-02-18 11:38:16 +01:00
Robert Jördens 75c89422c9 ad991[02]: sysclk can be 1 GHz 2018-02-18 10:29:19 +00:00
Sebastien Bourdeauducq 6ae1cc20aa conda: bump misoc (#908) 2018-02-18 12:35:49 +08:00
Sebastien Bourdeauducq 41adbef9a9 conda: bump misoc 2018-02-17 17:41:16 +08:00
Sebastien Bourdeauducq 287d533437 Revert "sayma_amc: remove RTM bitstream upload core. Closes #908"
This reverts commit 2d4a1340ea.
2018-02-17 17:38:48 +08:00
Sebastien Bourdeauducq 73985a9215 sayma: remove constraints at outputs of serwb PLL (see misoc d1489ed) 2018-02-17 17:38:17 +08:00
Sebastien Bourdeauducq 039dee4c8e si5324: rename SI5324_FREE_RUNNING to SI5324_AS_SYNTHESIZER
The previous name was causing confusion with the FREE_RUN bit
that connects the crystal to CLKIN2.
2018-02-17 13:54:50 +08:00
Sebastien Bourdeauducq cfb21ca126 si5324: fix usage of external CLKIN2 reference 2018-02-17 13:52:01 +08:00
Sebastien Bourdeauducq 07a31f8d86 conda: bump openocd 2018-02-17 13:21:10 +08:00
Sebastien Bourdeauducq fb8b36cd41 clean up ccc279b8 2018-02-17 12:10:46 +08:00
hartytp ccc279b8da rewrite HMC7043 init code without using ADI GUI outputs, working analog/digital delay 2018-02-17 12:07:11 +08:00
Robert Jördens e41f49cc75 kasli: opticlock 125 MHz, mark external reference case broken 2018-02-16 17:23:15 +00:00
Sebastien Bourdeauducq e4db84e214 doc: fix typo 2018-02-17 00:11:48 +08:00
Sebastien Bourdeauducq 7a5161d348 conda: bump misoc (#902) 2018-02-17 00:11:42 +08:00
Robert Jördens 0ef33dd0d8 manual: add note about the "correct" vivado version
close #910
2018-02-15 14:21:17 +01:00
Robert Jördens 7002bea0ab kasli: clean up urukul example more 2018-02-15 14:21:17 +01:00
Sebastien Bourdeauducq 4d42df2a7c kasli: set up Si5324 in standalone operation 2018-02-15 20:32:58 +08:00
Sebastien Bourdeauducq c5ae81f452 satman: remove unused 62.5MHz Si5324 settings 2018-02-15 20:29:51 +08:00
Sebastien Bourdeauducq d7387611c0 sayma: print RTM gateware version 2018-02-15 19:31:58 +08:00
whitequark d572c0c34d artiq_devtool: fix the hotswap action. 2018-02-14 23:10:27 +00:00
whitequark fe50018037 firmware: make network tracing runtime switchable. 2018-02-14 23:03:20 +00:00
Robert Jördens 2adba3ed33 urukul: document ad9912, and cpld, fix api 2018-02-14 09:45:17 +01:00
Robert Jördens ede98679fc ad9910: add documentation 2018-02-14 09:05:03 +01:00
Robert Jördens b6395a809b kasli: remove old urukul test code 2018-02-13 22:16:57 +01:00
Robert Jördens be693bc8a9 opticlock: examples 2018-02-13 22:13:40 +01:00
Robert Jördens a3d136d30d opticlock: wire urukul and novogorny 2018-02-13 22:13:40 +01:00
Robert Jördens 7f1bfddeda ad9910: tweak spi timing for higher speed 2018-02-13 22:13:40 +01:00
Robert Jördens 6a6695924f urukul: proto 8 2018-02-13 22:13:40 +01:00
Robert Jördens bc6af03a61 urukul: (proto 7) drop att_le 2018-02-13 22:13:40 +01:00
Sebastien Bourdeauducq df177bfd5b use new misoc identifier 2018-02-13 20:38:48 +08:00
Sebastien Bourdeauducq ab5f397fea sed/fifos: use AsyncFIFOBuffered
(D)RTIO now passes timing at 150MHz on Kasli.
2018-02-13 20:02:51 +08:00
Sebastien Bourdeauducq 00f42f912b rename 'RTM identifier' to 'RTM magic number'
Avoids confusion with the MiSoC identifier (containing the ARTIQ version).
2018-02-13 20:02:51 +08:00
Sebastien Bourdeauducq 96b948f57f remote_csr: add sanity check of CSR CSV type column 2018-02-13 20:02:51 +08:00
Sebastien Bourdeauducq e67a289e2b examples: add SAWG sines (DAC synchronization test) 2018-02-13 20:02:51 +08:00
Florent Kermarrec bfdda340fd drtio/transceiver/gtp_7series: use parameters from xilinx wizard 2018-02-13 00:23:59 +01:00
Florent Kermarrec 180c28551d drtio/gateware/transceiver/gtp_7series: add power down state before reset on rx (seems to make restart reliable) 2018-02-09 20:17:02 +01:00
Sebastien Bourdeauducq 2d4a1340ea sayma_amc: remove RTM bitstream upload core. Closes #908 2018-02-07 12:27:35 +08:00
whitequark 61c64a76be gateware: use a per-variant subfolder in --output-dir. (fixes #912)
This commit also adds support for --variant and --args
to artiq-devtool.
2018-02-06 08:19:01 +00:00
Florent Kermarrec e80b481032 firmware/libboard_artiq/hmc830_7043.rs: add template for sys_ref phase configuration for dac1/dac2 and fpga 2018-02-05 13:40:17 +01:00
Florent Kermarrec e50bebb63d firmware/liboard_artiq/ad9154.rs: add checks for jesd subclass 1 (verify that we receive the sysref and that phase error is within the specified window error threshold). 2018-02-05 13:39:30 +01:00
Robert Jördens 4c22d64ee4 conda: sync artiq/artiq-dev dependencies 2018-01-30 08:36:55 +01:00
Robert Jördens 9fca7b8faa artiq_flash: also report sayma AMC SYSMONE1 data
requires hardware patch (https://github.com/m-labs/sinara/issues/495)
2018-01-30 15:17:11 +08:00
Robert Jördens fb8c779b4f artiq_flash: report XADC data
* bump openocd
* only kasli, kc705, sayma rtm so far
2018-01-30 14:56:50 +08:00
whitequark 807eb1155b Update smoltcp.
Fixes #902.
2018-01-30 03:29:08 +00:00
whitequark a669652854 artiq_flash: tell openocd to not listen on any network ports. 2018-01-30 03:12:06 +00:00
whitequark 0edc34a9e5 artiq_devtool: the proxy artiq_flash action doesn't exist anymore. 2018-01-28 15:19:17 +00:00
whitequark 9a94482c6e conda: fix typo in 885ab409. 2018-01-28 15:18:52 +00:00
whitequark 79ea454ec1 conda: use $SP_DIR instead of $PREFIX/lib/python3.5/site-packages. (#652)
This removes the last hardcoded python3.5 reference.
2018-01-28 14:29:19 +00:00
whitequark 885ab40946 conda: split RTM and AMC packages back.
This avoids multiplying the RTM compilation time by the number
of AMC packages.
2018-01-28 14:27:55 +00:00
whitequark 11a8b84355 Merge the build trees of sayma_amc and sayma_rtm targets.
This also makes them a single artiq_flash target, and a single
conda package.
2018-01-27 19:54:31 +00:00
whitequark 0b9c551962 artiq_flash: implement flash read functionality. 2018-01-27 19:54:31 +00:00
Sebastien Bourdeauducq 0aacdb0458 tools: add missing import 2018-01-28 02:12:46 +08:00
Sebastien Bourdeauducq 6f90a43df2 examples: reorganize for new hardware 2018-01-28 02:11:45 +08:00
Sebastien Bourdeauducq 67625fe912 test: check kernel overhead credibility 2018-01-28 01:02:03 +08:00
Sebastien Bourdeauducq e8ed3475ea test: add kernel overhead test (#407) 2018-01-28 01:00:59 +08:00
Sebastien Bourdeauducq 3231d8b235 RELEASE_NOTES: 3.3 2018-01-28 00:18:01 +08:00
whitequark eed2db3a98 artiq_flash: make the proxy action unnecessary. 2018-01-27 15:43:27 +00:00
whitequark d58393a1e5 runtime: build with -Cpanic=unwind.
This is required for backtraces to function. I'm not sure how it
turned out that master had -Cpanic=abort.
2018-01-26 23:01:24 +00:00
whitequark 08101b631d artiq_devtool: fix typo. 2018-01-26 13:55:31 +00:00
Sebastien Bourdeauducq 440e19b8f9 kasli: use SFP2 for DRTIO mastering
SFP1 PCB routing has some issues.

Also use SFP1 LED for DRTIO in both master and satellite.
2018-01-26 19:02:54 +08:00
Robert Jördens c9b36e3559 conda: bump misoc, close #905 2018-01-25 19:31:26 +01:00
Sebastien Bourdeauducq 0d2f89db53 si5324: chip does not ack RST_REG write 2018-01-25 11:06:19 +08:00
Sebastien Bourdeauducq ca4d5ae73e artiq_flash: add kasli drtio variants 2018-01-25 00:00:07 +08:00
Sebastien Bourdeauducq 77f90cf93b test: relax RTIO counter test and print result 2018-01-24 10:07:22 +08:00
Sebastien Bourdeauducq ed0fbd5662 test: add test for RTIO counter (#883) 2018-01-24 00:28:39 +08:00
Robert Jördens e0e795f11c sayma_amc: constrain pin, remove keep 2018-01-23 15:42:47 +00:00
Robert Jördens ee14912042 conda: bump migen/misoc (vivado constraints) 2018-01-23 16:23:12 +01:00
Robert Jördens b5c035bb52 sayma_rtm: constrain serwb clock input 2018-01-23 13:54:53 +00:00
Robert Jördens aada38f508 kasli, kc705: remove vivado "keep", cleanup a constraint 2018-01-23 13:15:26 +00:00
Robert Jördens 85102e191e sayma_rtm: derive clocks automatically
* also don't add false paths unless necessary
2018-01-23 11:00:55 +00:00
Robert Jördens 7d1b3f37c9 sayma_rtm: set CFGBVS/CONFIG_VOLTAGE, compress 2018-01-23 10:56:42 +00:00
Sebastien Bourdeauducq cb0016ceee examples/sayma: fix ref_multiplier
SAWG is working, whoohoo!
2018-01-23 15:26:03 +08:00
Sebastien Bourdeauducq cfffd9e13d si5324: kasli support 2018-01-23 13:17:03 +08:00
Sebastien Bourdeauducq 649deccd9b kasli: fix DRTIO satellite QPLL refclksel 2018-01-23 12:27:19 +08:00
Sebastien Bourdeauducq 4b4374f76a sayma: register_jref for JESD204. Closes #904 2018-01-23 12:19:15 +08:00
Sebastien Bourdeauducq 763aefacff kasli: fix typo 2018-01-23 12:10:54 +08:00
Sebastien Bourdeauducq c7b148a704 kasli: when using both GTP clocks, send REFCLK0 to PLL0 and REFCLK1 to PLL1 2018-01-23 12:08:10 +08:00
Sebastien Bourdeauducq d6157514c7 gtp_7series: flexible QPLL channel selection 2018-01-23 12:03:09 +08:00
Sebastien Bourdeauducq 9f87c34a94 kasli: fix QPLL instantiation 2018-01-23 10:39:31 +08:00
Sebastien Bourdeauducq 98a5607634 gtp_7series: set clock muxes correctly for second QPLL channel 2018-01-23 10:39:20 +08:00
Sebastien Bourdeauducq 25fee1a0bb gtp_7series: use QPLL second channel 2018-01-23 10:15:49 +08:00
Sebastien Bourdeauducq 031d7ff020 kasli: keep using second QPLL channel for DRTIO satellite 2018-01-23 10:13:10 +08:00
Sebastien Bourdeauducq 626075cbc1 gtp_7series: simplify TX clocking 2018-01-23 09:49:23 +08:00
Robert Jördens 472840f16b conda: bump migen/misoc
* kasli clock constraint
* vivado false paths
2018-01-22 20:32:18 +01:00
Robert Jördens 74b7baa8c5 urukul example: mmcx clock input 2018-01-22 20:30:08 +01:00
Robert Jördens a86b28def2 urukul: example additions
* relax timings for faster spi xfers
* continuous readback test to explore spi speed limit
2018-01-22 20:29:30 +01:00
Robert Jördens 5a9035b122 urukul: faster spi clock 2018-01-22 18:27:40 +00:00
Robert Jördens ca1fdaa190 ad9910: relax timing for faster spi clock 2018-01-22 18:27:40 +00:00
Sebastien Bourdeauducq 0d73401365 conda: bump migen+misoc 2018-01-23 01:28:10 +08:00
Sebastien Bourdeauducq 401e57d41c gtp_7series: fix nchannels assert 2018-01-23 01:28:01 +08:00
Sebastien Bourdeauducq aa62e91487 kasli: add DRTIO targets (no firmware) 2018-01-23 01:27:40 +08:00
Sebastien Bourdeauducq 296ac35f5d sayma_amc: SFP TX disable is active-high 2018-01-23 00:32:09 +08:00
Sebastien Bourdeauducq 77192256ea kc705: style 2018-01-23 00:02:35 +08:00
Sebastien Bourdeauducq ab7c49d6d0 sayma_amc: raise error on invalid variant 2018-01-23 00:02:16 +08:00
Sebastien Bourdeauducq c1ac3b66b1 sayma_rtm: fix 8fe463d4a 2018-01-23 00:01:45 +08:00
Sebastien Bourdeauducq 53facfef13 sayma: build fixes 2018-01-22 18:33:22 +08:00
Sebastien Bourdeauducq 25f3feeda8 refactor targets 2018-01-22 18:25:10 +08:00
Sebastien Bourdeauducq 5198c224a2 sayma,kasli: use new pin names 2018-01-22 11:51:07 +08:00
whitequark 8598e475e9 artiq_flash: fix a refactoring mistake. 2018-01-20 08:30:42 +00:00
Sebastien Bourdeauducq c3323f0d57 hmc830: improve lock failure error report 2018-01-20 15:42:53 +08:00
whitequark 115aa0d0d6 artiq_flash: support load action for Sayma RTM FPGA. 2018-01-20 07:23:50 +00:00
whitequark 94592c7a4c artiq_flash: unify flash handling in XC7 and Sayma programmers. 2018-01-20 07:23:50 +00:00
whitequark 1ffabac06f artiq_flash: use atexit for tempfile cleanup. 2018-01-20 07:23:50 +00:00
whitequark ab9eb56ceb setup.py: migen now works on Python 3.6, relax version check. 2018-01-20 07:23:50 +00:00
Florent Kermarrec 8fe463d4a0 sayma_rtm: add UART loopback to easily know if rtm fpga is alive 2018-01-20 06:04:34 +01:00
Florent Kermarrec 74ce7319d3 sayma: reduce serwb linerate to 625Mbps (make it work on saymas with 1.8v issue, related?) 2018-01-20 06:04:18 +01:00
whitequark f4022ba872 remoting: avoid a race condition. 2018-01-20 01:30:44 +00:00
whitequark 83278a6edb artiq_flash: fix a refactoring bug. 2018-01-20 01:30:44 +00:00
hartytp 37fa3b29da firmware: add register dump on HMC830 lock timeout. 2018-01-20 00:19:31 +00:00
whitequark 934bc53cb5 artiq_devtool: refactor. 2018-01-19 20:35:35 +00:00
whitequark ebd02c4f43 artiq_flash: fix typo. 2018-01-19 18:53:49 +00:00
whitequark 1c7cb737ca artiq_flash: refactor. 2018-01-19 17:45:49 +00:00
whitequark bcc39a8c9d artiq_flash: add --dry-run option. 2018-01-19 17:45:49 +00:00
whitequark 323c7e66cf artiq_devtool: fix help message. 2018-01-19 17:45:49 +00:00
Florent Kermarrec 9eb13aba3c liboard_artiq/hmc830_7043: allow sysref digital/analog delay configuration (will need to be adjusted for jesd subclass1) 2018-01-19 17:19:02 +01:00
Florent Kermarrec d27727968c add artix7 gtp (3gbps), share clock aligner with gth_ultrascale 2018-01-19 12:17:54 +01:00
Sebastien Bourdeauducq cdbf95d46a kasli: fix permissions 2018-01-19 18:31:20 +08:00
whitequark 3c0b164e4d artiq_devtool: update for new board file convention.
Also fix a typo in documentation.
2018-01-19 09:43:03 +00:00
whitequark 0cdbc5544a doc: update DEVELOPER_NOTES. 2018-01-19 09:38:06 +00:00
whitequark b1453eb856 Revert "conda: remove openocd version constraint."
This reverts commit 3eb882b6b7.

Fixes #892.
2018-01-19 08:28:36 +00:00
whitequark 4fd236d234 artiq_flash: cache transferred artifacts. 2018-01-19 08:28:04 +00:00
whitequark 06388e21b7 doc: update DEVELOPER_NOTES. 2018-01-19 07:59:23 +00:00
whitequark 3922a7c64b artiq_devtool: make locking reentrant. 2018-01-19 07:58:58 +00:00
whitequark b553804e5a artiq_flash: implement network transparency. 2018-01-19 07:39:55 +00:00
whitequark 80cbef0031 firmware: always reset PHY when initializing Ethernet.
Fixes #897.
2018-01-19 04:56:11 +00:00
whitequark 1f82ceaa85 firmware: add HMC542 (Allaki) support. 2018-01-19 04:47:26 +00:00
whitequark bdf41cd574 doc: mention that ARTIQ can only be developed on Linux. (fixes #896). 2018-01-18 20:29:24 +00:00
Florent Kermarrec 07f4e2e35a libboard_artiq/ad9154: fix prbs test (only keep prbs7) and
always do it after ad9154 initialization
2018-01-18 08:19:37 +01:00
Robert Jördens 8ec33ae7bd kasli: feed EEM clock fan-out from SI5324 2018-01-17 17:27:59 +01:00
whitequark dbe48d3cad Fix 3313e997. 2018-01-17 11:31:32 +00:00
whitequark 3313e997df test: fix test_worker to work when deprecation warnings are emitted. 2018-01-17 11:27:56 +00:00
Robert Jördens ed3e3b2791 sayma_amc: clarify --with-sawg help 2018-01-17 12:10:30 +01:00
Florent Kermarrec f54b27b79c sayma_amc: prepare for jesd subclass 1 2018-01-17 11:49:36 +01:00
whitequark 5c6276c78f conda: build artiq-$BOARD as noarch: python, like artiq itself.
Fixes #894.
2018-01-17 02:09:53 +00:00
whitequark f77aa9b78f artiq_flash: rename sayma to sayma_amc to fix bitstream discovery.
Fixes #895.
2018-01-17 01:45:47 +00:00
whitequark a536d6df12 artiq_flash: add sayma_rtm support. 2018-01-17 01:21:19 +00:00
whitequark bfceef439f Add missing parts of f317d1a2. 2018-01-17 01:14:16 +00:00
whitequark 1e896d4ba8 firmware: fix warnings. 2018-01-17 00:48:46 +00:00
whitequark f317d1a2c6 Update board naming (again) to match DNS. 2018-01-17 00:42:56 +00:00
Florent Kermarrec f73c3e5944 gateware/test/serwb: update and cleanup test (v2...) 2018-01-16 20:06:43 +01:00
Robert Jördens 7405006668 sayma: rtio clock is jesd fabric clock 2018-01-16 18:19:04 +01:00
whitequark 3eb882b6b7 conda: remove openocd version constraint.
Conda chokes on it and I don't care enough to fix it.
2018-01-16 08:51:45 +00:00
whitequark 247167d34a Revert "gateware/test/serwb: update and cleanup tests"
This reverts commit 5b03cc2fae.
2018-01-16 08:21:26 +00:00
whitequark 44cd7dfa23 conda: update misoc. 2018-01-16 08:09:25 +00:00
whitequark 444b901dbe sayma: add RTM configuration port. 2018-01-16 07:28:00 +00:00
Florent Kermarrec 702c35821b libboard_artiq/ad9154: add dac_status and dac_prbs (untested) 2018-01-15 22:15:35 +01:00
Florent Kermarrec 5b03cc2fae gateware/test/serwb: update and cleanup tests 2018-01-15 21:53:40 +01:00
Robert Jördens d52568e254 conda: bump migen (kasli link_up) 2018-01-15 16:41:24 +01:00
Robert Jördens fd82a1a9af conda: bump migen (kasli) 2018-01-15 16:14:58 +01:00
Robert Jördens 21cd24fe80 manual: add section on Kasli/opticlock 2018-01-15 15:13:24 +01:00
Robert Jördens ef40fb93c2 conda: add artiq-kasli-opticlock 2018-01-15 15:04:46 +01:00
Robert Jördens 344ce7e294 conda: bump misoc (kasli sfp) 2018-01-15 14:17:40 +01:00
Robert Jördens 1c15124c5e artiq_flash: add kasli 2018-01-15 14:17:40 +01:00
Robert Jördens 8a960c1b31 conda: bump openocd (kasli) 2018-01-15 14:17:40 +01:00
Robert Jördens fe44b6651a conda: bump misoc (1000basex) 2018-01-15 14:17:40 +01:00
whitequark 6891141fa6 artiq_flash: add sayma support. 2018-01-15 11:43:29 +00:00
Robert Jördens 529033e016 kernel_cpu: disable PCU
* contributes to long timing paths on artix 7 (kasli)
* currently only used for testing and debugging
2018-01-12 12:03:50 +00:00
Robert Jördens ac3c3871d0 kasli: s/extensions/variant/g 2018-01-12 12:29:42 +01:00
Chris Ballance 7429ee4fb6 firmware: make read leveling robust for KUS SDRAM
Increases the initial delay step into the valid read window as
with the original delay I was not getting out of the noisy
transition window, as evidenced by seeing read delay windows
of only 8 LSB ~10% of the time, leading to failing memory
tests
2018-01-12 10:35:38 +08:00
Sebastien Bourdeauducq 5a79c9bc09 RELEASE_NOTES: add SED 2018-01-11 11:38:06 +08:00
Sebastien Bourdeauducq 7c82fcf41a targets: avoid passing cpu_type around unnecessarily 2018-01-11 11:21:55 +08:00
Sebastien Bourdeauducq 6d58c4390b Merge branch 'sed-merge' 2018-01-10 13:14:39 +08:00
Sebastien Bourdeauducq 94d51d1364 firmware: fix drtio_dbg module syntax 2018-01-10 12:15:23 +08:00
Sebastien Bourdeauducq 04b2fd3e13 sayma: fix AD9154NoSAWG ramp clock domain 2018-01-10 12:11:33 +08:00
Sebastien Bourdeauducq dc593ec0f0 Merge branch 'rtio-sed' into sed-merge 2018-01-10 12:04:54 +08:00
whitequark 0ce63e7f4a doc: Rust uses recursive submodules (brrr).
[ci skip]
2018-01-10 01:27:18 +00:00
whitequark 16832291eb doc: update Rust version.
[ci skip]
2018-01-10 01:27:18 +00:00
Florent Kermarrec 2009734b3c serwb/phy: get 625Mbps linerate working, increase timeout 2018-01-09 18:54:52 +01:00
Florent Kermarrec 9c6a7f7509 serwb/kusphy: use same serwb_serdes_5x reset than s7phy 2018-01-09 18:54:05 +01:00
whitequark 267c699835 firmware: support DDRPHY without write leveling (fixes #886).
Currently, this is kasli.
2018-01-09 02:41:02 +00:00
whitequark 07ccb9eebd firmware: support configuration without ethphy (#886).
Currently, this is kasli.
2018-01-08 22:16:17 +00:00
whitequark 34a5445802 compiler: don't die if addr2line cannot extract line from backtrace.
Fixes #885.
2018-01-08 21:53:04 +00:00
whitequark 3a3f44af53 firmware: update smoltcp. 2018-01-08 21:41:53 +00:00
whitequark 987a9c8308 conda: update rustc to 1.23.0. 2018-01-08 21:39:15 +00:00
Robert Jördens 8813aee6b1 targets: add kasli [wip, untested] 2018-01-04 16:12:12 +01:00
Sebastien Bourdeauducq 161a414567 serwb: debug print on error 2018-01-04 22:23:59 +08:00
Sebastien Bourdeauducq e1a75ac1c1 runtime: set log level early
We want to debug startup.
2018-01-04 22:19:48 +08:00
whitequark fc9766d2fa firmware: reset ethphy before initializing smoltcp (fixes #884). 2018-01-04 11:42:35 +00:00
Robert Jördens 67746cc7a0 urukul: raise instead of assert, clean up 2018-01-03 19:22:36 +00:00
Robert Jördens e3d66d286d urukul: ad9910 examples 2018-01-03 18:43:04 +00:00
Robert Jördens eae7584432 ad9910: add [wip] 2018-01-03 18:43:04 +00:00
Robert Jördens 7ac809f8b3 urukul: do io reset 2018-01-03 18:43:04 +00:00
Robert Jördens 28a3ee7e61 urukul: make STA reading robust, add io_rst(), clean up 2018-01-03 18:43:04 +00:00
Robert Jördens cef40eef43 ad9912: clean up 2018-01-03 18:43:04 +00:00
Robert Jördens d8dbab024d urukul: don't deal with dds_reset for now 2018-01-03 18:43:04 +00:00
Robert Jördens e8608d12f5 device_db.py: whitespace 2018-01-03 18:43:04 +00:00
Florent Kermarrec 1e972034e8 gateware/targets: enable serwb scrambling on sayma amc & rtm 2018-01-03 17:34:46 +01:00
Florent Kermarrec 907af25a69 gateware/serwb: add scrambling, reduce cdc fifo depth 2018-01-03 17:34:03 +01:00
Florent Kermarrec 7f4756a869 gateware/serwb: cleanup packet 2018-01-03 17:30:12 +01:00
Robert Jördens 08dada9e16 artiq-dev: bump misoc (spi logic fold) 2018-01-03 09:14:35 +01:00
Robert Jördens a940550e47 urukul: add CPLD and AD9912 driver [wip] 2018-01-02 19:59:24 +01:00
Robert Jördens c2be820e9a kc705_dds: make ext_clkout 100 MHz 2018-01-02 19:58:47 +01:00
Robert Jördens 43686f324b kc705_dds: fix HPC voltages
* VADJ is 3.3 V due to the DDS card on LPC
* the LVDS standards need to be 2.5 V

* the direction control register on HPC (FMC-DIO to VHDCI)
  was LVCMOS33 but while all the LVDS pairs are at VCCIO=VADJ=3.3 V
  they were instantiated as LVDS_25 (ignoring the wrongly powered bank)
* we now use 2.5 V standards on HPC consistently despite VADJ=3.3 V
  and hope for the best.
2018-01-02 13:41:07 +01:00
Robert Jördens 94b84ebe7c kc705_dds: add urukul spi/ttl channels 2018-01-02 13:20:48 +01:00
Robert Jördens 53969d3686 kc705_dds: add urukul on vhdci extension definition 2018-01-02 13:20:47 +01:00
Robert Jördens 2f8e6c7462 spi: add diff_term, save power on outputs 2018-01-02 13:20:47 +01:00
Robert Jördens 6d20b71dde ttl_serdes_7series: refactor IOSERDES 2018-01-02 13:20:47 +01:00
whitequark b7f38b123b frimware: update to log 0.4. 2018-01-01 11:45:55 +00:00
Robert Jördens 745e695b09 sayma: output a ramp in the absence of SAWG channels 2017-12-31 12:18:53 +01:00
whitequark a371b25525 bootloader: allow using without Ethernet. 2017-12-31 09:21:28 +00:00
whitequark 70ebe431fd satman: fix build after b8f3d28b. 2017-12-31 09:21:02 +00:00
whitequark e1253db0e8 firmware: update crc dependency, use it in libdrtioaux. 2017-12-31 09:16:11 +00:00
whitequark b8f3d28bc0 firmware: update compiler_builtins dependency and move it to libboard.
This is so that we only specify it once.
2017-12-31 09:16:11 +00:00
Sebastien Bourdeauducq a1b8bca1e6 Revert "artiq_flash: ignore RTM FPGA"
Naive optimism.

This reverts commit 100bda2582.
2017-12-31 13:29:36 +08:00
Sebastien Bourdeauducq 100bda2582 artiq_flash: ignore RTM FPGA
It has no flash connected, and attempting to detect it causes unnecessary program failure when the RTM is not present.
2017-12-31 12:10:16 +08:00
Sebastien Bourdeauducq 38ce1f1d5d artiq_flash: support flashing satman
A bit ugly and ad-hoc but I cannot think of an easy and better option right now.
2017-12-31 12:09:18 +08:00
Sebastien Bourdeauducq a897d82324 ad9154: retry initialization (#727) 2017-12-31 11:27:43 +08:00
Sebastien Bourdeauducq 6e0288e568 drtio: fix GTH CPLL reset 2017-12-30 12:14:36 +08:00
Robert Jördens 379d29561b sayma: plausibility assertion on sawg data stream 2017-12-29 19:15:40 +01:00
Sebastien Bourdeauducq 37eb73bf5c conda: bump migen 2017-12-29 10:45:46 +08:00
Robert Jördens 6f27ca81fb conda/artiq-dev: bump migen (color xilinx, colorama) 2017-12-28 23:37:28 +01:00
Robert Jördens f26d08fed3 conda/artiq-dev: bump migen (color vivado 2017.4) 2017-12-28 22:47:25 +01:00
Robert Jördens 605da18684 conda/artiq-dev: bump misoc (spi) 2017-12-28 16:53:41 +01:00
Robert Jördens 37f9c0b10c spi: register clk
following m-labs/misoc#65
1dc68b0d0b
2017-12-28 16:50:22 +01:00
whitequark 3505878176 bootloader: add basic network support. 2017-12-28 15:26:12 +00:00
whitequark d2687ce3c4 firmware: fix a typo replacing spiflash::SECTOR_SIZE with PAGE_SIZE. 2017-12-28 15:26:12 +00:00
whitequark 6d0168edb7 conda: bump misoc dependency. 2017-12-28 15:26:12 +00:00
whitequark 33e0393e4a firmware: move mod ethmac to libboard. 2017-12-28 14:40:15 +00:00
whitequark 55cfdec644 firmware: enlarge bootloader partition to 4 sectors. 2017-12-28 14:39:26 +00:00
whitequark a9ad4f08e9 conda: bump misoc dependency. 2017-12-28 13:36:28 +00:00
whitequark acd13837ff firmware: implement the new bootloader. 2017-12-28 13:18:51 +00:00
whitequark b9754e7108 firmware: deduplicate libbuild_misoc and libbuild_artiq. 2017-12-28 13:18:51 +00:00
Sebastien Bourdeauducq 8153cfa88f drtio/gth: add probes on {tx,rx}_init.done 2017-12-28 16:49:08 +08:00
Sebastien Bourdeauducq c086149782 drtio/gth: use async microscope probes 2017-12-28 16:37:40 +08:00
whitequark d94db1de5d Revert accidentally committed parts of 1b9b5602. 2017-12-28 08:23:34 +00:00
whitequark fcc438524c firmware: use main.rs as the root source for non-library crates. NFC. 2017-12-28 08:20:23 +00:00
whitequark 1b9b560242 firmware: use libbuild_misoc in libdrtioaux. NFC. 2017-12-28 08:20:23 +00:00
whitequark 8f33061a6d firmware: fix sayma_amc_standalone build with sawg. 2017-12-28 08:20:23 +00:00
Sebastien Bourdeauducq 4ea801b2ea firmware: si5324 moved to board_artiq 2017-12-28 15:45:45 +08:00
whitequark 3b18ece3b7 satman: update for changes in firmware elsewhere. 2017-12-28 07:36:33 +00:00
whitequark d3066e5044 firmware: oops, misoc #[cfg]s were missing from libboard_artiq. 2017-12-28 07:36:33 +00:00
whitequark ca419aa3c2 firmware: split out libboard_artiq from libboard. 2017-12-28 07:07:00 +00:00
Sebastien Bourdeauducq 6801921fc0 drtio: instrument GTH transceiver 2017-12-28 15:03:14 +08:00
whitequark c626456030 conda: bump misoc dependency. 2017-12-28 05:21:30 +00:00
whitequark b443fbd8f7 runtime: remove #[repr(simd)] hack. 2017-12-28 04:46:27 +00:00
whitequark 7687a34285 firmware: remove dependency on compiler-rt. 2017-12-28 04:08:29 +00:00
whitequark 4dfe71676e firmware: remove dependency on libbase. 2017-12-28 04:03:27 +00:00
whitequark 68f128944a firmware: clean up makefiles. 2017-12-27 23:10:47 +00:00
whitequark d7cb4963e1 firmware: prepare config block for access from BIOS/bootloader.
* remove liballoc dependency from mod config,
  * move mod config to libboard,
  * move config sector immediately after BIOS sector.
2017-12-27 21:28:40 +00:00
whitequark 5a2cbe7088 runtime: remove borrow_mut!() in favor of backtraces. 2017-12-27 19:15:25 +00:00
whitequark 4d915ad15b compiler: do not permit str(...). (#878) 2017-12-27 03:10:50 +00:00
Sebastien Bourdeauducq bd47a0371f RELEASE_NOTES: add 3.2 entry 2017-12-27 10:52:41 +08:00
whitequark f46a58f5b2 conda: bump rustc version requirement. 2017-12-27 01:44:16 +00:00
whitequark 355acb5e13 compiler: fix typo in a0a2650f. 2017-12-26 21:55:22 +00:00
whitequark edfacbd063 conda: ship runtime.elf in board-specific packages.
This is so that backtraces may be symbolized.
2017-12-26 21:50:31 +00:00
whitequark 40ca0ac83f conda: update llvmlite-artiq dependency. 2017-12-26 21:46:20 +00:00
whitequark 9aec64093b compiler: do not ever emit !tbaa on invoke instructions. 2017-12-26 21:35:08 +00:00
whitequark a2bc12da68 Only print gateware/software mismatch warning once per process. 2017-12-26 21:13:46 +00:00
whitequark b31b59f7ca compiler: update for llvmlite 0.20.0. 2017-12-26 16:25:19 +00:00
whitequark a0a2650fca compiler: do not use invoke for calls to nounwind ffi functions.
Otherwise, declarations such as:

  @syscall(flags={"nounwind", "nowrite"})
  def foo(...):

trip an LLVM assert because the invoke instruction and the !tbaa
metadata are no longer compatible since LLVM 4.0.
2017-12-26 16:24:57 +00:00
whitequark fd6d97f052 artiq_devtool: set ServerAliveInterval. 2017-12-26 15:41:03 +00:00
whitequark 8b4a006855 runtime: update smoltcp. 2017-12-26 14:33:56 +00:00
whitequark c939c6183e Update to LLVM 4.0. 2017-12-26 14:09:17 +00:00
whitequark 71eca5ad61 runtime: fix some final flash storage issues. 2017-12-26 14:09:17 +00:00
whitequark 188764693e runtime: we're growing, put storage at 1M instead of 512K. 2017-12-26 03:34:16 +00:00
whitequark e2513a2401 runtime: ensure flash storage never overlaps with runtime sections. 2017-12-26 03:31:37 +00:00
whitequark 6e341da3a1 runtime: simplify. NFC. 2017-12-26 02:31:28 +00:00
whitequark 061fb3dcd5 runtime: remove accidentally committed parts of a Makefile. 2017-12-25 20:30:13 +00:00
whitequark 230f2e5e18 runtime: print (address-only) backtraces on core device panics. 2017-12-25 18:32:41 +00:00
whitequark 3eec15c01d firmware: fix compatibility with newer rustc. NFC. 2017-12-25 17:16:05 +00:00
whitequark 1570a482c2 artiq_devtool: don't require lock for reset.
reset is mainly useful as a part of reset+hotswap sequence, and that
already needs lock via connect.
2017-12-25 16:15:51 +00:00
whitequark fa4dc1bf0e doc: developing: show how to make clang source builds faster. 2017-12-24 16:27:54 +00:00
Sebastien Bourdeauducq 70b7f28ad3 drtio: drive SFP TX disable pins 2017-12-23 22:58:51 +08:00
Sebastien Bourdeauducq 00ed51f6f4 satman: use new alloc_list (#880) 2017-12-23 22:15:39 +08:00
Sebastien Bourdeauducq f8c8f3fe26 drtio: fix GTH clock domains 2017-12-23 07:21:44 +08:00
Sebastien Bourdeauducq 1af21c0b29 drtio: integrate GTH transceiver for Sayma 2017-12-23 01:19:59 +08:00
Sebastien Bourdeauducq c57b66497c drtio: refactor/simplify GTH, use migen 2017-12-23 01:19:44 +08:00
Sebastien Bourdeauducq 77897228ca drtio: add GTH transceiver code from Florent (197c79d47) 2017-12-22 18:01:28 +08:00
Sebastien Bourdeauducq ebdbaaad32 drtio: remove KC705/GTX support 2017-12-22 17:51:42 +08:00
Sebastien Bourdeauducq 0681d472c7 conda: fix sayma_rtm_csr.csv location for Sayma AMC 2017-12-22 17:14:10 +08:00
Sebastien Bourdeauducq cbd69287a7 artiq_flash: select Sayma standalone variant by default 2017-12-22 16:54:06 +08:00
Sebastien Bourdeauducq 44959144d8 conda: add Sayma AMC standalone board package 2017-12-22 16:44:04 +08:00
Sebastien Bourdeauducq e43e14152a conda: remove BUILD_SETTINGS_FILE boilerplate 2017-12-22 09:15:22 +08:00
Florent Kermarrec 86825a852c gateware/targets/sayma_rtm: add false path between cd_sys and cd_clk200 2017-12-21 23:52:44 +01:00
Sebastien Bourdeauducq 8adb50037f conda: remove superfluous SoC build command line arguments 2017-12-22 00:01:26 +08:00
Sebastien Bourdeauducq 6cad942041 conda: add Sayma RTM package 2017-12-21 23:59:14 +08:00
Sebastien Bourdeauducq 69d7e93e99 drtio: adapt examples to Sayma 2017-12-21 23:09:19 +08:00
Sebastien Bourdeauducq a6ffe9f38d drtio: add Sayma top-level designs 2017-12-21 23:08:56 +08:00
Sebastien Bourdeauducq 4fbc8772a5 sayma: allocate all user LEDs to RTIO, make one TTL SMA input 2017-12-21 19:27:38 +08:00
Sebastien Bourdeauducq a23251276d Revert "sayma: set up Si5324 for RGMII clock rerouting"
This reverts commit 2b01aa22b6.
2017-12-21 14:42:15 +08:00
whitequark 701308474f runtime: update smoltcp. 2017-12-19 15:51:03 +00:00
whitequark aaba36be7a runtime: log moninj messages at TRACE level, like all others. 2017-12-16 22:39:13 +00:00
whitequark 8cece4f260 runtime: hotswap slightly more carefully.
This generally lets some last characters out of UART, last ACKs
out of queues, etc. Nothing guaranteed though.
2017-12-16 22:39:13 +00:00
whitequark 4a9d8c9459 runtime: fix a warning. 2017-12-16 22:39:13 +00:00
Sebastien Bourdeauducq 2b01aa22b6 sayma: set up Si5324 for RGMII clock rerouting 2017-12-17 00:25:33 +08:00
David Nadlinger c3c13da1a6 dashboard: Restore minimized experiments when trying to open them again
When the user tried to open an experiment from the explorer that
already existed, previously "nothing would happen" (focus change
without the window being restored).
2017-12-15 19:11:09 +00:00
Sebastien Bourdeauducq 25022b28c3 conda: bump migen+misoc 2017-12-16 00:10:49 +08:00
Sebastien Bourdeauducq b6199bb35b sayma: style 2017-12-15 19:45:51 +08:00
Sebastien Bourdeauducq 649b60ea29 targets/kc705_drtio: remove DAC FMC card support 2017-12-15 17:32:25 +08:00
Sebastien Bourdeauducq f02c74cb7b libboard/si5324: enable both clock outputs 2017-12-15 16:56:44 +08:00
Sebastien Bourdeauducq 9caef3c1d3 libboard/si5324: configure I2C mux on Sayma 2017-12-15 16:45:26 +08:00
Sebastien Bourdeauducq 341e809859 targets/sayma_rtm: enable Allaki RF switches, GPIO access to attenuator 2017-12-15 13:08:35 +08:00
Sebastien Bourdeauducq 77977932f2 firmware: remove AD9516 support
This was only used in KC705 phaser.
2017-12-14 19:16:39 +08:00
Sebastien Bourdeauducq 2e74ce25d8 examples/sayma: make LED blink pattern more peculiar 2017-12-14 19:10:34 +08:00
Sebastien Bourdeauducq 100c2b1769 add Sayma LED blinker example 2017-12-14 18:49:50 +08:00
Sebastien Bourdeauducq 569484f888 remove phaser, adapt SAWG example to Sayma 2017-12-14 18:49:27 +08:00
Sebastien Bourdeauducq 5809e08686 runtime: no startup_clock config is not an error 2017-12-14 12:39:26 +08:00
Sebastien Bourdeauducq 71db953ea0 artiq_flash: add srcbuild option to look into MiSoC source build trees. Closes #868 2017-12-14 10:36:32 +08:00
Robert Jördens 5e251cd85c sayma_amc: remove redundant bitstream options
* CONFIGRATE default is sufficient
* SPI width can be auto and QSPI works
2017-12-13 14:39:32 +01:00
Robert Jördens a9d0f253a5 sayma_amc: set bitstream and config parameters
* slow down CCLK rate as there is additional loading
  on the signals
* single bit SPI for now until we know that quad SPI
  works
* set up

https://github.com/m-labs/artiq/issues/847
2017-12-13 21:21:52 +08:00
Robert Jördens 2917208d89 artiq_flash: fix sayma flashing
* do not include jtagspi as it already instantiates a flash bank
  instead define the target manually
* erase before writing
* verify written images
2017-12-13 21:20:16 +08:00
whitequark 3cf5cef168 artiq_pcap: still grab the file if the command fails. 2017-12-08 07:36:56 +00:00
whitequark 9e8bb1d51c runtime: update smoltcp. 2017-12-08 07:36:56 +00:00
Robert Jördens d6f62c5697 DEVELOPER_NOTES: add old release branch deprecation 2017-12-07 12:32:58 +01:00
Robert Jördens 63f65b6e53 doc: clean up artiq-dev installation instructions
Add a heading to the openocd setup instruction so that it is
clearly distinguishable from the openocd installation. Otherwise people
"re-install" openocd the wrong way.
2017-12-07 12:31:30 +01:00
Robert Jördens 69b2d1abfc conda/artiq-dev: fix channel list
Now, with conda 4.1 packages are sorted by channel, version, build
number in decreasing priority. The highest matching package is
taken. https://conda.io/docs/user-guide/tasks/manage-channels.html

For the artiq-dev environment, the m-labs/label/dev channel should be
first, then the main channel, then defaults, and then conda-forge
(community supported packages).

closes #864
2017-12-07 12:31:30 +01:00
Sebastien Bourdeauducq 825f1ff1ce move RELEASING into DEVELOPER_NOTES 2017-12-07 13:24:06 +08:00
Sebastien Bourdeauducq e5d8314aa7 RELEASE_NOTES: 3.1 2017-12-07 13:23:11 +08:00
Robert Jördens a44f8282dc test_performance: relax network speed to 2 MB/s
At QUARTIQ I am getting 2.4/2.3 MB/s and with single switch at M-Labs we
apparently regularly met 2.2/2.2 MB/s. But with the current multiple
switches and one of them being a problematic switch that triggered #837
it looks like it is a tad slower.

http://buildbot.m-labs.hk/builders/artiq/builds/1818/steps/python_coverage_1/logs/stdio
2017-12-06 17:21:41 +01:00
Robert Jördens c47006b154 conda: bump migen
Relevant changes:

* Kasli
2017-12-06 16:55:27 +01:00
Robert Jördens fcbf6fde8a conda: bump misoc again
(wrong version in previous commit)
shot at #837
2017-12-06 16:50:44 +01:00
Robert Jördens 41e30a5ddf conda: bump misoc dependency
* fixed LiteETH preamble/SFD checker (this is a shot at #837)
2017-12-06 16:48:21 +01:00
whitequark 1c25f7ef52 gateware: make software builds spew less junk on the console.
[ci skip]
2017-12-04 14:19:35 +00:00
whitequark 277b00eb9d artiq_devtool: --config is no longer supported by artiq_flash.
[ci skip]
2017-12-04 14:19:31 +00:00
Sebastien Bourdeauducq 66e089b376 libboard/serwb: more explicit retry log message 2017-12-02 10:51:13 +08:00
Florent Kermarrec 0eb9f93611 libboard/serwb: retry serwb initialization on error 2017-12-01 22:45:05 +01:00
Sebastien Bourdeauducq 2e5b20d53d libboard/hmc830_7043: enable HMC830 2017-11-30 12:06:54 +08:00
Sebastien Bourdeauducq ad2a32d381 libboard/ad9154: small cleanup 2017-11-30 11:33:58 +08:00
Florent Kermarrec bd75954192 libboard/ad9154: update for sayma (spi, jesd parameters, linerate), breaks kc705/ad9154 fmc support 2017-11-29 18:09:39 +01:00
Florent Kermarrec 8b8da39a8f libboard/hmc830_7043.rs: fix HMC7043 comments 2017-11-29 17:59:42 +01:00
Sebastien Bourdeauducq 19498e59f9 libboard: fix JESD reset release 2017-11-29 18:18:41 +08:00
Sebastien Bourdeauducq bb3d6ef84a sayma: remove ad9154 from mem_map
Address is autogenerated by CSR system.
2017-11-29 18:17:25 +08:00
Chris Ballance 1426ecad64 dashboard: tidy dashboard naming logic 2017-11-28 08:56:04 +08:00
Chris Ballance fbd4d8eb6f dashboard: log server address even if friendly name given 2017-11-28 08:56:04 +08:00
Chris Ballance 9a1adfe65c RELEASE_NOTES: master friendly name, dashboard config one-per-master 2017-11-28 08:56:04 +08:00
Chris Ballance b6ad510007 master: style (NFC) 2017-11-28 08:56:04 +08:00
Chris Ballance 00efb0ccd2 master: expand --name help 2017-11-28 08:56:04 +08:00
Chris Ballance 10ee3f19a8 dashboard: close config RPC Client cleanly at exit 2017-11-28 08:56:04 +08:00
Chris Ballance 0999f2dd86 dashboard: explain default configuration file path 2017-11-28 08:56:04 +08:00
Chris Ballance 84b5e68349 dashboard: use master's friendly name in dashboard title 2017-11-28 08:56:04 +08:00
Chris Ballance fafabacf97 master: add friendly name 2017-11-28 08:56:04 +08:00
Chris Ballance 2852e793ab dashboard: store separate configuration data for each master, keyed by server and port 2017-11-28 08:56:04 +08:00
Sebastien Bourdeauducq cfb41e71a8 libboard: print serwb settings at the debug log level 2017-11-28 01:23:33 +08:00
whitequark cf5d50de0c conda: do not compile .py files to .pyc.
We are producing a noarch package, and conda will strip all .pyc
files, so this is a significant waste of time.
2017-11-26 23:59:53 +00:00
whitequark 30f47994db artiq-dev: fix typo. 2017-11-26 23:48:41 +00:00
whitequark 8e8f037971 runtime: print ethmac preamble error count.
Also, print total error count, not the difference (but still compute
the difference to determine *when* to print).
2017-11-26 22:35:26 +00:00
whitequark e5995794be artiq_devtool: actually hold the lock until script termination.
The open channel that ran flock was garbage collected, which caused
the flock command to terminate.
2017-11-26 20:54:24 +00:00
whitequark b5d098c6db Add lockfile support to artiq_devtool. 2017-11-26 15:17:35 +00:00
Sebastien Bourdeauducq b89929565c manual: fix formatting problem 2017-11-25 14:46:31 +08:00
Sebastien Bourdeauducq 14e4e1cf22 Hack-patch Sphinx so that ARTIQ-Python types are correctly printed.
Modification proposed to Sphinx but my issue is getting ignored.

Closes #741
2017-11-25 14:45:31 +08:00
Robert Jördens 7f15f50878 coredevice/ad9912: add [untested, wip] 2017-11-24 18:47:46 +01:00
Sebastien Bourdeauducq 280392708d sawg: fix typo 2017-11-22 20:06:02 +08:00
Sebastien Bourdeauducq 29181b1586 artiq_influxdb: use aiohttp.ClientSession. Closes #829 2017-11-22 17:31:09 +08:00
whitequark 26fdd42f8f runtime: update smoltcp. 2017-11-22 08:09:06 +00:00
Robert Jördens ecfe2e40ee sayma_amc_standalone: rtio channels for both sawg groups 2017-11-19 18:32:42 +01:00
Robert Jördens d1a7c1c3a1 sayma_amc_standalone: connect sawg to jesd again 2017-11-19 14:36:20 +01:00
Florent Kermarrec dfdd2dd9e6 gateware/targets/sayma_amc_standalone: revert self.add_wb_slave on serwb 2017-11-19 09:01:20 +01:00
Florent Kermarrec cd83b71d92 gateware/targets/sayma_amc_standalone: serwb working, need fixing on AD9154 data mapping 2017-11-18 18:10:28 +01:00
Florent Kermarrec a3383c340c firmware/satman/lib.rs: has_serwb_phy to has_serwb_phy_amc 2017-11-18 18:09:35 +01:00
Florent Kermarrec 39a8fc682d artiq/firmware/libboard/hmc830_7043.rs: some cleanup, don't use hmc830 for now 2017-11-18 18:08:31 +01:00
Florent Kermarrec f003566e52 serwb: fix rx_delay_inc on ultrascale, this was the issue serwb issue...
rx_delay_inc and rx_delay_ce were set for only one cycle, on ultrascale, these signals are translated to serwb_serdes_5x clock domain and we now set rx_delay_inc always to 1 (MultiReg), rx_delay_ce for one cycle (PulseSynchronizer)
2017-11-18 18:01:46 +01:00
Florent Kermarrec 1b976bfa4d gateware/serwb/kusphy: use AsyncResetSynchronizer on cd_serwb_serdes_5x 2017-11-18 17:57:11 +01:00
Florent Kermarrec aff1609a53 firmware/libboard: use correct jesd clocking 2017-11-10 10:56:45 +01:00
Florent Kermarrec d90d624877 firmware/libboard/serwb: revert init reset, show delay 2017-11-10 10:53:20 +01:00
Florent Kermarrec 464b24a608 gateware/targets/sayma_amc: integrate ad9154 correctly (add crg, use cpll instead of qpll, use correct clocking) and cleanup serwb constraints. 2017-11-10 10:48:32 +01:00
Florent Kermarrec 278c739d30 gateware/targets/sayma_rtm: add dynamic clock mux, cleanup serwb clock constraints 2017-11-10 10:39:47 +01:00
Florent Kermarrec 48bfaec8d3 gateware/serwb/phy: remove unnecessary rx_dly_rst (use wrap-around), fix typo & pep8 2017-11-10 10:37:08 +01:00
Florent Kermarrec 59be095512 gateware/serwb/kusphy: use locally inverted clk_b on iserdese3 2017-11-10 10:35:48 +01:00
Florent Kermarrec db82b11f29 gateware/serwb/core: cleanup and increase fifo depth 2017-11-10 10:33:39 +01:00
Robert Jördens 5dc131636d artiq_flash: adapt to bit2bin 2017-11-09 18:10:15 +01:00
Robert Jördens 4880e4225d bit2bin: cleanup 2017-11-09 13:00:04 +01:00
Florent Kermarrec 76ddb063cf gateware/targets/sayma: get hmc830/7043 spi working (still need to test clock generation) 2017-11-06 12:08:28 +01:00
whitequark fcd660d682 runtime: remove accidentally deleted code. 2017-11-03 16:10:59 +00:00
whitequark dfb2fe0b80 runtime: allow #[cfg(not(has_ethmac))] builds. 2017-11-03 16:09:22 +00:00
whitequark 4835431ac3 runtime: allow #[cfg(not(has_kernel_cpu))] builds. 2017-11-03 16:04:17 +00:00
whitequark ad8fcb8b86 runtime: has_rtio -> has_rtio_core.
has_rtio is the cfg for the kernel CPU, has_rtio_core is the one
for the comms CPU.

Also remove a few useless #[cfg]s.
2017-11-03 15:59:59 +00:00
whitequark 2404a0d8c8 runtime: allow #[cfg(not(has_rtio))] builds. 2017-11-03 15:49:30 +00:00
Florent Kermarrec b3e920b3c8 firmware/libboard/serwb: fix init 2017-11-03 12:16:16 +01:00
Florent Kermarrec 5bd1e43ced gateware/serwb: cleanup imports, use buffered SyncFIFO in EtherboneRecordSender 2017-11-03 12:15:14 +01:00
Sebastien Bourdeauducq 0d8bad5128 runtime: fix rtio::log 2017-11-03 09:25:37 +08:00
Sebastien Bourdeauducq 4387b0be1e clean up rtio_log 2017-11-03 00:52:53 +08:00
Sebastien Bourdeauducq 5a972907f3 conda: update misoc 2017-11-02 12:27:46 +08:00
Robert Jördens 62320432a5 artiq_flash: fix sayma amc tap/pld index 2017-11-01 14:45:07 +01:00
Robert Jördens e16ab69f01 DEVELOPER_NOTES: fix syntax 2017-11-01 14:37:30 +01:00
Sebastien Bourdeauducq 33d339947c doc: add information on how to connect Zotino 2017-11-01 20:20:42 +08:00
Sebastien Bourdeauducq bfd36e7340 artiq_flash: update for Sayma OpenOCD changes 2017-11-01 20:11:18 +08:00
Sebastien Bourdeauducq 99b99d436d DEVELOPER_NOTES: add instructions to select Sayma 2017-11-01 17:35:03 +08:00
Sebastien Bourdeauducq 4a57b52241 artiq_flash: add preinit-command option 2017-11-01 17:34:10 +08:00
Sebastien Bourdeauducq 6089d44fd0 artiq_flash: update Sayma flash proxy bitstream name 2017-11-01 14:57:30 +08:00
Sebastien Bourdeauducq 8407b2c400 examples/ad5360: set FMC DIO directions 2017-10-31 23:15:03 +08:00
Sebastien Bourdeauducq d80cf8d59d kc705: add TTLs and shift register driver for FMC DIO 2017-10-31 23:14:39 +08:00
Sebastien Bourdeauducq 4deeccbead coredevice: add shift register driver 2017-10-31 23:13:06 +08:00
Sebastien Bourdeauducq 35fd15db4a DEVELOPER_NOTES: add board lock script 2017-10-31 22:53:39 +08:00
Sebastien Bourdeauducq f3f83174b1 test: check that DMA can underflow 2017-10-31 00:10:13 +08:00
Sebastien Bourdeauducq 0695afec37 examples/dma_blink: use handle 2017-10-31 00:07:34 +08:00
Sebastien Bourdeauducq 415fa00846 test: relax rtio test_loopback 2017-10-30 23:07:54 +08:00
Sebastien Bourdeauducq 20a5f095f8 test: use longer DMA sequence when playing it back repeatedly
The CPU has to keep up.
2017-10-30 23:06:38 +08:00
Sebastien Bourdeauducq 9bf189ca10 test: relax timing requirements when not using DMA handle
core_dma.playback() without handle incurs a round-trip with the comms
CPU and should not be used in critical real-time sections.

Closes #834.
2017-10-30 22:57:12 +08:00
Sebastien Bourdeauducq cd51bd3980 conda: fix misoc version 2017-10-30 18:37:20 +08:00
Sebastien Bourdeauducq efc16a8f13 DEVELOPER_NOTES: typo 2017-10-30 18:37:12 +08:00
Sebastien Bourdeauducq f23b4127eb add developer notes 2017-10-30 18:03:28 +08:00
whitequark b03e36e4e9 conda: update misoc. 2017-10-30 09:33:02 +00:00
whitequark 7f32ae31de runtime: fix a typo. 2017-10-30 08:48:35 +00:00
whitequark a66450b0af runtime: temporarily revert ethmac statistics collection. 2017-10-30 08:27:51 +00:00
whitequark ae2d7abbed runtime: update smoltcp. 2017-10-30 08:26:54 +00:00
whitequark cdf63c5ea0 runtime: interrogate ethmac error counters and display changes. 2017-10-30 07:46:23 +00:00
whitequark 978c0d98aa runtime: update smoltcp. 2017-10-30 07:22:47 +00:00
whitequark 7dfe7d8c93 test: verify no network performance regression from current 2.2 MB/s. 2017-10-30 04:25:58 +00:00
whitequark 8e91856426 runtime: parse the "ip" configuration as IP, not CIDR.
Or it defaults to the default IP on settings that were previously
perfectly valid.
2017-10-30 04:25:58 +00:00
Sebastien Bourdeauducq dc9327e056 dashboard: handle device dependencies in moninj 2017-10-26 14:33:49 +08:00
Sebastien Bourdeauducq c98fe70cfa dashboard: resize moninj widgets to fit titles 2017-10-26 12:02:15 +08:00
Sebastien Bourdeauducq d5b5076f67 gateware/ad5360_monitor: fix SPI data decoding 2017-10-26 11:58:59 +08:00
Sebastien Bourdeauducq 00a2e51f99 examples/ad5360: adapt for Zotino 2017-10-26 11:58:15 +08:00
Sebastien Bourdeauducq e80a527f2e dashboard: add DAC monitoring widgets 2017-10-26 02:26:59 +08:00
Sebastien Bourdeauducq bb6e7618bb examples/device_db: update DAC entry for Zotino, add sections 2017-10-26 02:26:19 +08:00
whitequark 6bdeddd201 runtime: remove UDP-related code. 2017-10-25 02:55:01 +00:00
whitequark cdba330845 Update smoltcp.
Fixes #840.
2017-10-25 02:31:27 +00:00
Robert Jördens 70e6f77d4d conda: bump openocd to simplify pinning 2017-10-23 17:26:41 +02:00
Robert Jördens 7edff48b6d conda/artiq_flash: use proxy bitstream package
fix #841
2017-10-23 15:21:54 +02:00
Robert Jördens 22d5859876 conda: pin openocd dependency 2017-10-23 14:32:51 +02:00
Sebastien Bourdeauducq 412548a86c gateware: add AD5360 monitor (untested) 2017-10-23 20:09:28 +08:00
Robert Jördens 3329d8990d conda/artiq: also bump openocd 2017-10-23 13:20:11 +02:00
Sebastien Bourdeauducq 42aca0d64a ad5360: revert incorrect part of a9798ae2
We don't have enumerate() yet.
2017-10-23 18:50:50 +08:00
Sebastien Bourdeauducq a9798ae2b1 gateware/spi: style 2017-10-23 18:46:18 +08:00
Robert Jördens a6b45caefa conda: new openocd
* new jtagspi protocol
* new proxy bitstreams
2017-10-23 12:39:27 +02:00
Sebastien Bourdeauducq 5803ac9998 gateware: add Zotino SPI to NIST CLOCK target 2017-10-23 15:04:30 +08:00
Sebastien Bourdeauducq 4fa823b62a gateware: add support for SPI-over-LVDS 2017-10-23 15:04:01 +08:00
whitequark 9d356ed93b firmware: implement board::pcr. 2017-10-18 11:04:13 +00:00
Sebastien Bourdeauducq acb25f549b conda: use new misoc version number 2017-10-17 12:57:24 +08:00
Sebastien Bourdeauducq b772c2c237 conda: update misoc 2017-10-17 11:42:06 +08:00
Robert Jördens e1e1f58ba9 libboard: fix use 2017-10-13 12:26:34 +02:00
Robert Jördens 95b3ddbaf0 scanwidget: protect against resize from zero
fix #839
2017-10-11 22:26:18 +02:00
Sebastien Bourdeauducq 893be82ad1 rtio/dma: raise underflow in test 2017-10-09 10:22:58 +08:00
Sebastien Bourdeauducq a9c9d5779d rtio/dma: add full-stack test with connection to RTIO core 2017-10-08 22:38:02 +08:00
Sebastien Bourdeauducq 5f083f21a4 rtio/dma: fix signal width 2017-10-08 22:37:46 +08:00
Sebastien Bourdeauducq 375d2d587c conda: fix misoc version number 2017-10-04 09:45:32 +08:00
whitequark e7dac530c1 runtime: avoid hardcoding ethmac slot layout, use info from CSR. 2017-10-03 19:16:11 +00:00
Sebastien Bourdeauducq a89b053473 firmware: wait for HMC830 lock 2017-10-04 01:42:57 +08:00
whitequark fd3a09dd4d Fix ca254ec5. 2017-10-03 05:49:50 +00:00
whitequark ca254ec55e compiler: disallow op= on mutable lists only (fix #835).
This only really applies to lists since those use fat pointers.
`x.y += z` is fine.
2017-10-02 07:21:14 +00:00
Sebastien Bourdeauducq cda9719f4b gui: update version number in background 2017-10-02 12:43:49 +08:00
Sebastien Bourdeauducq 84f27330e3 RELEASE_NOTES: 2.5 2017-10-02 12:17:25 +08:00
whitequark 2684aec4c6 firmware: use read_unaligned instead of a hack. NFC. 2017-10-02 03:38:31 +00:00
whitequark fd07c3f4d7 runtime: get rid of config_dummy.rs. NFC.
Use the same strategy as elsewhere.
2017-10-02 03:20:50 +00:00
whitequark 73c76ebb9a firmware: eliminate most transmutes and document the rest. NFC. 2017-10-02 03:09:46 +00:00
whitequark 7ad54e1dcf firmware: unbreak heap view.
This was missing since 7799413a for no good reason.
2017-10-02 02:02:45 +00:00
whitequark e59b301a3b compiler: disallow op= on mutable values (fix #835).
In general, we can't reallocate a value in earlier stack frames,
or fixup references to it. This mainly impacts lists.
2017-10-02 01:55:26 +00:00
whitequark f86744c65c compiler: implement ~ operator (fix #836). 2017-10-01 19:33:18 +00:00
whitequark 843786a091 compiler: minor intrinsic refactoring. 2017-10-01 19:00:10 +00:00
whitequark 491c7ef898 compiler: correct semantics of floating point % operator (fix #830). 2017-10-01 18:57:45 +00:00
whitequark 62f2693e36 compiler: correct semantics of integer % operator (#830). 2017-10-01 18:32:57 +00:00
Sebastien Bourdeauducq a87031f8c3 RELEASING: reminder to close GH milestones 2017-10-01 12:54:01 +08:00
Robert Jördens c7de233208 Merge Sayma SAWG changes (untested)
See #798

* sinara:
  conda: bump migen
  sayma_amc: SAWG (untested)
  sayma_rtm: make build dir
  conda: jesd204b 0.4
2017-09-29 21:01:02 +02:00
Sebastien Bourdeauducq 0f4bc54e92 conda: fix llvmlite-artiq dependency 2017-09-30 01:32:10 +08:00
Sebastien Bourdeauducq b4c52c34f7 Merge branch 'sinara' 2017-09-30 01:11:16 +08:00
Sebastien Bourdeauducq 4bafdecd47 RELEASE_NOTES: formatting 2017-09-30 01:10:10 +08:00
Sebastien Bourdeauducq c7cdd2016a doc: no more win32 packages 2017-09-30 00:30:22 +08:00
Sebastien Bourdeauducq e7594b540e RELEASE_NOTES: add 4.0 section 2017-09-30 00:29:54 +08:00
Sebastien Bourdeauducq 74dbb4c977 conda: use non-dev llvmlite-artiq 2017-09-29 21:10:28 +08:00
Sebastien Bourdeauducq 071439f9bd conda: use migen/misoc releases 2017-09-29 16:38:33 +08:00
Sebastien Bourdeauducq 6d72329d45 RELEASE_NOTES: 3.0 2017-09-29 16:37:36 +08:00
Sebastien Bourdeauducq 6c049ad40c rtio: report channel numbers in asynchronous errors 2017-09-29 16:32:57 +08:00
Sebastien Bourdeauducq 5437f0e3e3 rtio: make sequence errors consistently asychronous 2017-09-29 14:40:06 +08:00
Robert Jördens 38388d1136 conda: bump migen 2017-09-27 19:02:37 +02:00
Robert Jördens 5e3cc83842 sayma_amc: SAWG (untested) 2017-09-27 18:44:35 +02:00
Robert Jördens 2604806512 sayma_rtm: make build dir 2017-09-27 18:35:46 +02:00
Robert Jördens 2821f50884 conda: jesd204b 0.4 2017-09-27 17:17:04 +02:00
Sebastien Bourdeauducq 4e31e9a9ac test: relax test_rtio.test_loopback
With SED there are 8 additional FIFO output stages.
2017-09-26 17:13:02 +08:00
Sebastien Bourdeauducq 73043c3464 drtio: disable SED lane spread
Doesn't improve things as the buffer space would still be determined
by the full FIFO, and adds unnecessary logic.
2017-09-26 16:46:09 +08:00
Sebastien Bourdeauducq d7ef07a0c2 rtio/sed: document architecture 2017-09-26 16:44:23 +08:00
Sebastien Bourdeauducq e6f0ce3aba rtio/sed: test latency compensation 2017-09-26 16:11:21 +08:00
Sebastien Bourdeauducq 9905b8723b rtio/sed: support negative latency compensation 2017-09-26 16:11:08 +08:00
Sebastien Bourdeauducq f079ac6af6 rtio/sed: disable wait in TestLaneDistributor.test_regular 2017-09-26 16:10:52 +08:00
Sebastien Bourdeauducq 4112e403de rtio/sed: latency compensation 2017-09-26 15:09:07 +08:00
whitequark c00b3fe8cd firmware: update smoltcp. 2017-09-24 22:57:27 +00:00
whitequark 7799413a41 firmware: update Rust from 1.18.0 to 1.20.0. 2017-09-24 22:51:44 +00:00
Sebastien Bourdeauducq e430d04d3f drtio: remove obsolete import 2017-09-24 12:49:21 +08:00
Sebastien Bourdeauducq 20d79c930c drtio: use SED and input collector 2017-09-24 12:23:47 +08:00
Sebastien Bourdeauducq aa8fc81a87 rtio: allow specifying glbl_fine_ts_width externally 2017-09-23 22:34:55 +08:00
Sébastien Bourdeauducq 57b12abf1e manual: remove reference to Spartan-6 proxy bitstream
Pipistrello is no longer supported
2017-09-23 11:31:17 +08:00
whitequark c1829f3eda runtime: update smoltcp. 2017-09-22 19:05:18 +00:00
Sebastien Bourdeauducq 5cf0693758 rtio: use BlindTransfer to report collision and busy errors to sys domain 2017-09-21 22:31:56 +08:00
Sebastien Bourdeauducq d74a7d272e rtio: fix/cleanup parameters 2017-09-21 15:59:48 +08:00
Robert Jördens 0a43815956 Merge pull request #832 from mntng/master
set range for divider values
2017-09-21 08:43:43 +02:00
Sebastien Bourdeauducq 07d3f87c51 rtio/sed: min_space → buffer_space 2017-09-21 14:36:13 +08:00
Thao e94d2d3779 set range for divider values 2017-09-21 14:26:16 +08:00
Sebastien Bourdeauducq d8aa75b742 rtio/sed: add minimum buffer space reporting 2017-09-20 11:27:57 +08:00
Sebastien Bourdeauducq 63e39dec94 style 2017-09-20 11:26:12 +08:00
Sebastien Bourdeauducq 9ccd95e10d drtio: remove spurious signals 2017-09-19 20:48:12 +08:00
Sebastien Bourdeauducq 7249f151a5 targets/kc705_drtio_satellite: add missing shebang line 2017-09-19 20:48:12 +08:00
Sebastien Bourdeauducq 171a2d19a0 drtio: remove spurious signals 2017-09-19 20:47:37 +08:00
Sebastien Bourdeauducq 1ff10785dc targets/kc705_drtio_satellite: add missing shebang line 2017-09-19 20:46:16 +08:00
Sebastien Bourdeauducq ddcd6065e8 rtio: drive InputCollector.coarse_timestamp 2017-09-19 17:46:38 +08:00
Sebastien Bourdeauducq ff8e17ab89 rtio: use input collector module 2017-09-19 15:53:35 +08:00
Sebastien Bourdeauducq 4dc80e3d05 rtio: add missing import 2017-09-19 15:53:23 +08:00
Sebastien Bourdeauducq 06a0707c00 rtio: add simulation unit test for input collector 2017-09-19 15:30:44 +08:00
Sebastien Bourdeauducq d37577a8a1 rtio: add input collector module 2017-09-19 15:30:30 +08:00
Sebastien Bourdeauducq 6dc9cad2c9 rtio: add explanation about cri.counter 2017-09-19 12:05:12 +08:00
Sebastien Bourdeauducq 81d6317053 rtio/sed: take global fine TS width 2017-09-18 11:30:49 +08:00
Sebastien Bourdeauducq 65baca8c57 rtio: clean up error-prone rtlink.get_or_zero() 2017-09-17 16:11:36 +08:00
Sebastien Bourdeauducq 53860868f4 test/rtio: wait for counter >= now before checking for async errors 2017-09-16 17:52:39 +08:00
Sebastien Bourdeauducq 0824e0aeae gateware/targets: remove deprecated ofifo_depth parameter 2017-09-16 17:04:11 +08:00
Sebastien Bourdeauducq e2c1d4f3d5 rtio/sed: trigger collision error on non-data replace 2017-09-16 17:01:23 +08:00
Sebastien Bourdeauducq 770ce2658f test: adapt SequenceError test to SED 2017-09-16 16:28:57 +08:00
Sebastien Bourdeauducq 0e25154e25 rtio/sed: quash writes to LogChannel 2017-09-16 15:19:30 +08:00
Sebastien Bourdeauducq 1cfe90b1d9 rtio/sed/Gates: fix fine_ts_width computation 2017-09-16 15:09:21 +08:00
Sebastien Bourdeauducq 30e7765a2e drtio: add missing import 2017-09-16 14:36:27 +08:00
Sebastien Bourdeauducq a3bb6c167c rtio: use SED 2017-09-16 14:13:42 +08:00
Sebastien Bourdeauducq 131f5e4a3b rtio/sed/LaneDistributor: fix CRI address 2017-09-16 14:13:01 +08:00
Sebastien Bourdeauducq 25c644c663 rtio/sed: add top-level core unit test 2017-09-16 14:05:08 +08:00
Sebastien Bourdeauducq a155a481b1 rtio/sed: add top-level core 2017-09-16 14:04:56 +08:00
Sebastien Bourdeauducq 92c63ce2e4 rtio/sed: rename fifos/gates, refactor tsc 2017-09-16 14:03:48 +08:00
Sebastien Bourdeauducq ac52c7c818 rtio/sed/LaneDistributor: style 2017-09-16 14:02:37 +08:00
Sebastien Bourdeauducq 7b299ba583 rtio/sed: remove obsolete ofifo_depth from test_output_driver 2017-09-16 14:01:19 +08:00
Sebastien Bourdeauducq 6b7a1893c7 rtio/sed/OutputDriver: support channels with different fine timestamp widths 2017-09-16 10:53:30 +08:00
Sebastien Bourdeauducq f39ee7ad62 rtio/sed: fix seqn_width 2017-09-16 10:52:37 +08:00
Sebastien Bourdeauducq 064503f224 rtio/sed/LaneDistributor: support specifying existing CRI 2017-09-16 10:52:13 +08:00
Sebastien Bourdeauducq 1cb05f3ed5 rtio/sed/LaneDistributor: persist underflow/sequence error until next write 2017-09-16 10:51:44 +08:00
Sebastien Bourdeauducq 3c922463a0 style 2017-09-15 15:36:46 +08:00
Sebastien Bourdeauducq 8e5ab90129 rtio/sed: add FIFO wrapper 2017-09-15 15:36:34 +08:00
Sebastien Bourdeauducq 490c9815a2 rtio/sed: add TSC/gate (untested) 2017-09-14 19:53:21 +08:00
Sebastien Bourdeauducq 181cb42ba8 rtio/sed: centralize all layouts in one file 2017-09-14 19:52:31 +08:00
Sebastien Bourdeauducq 1b61442bc3 rtio/sed: fix lane spreading and enable by default 2017-09-13 22:48:10 +08:00
Sebastien Bourdeauducq 8cfe2ec53a rtio/sed: fix sequence number width computation 2017-09-13 22:11:41 +08:00
Sebastien Bourdeauducq a92a955d1e rtio/sed: use __all__ 2017-09-13 18:17:22 +08:00
Sebastien Bourdeauducq feec6298a5 rtio/sed: add lane distributor simulation unittest 2017-09-13 18:00:16 +08:00
Sebastien Bourdeauducq c74abccfd5 rtio/sed: lane distributor fixes 2017-09-13 17:50:06 +08:00
Sebastien Bourdeauducq bdd96084c5 rtio/sed: add lane distributor (untested) 2017-09-13 00:07:26 +08:00
Sebastien Bourdeauducq faf54127ac rtio/sed: remove VCD fine in unittest 2017-09-11 23:07:09 +08:00
Sebastien Bourdeauducq a2b7894134 rtio/sed: add output driver simulation unittest 2017-09-11 23:05:10 +08:00
Sebastien Bourdeauducq 00ff3f5b0d rtio/sed: fix output driver busy output 2017-09-11 23:04:52 +08:00
Sebastien Bourdeauducq 64d9381c36 rtio/sed: remove uneeded yield in test_sed_output_network 2017-09-11 23:02:56 +08:00
Sebastien Bourdeauducq 666bc600a2 rtio/sed: add output driver (untested) 2017-09-11 11:10:28 +08:00
Sebastien Bourdeauducq 1d2ebbe60f rtio/sed: make ON payload layout configurable, add latency function 2017-09-11 09:06:40 +08:00
Sebastien Bourdeauducq 527b403bb1 rtio/sed: add output network simulation unittest 2017-09-10 23:41:20 +08:00
Sebastien Bourdeauducq c5d6a2ba1a rtio/sed: more output network fixes 2017-09-10 23:41:04 +08:00
Sebastien Bourdeauducq 96505a1cd9 rtio/sed: output network fixes 2017-09-10 23:23:10 +08:00
Sebastien Bourdeauducq 5646e19dc3 rtio/sed: add output network (untested) 2017-09-10 14:38:43 +08:00
Sebastien Bourdeauducq 928cffb09b firmware: export floor() in ksupport. Closes #828 2017-09-10 12:07:06 +08:00
Sebastien Bourdeauducq 629827f573 doc/slides: minor fixes 2017-09-06 19:25:38 +08:00
Sebastien Bourdeauducq 264d5fde83 runtime: fix Rust types in RTIO
Previous code assumed all RTIO registers were u32, but this was changed
by misoc c5edcd08.
2017-09-06 19:21:39 +08:00
Sebastien Bourdeauducq 7fe5d737dd conda: bump migen/misoc 2017-09-06 19:21:15 +08:00
Florent Kermarrec 2091c7696a artiq/gateware/targets/sayma_amc_standalone: fix serwb_pll vco_div and serwb_phy mode 2017-09-06 09:18:12 +02:00
Sebastien Bourdeauducq 34ec37ac85 conda: bump misoc 2017-09-06 11:09:38 +08:00
Sebastien Bourdeauducq 2b2b345eb9 firmware: wait for serwb to be ready before proceeding further 2017-09-06 11:07:07 +08:00
Sebastien Bourdeauducq 33f053cff8 libboard: complete but undebugged support for HMC830/7043 programming 2017-09-06 10:46:02 +08:00
Sebastien Bourdeauducq 4baf17cebe libboard: generate HMC7043 register write list 2017-09-05 21:46:03 +08:00
Sebastien Bourdeauducq 091bb28043 libboard: use libbuild_artiq 2017-09-05 21:13:04 +08:00
whitequark 74b7010d67 runtime: allow safely pulling logs even on TRACE log level.
Before this commit, this resulted in a packet flood, because
sending a TRACE log message to the host caused more TRACE log
messages to be emitted.
2017-08-31 14:13:51 +00:00
whitequark c9e2a085ec logging, aqctl_corelog: recognize log level TRACE. 2017-08-31 13:12:22 +00:00
Sebastien Bourdeauducq c5fe2799cf conda: bump misoc 2017-08-31 13:44:31 +08:00
Sebastien Bourdeauducq b609366c6f runtime: fix Rust types in RTIO
Previous code assumed all RTIO registers were u32, but this was changed
by misoc c5edcd08.
2017-08-31 13:42:32 +08:00
Sebastien Bourdeauducq 44edba0c65 firmware: add placeholder code for HMC830/7043 initialization 2017-08-31 13:35:47 +08:00
Sebastien Bourdeauducq 9edff2c520 remote_csr: interpret length as CSR size, not number of bus words 2017-08-31 13:34:48 +08:00
Sebastien Bourdeauducq 0a5904bbaa firmware: support for multiple JESD DACs 2017-08-31 13:05:48 +08:00
Sebastien Bourdeauducq a4144a07c4 sayma_amc: add converter SPI config defines 2017-08-31 13:04:38 +08:00
Sebastien Bourdeauducq bacf8a1614 style 2017-08-31 12:52:09 +08:00
Sebastien Bourdeauducq 5a041c24f3 conda: bump misoc 2017-08-31 12:17:52 +08:00
Sebastien Bourdeauducq d92cca9712 artiq_flash: fix target_file handling 2017-08-31 12:16:52 +08:00
Sebastien Bourdeauducq e652221221 conda: bump migen and misoc 2017-08-31 11:50:32 +08:00
Sebastien Bourdeauducq ad0a940e2d sayma_rtm: hook up DAC SPI 2017-08-31 11:48:54 +08:00
Sebastien Bourdeauducq f765dc50de sayma_rtm: do not keep DACs in reset 2017-08-31 11:44:33 +08:00
Sebastien Bourdeauducq a67659338d sayma: clean up serwb comments 2017-08-31 11:42:01 +08:00
whitequark 4883eea252 libproto: simplify (NFC). 2017-08-31 02:48:59 +00:00
whitequark 20f43d5792 firmware: fix ethmac MTU value.
1500 is the maximum payload size, not maximum frame size.
2017-08-31 00:57:35 +00:00
whitequark 737c1044a4 firmware: update smoltcp. 2017-08-31 00:45:56 +00:00
Florent Kermarrec 660f9856ec gateware/serwb: add test for phy initialization 2017-08-30 17:59:10 +02:00
whitequark f26e698f31 Revert "firmware: reduce ethmac maximum burst size by one."
This reverts commit 2231b16e0a.

Only made a difference with TRACE log level to UART, i.e. only
because UART was the bottleneck.
2017-08-30 15:22:20 +00:00
whitequark 39ecbc0d68 firmware: update smoltcp. 2017-08-30 14:35:45 +00:00
whitequark 2231b16e0a firmware: reduce ethmac maximum burst size by one.
Empirically, this much reduces packet loss. I'm not really sure why,
but it seems safe to do the change.
2017-08-30 14:35:25 +00:00
Florent Kermarrec 9650233007 gateware/serwb: change serdes clock domain to serwb_serdes 2017-08-30 15:44:44 +02:00
Florent Kermarrec 32ca51faee gateware/targets/sayma_amc_standalone/rtm: use new serwb modules 2017-08-30 15:25:20 +02:00
Florent Kermarrec 41d57d64f6 gateware/serwb: SERWBPLL, SERWBPHY, SERWBCore and add checks in delay finding to verify the sampling window 2017-08-30 14:40:11 +02:00
Florent Kermarrec 9ba50098a8 gateware/test/serwb: use unittest for in test_etherbone 2017-08-29 17:31:01 +02:00
Florent Kermarrec 7d7f6be7ce gateware/serwb: generate wishbone error if link loose ready in the middle of a transaction 2017-08-29 16:41:29 +02:00
Robert Jördens c0eb2ad0b7 developing.rst: stress artiq-dev setup
closes #814
2017-08-29 16:22:57 +02:00
Robert Jördens 43d551f1d8 README_PHASER: integrate into board port docs
* rewrite setup commands for usage of artiq-dev metapackage
* integrate with rest of installation documentation
* move contents of README_PHASER to core_device.rst
* closes #815
2017-08-29 16:15:51 +02:00
Robert Jördens 7951e8f58a README.rst: add licensing manifesto
closes #825
2017-08-29 16:00:58 +02:00
Robert Jördens f76f08ffd4 LICENSE.GPL-3: add (referenced in LGPL) 2017-08-29 16:00:38 +02:00
Florent Kermarrec 60ad36e7d6 gateware/serwb: generate wishbone error on wishbone slave when access while link is not ready 2017-08-29 13:43:26 +02:00
Florent Kermarrec 89558e2653 gateware/serwb: for the initial version set delay in the center of the valid sampling window and don't use phase detectors
we'll use phase detectors later when it will be working reliably for both artix7 and kintex ultrascale
2017-08-29 13:38:52 +02:00
mntng d19e70595a test_rpctool: always create new asyncio event loop 2017-08-29 04:00:09 -04:00
mntng 3952954c12 add unitttest for artiq_rpctool 2017-08-28 10:39:32 -04:00
Sebastien Bourdeauducq 26a11a296c sayma_rtm: drive DAC control signals 2017-08-26 16:57:02 -07:00
Sebastien Bourdeauducq d609c67cbd sayma_rtm: set clock mux pins 2017-08-26 16:48:10 -07:00
Sebastien Bourdeauducq 9194402ea5 sayma_rtm: expose HMC SPI bus 2017-08-26 16:31:31 -07:00
Sebastien Bourdeauducq dbc12540da sayma_amc: register RTM CSR regions from CSV 2017-08-26 14:48:11 -07:00
whitequark e6e176fa14 Revert "firmware: update smoltcp."
This reverts commit 7c340f6b48.
2017-08-25 12:03:01 +00:00
whitequark 7c340f6b48 firmware: update smoltcp. 2017-08-25 07:20:38 +00:00
whitequark f5e1d9568d firmware: update smoltcp. 2017-08-24 05:50:59 +00:00
Sebastien Bourdeauducq 54c75d3274 sayma_rtm: use CSR infrastructure, generate CSR CSV 2017-08-23 17:19:53 -04:00
whitequark 3823193060 artiq_devtool: forward multiple connections.
In particular this is useful for running concurrent arqctl_corelog
and anything else using the management channel, such as
artiq_coreboot.
2017-08-23 09:33:07 +00:00
Robert Jördens 32aac9c70d doc: use pip as artiq dev mechanism
Seems to be much less prone to installing packages using non-conda
mechanisms and much less prone to mess up conda.
2017-08-22 17:44:37 -04:00
Sebastien Bourdeauducq 668450db26 sayma_amc: add serwb 2017-08-21 18:11:29 -04:00
Sebastien Bourdeauducq 0459a70cf6 sayma_amc: cleanup, fix RTM UART forwarding 2017-08-21 16:49:42 -04:00
Sebastien Bourdeauducq 1f2b373d09 sayma_rtm: remove unnecessary serwb_control 2017-08-21 16:37:13 -04:00
Sebastien Bourdeauducq bfea297279 targets: add Sayma RTM 2017-08-21 15:58:01 -04:00
Sebastien Bourdeauducq 53c7f92fdc serwb: add __init__.py and expose submodules 2017-08-21 15:57:43 -04:00
Sebastien Bourdeauducq dac3a78b75 serwb: style, use migen, fix imports 2017-08-21 12:35:59 -04:00
Florent Kermarrec da90a0fa12 Add test for Etherbone
Files copied directly from https://github.com/enjoy-digital/sayma_test @ 9ec62242659910ad1726beb00ff15b3f0a406615
2017-08-21 12:31:49 -04:00
Florent Kermarrec 44dc76e42e Add serial Wishbone bridge
Files copied directly from https://github.com/enjoy-digital/sayma_test @ 9ce2cba87896d056819dc2edc54f0453a86162c3
2017-08-21 12:22:05 -04:00
Sebastien Bourdeauducq d6b624dfbe sayma_amc: connect RTM serial and second serial 2017-08-20 19:01:55 -04:00
Sebastien Bourdeauducq e94d0803e1 artiq_flash: fix Sayma load addresses 2017-08-20 18:21:36 -04:00
Sebastien Bourdeauducq 261b6fb42e artiq_flash: fix AMC_DR_LEN 2017-08-20 18:20:51 -04:00
Sebastien Bourdeauducq 9f4c9fc14b artiq_flash: Sayma support 2017-08-20 17:23:56 -04:00
Sebastien Bourdeauducq bee4902323 add Sayma AMC standalone target 2017-08-20 11:47:45 -04:00
Sebastien Bourdeauducq ac83bfbd8e runtime: add support for targets without SPI flash 2017-08-20 11:28:57 -04:00
Sebastien Bourdeauducq 1dab7df846 kc705_sma_spi: fix permissions 2017-08-20 10:54:24 -04:00
Robert Jördens 2a91b6996f doc: update proxy bitstream url 2017-08-15 14:34:27 -06:00
Robert Jördens 34ddda7a0c conda: use single-tap proxy bitstreams 2017-08-15 14:30:53 -06:00
Sebastien Bourdeauducq 8459cfe8db firmware: remove unnecessary git_describe rust-cfg 2017-08-15 08:14:17 -06:00
mntng ea135f9d06 add unittest for artiq_compile and ELF artiq_run (#455) 2017-08-15 08:13:11 -06:00
Sebastien Bourdeauducq cf1de4b26a test_spi: convert to Unix EOL 2017-08-04 11:48:20 +08:00
Robert Jördens 7085c1cccb RELEASE_NOTES: clarify time/date 2017-08-03 13:56:15 +02:00
Robert Jördens bc2d9ef818 Merge pull request #809 from cjbe/epoch_time
master: use epoch time for timestamps (closes #726)
2017-08-03 12:55:23 +02:00
Robert Jördens dd6c48fed2 Merge branch 'master' into epoch_time 2017-08-03 12:55:01 +02:00
Chris Ballance cc289dd3a0 master: store run_time and start_time as doubles 2017-08-03 10:41:57 +01:00
Robert Jördens c3e462ba4b Merge pull request #808 from cjbe/timed_log_rotation
master: rotate logs at midnight, rather than on log size
2017-08-03 11:40:49 +02:00
Chris Ballance 223501f811 master: use epoch time for timestamps (closes #726) 2017-08-03 10:30:31 +01:00
Chris Ballance eabca1f311 master: correct example datestring in help 2017-08-03 10:12:52 +01:00
Chris Ballance 810bb69989 master: rotate logs at midnight, rather than on log size 2017-08-03 00:31:04 +01:00
Sebastien Bourdeauducq 2998372d08 browser,dashboard: delete MDI subwindows when they are closed 2017-07-29 20:36:38 +08:00
mntng 692dc0803b test: add test for SPI core using SD card 2017-07-28 19:10:44 +08:00
Sebastien Bourdeauducq 3778f93991 README: update credits/roles 2017-07-25 13:34:00 +08:00
Sebastien Bourdeauducq 3ae1c4f7f7 manual: add note about updating conda (#785) 2017-07-25 13:05:43 +08:00
Sebastien Bourdeauducq df4f38a1e4 kc705: add pullup on SD card MISO 2017-07-24 22:26:16 +08:00
Sebastien Bourdeauducq 7eed4e7b6c synchronize introduction.rst with README 2017-07-22 00:41:59 +08:00
dhslichter 61b0ad1982 Update README links 2017-07-22 00:11:16 +08:00
Sebastien Bourdeauducq 189020344c spi: fix typo in doc 2017-07-20 22:18:21 +08:00
Sebastien Bourdeauducq d0b21a8e85 manual: add short description of drivers, with replace support information. Closes #777 2017-07-20 12:01:29 +08:00
Robert Jördens 471605ec1e pdq: move to https://github.com/m-labs/pdq 2017-07-19 17:35:28 +02:00
Robert Jördens 5c66b63768 setup.py etc: update license 2017-07-18 11:31:43 +02:00
Sebastien Bourdeauducq 377c776ec8 examples/dma_blink: replay → playback 2017-07-18 14:01:08 +08:00
Sebastien Bourdeauducq 9898681a38 aqctl_corelog: only set logging.DEBUG after the server is set up
Otherwise asyncio pollutes the log.
2017-07-18 14:00:06 +08:00
whitequark dd87508a7f Implement forwarding of logs from core device to master.
Fixes #691.
2017-07-18 05:31:59 +00:00
whitequark 819440f839 runtime: split log timestamp into secs.micros. 2017-07-18 05:31:59 +00:00
whitequark 9e38132c0a artiq_devtool: don't drop data in unpredictable ways (sigh). 2017-07-18 05:31:59 +00:00
Sebastien Bourdeauducq a201a9abd9 drtio: multilink transceiver interface 2017-07-18 13:27:33 +08:00
Robert Jördens d96c2abe44 pdq: read/write_reg -> get/set_reg
see also m-labs/pdq#14
2017-07-17 21:45:46 +02:00
Sebastien Bourdeauducq 9045b4cc19 drtio: initial firmware support for multi-link 2017-07-18 00:40:21 +08:00
Robert Jördens 94ee48860a doc: fix phaser channel number statement
closes #781
2017-07-15 20:24:50 +02:00
whitequark d06d53b00d firmware: don't bail out if building not from a git checkout (#783). 2017-07-15 03:16:21 +00:00
Sebastien Bourdeauducq 0253db0421 conda: fix misoc git hash 2017-07-13 19:32:03 +08:00
Sebastien Bourdeauducq 4deb5f6a45 gateware: use new MiSoC Wishbone address system 2017-07-13 19:16:49 +08:00
mntng 40ca951750 kc705: add SPI bus for memory card
This will be useful for SPI unit tests using a SD card as victim.
2017-07-12 00:27:44 +08:00
Robert Jördens 298ceafd92 README_PHASER: fix ref_multiplier 2017-07-08 19:44:57 +02:00
Robert Jördens f0841f5489 spline: be really verbose
closes #773
2017-07-07 11:43:58 +02:00
Robert Jördens 7b130a2c32 sawg: confirm smooth(order=3) 2017-07-07 11:36:03 +02:00
Robert Jördens 3bc0e32dc0 sawg: advance the timeline on Config access
c.f. #773 #765
2017-07-07 11:33:58 +02:00
Robert Jördens 3222f5036f sawg: describe latency matching in detail 2017-07-06 10:06:21 +02:00
whitequark 1e2603572a runtime: fix a bug causing sockets to get stuck in CLOSE-WAIT. 2017-07-05 16:27:36 +00:00
whitequark 86c027e9c5 artiq_flash: don't require binaries to merely restart FPGA. 2017-07-04 18:55:38 +00:00
whitequark ee1d5dbccb runtime: allow a much larger log buffer and avoid hacks. 2017-07-04 18:18:31 +00:00
whitequark 3ab8a4d505 aqctl_corelog: add missing script definition to setup.py. 2017-07-04 18:04:25 +00:00
whitequark 7a5fbc1622 devtool: forward port 1383 (moninj). 2017-07-04 17:54:18 +00:00
whitequark 4e5ea1bbaf dashboard: fix a crash touching moninj without a connection. 2017-07-04 17:53:48 +00:00
Robert Jördens 2f1029c292 Revert "sawg: advance dds 1/2 by one sample group"
This reverts commit 8e0a1cbdc8.

c.f. #772

The underlying issue is still the same. You will always find something that does not match when trying to compare the DDS with the parallelized DUC. They are just different. I could correct it for phase but then it will fail for amplitude. Or you'll compare the offset channel to phase1 or amplitude1. Let's state that equal things are well synchronized but unequal things may have a deterministic latency difference of strictly less than one coarse RTIO cycle.
2017-07-04 17:55:19 +02:00
Robert Jördens 8e0a1cbdc8 sawg: advance dds 1/2 by one sample group
closes #772
2017-07-04 16:51:58 +02:00
Robert Jördens 91ca9fbcad sawg: also give offset some headroom
closes #771
2017-07-04 16:50:06 +02:00
Robert Jördens 60809d1cb4 conda: bump misoc (migen change) 2017-07-04 11:58:12 +02:00
Robert Jördens 78d1f0fdf6 sawg: fix PhasedAccu resets 2017-07-04 11:56:21 +02:00
Florent Kermarrec 42476c64a7 conda: bump migen (Record.connect leave_out --> keep/omit) 2017-07-04 11:26:57 +02:00
Florent Kermarrec 2910b1be5e artiq/gateware/rtio/dma: replace leave_out with omit in Record.connect 2017-07-04 10:48:06 +02:00
Robert Jördens 5b26e5de6c conda: bump migen (reset_less cdc) 2017-07-02 15:41:58 +02:00
Sebastien Bourdeauducq d7ad72efa2 doc: point to artiq_flash hardware selection options when writing flash storage. Closes #766 2017-07-02 10:40:52 +08:00
Sebastien Bourdeauducq 838127d914 rtio: break DMA timing path 2017-07-02 10:24:01 +08:00
whitequark ea7549cfa4 compiler: coerce `while` condition to bool.
Fixes #768.
2017-07-01 18:59:07 +00:00
Robert Jördens 911ee4a959 rtio: make pipelined logic reset_less
* latency-corrected counters
* registered error logic
2017-06-29 12:55:32 +02:00
Robert Jördens 600a48ac61 dsp.fir: cleanup 2017-06-29 12:18:48 +02:00
Robert Jördens dca662a743 dsp.fir: pipeline final systolic adder 2017-06-29 11:33:19 +02:00
Robert Jördens 32a33500c8 dsp.fir: actively cull zero delays 2017-06-29 11:24:56 +02:00
Robert Jördens f520d4a768 rtio: undo _RelaxedAsyncResetSynchronizer 2017-06-28 22:08:15 +02:00
Robert Jördens 6fad15c532 conda: bump migen, misoc
* reset_less Cordic
* Signal.like() inherits more
* address decoder changes
2017-06-28 20:56:43 +02:00
Robert Jördens 3cbbcdfe96 sawg: don't enable_replace for Config
closes #762
2017-06-28 20:31:40 +02:00
Robert Jördens f2632e0fd1 sawg: adapt latency to fir changes
closes #748
2017-06-28 20:12:30 +02:00
Robert Jördens e7db2c6578 dsp.accu: reset_less outputs 2017-06-28 20:04:58 +02:00
Robert Jördens 6bb994228f dsp.fir: drop x shift 2017-06-28 19:55:15 +02:00
Robert Jördens 01847271c5 rtio: use reset_less signal for reset fanout 2017-06-28 19:43:55 +02:00
Robert Jördens b9859cc0c3 dsp.fir: remove old/wrong comment 2017-06-28 19:21:57 +02:00
Robert Jördens 55b5b87490 fir: simplify latency compensation
Don't try to tweak out the last bit of latency by feeding the HBF input
early. Instead feed it late so the interpolated samples are early and
the latency is an even multiple of the super-sample cycle.
2017-06-28 19:13:43 +02:00
Robert Jördens d1e5dd334f sawg: use pipeline reset 2017-06-28 19:09:39 +02:00
Robert Jördens 6418205906 dsp.fir: use pipelin-reset 2017-06-28 19:09:21 +02:00
whitequark 6a49c114c8 runtime: update smoltcp. 2017-06-28 00:27:22 +00:00
whitequark 370f22541c runtime: update smoltcp. 2017-06-27 21:06:45 +00:00
whitequark f36f00a83d artiq_devtool: do not chop up the TCP stream into 1024 byte chunks.
This makes the smoltcp behavior quite different than without
the TCP forwarding (and can mask smoltcp issues).
2017-06-26 08:39:16 +00:00
whitequark 282f4256e0 artiq_pcap: atomically replace pcap file.
Otherwise this segfaults Wireshark (?!).
2017-06-26 03:22:14 +00:00
whitequark d6f4f1f3bc artiq_devtool, artiq_pcap: better option naming. 2017-06-26 00:00:05 +00:00
Robert Jördens f4624e086a conda: bump migen 2017-06-25 21:14:52 +02:00
whitequark 6061393bd0 tools: lazily import paramiko. 2017-06-25 07:17:03 +00:00
whitequark 816ec6c52f artiq_pcap: implement. 2017-06-25 07:04:29 +00:00
whitequark 69fa9b38e0 test: actually run test_embedding.AsyncTest. 2017-06-25 05:28:32 +00:00
whitequark 31b52ff1b3 coredevice: do not desync kernel TCP stream on RPCReturnValueError.
And propagate the error upwards instead of trying to squeeze it
through the core device in futility.
2017-06-25 04:47:32 +00:00
whitequark fdb24ef139 coredevice: truncate overlong exception messages.
If we have a really long one (megabytes) then this may exhaust
the heap of the core device and crash it.
2017-06-25 04:39:08 +00:00
whitequark 1fa8be3835 artiq_devtool: don't loop forever if core device dies. 2017-06-25 04:18:45 +00:00
whitequark f17a6616b2 runtime: ensure management interface buffer can hold log buffer.
Otherwise we get weird edge cases where the network stack could try
to append to log buffer while management interface is holding
the log buffer and trying to push it out, and it's just no good.

The serialized log buffer at its maximum length is slightly longer
than 32 KiB, so we just allocate the largest possible TCP buffer
to the management interface to keep it simple.
2017-06-24 17:09:28 +00:00
whitequark d0f72632e1 language: export TBytes and TByteArray. 2017-06-24 17:03:35 +00:00
whitequark 12357d884e runtime: update smoltcp. 2017-06-24 16:55:59 +00:00
Robert Jördens 07f5e99140 dsp/sat_add: works after previous changes 2017-06-22 18:24:22 +02:00
Robert Jördens f78d5a87e9 dsp/test: skip and fix sat_add 2017-06-22 18:01:31 +02:00
Robert Jördens 47928a2c0d sawg: disable limiter
temporary workaround to permit testing other aspects
2017-06-22 17:31:04 +02:00
Robert Jördens cd2ac53bc5 dsp/sat_add: make width mandatory 2017-06-22 17:28:39 +02:00
Robert Jördens 9b940aa876 dsp/sat_add: spell out logic more 2017-06-22 16:55:13 +02:00
Robert Jördens d0cf0f2b87 sawg/limiter: make signed signals explicitly 2017-06-22 13:44:36 +02:00
Robert Jördens 53be34a25f sawg: clear phase accu in reset 2017-06-22 13:27:49 +02:00
Robert Jördens 694f8d784c dsp/tools: unittest sat_add 2017-06-22 11:29:56 +02:00
Robert Jördens bd1438d28e sawg: wrap limits init values 2017-06-22 10:26:29 +02:00
Robert Jördens cccd01e81e sawg: cleanup sat_add logic 2017-06-22 10:26:29 +02:00
Robert Jördens 5f6e665158 test/sawg: patch delay_mu 2017-06-22 10:26:29 +02:00
Robert Jördens 570f2cc1ff dsp/tools/SatAdd: fix reuse of clipped signal 2017-06-22 10:26:29 +02:00
Robert Jördens 4b3aad2563 sawg: clean up Config
* unify I and Q data limiters. there is no conceivable way why they
would be different.
* reorder clr bits to be like consistent
* move the sat add limiter to before the hbf again
2017-06-22 10:26:29 +02:00
Robert Jördens f4c6879c76 sawg: special case Config RTIO address 2017-06-22 10:26:29 +02:00
Robert Jördens ff0da2c9fc sawg: stage code for y-data exchange on channels 2017-06-22 10:26:29 +02:00
Robert Jördens b6569df02f dsp/tools: clean up SatAddMixin logic 2017-06-22 10:26:29 +02:00
Robert Jördens f369cb97f7 sawg/examples: add a bit more slack 2017-06-22 10:26:29 +02:00
Chris Ballance 05b57f5110 protocols: increase another asyncio line limit (#671) 2017-06-22 09:43:52 +08:00
Sebastien Bourdeauducq e3588c9e68 RELEASE_NOTES: 2.4 2017-06-22 00:38:49 +08:00
Sebastien Bourdeauducq c2cc29142d drtio: remove misleading comment from device_db 2017-06-21 18:34:53 +08:00
Sebastien Bourdeauducq 6262969d46 test: relax test_dma_record_time 2017-06-21 18:33:58 +08:00
Sebastien Bourdeauducq 64ce85445c drtio: add remote converter SPI example (#740) 2017-06-21 17:08:12 +08:00
Sebastien Bourdeauducq 74cf074538 drtio: remove sawg_3g from example targets, add converter SPI bus from FMC-EBZ at all times 2017-06-21 17:01:52 +08:00
Sebastien Bourdeauducq 66dee9d1ad drtio: send/process I2C and SPI aux packets (#740) 2017-06-21 16:50:51 +08:00
Sebastien Bourdeauducq f58f16ccd4 drtioaux: add default timeout 2017-06-21 16:23:11 +08:00
Sebastien Bourdeauducq 7675dd063b drtioaux: add I2C and SPI packets (#740) 2017-06-21 14:07:16 +08:00
Robert Jördens c399bec8da RELEASE_NOTES: pipistrello discontinued by manufacturer 2017-06-20 06:18:34 +02:00
Sebastien Bourdeauducq c74de6ae96 phaser: reintroduce test_ad9154_status 2017-06-20 00:49:57 +08:00
Sebastien Bourdeauducq 8c56a95fa2 spi: add default busno 2017-06-20 00:49:38 +08:00
Sebastien Bourdeauducq 39ddb66f0f phaser: add AD9154 SPI access driver to example ddb 2017-06-20 00:49:21 +08:00
Sebastien Bourdeauducq 470bce6214 coredevice: add AD9154 SPI access driver 2017-06-20 00:48:50 +08:00
Sebastien Bourdeauducq a6d06824e7 fix indentation 2017-06-20 00:12:11 +08:00
Sebastien Bourdeauducq 8f2d85fc5b add back ad9154_reg.py 2017-06-19 23:45:32 +08:00
Sebastien Bourdeauducq c86029bca2 i2c: expose restart as syscall, add structure for I2C-over-DRTIO 2017-06-19 23:44:51 +08:00
Sebastien Bourdeauducq 268b7d8aaf typo 2017-06-19 15:42:10 +08:00
Sebastien Bourdeauducq 09d198c7a1 test: add test for exception on non-existent I2C bus 2017-06-19 15:32:09 +08:00
Sebastien Bourdeauducq d08bd58dff versioneer: cut git hashes consistently (#753) 2017-06-19 15:31:48 +08:00
Sebastien Bourdeauducq 6c6bb67618 libboard: fix compiler warning on not(has_i2c) 2017-06-19 14:57:15 +08:00
Sebastien Bourdeauducq 5d63489080 i2c,spi: add busno error detection 2017-06-19 14:27:30 +08:00
Robert Jördens 0d8067256b rtio: refactor RelaxedAsyncResetSynchronizer 2017-06-18 14:37:08 +02:00
Sebastien Bourdeauducq 8399f8893d add kernel access to non-realtime SPI buses (#740) 2017-06-18 12:45:07 +08:00
Robert Jördens 424b2bfbd8 rtio: describe rio and rio_phy domains a bit more 2017-06-17 12:21:07 +02:00
Robert Jördens 219dfd8984 rtio: add one register level for rio and rio_phy resets
* This should give Vivado some wiggle room during PnR.
* It needs three new clock domains which is ugly. But since
AsyncResetSynchronizer can only drive clock domains resets directly
there seems to be no other way to add one register level currently.
2017-06-17 12:17:48 +02:00
Sebastien Bourdeauducq 8fea361412 firmware: always use 8 characters to abbreviate git commit hashes 2017-06-17 14:43:50 +08:00
Robert Jördens e19bfd4781 test_sawg_fe: add ref_multiplier to simulated core 2017-06-16 19:45:24 +02:00
Robert Jördens b5772f478a sawg: add channel reset (closes #751) 2017-06-16 19:31:57 +02:00
Robert Jördens 2a76034fbc cri: add note about clearing of o_data 2017-06-16 19:06:00 +02:00
Sebastien Bourdeauducq 10fb6c6216 conda: set ignore_prefix_files on all board packages 2017-06-15 16:25:52 +08:00
Sebastien Bourdeauducq 5e94810e84 Revert "Revert "conda: use new noarch system for board packages as well""
This reverts commit 832fb139a0.
2017-06-15 16:10:58 +08:00
Sebastien Bourdeauducq 832fb139a0 Revert "conda: use new noarch system for board packages as well"
Never missing an opportunity to be awful, conda helps itself with the .fbi files and merrily patches the strings inside them that contain paths resembling the conda build folder, resulting of course in corrupption and CRC errors.

This reverts commit c856b22579.
2017-06-15 16:00:00 +08:00
Robert Jördens fecc42fd0c sawg/phaser: expand documentation (closes #750) 2017-06-14 11:49:52 +02:00
Sebastien Bourdeauducq ed2b27fed2 conda: fix pythonparser dependency 2017-06-14 12:39:29 +08:00
whitequark 53f7d145a4 conda: update pythonparser dependency. 2017-06-14 03:35:54 +00:00
Robert Jördens 858c1be381 sawg: expand documentation 2017-06-13 18:51:48 +02:00
Robert Jördens 3f37870e25 sawg: register pre-hbf adder 2017-06-13 18:15:44 +02:00
Robert Jördens e229edd5d5 sawg: add register after hbf for timing 2017-06-12 23:08:27 +02:00
Robert Jördens 315338fca9 test/sawg: test HBF overshoot, fix sim patching 2017-06-12 20:35:47 +02:00
Robert Jördens 9a8a7b9102 sawg: handle clipping interpolator
* give 1 bit headroom to interpolator to handle overshoot
* fix Config limiter widths (NFC)
* move clipper to behind the HBF to correctly shield DUC

This leaves a factor of two headroom for the sum of the following
effects:

  * HBF overshoot (~15 % of the step)
  * A1/A2 DDS sum

While this is technically not sufficient and can still lead to
overflows, it is unlikely that one would trigger those. It would require
doing large amplitude A1, large amplitude A2 and additionally doing
amplitude/phase jumps that would overshoot the HBF. No sane person would
try that, right?

closes #743
2017-06-12 20:33:54 +02:00
Robert Jördens 1fb3995ffc Revert "fir/ParallelHBFUpsampler: add headroom (gain=2)"
This reverts commit 6ac9d0c41e.

Overshooting behavior must to be handled outside the FIR.
2017-06-12 20:07:25 +02:00
Robert Jördens 332bcc7f3b fir: check widths 2017-06-12 20:07:23 +02:00
Robert Jördens 39a1dcbb3d test/fir: look at overshoot behavior 2017-06-12 20:06:07 +02:00
Robert Jördens 6ac9d0c41e fir/ParallelHBFUpsampler: add headroom (gain=2)
This addresses part of #743
2017-06-12 18:59:45 +02:00
Robert Jördens 566ff73dff pdq: unify spi-PDQ and usb-PDQ protocols 2017-06-10 15:03:25 +02:00
Robert Jördens 6c54c0f834 sawg: update example 2017-06-10 11:52:48 +02:00
Robert Jördens d8aee931ba sawg: extend phase mode docs 2017-06-09 12:26:49 +02:00
whitequark f7254dd3ce compiler.validators.constness: take AugAssign into account. 2017-06-09 07:31:08 +00:00
whitequark ad2ee714c2 compiler: do not permit iterating str values.
This currently breaks badly on UTF-8, and doesn't even return
a value of a correct type.
2017-06-09 07:29:31 +00:00
whitequark 4e7493843a compiler: Constness is a validator, not analysis. 2017-06-09 07:29:31 +00:00
whitequark 5d841d08e9 compiler: do not permit mutation of bytes values (#714). 2017-06-09 07:29:28 +00:00
whitequark 284382b1f5 compiler: add support for bytearray values in RPC (#714). 2017-06-09 07:15:25 +00:00
whitequark 9ed4e9c1cd compiler: add support for printing of bytearray values (#714). 2017-06-09 07:15:25 +00:00
whitequark e9564b15c8 compiler: add support for bytearray type (#714). 2017-06-09 07:15:24 +00:00
whitequark 5b4fde30a8 compiler: unbreak subscripts for bytes values (#714). 2017-06-09 07:10:48 +00:00
whitequark 66a683f583 compiler: add support for bytes values in RPC (#714). 2017-06-09 07:10:48 +00:00
whitequark 778e7dc2ab compiler: add support for concatenating bytes values (#714). 2017-06-09 07:10:48 +00:00
whitequark 7b2da5294f compiler: add support for printing of bytes values (#714). 2017-06-09 07:10:48 +00:00
whitequark dba4e1a28b compiler: add support for bytes type and b"x" literals (#714). 2017-06-09 07:10:48 +00:00
whitequark d0e92067c3 ksupport: fix UB. 2017-06-09 06:18:20 +00:00
whitequark ffc6745293 Revert "update/cleanup gitignore"
This reverts commit d8eff2aa4e.

I insist on supporting this layout during development.
2017-06-09 06:03:48 +00:00
Robert Jördens 91ad2bc600 sawg: add note about disabled q-exchange 2017-06-07 09:13:01 +02:00
Robert Jördens 94273e9455 sawg: add non-mu methods for limiter 2017-06-07 09:12:36 +02:00
Sebastien Bourdeauducq ebb4660207 coredevice: compare software and gateware versions strictly 2017-06-07 02:11:54 +08:00
Sebastien Bourdeauducq 076e4119f7 versioneer: always use 8 characters to abbreviate git commit hashes 2017-06-07 02:10:22 +08:00
Sebastien Bourdeauducq 6be336d2bd MANIFEST.in: remove stale fastentrypoints entry 2017-06-06 18:27:40 +08:00
Sebastien Bourdeauducq f3c7a7de3b phaser: remove non-functional SPI examples
Those will be reimplemented after we have converter SPI access, but this will not be part of the 3.0 release.
2017-06-06 17:37:13 +08:00
Sebastien Bourdeauducq 70a3b66c76 conda: unbreak channel lists in environment descriptions 2017-06-06 15:57:38 +08:00
Sebastien Bourdeauducq e938b35e8e conda: fix command examples in conda environment descriptions 2017-06-06 15:26:26 +08:00
Sebastien Bourdeauducq c856b22579 conda: use new noarch system for board packages as well 2017-06-06 15:05:13 +08:00
Sebastien Bourdeauducq 68ecaacb3a Remove fastentrypoints
Breaks conda and only provides a minimal benefit (does NOT accelerate experiment startup).
2017-06-06 12:38:41 +08:00
Sebastien Bourdeauducq 5a134c82c5 conda: use new noarch system 2017-06-06 11:16:12 +08:00
Sebastien Bourdeauducq 7f2f0031d6 conda: use stock dateutil package 2017-06-05 17:57:35 +08:00
Sebastien Bourdeauducq de11b3b7c7 manual: fix table formatting 2017-06-05 17:39:54 +08:00
Sebastien Bourdeauducq ab493a860d coredevice: fix socket resource leak 2017-06-05 15:45:40 +08:00
Sebastien Bourdeauducq bea7a47349 coredevice: compare gateware and software versions on release numbers only. Closes #738 2017-06-05 13:52:24 +08:00
Sebastien Bourdeauducq 9c973793df update versioneer 2017-06-05 13:27:26 +08:00
Sebastien Bourdeauducq d3ac21f6fb manual: minor fixes to DRTIO doc 2017-06-05 13:26:56 +08:00
Sebastien Bourdeauducq 0b437c7645 conda: shorten git hash in strings to 8 characters instead of 12 2017-06-05 11:43:10 +08:00
Sebastien Bourdeauducq 234e41df9d bump setuptools (#705) 2017-06-05 11:39:42 +08:00
Sebastien Bourdeauducq fdb4e3f8cf jesd204: bump 2017-06-05 01:17:46 +08:00
Sebastien Bourdeauducq 8c8203ef73 require Python 3.5.3+ (#737) 2017-06-05 00:50:54 +08:00
Sebastien Bourdeauducq 9d56cd43e6 manual: document DRTIO 2017-06-05 00:48:16 +08:00
Sebastien Bourdeauducq a20f5392a9 add pdq2→pdq rename to release notes 2017-06-03 18:36:41 +08:00
Sebastien Bourdeauducq 92307d1f9c fix some missing pdq2→pdq renames 2017-06-03 18:35:36 +08:00
Robert Jördens 2458da1ade pdq: get new host driver, adapt 2017-05-31 00:20:10 +02:00
Robert Jördens 2895448477 sawg: link Spline in docs 2017-05-23 10:33:04 +02:00
Robert Jördens 52625d57f0 sawg: explain DUC 2017-05-23 10:28:23 +02:00
Robert Jördens bfc224d4ba phaser: adjust to new jesd 2017-05-22 19:59:53 +02:00
Robert Jördens 679060af1d phaser: enable dma 2017-05-22 19:32:34 +02:00
Robert Jördens 06721c19c4 sawg: work around bool->int 2017-05-22 18:50:58 +02:00
Robert Jördens 1562f79101 sawg: expose config channel 2017-05-22 18:27:42 +02:00
Robert Jördens 4901cb9a8a sawg: fix clr width 2017-05-22 17:46:55 +02:00
Robert Jördens 253ee950f6 sawg: fix config channel addr 2017-05-22 17:45:14 +02:00
Sebastien Bourdeauducq e845de2ff2 remove aqcli_pdq2 2017-05-22 19:17:23 +08:00
Sebastien Bourdeauducq cf746cee5b fix documentation formatting problems 2017-05-22 19:08:20 +08:00
Sebastien Bourdeauducq e4a631a3d7 scheduler: consider the pipeline flushed if everything has a lower priority than us. Closes #640 2017-05-22 18:43:59 +08:00
Sebastien Bourdeauducq a649408304 manual: add core device logging controller reference 2017-05-22 17:59:39 +08:00
Sebastien Bourdeauducq 5fc953119e fix usage of CommMgmt 2017-05-22 17:32:11 +08:00
Sebastien Bourdeauducq d8eff2aa4e update/cleanup gitignore 2017-05-22 16:49:33 +08:00
Sebastien Bourdeauducq 6bdb76e9ea core device logging controller WIP (#691) 2017-05-22 16:48:00 +08:00
Sebastien Bourdeauducq 5ccca74a3f fold comm device into core device 2017-05-22 15:45:45 +08:00
Sebastien Bourdeauducq e7382f4753 fix test_ctlmgr 2017-05-22 15:04:46 +08:00
Sebastien Bourdeauducq d95c7de777 README: add license header 2017-05-22 00:30:40 +08:00
Sebastien Bourdeauducq 0ae5e6d8b1 test_lda: more thorough and consistent test of simulation mode 2017-05-22 00:26:05 +08:00
Sebastien Bourdeauducq 3ed70afaa1 Use commandline prefix for controllers
This keeps them better organized and consistent with the artiq_* naming scheme.
Tab completion from aqctl_ also lists all the controllers installed on a machine.
2017-05-22 00:22:10 +08:00
Sebastien Bourdeauducq c83e15d040 artiq_corelog: cleanup 2017-05-22 00:06:03 +08:00
Sebastien Bourdeauducq 8cf0628435 fix lit tests 2017-05-18 23:41:01 +08:00
Sebastien Bourdeauducq b7a94d466d fix experiment name conflict in phaser example 2017-05-18 23:14:55 +08:00
Sebastien Bourdeauducq cd757c0f16 generate device database from executable python file 2017-05-18 23:14:55 +08:00
Sebastien Bourdeauducq c44f2da9fd RELEASE_NOTES: formatting 2017-05-18 23:14:55 +08:00
Florent Kermarrec db3e1aef77 examples/phaser: adapt test_ad9154_prbs to new prbs in fabric 2017-05-15 16:12:02 +02:00
Sebastien Bourdeauducq 9ab63920e0 Remove Pipistrello support
Closes #658
Closes #381
2017-05-15 17:17:44 +08:00
Sebastien Bourdeauducq ad85a0cee3 add session manager (#691) 2017-05-15 17:05:22 +08:00
whitequark edef51c6b6 Merge pull request #734 from cjbe/satman_compiler_builtins_rev
firmware: fix revision of compiler_builtins for satman
2017-05-13 19:16:53 +00:00
Chris Ballance 0b6fb95deb firmware: fix revision of compiler_builtins for satman 2017-05-13 15:12:53 +01:00
Robert Jördens 170d2886fd Merge branch 'pdq'
* pdq:
  pdq: documentation
  pdq2 -> pdq
  pdq2: use 16 bit data, buffered read_mem()
  spi: style
  pdq2: mem_read
  pdq2: align subsequent writes to end
  sma_spi: undo cri_con
  pdq2: memory write, kernel_invariants
  sma_spi: cri/cd changes
  sma_spi: LVCMOS25
  coredevice.spi: kernel invariants and style
  sma_spi: free up user_sma pins
  sma_spi: add demo target with SPI on four SMA
  pdq2: memory write
  pdq2: crc/frame register accessors
  doc: pdq2 spi backend
  pdq2: config writes
2017-05-12 11:46:45 +02:00
Robert Jördens 548796030b setup.py: fix math 2017-05-12 09:18:47 +02:00
Robert Jördens e87b6b99f7 depend on python >=3.5.2 <3.6 2017-05-11 15:05:00 +02:00
Robert Jördens 2b1f890c46 Merge branch 'fast-entrypoints'
* fast-entrypoints:
  setup.py: Use fastentrypoints to speed up things
2017-05-09 14:16:49 +02:00
Robert Jördens 94ca9beb55 setup.py: Use fastentrypoints to speed up things
This is not beautiful but closes #665

https://github.com/ninjaaron/fast-entry_points
pypa/setuptools#510
pypa/setuptools#926
2017-05-05 09:22:05 +02:00
Robert Jördens fed24309b8 pdq: documentation 2017-05-02 18:55:02 +02:00
Robert Jördens 1a1edb13bf pdq2 -> pdq 2017-05-02 18:05:41 +02:00
Florent Kermarrec 79c339d4ac gateware/targets/phaser: jesd core now handles jsync completely 2017-04-26 22:25:08 +02:00
Chris Ballance 8ebb33c05c master: record time run() is called 2017-04-26 23:36:19 +08:00
Florent Kermarrec 0546affd4c gateware/target/phaser: jesd start signal renamed to jsync 2017-04-26 12:27:40 +02:00
whitequark bb64992395 compiler: remove dead code. 2017-04-21 18:38:43 +00:00
whitequark c5d7445973 compiler: reject reachable implicit return if not returning TNone.
Fixes #718.
2017-04-21 18:11:14 +00:00
whitequark ed2b10c5aa compiler: in codegen for delay(), round fp instead of truncating.
Consider delay(8*us). It results in the following computation...
  >>> 8*1e-06/1e-09
  7999.999999999999
with the result promptly getting truncated to 7999.

Fixes #706.
2017-04-21 17:36:44 +00:00
whitequark a820ae98cf ksupport: avoid allocations on I/O error paths.
Fixes #715.
2017-04-21 17:20:50 +00:00
whitequark b913d1d6f2 runtime: make a copy of startup/idle kernel firmware before loading.
Fixes #716.
2017-04-21 16:46:40 +00:00
whitequark 726ee7370a runtime: update smoltcp.
This brings in correct TIME-WAIT handling. Fixes #722.
2017-04-21 16:08:04 +00:00
whitequark 0e68eaa879 runtime: print a heap dump on out-of-memory condition. 2017-04-21 14:48:10 +00:00
whitequark fd994ceef3 DMA: various fixes to bring tests in line. 2017-04-20 20:05:03 +00:00
whitequark d383145752 conda: use GIT_FULL_HASH rather than GIT_DESCRIBE_HASH. 2017-04-20 16:58:38 +00:00
whitequark c9b20a1765 Commit missing parts of 0d0ddf2e. 2017-04-20 16:53:16 +00:00
whitequark 0d0ddf2e58 conda: limit git hashes in build numbers to 8 chars exactly.
Before this commit, a nasty edge case was possible where repositories
on different builders have had different sets of objects fetched
into them, and so git-describe selected different lengths for
abbreviating hashes.

See also https://github.com/conda/conda-build/issues/1940.
2017-04-20 16:40:10 +00:00
whitequark af20e7ede4 conda: update rust dependency. 2017-04-19 12:53:13 +00:00
whitequark 5324a42549 conda: update rust dependency. 2017-04-19 11:18:14 +00:00
whitequark db494967c5 firmware use Rust 0.18.0. 2017-04-19 09:38:24 +00:00
Sebastien Bourdeauducq fe05aede78 firmware: DmaPlayback → DMARetrieve 2017-04-19 11:11:42 +08:00
Sebastien Bourdeauducq badbd72beb manual: update example to use DMA handle API 2017-04-19 11:07:41 +08:00
Sebastien Bourdeauducq e8f7f8ef9c DMA: speed up playback
Time reduced from 1.53µs to 1.37µs.
2017-04-19 10:59:12 +08:00
whitequark 41c4de4556 DMA: add API for a much faster replay using handles. 2017-04-18 08:20:12 +00:00
whitequark c6e8d5c901 runtime: allow setting UART log level explicitly.
This is way more convenient than commenting out parts
of session.rs when debugging.
2017-04-15 08:27:18 +00:00
whitequark 0531dc45c3 DMA: erase trace before re-recording it.
Or we could needlessly OOM replacing a large trace.
2017-04-15 07:48:02 +00:00
whitequark 9dfe9c1248 DMA: improve recording performance.
This commit moves DMA serialization code to the kernel CPU
(to cope with the existence of rtio_output_wide) and batches
the resulting sequences. This results in less data being transferred
between kernel and comms CPUs (24 octets with one pointer before,
18 octets with no pointers now, for the common case of rtio_output),
but most importantly reduces cache flushes, which now happen
once per 64k octets.

On average, it now takes about 15us to record a single RTIO event
in a DMA trace.

Fixes #712.
2017-04-15 07:29:52 +00:00
whitequark ea753bed17 runtime: advise to set panic_reboot=1 on panic. 2017-04-15 07:29:36 +00:00
Robert Jördens 534e681d0b pdq2: use 16 bit data, buffered read_mem() 2017-04-13 20:49:46 +02:00
Robert Jördens 90cf11994e spi: style 2017-04-13 13:38:29 +02:00
Robert Jördens 8446cccb4e pdq2: mem_read 2017-04-13 13:38:13 +02:00
whitequark 0b9601f12d artiq_devtool: more robust defaults. 2017-04-13 08:26:48 +00:00
whitequark 3a1fc729cf compiler: refactor type annotations recognizing in kernels.
The new implementation is much more generic, more robust,
and shares code with the same for syscalls as well as RPCs.

Fixes #713.
2017-04-13 08:26:10 +00:00
Sebastien Bourdeauducq 99196986c0 conda: use conda-forge and depend on pyqtgraph 0.10.0 (#704) 2017-04-13 00:55:16 +08:00
whitequark 31048f4b6a compiler: fix monomorphization of coerced integer literals.
Fixes #703.
2017-04-12 04:11:47 +00:00
Sebastien Bourdeauducq c5cd77f177 manual: add DRTIO intro 2017-04-12 00:43:35 +08:00
Sebastien Bourdeauducq 598533adba manual: add DMA to tutorial 2017-04-12 00:43:09 +08:00
whitequark 296dc3b0c4 artiq_coreboot: allow hot-rebooting the device. 2017-04-11 03:24:24 +00:00
whitequark 1bd4d13391 artiq_compile: make print() write to core log, not an invalid op.
Fixes #710.
2017-04-11 03:16:34 +00:00
Robert Jördens 20652ce128 pdq2: align subsequent writes to end 2017-04-09 13:50:19 +02:00
Robert Jördens ed8edf318d sma_spi: undo cri_con 2017-04-08 17:19:35 +02:00
Robert Jördens 78dd4b8614 pdq2: memory write, kernel_invariants 2017-04-08 17:16:19 +02:00
Robert Jördens 16b7f8f50c sma_spi: cri/cd changes 2017-04-08 17:16:19 +02:00
Robert Jördens 1e6e81a19e sma_spi: LVCMOS25 2017-04-08 17:16:19 +02:00
Robert Jördens 0838981bed coredevice.spi: kernel invariants and style 2017-04-08 17:16:19 +02:00
Robert Jördens 555b3c38c1 sma_spi: free up user_sma pins 2017-04-08 17:16:19 +02:00
Robert Jördens 2c7c6143ab sma_spi: add demo target with SPI on four SMA 2017-04-08 17:16:19 +02:00
Robert Jördens f13f6eb7be pdq2: memory write 2017-04-08 17:16:19 +02:00
Robert Jördens b9c61ae2da pdq2: crc/frame register accessors 2017-04-08 17:16:19 +02:00
Robert Jördens 1ce1b7cd71 doc: pdq2 spi backend 2017-04-08 17:16:19 +02:00
Robert Jördens aebbaa339e pdq2: config writes 2017-04-08 17:16:18 +02:00
Sebastien Bourdeauducq f314f8b8f5 relax test_rpc_timing 2017-04-08 22:45:08 +08:00
Sebastien Bourdeauducq c2667debf8 drtio: test replace in RTL simulation 2017-04-06 16:33:59 +08:00
Sebastien Bourdeauducq 729e7b52f0 drtio: collision/replace fixes 2017-04-06 16:33:49 +08:00
Sebastien Bourdeauducq 83d87b5805 drtio: remove outdated comment 2017-04-06 12:45:10 +08:00
Sebastien Bourdeauducq c0100ebc56 rtio: fix indentation 2017-04-06 12:08:13 +08:00
Sebastien Bourdeauducq 207453efcd rtio: add a missing case for collision reporting 2017-04-06 11:28:16 +08:00
whitequark 14ae1cc100 runtime: advance now on DMA replay.
Fixes #700.
2017-04-05 18:34:36 +00:00
Sebastien Bourdeauducq 674bf82f3a gateware: add cri_con CSRs to all DMA-capable targets 2017-04-06 01:14:09 +08:00
Sebastien Bourdeauducq 5e3aef45dc drtio: support collision/replace + detect sequence errors at satellite 2017-04-06 01:06:56 +08:00
whitequark 56918fb375 test: re-enable DMA tests as the feature is now stable. 2017-04-05 16:43:22 +00:00
whitequark 17b5388259 gateware: remove one stray CRI arbiter remnant. 2017-04-05 16:38:56 +00:00
whitequark 464202d0aa gateware: connect CRI switch to kernel CPU. 2017-04-05 16:10:53 +00:00
whitequark 47632f81b1 gateware: CRIArbiter -> CRISwitch. 2017-04-05 16:10:39 +00:00
whitequark 391660e545 gateware: simplify the CRI arbiter to use a plain mux. 2017-04-05 15:09:19 +00:00
Sebastien Bourdeauducq 12249dac57 rtio: do not clear asynchronous error flags on RTIO reset 2017-04-03 00:20:30 +08:00
Sebastien Bourdeauducq db3118b916 drtio: use BlindTransfer for error reporting 2017-04-03 00:18:07 +08:00
Sebastien Bourdeauducq 8c414cebc7 drtio: report busy errors 2017-04-03 00:11:08 +08:00
Sebastien Bourdeauducq 008678b741 drtio: add infrastructure for reporting busy/collision errors 2017-04-02 23:45:55 +08:00
Sebastien Bourdeauducq 0a687b7902 drtio: report satellite errors through firmware 2017-04-01 12:18:00 +08:00
whitequark 8b98e1ea6d test: relax test_rpc_timing: rpc_time_mean <2ms → <3ms. 2017-03-31 20:41:47 +00:00
Sebastien Bourdeauducq 7ec14f26c2 examples: fix after introduction of RangeScan 2017-03-31 16:54:07 +08:00
Chris Ballance 58da76a169 gui: remove unnecessary state test 2017-03-31 16:48:39 +08:00
Chris Ballance bdf1ca25c6 scannable: fix RangeScan randomize seeding 2017-03-31 16:48:39 +08:00
Chris Ballance 07c71bf020 language,gui: combine LinearScan and RandomScan into RangeScan. Closes #679 2017-03-31 16:48:39 +08:00
Sebastien Bourdeauducq 28211e0b32 gateware: reset RTIO DMA core when kernel CPU is reset 2017-03-31 15:35:28 +08:00
Sebastien Bourdeauducq 200c499114 test: change base address in DMA simulation testbench 2017-03-31 13:17:00 +08:00
whitequark 245e186347 Commit missing parts of 948ed6fb. 2017-03-29 18:34:08 +00:00
Chris Ballance 756e8a415e language: fix PYONValue list defaults (fixes #682) 2017-03-29 21:58:34 +08:00
whitequark d04d7ed120 runtime: show a more informative message for interrupted sessions.
Fixes #690.
2017-03-29 03:36:49 +00:00
whitequark 948ed6fb0a Extract core device management interface from session interface (#691). 2017-03-29 03:36:21 +00:00
Sébastien Bourdeauducq 0cda1a3d34 manual: add note about git branches
Closes #695
2017-03-29 09:56:09 +08:00
Sebastien Bourdeauducq 6d1046cae2 conda: use python 3.5.3 2017-03-29 09:39:02 +08:00
Sebastien Bourdeauducq 2e2d0be201 skip crashing DMA tests on buildbot 2017-03-29 09:36:51 +08:00
Chris Ballance 452bc6ecac monkey_patches: fix 3af29f7 2017-03-29 01:07:32 +02:00
whitequark b643847da5 Fix a misleading message for non-clean kernel termination. 2017-03-28 14:22:20 +00:00
whitequark 7eb368fd5d test: add DMA test that checks the analyzer trace. 2017-03-28 14:22:20 +00:00
Sebastien Bourdeauducq 6caab4d10b test: verify that RTIO collisions appear in log 2017-03-27 18:08:03 +08:00
Sebastien Bourdeauducq 432c6b99e2 master: still save results when analyze fails. Closes #684 2017-03-27 17:57:02 +08:00
Sebastien Bourdeauducq 70343b244d test: add more RTIO slack in test_clock_generator_loopback 2017-03-27 17:26:23 +08:00
Sebastien Bourdeauducq 58ee09dbdc test: re-enable test_clock_generator_loopback
It passes now for some reason.
2017-03-27 17:26:02 +08:00
Sebastien Bourdeauducq b9ff5afc85 dma: improve/fix documentation 2017-03-27 17:21:39 +08:00
Sebastien Bourdeauducq 2c3f720301 runtime: report asynchronous RTIO errors (collision, busy) in log. Closes #681 2017-03-27 17:14:14 +08:00
Sebastien Bourdeauducq ea3af1e20e drtio: remove obsolete CSR accesses from test 2017-03-27 16:44:22 +08:00
Sebastien Bourdeauducq b74d6fb9ba make collision and busy asynchronous errors, and simplify CPU/gateware handshake for output errors and reads 2017-03-27 16:32:23 +08:00
Sebastien Bourdeauducq 1ee3f96482 test: self.break_realtime → self.core.break_realtime 2017-03-27 16:31:11 +08:00
whitequark ac9e8b8568 test: avoid underflow in DMA replay test. 2017-03-17 12:09:02 +00:00
whitequark dbea679e96 Revert "test: relax test_rpc_timing on Windows."
This reverts commit e9cf451c0b.
2017-03-17 11:34:45 +00:00
whitequark e9cf451c0b test: relax test_rpc_timing on Windows. 2017-03-17 11:20:16 +00:00
whitequark 7dc7dcda2c test: relax test_pulse_rate_dds to only catch catastrophic slowdown. 2017-03-17 11:17:47 +00:00
whitequark 4de336fbe9 gateware: reverse bytes of SDRAM word, not bits. 2017-03-17 11:16:46 +00:00
whitequark 6b63322106 gateware: reverse SDRAM words in RTIO DMA engine. 2017-03-17 07:29:28 +00:00
whitequark 4b14887ddb gateware: work around ISE/Vivado bugs with very wide shifts. 2017-03-17 07:29:28 +00:00
Sebastien Bourdeauducq f5aa73b8fa satman: unbreak after c586035c 2017-03-15 17:26:09 +08:00
whitequark c586035caa runtime: add an option to reboot after a panic. 2017-03-14 09:02:28 +00:00
whitequark 80c75ed505 firmware: fix for unwinder update. 2017-03-14 08:50:32 +00:00
whitequark 618942bda6 conda: bump misoc. 2017-03-14 08:35:04 +00:00
whitequark 4beda73217 firmware: don't build libdyld through misoc. 2017-03-14 08:33:31 +00:00
Sebastien Bourdeauducq a7de58b604 rtio: Inout → InOut 2017-03-14 14:18:55 +08:00
Sebastien Bourdeauducq 13ae1d1a38 drtio: input unittest 2017-03-14 14:14:55 +08:00
Sebastien Bourdeauducq 56fd9b3b4b drtio: input fixes 2017-03-14 14:14:43 +08:00
Sebastien Bourdeauducq 856a64f6d2 drtio: use TTLInOut in device_db 2017-03-14 14:13:52 +08:00
Sebastien Bourdeauducq 95ede18809 drtio: support PHY latency compensation 2017-03-14 00:01:38 +08:00
Sebastien Bourdeauducq 497c795d8c drtio: input support (untested) 2017-03-13 23:54:44 +08:00
Sebastien Bourdeauducq d1b9f9d737 drtio: rt_packets → rt_packet 2017-03-13 00:10:07 +08:00
Sebastien Bourdeauducq 6b7c781ff2 drtio: introduce 'standard request' interface in RT packet layer 2017-03-13 00:08:03 +08:00
Sebastien Bourdeauducq 2b8729f326 drtio: clear any read request on satellite reset 2017-03-13 00:00:38 +08:00
Robert Jördens 1dbfaf5ad0 Revert "conda: bump misoc (pcu/ISE fix)"
This reverts commit d5d3e25f97.
2017-03-08 23:15:23 +01:00
Robert Jördens 0c959ba6ea Revert "conda: actually bump misoc (pcu/ISE fix)"
This reverts commit ccc4cf8a22.
2017-03-08 23:15:21 +01:00
Robert Jördens ccc4cf8a22 conda: actually bump misoc (pcu/ISE fix) 2017-03-08 17:34:38 +01:00
Robert Jördens d5d3e25f97 conda: bump misoc (pcu/ISE fix) 2017-03-08 17:32:59 +01:00
whitequark b391598c87 artiq_devtool: add reset action. 2017-03-07 14:37:08 +00:00
whitequark 5bbb05362b runtime: update smoltcp. 2017-03-07 11:36:28 +00:00
whitequark d52723d5bc runtime: allow setting log level in configuration. 2017-03-07 11:36:28 +00:00
whitequark cce1481fac artiq_devtool: add hotswap action. 2017-03-07 11:36:28 +00:00
whitequark 795a3e24d8 artiq_coreboot: block until hotswap image is actually received. 2017-03-07 11:36:28 +00:00
Chris Ballance 804e69b144 language: add "W" (Watt) to units 2017-03-07 10:03:42 +08:00
Sebastien Bourdeauducq 6895236794 frontend: fix permissions 2017-03-07 00:47:45 +08:00
Sebastien Bourdeauducq 1e47e638bb drtio: implement inputs in RTPacketSatellite, reorganize code 2017-03-07 00:46:59 +08:00
whitequark b0cdef3211 firmware: implement hotswap through artiq_coreboot tool. 2017-03-06 16:01:28 +00:00
whitequark 12e22823a2 conda: update misoc dependency. 2017-03-06 13:23:43 +00:00
whitequark 98454e9bda runtime: remove unnecessary dcache flush.
Data cache is write-through, so sending data to DMA doesn't need
a flush.
2017-03-04 09:46:55 +00:00
whitequark 218046d96c artiq_devtool: fix an infinite loop on network error. 2017-03-04 09:40:22 +00:00
whitequark 924ae73000 firmware: fix DMA trace alignment and flush caches. 2017-03-04 09:40:22 +00:00
whitequark 30ac42de3f ksupport: fix an exception safety issue.
Raising from inside a recv! will never send an acknowledgement.
2017-03-04 09:40:22 +00:00
Sebastien Bourdeauducq f121ca20fe test: relax test_pulse_rate_dds 2017-03-03 18:10:27 +08:00
Sebastien Bourdeauducq 1e6a33b586 rtio: handle input timeout in gateware
The information passed by the runtime will be used by the DRTIO core
to poll the remote side appropriately.
2017-03-03 17:37:47 +08:00
whitequark 4f94709e9f firmware: move packet dumps to the DEBUG log level. 2017-03-03 06:11:35 +00:00
whitequark e8c093deb3 Allow changing runtime log level without recompilation.
This shouldn't affect performance much, as the log crate guards
every log statement with a branch, adding just two instructions.
2017-03-03 06:06:26 +00:00
whitequark fe77fcc45f firmware: fix a warning. 2017-03-03 05:35:28 +00:00
whitequark 3070a2fac1 runtime: fix more bugs in DMA trace encoder. 2017-03-03 05:15:54 +00:00
whitequark 86dea869b3 compiler.types: add missing TTuple.__hash__ implementation. 2017-03-03 03:27:49 +00:00
whitequark 7e886ddc89 transforms.inferencer: do not unnecessarily mutate typedtree.
This caused the hash to change after every iteration of inference,
if the result of any coercion was an integer of indefinite width.
2017-03-02 16:15:37 +00:00
whitequark 8c9f157563 compiler.embedding: fix an overly lax hasher. 2017-03-02 15:28:24 +00:00
whitequark a79c3c2cff compiler.transforms: implement a typedtree printer. 2017-03-02 15:28:04 +00:00
Sebastien Bourdeauducq d2f2415b50 analyzer: use CRI and connect at RTIO core
This causes DMA events to be included in analyzer traces.
2017-03-02 18:47:56 +08:00
Sebastien Bourdeauducq 0b4922e0f4 dma: request RTIO control 2017-03-01 18:59:45 +08:00
Sebastien Bourdeauducq 553b8046ff examples: add DMA LED blinker 2017-03-01 18:37:58 +08:00
whitequark a4ece19614 Implement DMA playback. 2017-02-28 21:28:40 +00:00
whitequark 4107938fd8 compiler.embedding: use attribute count in fixpoint condition.
Before this commit, we had a hack where inferencing would run
one more time, in case we can still infer more attributes even
after all the type information is there. This doesn't work
if *that* round of inferencing brings even more code, e.g.
this is easy to trigger with context managers.
2017-02-28 21:28:40 +00:00
whitequark 252cda6e7f compiler.llvm_ir_generator: fix string quoting. 2017-02-28 21:28:38 +00:00
Robert Jördens 3f556a3f58 doc: remove qt5 note 2017-02-28 13:22:47 +01:00
Robert Jördens 3c50c46a81 conda: pyqt >= 5.5 2017-02-28 13:22:39 +01:00
Robert Jördens fca315235c Merge branch 'use_default_pyqt' of https://github.com/cjbe/artiq
* 'use_default_pyqt' of https://github.com/cjbe/artiq:
  conda: use anaconda default pyqt (fixes #670)
2017-02-28 13:21:13 +01:00
Robert Jördens 3af29f7a59 monkey_patches: cleanup 2017-02-28 13:20:41 +01:00
Robert Jördens 056a5a7e4d Merge branch 'py3.5.3_monkey-patch' of https://github.com/cjbe/artiq
* 'py3.5.3_monkey-patch' of https://github.com/cjbe/artiq:
  monkey-patch Python 3.5.3 asyncio.base_events._ipaddr_info this fixes #506 for py3.5.3
2017-02-28 13:19:08 +01:00
Chris Ballance 00ed3909dd monkey-patch Python 3.5.3 asyncio.base_events._ipaddr_info
this fixes #506 for py3.5.3
2017-02-28 10:49:19 +00:00
Chris Ballance 34421ee2f4 conda: use anaconda default pyqt (fixes #670) 2017-02-28 10:38:46 +00:00
Sebastien Bourdeauducq 9cfa3e704b fix test_analyzer 2017-02-27 19:19:46 +08:00
Sebastien Bourdeauducq 3b386aa590 fix test_moninj import 2017-02-27 18:44:32 +08:00
Sebastien Bourdeauducq 7d6ebabc1b reorganize core device communication code 2017-02-27 18:37:30 +08:00
Sebastien Bourdeauducq e64d923a67 dashboard: fix moninj display refresh issues after mode changes 2017-02-27 17:56:45 +08:00
Sebastien Bourdeauducq f402b4af3f drtio: fix typo in example device_db 2017-02-27 17:51:55 +08:00
Sebastien Bourdeauducq d16073fcaa test: add moninj unittest 2017-02-27 15:56:58 +08:00
Sebastien Bourdeauducq b8bfcd2d7e moninj: share probe/override numbers and use Enum 2017-02-27 11:54:16 +08:00
Sebastien Bourdeauducq fc0ce310a8 examples: fix dds_test RTIO underflow 2017-02-27 11:45:18 +08:00
Sebastien Bourdeauducq 26654e6a3a moninj: Python-side fixes 2017-02-27 11:45:04 +08:00
Sebastien Bourdeauducq 7481eaff52 moninj: use smaller network buffer 2017-02-27 11:44:29 +08:00
whitequark 88bf7d2233 firmware: specialize protocol read/write functions.
Before this commit, proto::io::{read,write}_* functions were taking
a &mut {Read,Write}. This means a lot of virtual dispatch.
After this commit, all these functions are specialized for
the specific IO trait.

This could be achieved with just changing the signature from
  fn read_x(reader: &mut Read)
to
  fn read_x<R: Read>(reader: &mut R)
but the functions were also grouped into ReadExt and WriteExt
traits as a refactoring.

Initially, it was expected that the generic traits from
the byteorder crate could be used, but they require endianness
to be specified on every call and thus aren't very ergonomic.
They also lack the equivalent to our read_string and read_bytes.

Thus, it seems fine to just define a slightly different extension
trait.

This also optimized the test_rpc_timing test: 1.7ms→1.2ms.
2017-02-26 18:24:37 +00:00
whitequark de015b994d compiler: allow dumping the object file with ARTIQ_DUMP_OBJ. 2017-02-26 17:09:21 +00:00
Sebastien Bourdeauducq dff23293c7 Merge branch 'master' of github.com:m-labs/artiq 2017-02-27 01:05:40 +08:00
Sebastien Bourdeauducq 96bf414257 dashboard: use new moninj protocol 2017-02-27 00:59:31 +08:00
Sebastien Bourdeauducq 990b8152f6 coredevice: add moninj protocol driver 2017-02-27 00:59:17 +08:00
whitequark 5d3b00cf12 Implement recording of DMA traces on the core device. 2017-02-26 02:50:20 +00:00
whitequark 3a1f14c16c compiler: fix overly strict constness analysis.
Before this commit, the following code would fail to compile...
  obj.foo.bar = True
... if foo is marked kernel_invariant in obj, even if bar is not
marked as such in obj.foo.
2017-02-26 01:58:21 +00:00
whitequark a07bd918f0 firmware: use Rust naming conventions for enum variants. 2017-02-25 22:34:11 +00:00
whitequark 2a81819eb0 firmware: restructure to avoid #[path = "..."] mod ...;
Such code is fragile, introduces mess in dependencies, and
inflates compile times.
2017-02-25 17:54:14 +00:00
whitequark d04e611232 firmware, compiler: rename rpc functions to be more consistent. 2017-02-25 14:12:58 +00:00
Sebastien Bourdeauducq e82ce3ea28 coredevice: ignore .dirty in version checks correctly 2017-02-25 20:05:05 +08:00
Sebastien Bourdeauducq 98be556143 drtioaux: fix compiler warnings 2017-02-25 12:18:57 +08:00
Sebastien Bourdeauducq f017d1771f gateware: remove unused configs in targets (not needed with new moninj) 2017-02-25 12:14:56 +08:00
Sebastien Bourdeauducq 5a16660aa2 runtime: new moninj protocol, TCP-based, with DRTIO support 2017-02-25 12:07:00 +08:00
Sebastien Bourdeauducq 1486a945d9 manual: update moninj network info 2017-02-25 12:06:35 +08:00
Sebastien Bourdeauducq 7d568b4bac style 2017-02-25 12:06:12 +08:00
whitequark 13c6e96760 firmware: implement dyld::Library::rebind. 2017-02-25 00:10:40 +00:00
whitequark 04ad267055 firmware: rewrite the dynamic linker in Rust. 2017-02-24 18:57:29 +00:00
Sebastien Bourdeauducq 360be0098f drtio: map local RTIO core on lower channels 2017-02-24 18:15:27 +08:00
whitequark 907589fb58 satman: simplify Makefile. 2017-02-23 10:29:25 +00:00
whitequark 623a605d3b satman: refactor type conversions. 2017-02-23 08:59:27 +00:00
Sebastien Bourdeauducq b34c6ba6b9 satman: process moninj packets 2017-02-23 16:24:05 +08:00
Sebastien Bourdeauducq 45ac0dcf57 drtioaux: add moninj packets 2017-02-23 16:23:51 +08:00
Sebastien Bourdeauducq 016743f079 libdrtioaux: do not attempt to access non-existent DRTIO gateware 2017-02-22 16:45:02 +08:00
Sebastien Bourdeauducq 257527629a firmware: use aux ping to determine when DRTIO satellite is ready 2017-02-22 15:26:32 +08:00
Sebastien Bourdeauducq a8ea557406 firmware: add DRTIO aux packet library (WIP) 2017-02-21 21:55:36 +08:00
Sebastien Bourdeauducq b455ea447d gateware: add moninj to drtio targets 2017-02-21 21:54:47 +08:00
whitequark a12876b239 firmware: update Cargo.lock. 2017-02-21 05:28:48 +00:00
whitequark 1dabe05c5a artiq_devtool: add clean command and --config option. 2017-02-21 05:28:19 +00:00
whitequark b468959e14 doc: manual/developing: update binutils patch URL. 2017-02-21 05:28:19 +00:00
Sebastien Bourdeauducq c66efc0279 moninj: do not require a rsys clock domain 2017-02-20 15:52:48 +08:00
Sebastien Bourdeauducq 8da28177a4 conda: bump migen 2017-02-20 15:52:05 +08:00
Robert Jördens e323e37829 pcu: refactor into a device 2017-02-19 19:34:55 +01:00
Robert Jördens b05d1bb7e3 coreanalyzer: fix corner case crash 2017-02-19 19:28:13 +01:00
Robert Jördens 1573ff5fc1 coreanalyzer: add WB stb signal 2017-02-18 14:53:10 +01:00
Robert Jördens 039ced6637 coreanalyzer: use VCD scopes for DDS/SPI 2017-02-18 14:25:01 +01:00
Robert Jördens 7519408857 coreanalyzer: add SPIMaster support 2017-02-18 14:13:20 +01:00
Robert Jördens 41e8acf3ad coreanalyzer handle input events without timestamp
Offset the timeline by the first non-zero timestamp.
2017-02-18 14:12:02 +01:00
Robert Jördens bc3fc26e34 coredevice: expose PCU 2017-02-18 14:09:12 +01:00
Robert Jördens 3e2dad6573 misoc: bump (mor1kx pcu) 2017-02-18 14:09:12 +01:00
Robert Jördens 6b5b679659 libboard: PCU regs 2017-02-18 14:09:12 +01:00
Robert Jördens c022b53578 kernel_cpu: enable perf counters 2017-02-18 14:09:12 +01:00
Sebastien Bourdeauducq 9501d37378 firmware: wait longer for Si5324 lock + more monitoring 2017-02-18 17:24:46 +08:00
Sebastien Bourdeauducq 7e8348a73e si5324: fix error handling 2017-02-18 14:12:18 +08:00
Sebastien Bourdeauducq 59e79673f7 satman: program Si5324 BWSEL depending on frequency 2017-02-18 14:12:01 +08:00
Sebastien Bourdeauducq 0bfce37fae satman: do not use Si5324 automatic clock switching
The Si5324 is easily confused by the broken clock generated during link
initialization with BruteforceClockAligner. This commit prevents this problem.
2017-02-18 13:32:40 +08:00
Sebastien Bourdeauducq bd55436668 protocols: increase asyncio line limit. Closes #671 2017-02-17 20:46:23 +08:00
whitequark f4ae166a4c conda: fix syntax. 2017-02-05 16:46:11 +00:00
whitequark 52a046d0fd conda: roll cargo back to 0.11.0, then fix revision of compiler_builtins. 2017-02-05 15:25:43 +00:00
whitequark 3de19f6786 conda: use verbose misoc build. 2017-02-05 14:26:08 +00:00
whitequark 990b642461 conda: bump cargo dependency to >= 0.16.0.
We currently have cargo ignoring and recreating the lockfile on CI,
which is probably caused by it being too old.
2017-02-05 13:55:15 +00:00
whitequark 25c9b8827a firmware: mark __artiq_{re,}raise as #[unwind].
This is required for correctness.
2017-02-05 09:04:22 +00:00
whitequark 6d094eda32 conda: bump rust dependency. 2017-02-05 09:00:45 +00:00
whitequark f94028b8df Fix c39394b. 2017-02-04 16:23:32 +00:00
Sebastien Bourdeauducq 3eef0bcc1a firmware: give si5324 more time to lock 2017-02-04 19:19:25 +08:00
Sebastien Bourdeauducq 935799dfb7 drtio: fix satellite transceiver clocking 2017-02-04 19:18:35 +08:00
whitequark c39394b4d5 firmware: port the exception handling routines to Rust. 2017-02-04 08:21:07 +00:00
whitequark b9cbedceb1 firmware: migrate last vestiges of the old runtime build system. 2017-02-03 12:59:35 +00:00
whitequark cde2054926 firmware: do not link to C code in runtime and satman. 2017-02-03 12:12:41 +00:00
whitequark fd8b11532f compiler, firmware: use Pascal strings everywhere.
This removes a large amount of very ugly code, and also simplifies
the compiler and runtime.
2017-02-03 11:53:27 +00:00
Chris Ballance e13d8919ff Correct tooltip inconsistency between browser and dashboard 2017-02-03 17:53:40 +08:00
Chris Ballance 639066c6d8 Add tooltips to experiment arguments 2017-02-03 17:53:40 +08:00
whitequark f48cf9d9a0 firmware: use libcompiler_builtins to build satman. 2017-02-03 08:11:42 +00:00
whitequark 4164fc880e artiq_devtool: add support for switching targets. 2017-02-03 07:42:06 +00:00
Sebastien Bourdeauducq a8ecbd6041 firmware: do not attempt to build Si5324 code when gateware does not support it 2017-02-03 12:27:13 +08:00
Sebastien Bourdeauducq 6fe1c9ff45 firmware: read back reserved bits from Si5324, use SFOUT2_REG=b001 instead of reserved b000 2017-02-03 12:24:13 +08:00
Sebastien Bourdeauducq f6e9d571c2 satman: use rust liballoc 2017-02-03 12:23:38 +08:00
Sebastien Bourdeauducq d181989de9 drtio: reset Si5324 at each boot 2017-02-03 12:00:58 +08:00
Sebastien Bourdeauducq b3697f951a drtio: forward clocks to SMA connectors for debugging 2017-02-03 12:00:36 +08:00
Robert Jördens 9c646801e3 doc: fix verbatim sections 2017-02-02 20:03:15 +01:00
Robert Jördens 02917aae62 doc: newline after label 2017-02-02 19:58:26 +01:00
Robert Jördens 5a30536d59 doc: write section on developing with a conda env 2017-02-02 19:53:18 +01:00
Robert Jördens edab068ac9 conda: pull in openocd in artiq and artiq-dev 2017-02-02 19:53:18 +01:00
Sebastien Bourdeauducq aafefee7f5 targets: make number of ethmac slots consistent 2017-02-02 23:02:51 +08:00
Sebastien Bourdeauducq 90ac915dd1 firmware: do not clear si5324 reserved bit 2017-02-02 20:54:50 +08:00
Sebastien Bourdeauducq 6bea253f82 firmware: fix misleading si5324 comment 2017-02-02 20:53:39 +08:00
whitequark 9c93c760fc firmware: do not use PIC in Rust code.
This fixes test_pulse_rate and test_pulse_rate_dds by making
rtio_output slightly faster.
2017-02-02 12:22:55 +00:00
whitequark 259319e456 firmware: use compiler_builtins crate instead of our compiler-rt.
This cannot be done for ksupport yet because compiler_builtins
misses most soft-float operations.
2017-02-02 10:55:35 +00:00
whitequark 44a9a79f96 firmware: port allocator to Rust. 2017-02-02 10:55:35 +00:00
Sebastien Bourdeauducq f512ea42dc drtio: initialize si5324 in firmware 2017-02-02 18:11:24 +08:00
Sebastien Bourdeauducq 3488b4a857 firmware: si5324 cleanups/fixes 2017-02-02 18:11:00 +08:00
Sebastien Bourdeauducq efd8eadf2c RELEASE_NOTES: 2.2 2017-02-02 18:09:19 +08:00
whitequark 3b54736c02 firmware: port flash storage management to Rust. 2017-02-02 05:26:06 +00:00
whitequark 0df8a24135 Fix c2cf60e. 2017-02-02 01:08:20 +00:00
whitequark c2cf60e7f6 firmware: use the cslice crate to get rid of unsafe code in ksupport. 2017-02-02 00:51:58 +00:00
whitequark 9a9a3aa7de firmware: remove unnecessary inline assembly in libboard. 2017-02-02 00:21:34 +00:00
Robert Jördens 715443e211 setup.py: remove doc and test dependencies 2017-02-01 23:24:54 +01:00
Robert Jördens e23be49208 conda: clean up dependencies 2017-02-01 22:26:12 +01:00
Robert Jördens e93f610323 conda/artiq: don't need numpy or binutils to build 2017-02-01 21:48:15 +01:00
Robert Jördens fb56c32d35 conda: use artiq-dev metapackage 2017-02-01 15:34:05 +01:00
whitequark f3b2610ffc Fix bc22d1c. 2017-02-01 01:56:39 +00:00
whitequark 6fd149f048 Show a message when interrupting a running kernel (except idle kernel).
Fixes #625.
2017-01-31 22:53:38 +00:00
whitequark bc22d1c009 firmware: libksupport → ksupport.
The idea is that support libraries are called lib*, and the final
products that linked into an executable are not.
2017-01-31 22:24:37 +00:00
whitequark 7a14cf503b firmware: fix a warning. 2017-01-31 22:19:45 +00:00
whitequark 680a7067a8 firmware: use ? instead of try! everywhere. 2017-01-31 22:18:59 +00:00
whitequark ee1b2fa3ea compiler: swap the order of ptr/len fields in lists.
This is to make them match the Rust slices.
Once the cslice crate becomes #![no_std] we'll also use its (tidier)
conversion functions.
2017-01-31 22:11:13 +00:00
whitequark ab71c9a0ba compiler: the len builtin is not polymorphic, coerce the result.
Fixes #659.
2017-01-31 21:28:20 +00:00
whitequark 6acdcbb82a Fix 2f37b1d. 2017-01-30 10:25:11 +00:00
whitequark 2f37b1d1c0 compiler: support methods defined on singleton instances.
Fixes #638.
2017-01-30 10:10:21 +00:00
whitequark c585784cd9 conda: bump misoc dependency. 2017-01-30 08:03:41 +00:00
whitequark b95db4fa4e Use four ethmac buffers instead of two.
This should address an issue where the host sends a packet burst,
the second packet in a burst gets dropped, the rest also gets
dropped since smoltcp doesn't do reassembly, and the entire dance
is repeated on every retransmit.
2017-01-30 07:42:27 +00:00
whitequark 3a19a9fb77 firmware: minor cleanup in board::si5324. 2017-01-30 07:29:44 +00:00
Sebastien Bourdeauducq 9800acea92 drtio: program Si5324 for 150MHz in 3G config 2017-01-30 14:50:12 +08:00
Sebastien Bourdeauducq bff5f1b714 conda: update migen 2017-01-30 13:39:44 +08:00
Sebastien Bourdeauducq 7daab07a29 drtio: fix syntax/import 2017-01-30 13:01:45 +08:00
Sebastien Bourdeauducq d8e9949266 drtio: initialize AD9516 clock chip 2017-01-30 11:06:45 +08:00
Sebastien Bourdeauducq 54295b1699 firmware: use has_ad9154 instead of has_converter_spi for conditional compilation
DRTIO designs do not have a JESD core yet, so we need to support converter SPI buses with only the clock chip.
2017-01-30 11:03:55 +08:00
Sebastien Bourdeauducq f6024b6c9a drtio: fix ad9154 extension registration 2017-01-30 10:59:22 +08:00
Sebastien Bourdeauducq 3aced46b19 dashboard: report lost connection with master. Closes #602 2017-01-30 10:48:27 +08:00
Sebastien Bourdeauducq dcea48a52d protocols/broadcast,sync_struct: add disconnect callback 2017-01-30 10:47:56 +08:00
Sebastien Bourdeauducq 43aad0914e python3.5 -> python3
Many things also work with Python 3.6.
2017-01-30 09:24:43 +08:00
Sebastien Bourdeauducq 657afd770e artiq/test/gateware -> artiq/gateware/test
This allows gateware simulations to be skipped or not considered for coverage when using test discovery.
2017-01-30 09:00:55 +08:00
whitequark be0953d98f firmware: unbreak Io::sleep().
Fixes #663.
2017-01-27 18:18:02 +00:00
Sebastien Bourdeauducq 82c4c61290 fix 7b2eba9f 2017-01-27 23:44:59 +08:00
Sebastien Bourdeauducq 94b0783897 drtio: remove support for transceiver SMAs
Passive SFP cables do not require bitstream rebuilds and do not cause weird transceiver failures.
2017-01-27 23:33:50 +08:00
Sebastien Bourdeauducq 7b2eba9fbd firmware: misoc_registers -> misoc_cfg 2017-01-27 23:28:00 +08:00
Sebastien Bourdeauducq 11994d1900 satman: unbreak build 2017-01-27 23:26:40 +08:00
Sebastien Bourdeauducq 6acb8021e1 satman: remove stale reference to main.c 2017-01-27 23:24:07 +08:00
Robert Jördens 55ce40ece0 RELEASING: use signed annotated tags 2017-01-27 15:38:04 +01:00
whitequark 6891b5fcfd firmware: accept sessions even when startup kernel is running.
Fixes #625.
Fixes #649.
2017-01-27 13:46:32 +00:00
whitequark 24ce9a057b firmware: add missing try!. 2017-01-27 13:46:32 +00:00
Robert Jördens 9e92706d09 conda: pin misoc/migen package hashes 2017-01-27 14:43:24 +01:00
Sebastien Bourdeauducq bbc4185737 RELEASING: mention GitHub releases 2017-01-27 21:37:30 +08:00
Sebastien Bourdeauducq f78aa1ee76 RELEASING: mention doc redirect 2017-01-27 21:26:51 +08:00
whitequark 74b910e97d In case of a load error, pass the reason to host interpreter.
Fixes #654.
2017-01-27 12:49:48 +00:00
whitequark 609fd3d902 test: skip test_clock_generator_loopback as well.
Both tests pass locally, which means there's some conda screwup
that prevents them from working on CI.
2017-01-27 11:47:26 +00:00
whitequark c529cefc89 conda: bump llvmlite-artiq dependency. 2017-01-27 11:14:53 +00:00
Robert Jördens c659c2e551 Relicense ARTIQ as LGPLv3+ (closes #570)
Kelly Stevens: 1481043941095.63542@gtri.gatech.edu
David Nadlinger: E7C03799-5D45-4C03-9DF9-029FE2B4F12B@klickverbot.at
whitequark: 69d1ca29d5ab03fbcfb446d65cbe1150@mail.whitequark.org
Felix Held: 9145cc19-2319-3516-b2a9-dde60aef11f7@felixheld.de
Robert Jordens: CANb+zoFgXVYgCji_vXPauK-fnnYKpm_QioMnvmh=hvLFWQONWA@mail.gmail.com
Daniel Slichter: BL2PR09MB1010FE3D3A325E889AD70A2591820@BL2PR09MB1010.namprd09.prod.outlook.com
Joe Britton: CAE2_b1V60_6PJ3VYx_s-p5XVfKJUx8kbQA7VwD3MdcmHdzROGw@mail.gmail.com
Florent Kermarrec: CA+96J6JHM8yZM=RYaporU36NdyOTL3BeSuO9oM8TTtdnXiJ5jw@mail.gmail.com
Zach Smith: CAAJ=EH+OzDs_rBJ_zTjbOZmumEZWONX2MSFUasJwf8josJGdkw@mail.gmail.com
David Leibrandt: CY1PR09MB0921C628EC76CDFC4CC7F64F95820@CY1PR09MB0921.namprd09.prod.outlook.com
Raghavendra Srinivas: DM5PR09MB1531C49EEE1774DF2BA80616F8850@DM5PR09MB1531.namprd09.prod.outlook.com
Yann Sionneau: CACi+aWbdY48D9CgKtXdtVsdX4NS1JwVN4v-PCC17F_rPKSt4XQ@mail.gmail.com
Sébastien Bourdeauducq: c3f235dc-e9c5-7f7a-10f2-bb4e4f85e7f5@m-labs.hk
2017-01-27 11:19:46 +01:00
whitequark 50f234bea4 firmware: update smoltcp to take advantage of TCP MSS option. 2017-01-27 03:47:57 +00:00
whitequark 477664f931 test: temporarily skip pulse_rate_dds. 2017-01-26 20:53:30 +00:00
Robert Jördens 143f784291 artiq_flash: fix scripts_path 2017-01-26 21:52:59 +01:00
Robert Jördens c43adbf846 conda: add artiq-dev environment description 2017-01-26 19:55:39 +01:00
whitequark b7f6bfffeb firmware: fix embedding of software version during build. 2017-01-26 17:40:29 +00:00
whitequark 31e5f9a810 firmware: read MAC/IP address configuration from flash. 2017-01-26 17:40:29 +00:00
Robert Jördens 6c637537f0 doc/conda: fix conda env description syntax 2017-01-26 18:14:58 +01:00
Robert Jördens 8a13c8c195 doc: use minimal conda environment to build 2017-01-26 18:12:10 +01:00
Robert Jördens 86bde74cd4 doc: fix autodoc search path 2017-01-26 17:56:18 +01:00
Robert Jördens c155fd3849 doc: minimize dependencies for manual 2017-01-26 17:54:10 +01:00
Robert Jördens 653eee071d artiq_flash: make scripts_path a function (for doc generating) 2017-01-26 17:53:33 +01:00
Sebastien Bourdeauducq f7dec72f02 firmware: give satman whole RAM in linker script 2017-01-26 15:58:42 +08:00
Robert Jördens aa3af4f72d conda: fix sphinx pin 2017-01-26 00:53:43 +01:00
Robert Jördens 151b51f836 conda: pin sphinx to 1.4.8 (closes #645)
can be reverted when https://github.com/snide/sphinx_rtd_theme/pull/346 is
released
2017-01-26 00:51:26 +01:00
Robert Jördens 591268a193 doc: use napoleon (for pdq2) 2017-01-25 23:25:01 +01:00
Robert Jördens 37fc7d58eb doc: remove non-existent modules 2017-01-25 23:23:01 +01:00
Robert Jördens d1be2f1a7d doc: fix table 2017-01-25 23:22:26 +01:00
whitequark 0b67396630 test: convert test_pulse_rate_dds to use mu.
Before this commit, this test was actually measuring soft-FP
performance.
2017-01-25 11:26:30 +00:00
whitequark 57f54dbd12 llvm_ir_generator: recognize inline and forceinline flags. 2017-01-25 10:25:00 +00:00
whitequark 7b6de36d1d firmware: cap loglevel at DEBUG to increase RPC throughput ~3x. 2017-01-25 06:50:56 +00:00
whitequark 3c177c6d71 firmware: update smoltcp, to fix analyzer dump extraction. 2017-01-25 06:36:26 +00:00
whitequark 6721c1e82f firmware: update smoltcp. 2017-01-25 04:08:06 +00:00
whitequark 82cd9e27f7 ksupport: fix I2C function signatures. 2017-01-25 02:11:32 +00:00
whitequark 58a0e4c97f Fix 2de3770. 2017-01-25 01:24:03 +00:00
whitequark de17908b38 Revert "Globally update UART baudrate to 921600."
This reverts commit b29e2d5bfe.

This broke flterm firmware upload, which was the entire point
of the whole exercise.
2017-01-25 00:31:28 +00:00
whitequark 6414e40deb firmware: fix race condition between TCP listen and accept. 2017-01-25 00:17:46 +00:00
whitequark 2de3770c06 firmware: rewrite cache flushing code in Rust. 2017-01-24 23:07:28 +00:00
whitequark 209be73204 firmware: simplify ksupport build script. 2017-01-24 23:07:28 +00:00
whitequark b29e2d5bfe Globally update UART baudrate to 921600. 2017-01-24 22:25:58 +00:00
whitequark e5085c063f doc: test mode was removed, clean up. 2017-01-24 22:25:21 +00:00
whitequark 3633671656 firmware: factor out console and logging from runtime/satman. 2017-01-24 21:58:58 +00:00
whitequark 5604d9bb55 firmware: factor out build scripts from runtime/satman. 2017-01-24 21:15:41 +00:00
whitequark 4d05c70dfa firmware: update smoltcp. 2017-01-23 22:37:33 +00:00
whitequark 15ba6f36ba runtime: reduce the amount of noise during build. 2017-01-23 13:59:34 +00:00
whitequark 527b1e986c firmware: integrate smoltcp instead of lwip. 2017-01-23 13:59:34 +00:00
whitequark 0253e0a89d firmware: remove false dependency from runtime to ksupport.
This significantly speeds up no-change builds.
2017-01-23 13:57:08 +00:00
whitequark 971e4c3026 firmware: increase post-boot UART speed to 921600. 2017-01-23 13:57:08 +00:00
whitequark 13a544e13f artiq_devtool: add boot+log action; avoid forwarder crashes. 2017-01-23 13:57:08 +00:00
Sebastien Bourdeauducq 28a41a2f60 gateware: fix aeb1ba847 2017-01-18 17:11:02 -06:00
Sebastien Bourdeauducq 5c0d402ef3 firmware: runtime.ld formatting 2017-01-18 17:09:49 -06:00
Sebastien Bourdeauducq 2a7a8f91ca gateware: fix import 2017-01-18 16:51:30 -06:00
Sebastien Bourdeauducq ce31ffddb0 firmware: add satellite manager
The code duplication with the runtime should be cleaned up later.
2017-01-18 16:50:32 -06:00
Sebastien Bourdeauducq 62274a6c0d RELEASE_NOTES: targets.kc705_dds 2017-01-18 15:28:56 -06:00
Sebastien Bourdeauducq b40953800a gateware: soc -> amp.soc 2017-01-18 15:28:14 -06:00
Sebastien Bourdeauducq aeb1ba8471 gateware: use default MiSoC timer 2017-01-18 15:22:33 -06:00
Sebastien Bourdeauducq b4f3be7e1b doc: fix table formatting problem, add 'string constant' as supported compiler type 2017-01-16 13:58:09 -06:00
Sebastien Bourdeauducq 043780d603 drtio: fix DRTIOSatellite invokation in test 2017-01-15 17:30:02 -06:00
Sebastien Bourdeauducq b8d89d56b1 drtio: add GenericRXSynchronizer 2017-01-15 13:44:43 -06:00
Sebastien Bourdeauducq d3dfbdfa8c typo 2017-01-13 09:29:55 -06:00
Sebastien Bourdeauducq 0edffb54c2 drtio: fix packet truncation detection in RTPacketSatellite 2017-01-13 09:29:22 -06:00
Joe Britton 93a71b9f77 phaser: clarify J1 termination; scope configuration
* spacing, spelling, wording

Signed-off-by: Robert Jordens <rj@m-labs.hk>
2017-01-13 13:11:48 +01:00
Sebastien Bourdeauducq 6805feb494 drtio: report truncated packets 2017-01-12 23:44:45 -06:00
Robert Jördens 394ffd827e phaser/demo_2tone: add ttl and led pulse 2017-01-11 21:45:34 +01:00
Sebastien Bourdeauducq 7c699e2f80 drtio: add FIFO space request count debug API 2017-01-11 13:48:14 -06:00
Sebastien Bourdeauducq c25186fae1 drtio: print packet error descriptions in log 2017-01-10 18:03:01 -06:00
Sebastien Bourdeauducq 7af152ed22 firmware: pass spawner around instead of scheduler 2017-01-10 16:15:39 -06:00
Sebastien Bourdeauducq d3d23d0d3b drtio: report get FIFO space timeouts to log 2017-01-10 16:12:46 -06:00
Sebastien Bourdeauducq 98598df78e rtio: keep retrying on get FIFO space timeout 2017-01-10 16:12:32 -06:00
Sebastien Bourdeauducq e624f45369 drtio: remove FIFO empty local detection optimization
It optimizes a marginal case, it is difficult to get right
(need to know the size of the FIFO for each channel), and
it adds complexity and potential bug sources.
2017-01-10 14:31:46 -06:00
Sebastien Bourdeauducq f75fffcf96 drtio: fix satellite RX data corruption 2017-01-10 14:29:30 -06:00
Sebastien Bourdeauducq fdfaa377db drtio: add debug syscalls 2017-01-08 15:06:14 -06:00
Sebastien Bourdeauducq 1b49affd18 typo 2017-01-08 13:04:10 -06:00
Sebastien Bourdeauducq 780d6d152c worker: fix handling of archive parameter during dataset get in examine 2017-01-07 16:20:17 +01:00
Sebastien Bourdeauducq c2bddd62e1 doc: fix llvmlite installation instructions 2017-01-05 19:10:12 +01:00
Sebastien Bourdeauducq fe53bab953 targets: kc705 -> kc705_dds 2017-01-05 18:40:56 +01:00
Sebastien Bourdeauducq 8be9a827ba test: move dsp tests into their own folder 2017-01-05 18:25:38 +01:00
Sebastien Bourdeauducq 4f97d00e79 firmware: make i2c busno u8 2017-01-05 14:54:48 +01:00
Sebastien Bourdeauducq 13c45c8766 firmware: add si5324 programming functions 2017-01-05 14:50:00 +01:00
Sebastien Bourdeauducq 6c685205ce firmware: support i2c restart 2017-01-05 14:49:24 +01:00
Sebastien Bourdeauducq 082fdaf450 move i2c to libboard, do bit-banging on comms CPU 2017-01-04 21:04:38 +01:00
Sebastien Bourdeauducq 3dd9d54b22 firmware: fix compilation warning without moninj/analyzer 2017-01-04 21:04:08 +01:00
Sebastien Bourdeauducq 86f6b391b7 ad9xxx -> ad9_dds 2017-01-04 11:34:52 +01:00
Sebastien Bourdeauducq 52fda27cb5 update copyright year 2017-01-04 11:29:10 +01:00
Sebastien Bourdeauducq c08fc8aae9 firmware: support moninj without DDS. Closes #650 2017-01-04 11:26:02 +01:00
Sebastien Bourdeauducq 455250b3f9 remove DDS_AD9914 and DDS_ONEHOT_SEL 2017-01-03 22:04:25 +01:00
whitequark c2ba718efa firmware: remove unnecessary --cfg injection. 2017-01-03 20:56:56 +00:00
Sebastien Bourdeauducq 9b4c1ddc8e libboard: use --cfg 2017-01-03 21:39:40 +01:00
Sebastien Bourdeauducq fbf5a4d4a2 Merge branch 'phaser2-rust-init' 2017-01-03 21:31:21 +01:00
Sebastien Bourdeauducq 318dbb699b fix phaser device_db SAWG channel numbers 2017-01-03 21:22:16 +01:00
whitequark c2d86c4f67 firmware: apply build flags globally, move --cfg handling to build.rs. 2017-01-03 20:12:56 +00:00
Sebastien Bourdeauducq 8e9be41c73 reset core device in phaser examples 2017-01-03 20:05:22 +01:00
Sebastien Bourdeauducq d29ec22497 remove stale phaser startup kernel 2017-01-03 20:03:55 +01:00
Robert Jördens 9a80b8d533 spi: fix xfers with full data_width (closes #615)
misoc 15000af43611bbe8be13cb2b016e408f043202cd
2017-01-03 19:51:14 +01:00
Sebastien Bourdeauducq 7ff77bceac move AD9616 and AD9154 initialization to firmware 2017-01-03 16:11:38 +01:00
Sebastien Bourdeauducq 6b7e6a53f7 firmware: ad9154 timeouts and logging 2017-01-03 15:19:51 +01:00
Sebastien Bourdeauducq 417708af90 phaser: add note about DDS defines (#650) 2017-01-02 22:15:21 +01:00
Sebastien Bourdeauducq eef3f50016 firmware: fix compilation problems in ad9154 and ad9516 2017-01-02 22:14:20 +01:00
Sebastien Bourdeauducq 26e7f68b5d firmware: move clock to libboard 2017-01-01 18:23:27 +01:00
Sebastien Bourdeauducq bb056c1d2c firmware: load *_reg correctly 2017-01-01 18:21:12 +01:00
Sebastien Bourdeauducq a3041fb23f manual: fix Rust installation instructions 2017-01-01 16:56:01 +01:00
whitequark 74f46cb965 firmware: fix merge screwup. 2016-12-31 14:03:39 +00:00
whitequark 58a95c1f40 firmware: libboard: extract irq.rs, csr.rs. 2016-12-31 14:00:43 +00:00
whitequark 3c01a1c93f Update .gitignore. 2016-12-31 13:58:09 +00:00
Sebastien Bourdeauducq 6c1fc2987a libbsp: add ad9154 and ad9516 init code (untested) 2016-12-31 14:48:43 +01:00
Sebastien Bourdeauducq 62596a733d libbsp: add ad9154 and ad9516 register maps 2016-12-31 14:48:43 +01:00
Sebastien Bourdeauducq fb35336389 typo 2016-12-31 14:48:43 +01:00
whitequark 4bb7132848 firmware: prune stabilized and unused features. 2016-12-31 13:41:32 +00:00
whitequark 4480a1c2ff firmware: libbsp::board → libboard. 2016-12-31 13:41:32 +00:00
whitequark bd33dca203 firmware: extract liballoc_none into its own crate. 2016-12-31 13:41:32 +00:00
Joe Britton 2dd72fb94c work around firmware bug in KA3005P that impacts get_i() 2016-12-30 12:19:19 +01:00
whitequark 010ce019b3 firmware: remove spurious build-dependency on winapi. 2016-12-29 13:06:40 +00:00
whitequark aed91292e2 firmware: remove cargo profiles.
These are specified per-workspace, and anyhow are mostly overridden
by our Makefile, so specify everything in it.
2016-12-29 13:06:40 +00:00
whitequark 9df7932169 firmware: add a Cargo workspace.
The Rust editor plugin for Sublime Text tries to invoke cargo,
which disregards our Makefile and places junk all around the source
tree. This calms it down, and now it only does that where our
.gitignore already handles it.
2016-12-26 17:20:29 +00:00
whitequark c45a170bb4 firmware: update for Rust 1.16.0. 2016-12-26 17:20:29 +00:00
Robert Jördens f5f662200b fir: streamline, optimize DSP extraction, left-align inputs 2016-12-20 21:39:51 +01:00
Robert Jördens cfb66117af fir: size hint for pre-adder 2016-12-20 17:58:06 +01:00
Robert Jördens f310274e39 fir: cleanup halfgen4 2016-12-20 17:58:06 +01:00
whitequark 5f3033b518 firmware: remove max_level_debug.
Tracing to the core log isn't particularly slow, and is handy
when debugging.
2016-12-19 13:24:29 +00:00
whitequark 739da9f1b3 runtime: print trace level log messages to UART during startup.
There's no way to retrieve them otherwise if the startup kernel
hangs.

This commit was mistakenly removed in 88ad054.
2016-12-19 13:21:21 +00:00
whitequark b9588ddf03 firmware: don't crash on artiq_compile'd kernels (fixes #641). 2016-12-19 13:01:18 +00:00
Sebastien Bourdeauducq 68b2373b9a korad_ka3005p: fix simulation mode 2016-12-19 09:49:44 +01:00
Sebastien Bourdeauducq 161025e7df korad_ka3005p: use ProactorEventLoop on windows 2016-12-19 09:33:20 +01:00
Sebastien Bourdeauducq d55f2bda86 korad_ka3005p: cleanup 2016-12-19 09:32:21 +01:00
jboulder baac555f96 add device for Korad KA3005P programmable DC power supply 2016-12-19 09:31:21 +01:00
Sebastien Bourdeauducq db5957a7e7 firmware: use bsp crate in ad9154 2016-12-17 11:43:29 +08:00
Sebastien Bourdeauducq 9a564e07c0 firmware: make libbsp a crate 2016-12-16 21:28:25 +08:00
Sebastien Bourdeauducq c99388f80f firmware: use M-Labs as author in Cargo.toml files 2016-12-16 20:14:11 +08:00
Sebastien Bourdeauducq 9967dfc5ca runtime: reorganize to support DRTIO satellite firmware 2016-12-16 19:11:19 +08:00
Sebastien Bourdeauducq 6b998581cc rtio: use same reset for counter_rtio whatever the interface delay is 2016-12-15 09:28:13 +08:00
Robert Jördens 15b48be6e4 test/sawg: adapt to new latency spec 2016-12-14 19:43:30 +01:00
Robert Jördens 115ea67860 fir: automatically use transposed topology 2016-12-14 19:16:07 +01:00
Robert Jördens a451b675c9 Revert "fir: different adder layout"
This reverts commit 6f50e77b409c293c1905f28e69d79403a0803866.
2016-12-14 19:16:07 +01:00
Robert Jördens 93076b8efa fir: different adder layout 2016-12-14 19:16:07 +01:00
Robert Jördens 61abd994e9 Revert "fir: force dsp48"
This reverts commit 0ad433832d1b6dcd803ffa086ae73b2ee0568326.
2016-12-14 19:16:07 +01:00
Robert Jördens 641d109786 fir: force dsp48 2016-12-14 19:16:07 +01:00
Robert Jördens 8381db279f sawg: wire up all HBF outputs, latency compensation in phys, simplify 2016-12-14 19:16:07 +01:00
Robert Jördens 6cdb96c5e0 rtio: add support for latency compensation in phy
* if multiple RTIO channels influence the same data stream and physical
output channel (see SAWG) differential latency needs to be compensated
* this is a NOP for phys with zero delay (default)
* if delay==1, it adds one timestamp-wide register
* if delay >1, it adds one adder and one register
* latency compensation using (~10-50 deep) delay lines is about as
expensive as a single adder+register but very tedious to implement
2016-12-14 19:16:07 +01:00
Robert Jördens 7be27d7116 fir: add upsample transfer function test 2016-12-14 19:16:07 +01:00
Robert Jördens 4c27029be0 sawg: fix limit regs 2016-12-14 19:16:07 +01:00
Robert Jördens 708c25b83a phaser: don't init rtio in startup_kernel 2016-12-14 19:16:07 +01:00
Sebastien Bourdeauducq e9592105ce drtio: fix aux controller clock domain mistakes 2016-12-14 10:16:45 +08:00
Sebastien Bourdeauducq 527757b471 kc705_drtio: use ad9154_fmc_ebz 2016-12-13 14:30:26 +08:00
Sebastien Bourdeauducq 3b5abae935 drtio: fix clock domain conflict 2016-12-13 14:19:49 +08:00
Robert Jördens 03d13d3811 phaser: dma/drtio changes 2016-12-12 17:46:36 +01:00
Robert Jördens c63fa46430 Merge branch 'phaser2'
* phaser2: (157 commits)
  sawg/hbf: tweak pipeline for timing
  fir: register multiplier output
  conda/phaser: build-depend on numpy
  sawg: reduce coefficient width
  sawg: fix latency
  test/fir: needs mpl. don't run by default
  test/sawg: patch spline
  sawg: use ParallelHBFCascade to AA [WIP]
  fir: add ParallelHBFCascade
  fir: add ParallelFIR and test
  gateware/dsp: add FIR and test
  README_PHASER: update
  sawg: documentation
  sawg: extract spline
  sawg: document
  sawg: demo_2tone
  sawg: round to int64
  gateware/phaser -> gateware/ad9154_fmc_ebz
  phaser: fix typo
  sawg: merge set/set64
  ...
2016-12-12 17:31:39 +01:00
Sebastien Bourdeauducq 4b61020b27 drtio: reset more local state 2016-12-12 18:48:10 +08:00
Sebastien Bourdeauducq d99e64effd drtio: clear any stale FIFO space reply 2016-12-12 18:02:56 +08:00
Sebastien Bourdeauducq 4c59c0fecf Revert "drtio: order resets wrt writes"
This reverts commit 9a048c2b3a.
2016-12-12 17:49:07 +08:00
Sebastien Bourdeauducq 6a60afcba0 runtime: clear all DRTIO FIFOs first, reset remote PHYs on link init 2016-12-12 17:48:25 +08:00
Sebastien Bourdeauducq 8f747fa209 drtio: clear underflow and sequence error on reset 2016-12-12 17:39:14 +08:00
Sebastien Bourdeauducq 7196bc21c1 rtio: simplify error reset logic
Channel is always selected when reset is issued.
2016-12-12 17:35:10 +08:00
Sebastien Bourdeauducq 1c74249638 runtime: reset local DRTIO state 2016-12-12 17:30:41 +08:00
Sebastien Bourdeauducq 9a048c2b3a drtio: order resets wrt writes 2016-12-12 17:18:07 +08:00
Sebastien Bourdeauducq ac792ec52b RELEASE_NOTES: 2.1 2016-12-12 13:12:18 +08:00
Sebastien Bourdeauducq cbc49ea91d set asyncio loop earlier in controllers (#627) 2016-12-12 11:38:02 +08:00
Sebastien Bourdeauducq 3743633b04 Revert "pc_rpc: use ProactorEventLoop on Windows (#627)"
This reverts commit 7d4297b9bb.
2016-12-12 11:33:56 +08:00
Sebastien Bourdeauducq 09fb4869f3 runtime: centralize (D)RTIO management 2016-12-09 19:24:00 +08:00
Sebastien Bourdeauducq 0a9f69a3ed kc705_drtio_master: add missing rtio_core CSRs 2016-12-09 19:23:36 +08:00
Sebastien Bourdeauducq 4422b6902a runtime: silence unused variable warnings 2016-12-09 19:23:06 +08:00
Sebastien Bourdeauducq bc36bda94a perform RTIO init on comms CPU side 2016-12-09 14:16:55 +08:00
Sebastien Bourdeauducq 5accb7a0ac manual: add missing quote 2016-12-09 14:16:32 +08:00
Robert Jördens f6071a5812 sawg/hbf: tweak pipeline for timing 2016-12-08 17:00:53 +01:00
Robert Jördens b7a308d33d fir: register multiplier output 2016-12-08 17:00:39 +01:00
Robert Jördens ca636ef28a conda/phaser: build-depend on numpy 2016-12-08 16:23:40 +01:00
Robert Jördens 18e3f58c22 sawg: reduce coefficient width 2016-12-08 16:14:32 +01:00
Robert Jördens 598da09a93 sawg: fix latency 2016-12-08 15:53:35 +01:00
Robert Jördens f4ceace253 test/fir: needs mpl. don't run by default 2016-12-08 15:49:50 +01:00
Robert Jördens efc95043c4 test/sawg: patch spline 2016-12-08 15:49:23 +01:00
Robert Jördens 3eef6229cc sawg: use ParallelHBFCascade to AA [WIP] 2016-12-08 15:32:57 +01:00
Robert Jördens a629eb1665 fir: add ParallelHBFCascade 2016-12-08 15:30:26 +01:00
Robert Jördens d303225249 fir: add ParallelFIR and test 2016-12-08 15:21:04 +01:00
Robert Jördens 7e0f3edca5 gateware/dsp: add FIR and test 2016-12-07 19:14:23 +01:00
Sebastien Bourdeauducq 4c3717932e drtio: link layer debugging CSRs 2016-12-07 23:03:14 +08:00
Robert Jördens d34084be0f README_PHASER: update 2016-12-06 20:22:47 +01:00
Robert Jördens 5efd0fcea5 sawg: documentation 2016-12-06 19:25:40 +01:00
Sebastien Bourdeauducq b311830fc4 kc705: fix drtio_aux address conflict 2016-12-06 18:28:48 +08:00
Sebastien Bourdeauducq 4669d3f02f kc705_drtio_satellite: add MiSoC system, hook up auxiliary controller 2016-12-06 14:56:42 +08:00
Sebastien Bourdeauducq f4b7d39a69 kc705_drtio_master: hook up auxiliary controller 2016-12-06 14:56:15 +08:00
Sebastien Bourdeauducq f3c50a37ca rtio: always read full DMA sequence 2016-12-06 01:05:47 +08:00
Sebastien Bourdeauducq c413d95b49 rtio: fix DMA get_csrs 2016-12-05 18:12:09 +08:00
Sebastien Bourdeauducq eb8d630148 rtio: test DMA RTIO wait state 2016-12-05 18:01:48 +08:00
Sebastien Bourdeauducq b677c69faf rtio: fix handling of o_status in DMA 2016-12-05 18:01:48 +08:00
Sebastien Bourdeauducq 75ea13748a rtio: fix DMA data MSB and stop signaling, self-checking unittest 2016-12-05 18:01:48 +08:00
Sebastien Bourdeauducq 43a5455058 rtio: DMA unittest WIP 2016-12-05 18:01:48 +08:00
Sebastien Bourdeauducq a5834765d0 rtio: more DMA fixes, better stopping mechanism 2016-12-05 18:01:48 +08:00
Sebastien Bourdeauducq 30bce5ad35 rtio: DMA fixes 2016-12-05 18:01:48 +08:00
Sebastien Bourdeauducq 74fe5c3ef0 test: make gateware simulations discoverable 2016-12-05 18:01:48 +08:00
whitequark 668928a16c runtime: fix a lifetime issue in lwip::Pbuf.
This would have allowed a use-after-move (or -free) to typecheck.
2016-12-05 05:24:27 +00:00
whitequark f68e4ae519 compiler: rein in overzealous cast monomorphization. 2016-12-05 05:08:57 +00:00
whitequark 218720cfa7 Revert "compiler: rein in overzealous cast monomorphization."
This reverts commit 4305903dde.

This broke the monomorphizer/round.py test.
2016-12-05 05:04:26 +00:00
whitequark 4305903dde compiler: rein in overzealous cast monomorphization.
This caused failures on e.g. "int32(var64a >> var64b)", where
the type of the argument is already fully known, but was unified
with the result of the cast anyway.
2016-12-05 04:38:25 +00:00
whitequark 4c94873560 runtime: upgrade lwip to release 2.0.0. 2016-12-05 04:35:02 +00:00
whitequark b5a684830d compiler: fix parsing of TList annotations (fixes #632). 2016-12-05 03:18:56 +00:00
Robert Jördens 695eb705b3 sawg: extract spline 2016-12-04 16:52:08 +01:00
Robert Jördens 39becd0b4e sawg: document 2016-12-04 16:50:49 +01:00
Sebastien Bourdeauducq 88ad054ab6 Merge branch 'drtio' 2016-12-03 23:25:17 +08:00
Sebastien Bourdeauducq 5d145ff912 drtio: add false paths between sys and transceiver clocks 2016-12-03 23:03:01 +08:00
Sebastien Bourdeauducq 4b97b9f8ce drtio: add clock constraints 2016-12-03 22:17:29 +08:00
Sebastien Bourdeauducq 35200387b5 manual: precisions about TTL sampling 2016-12-03 11:24:40 +08:00
Sebastien Bourdeauducq 617f6897a4 runtime: more concise message 2016-12-03 11:17:47 +08:00
Robert Jördens d6f6ebf066 sawg: demo_2tone 2016-12-02 18:18:47 +01:00
Robert Jördens a324f4faa1 Merge remote-tracking branch 'm-labs/master' into phaser2
* m-labs/master:
  compiler: monomorphize int64(round(x)) to not lose precision.
2016-12-02 18:11:29 +01:00
Robert Jördens 87bd2072e8 sawg: round to int64 2016-12-02 18:07:01 +01:00
whitequark 68de724554 compiler: monomorphize int64(round(x)) to not lose precision.
This applies to any expression with an indeterminate integer type
cast to int64(), not just round().
2016-12-02 15:02:44 +00:00
Robert Jördens 3d4723353e Merge branch 'master' into phaser2
* master:
  dashboard: mention disable in CCB policies
  runtime: clear async RPC queue when kernel stops (fixes #631).
  artiq_devtool: fix incorrect use of nargs in argparse.
2016-12-02 14:12:04 +01:00
Robert Jördens e747696aaa Merge remote-tracking branch 'm-labs/phaser2' into phaser2
* m-labs/phaser2:
  phaser: fix typo
2016-12-02 14:11:56 +01:00
Robert Jördens cbf1004df3 gateware/phaser -> gateware/ad9154_fmc_ebz 2016-12-02 14:11:41 +01:00
Sebastien Bourdeauducq 6353f6d590 drtio: support different configurations and speeds 2016-12-02 17:22:22 +08:00
Sebastien Bourdeauducq 3cee269afe phaser: fix typo 2016-12-02 11:06:45 +08:00
Robert Jördens 6e9bc7c05d sawg: merge set/set64 2016-12-01 16:45:54 +01:00
Robert Jördens 93a853a0e0 test/sawg: non trivial coarse_ref_period 2016-12-01 16:00:06 +01:00
Sebastien Bourdeauducq 3931d8097b rtio: fix DMA TimeOffset stream.connect 2016-12-01 16:43:46 +08:00
Sebastien Bourdeauducq d4cb1eb998 kc705: integrate DMA 2016-12-01 16:31:00 +08:00
Sebastien Bourdeauducq 7c59688a12 rtio: simple DMA fixes 2016-12-01 16:30:48 +08:00
Sebastien Bourdeauducq 46dbc44c8f rtio: export DMA and CRIInterconnectShared 2016-12-01 16:30:29 +08:00
Sebastien Bourdeauducq 6c97a97d8c rtio: support single-master CRI arbiter 2016-12-01 16:30:11 +08:00
Sebastien Bourdeauducq a318243083 rtio: CRI arbiter (untested) 2016-12-01 15:41:43 +08:00
Sébastien Bourdeauducq 696db32603 dashboard: mention disable in CCB policies 2016-12-01 11:47:04 +08:00
Sebastien Bourdeauducq cd3f68ba76 rtio: DMA core (untested) 2016-11-30 18:43:19 +08:00
Robert Jördens 01057dfb6d test/sawg: check 48 bit frequency 2016-11-30 11:21:25 +01:00
Robert Jördens ea04fb2704 test/sawg: skip 2tone demo test 2016-11-30 11:02:41 +01:00
Robert Jördens ed6d1e73cc sawg: cleanup 2016-11-30 10:52:35 +01:00
Robert Jördens fb58f31c9d Revert "sawg: test w/o discrete_compensate"
This reverts commit b736dd0df7.
2016-11-29 20:56:04 +01:00
Robert Jördens dbf72f5fde sawg: extend unittests 2016-11-29 20:52:51 +01:00
Robert Jördens b736dd0df7 sawg: test w/o discrete_compensate 2016-11-29 20:52:02 +01:00
Robert Jördens d8b5eac856 sawg: style 2016-11-29 20:51:40 +01:00
Robert Jördens 4f813c4977 test/sawg: rtio_output_wide fixes 2016-11-29 18:11:38 +01:00
Robert Jördens d9dd79fb1a sawg: int32 artiq python 2016-11-29 17:36:03 +01:00
Robert Jördens 4a03e3fce0 sawg: rtio_output_wide 2016-11-29 17:23:06 +01:00
Robert Jördens f6fc7f9216 rtio: rtio_output_{list->wide} 2016-11-29 17:22:55 +01:00
Robert Jördens 313aa32779 sawg: artiq-python list scoping 2016-11-29 17:20:02 +01:00
Robert Jördens c53040e1e4 sawg: work around #632 2016-11-29 17:01:39 +01:00
Robert Jördens a3d9e21b8c sawg: artiq-python changes 2016-11-29 16:58:26 +01:00
Robert Jördens 82c651c17a phaser: remove trivial sawg demo 2016-11-29 15:40:23 +01:00
Robert Jördens 27160f5912 phaser: make sysref input only for timing 2016-11-29 15:28:10 +01:00
Robert Jördens 7816078d6b phaser/demo: update 2016-11-29 15:11:18 +01:00
whitequark 5b7e068157 runtime: clear async RPC queue when kernel stops (fixes #631). 2016-11-29 14:00:43 +00:00
Robert Jördens 7657cf1264 phaser: bump misoc/migen 2016-11-29 14:55:15 +01:00
Robert Jördens d5d17aca9e Merge remote-tracking branch 'm-labs/master' into phaser2
* m-labs/master:
  applets: compatibility with older Qt. Closes #629
  doc: update LLVM configure command (fixes #628).
  runtime: match argument signedness between ARTIQ Python and ksupport.
  runtime: refactor rtio_output_list.
  runtime: use correct ABI when accepting ARTIQ lists.
2016-11-29 14:49:30 +01:00
Robert Jördens 23fd225947 sawg: spline knot packing/conversion, unittest 2016-11-29 14:49:07 +01:00
whitequark 852598c491 artiq_devtool: fix incorrect use of nargs in argparse. 2016-11-29 13:09:26 +00:00
Sebastien Bourdeauducq c5b55c1dfe applets: compatibility with older Qt. Closes #629 2016-11-29 10:45:07 +08:00
Sebastien Bourdeauducq cf342eca6e kc705_drtio_master: fix number of fine RTIO timestamp bits 2016-11-29 10:44:27 +08:00
Sebastien Bourdeauducq f4c6d6eb69 kc705_drtio_master: fix number of fine RTIO timestamp bits 2016-11-28 15:18:54 +08:00
Sebastien Bourdeauducq 85f2467e2c rtio: fix RTIO/DRTIO timestamp resolution discrepancy 2016-11-28 15:01:46 +08:00
Sebastien Bourdeauducq 9fdd29ddae drtio: connect KernelInitiator correctly 2016-11-28 14:36:18 +08:00
Sebastien Bourdeauducq 5460202220 drtio: typo 2016-11-28 14:35:21 +08:00
Sebastien Bourdeauducq 4e1b497742 drtio: typo 2016-11-28 14:34:58 +08:00
Sebastien Bourdeauducq c419c422fa drtio: support for local RTIO core 2016-11-28 14:33:26 +08:00
Sebastien Bourdeauducq d37b73fd31 drtio: FIFO timeout is handled in gateware + give remote side more time 2016-11-28 14:33:06 +08:00
Sebastien Bourdeauducq 046b8bfd33 drtio: fix transmit datapath with transceiver width > max packet width 2016-11-27 13:19:12 +08:00
Sebastien Bourdeauducq b2450c7c56 drtio: test large data 2016-11-27 12:57:12 +08:00
Sebastien Bourdeauducq 0903964488 drtio: large data fixes 2016-11-27 02:12:50 +08:00
whitequark 2ec6d43441 doc: update LLVM configure command (fixes #628). 2016-11-26 07:26:06 +00:00
whitequark ea25856d92 runtime: match argument signedness between ARTIQ Python and ksupport.
This is only required when reading the ABI very strictly, but better
be conservative here than spend time debugging silly stuff.
2016-11-26 07:25:22 +00:00
whitequark cf12a888e7 runtime: refactor rtio_output_list. 2016-11-26 07:25:22 +00:00
whitequark 79e70fa465 runtime: use correct ABI when accepting ARTIQ lists. 2016-11-26 07:25:22 +00:00
Sebastien Bourdeauducq d381dd5384 drtio: remove stale signal from test 2016-11-25 18:33:55 +08:00
Sebastien Bourdeauducq 8090abef5d drtio: large data support 2016-11-25 17:04:09 +08:00
Robert Jördens 41779367b5 phaser: adapt conda recipe 2016-11-24 16:04:13 +01:00
Robert Jördens 55e37b41ec phaser: use ttl_simple.Input for sync 2016-11-24 15:55:26 +01:00
Robert Jördens 6fa2a6ebd8 phaser: move ad9154 spi/jesd api to rust 2016-11-24 15:53:14 +01:00
Robert Jördens 8060652913 phaser: use Inout_8X 2016-11-24 15:21:03 +01:00
Robert Jördens 617650f3b2 phaser: extract target 2016-11-24 15:20:51 +01:00
Robert Jördens 1c84d1ee59 Merge branch 'master' into phaser2
* master:
  rtio: support differential ttl
  RELEASE_NOTES: int(a, width=b) removal, use int32/64
  pc_rpc: use ProactorEventLoop on Windows (#627)
2016-11-24 15:05:49 +01:00
Robert Jördens 95c885b580 rtio: support differential ttl 2016-11-24 15:04:12 +01:00
Robert Jördens d0a55e5c9b RELEASE_NOTES: int(a, width=b) removal, use int32/64 2016-11-24 14:32:51 +01:00
Sebastien Bourdeauducq 7d4297b9bb pc_rpc: use ProactorEventLoop on Windows (#627) 2016-11-24 10:19:13 +08:00
Robert Jördens 54235e5743 Merge branch 'master' into phaser2
* master:
  runtime: support rtio data wider than 64 bit
  moninj.rs: force u32 dds_ftws
2016-11-23 21:09:21 +01:00
Sebastien Bourdeauducq 8b736ddbc9 drtio: update test 2016-11-24 00:37:53 +08:00
Sebastien Bourdeauducq 7cd27abaa6 drtio: do not reset remote TSC on reset command 2016-11-24 00:09:53 +08:00
Robert Jördens dab19d23cc runtime: support rtio data wider than 64 bit 2016-11-23 16:40:52 +01:00
Robert Jördens fbf60108a8 moninj.rs: force u32 dds_ftws 2016-11-23 16:39:08 +01:00
Robert Jördens 0d5f962d0c runtime.rs/rtio.rs: style 2016-11-23 23:27:59 +08:00
Robert Jördens eab18d8e34 runtime.rs: wide rtio data 2016-11-23 23:27:46 +08:00
Sebastien Bourdeauducq 2d62a89143 rtio: use large data register 2016-11-23 23:23:27 +08:00
Sebastien Bourdeauducq 4fa5c55015 Merge branch 'master' into drtio 2016-11-23 23:22:34 +08:00
Sebastien Bourdeauducq 07f2d84275 drtio: remote resets 2016-11-23 23:19:31 +08:00
Sebastien Bourdeauducq 9941f3557d rtio: use only CRI commands for rio/rio_phy resets 2016-11-23 23:19:14 +08:00
Robert Jördens e7d588f612 Merge branch 'master' into phaser2
* master:
  runtime.rs/rtio.rs: style
  runtime.rs: wide rtio data
  rtio: auto clear output event data and address
2016-11-23 15:09:09 +01:00
Robert Jördens a964cf24f2 runtime.rs/rtio.rs: style 2016-11-23 15:03:36 +01:00
Robert Jördens 8cce5d2fcd runtime.rs: wide rtio data 2016-11-23 15:03:36 +01:00
Robert Jördens 347609d765 rtio: auto clear output event data and address
This is to support channels where variable length
event data is well-defined through zero-padding.
E.g. in the case of `Spline` zero-padding of events naturally
corresponds to low-order knots.

Use timestamp change as trigger. This assumes that writes to the
timestamp register always precede address and data writes.
It does not break support for ganged writes of the same event
timestamp and data/address to multiple channels or
channel-addresses.
2016-11-23 15:03:36 +01:00
Robert Jördens 32fdacd95a Merge remote-tracking branch 'm-labs/master' into phaser2
* m-labs/master:
  runtime: don't attempt to perform writeback if disabled in kernel.
  runtime: print trace level log messages to UART during startup.
  runtime: support for targets without RTIO log channel
  runtime: support for targets without I2C
  kc705: remove stale DDS definition
  runtime: show a prompt to erase startup/idle kernels.
2016-11-23 14:56:29 +01:00
Robert Jördens fec34d605e runtime.rs/rtio.rs: style 2016-11-23 14:56:20 +01:00
whitequark 4df7941a97 runtime: don't attempt to perform writeback if disabled in kernel.
Otherwise, the startup kernel session hangs.
2016-11-23 13:53:40 +00:00
whitequark cd7527b701 runtime: print trace level log messages to UART during startup.
There's no way to retrieve them otherwise if the startup kernel
hangs.
2016-11-23 13:53:40 +00:00
Sebastien Bourdeauducq d400c81cb2 rtio: remove debug print 2016-11-23 13:37:14 +08:00
Sebastien Bourdeauducq 4e931c7dd2 rtio: fix timestamp shift 2016-11-23 13:36:30 +08:00
Sebastien Bourdeauducq 5a2edef422 drtio: adapt example to new mu/second API 2016-11-23 12:43:17 +08:00
Sebastien Bourdeauducq cd334c0ecf Merge branch 'master' into drtio 2016-11-23 12:40:18 +08:00
Sebastien Bourdeauducq e532261a9b drtio: fix FullMemoryWE usage 2016-11-23 12:25:43 +08:00
Sebastien Bourdeauducq 0443f83d5e runtime: support for targets without RTIO log channel 2016-11-23 10:50:55 +08:00
Sebastien Bourdeauducq cd40d5b107 runtime: support for targets without I2C 2016-11-23 10:50:55 +08:00
Sebastien Bourdeauducq 0c49679984 runtime: support for targets without RTIO log channel 2016-11-23 10:48:26 +08:00
Sebastien Bourdeauducq 3c5a62243d runtime: support for targets without I2C 2016-11-23 10:43:33 +08:00
Sebastien Bourdeauducq ffefdb9269 rtio: fix counter readback 2016-11-23 00:54:47 +08:00
Sebastien Bourdeauducq aa00627c0e rtio: fix CRI CSRs 2016-11-22 22:57:04 +08:00
Sebastien Bourdeauducq fbd83cf9ee kc705: remove stale DDS definition 2016-11-22 22:48:22 +08:00
Sebastien Bourdeauducq 9acc7d135e gateware: common RTIO interface 2016-11-22 22:46:50 +08:00
Sebastien Bourdeauducq 0aaf120ca7 kc705: remove stale DDS definition 2016-11-22 22:46:19 +08:00
whitequark 965fdd35e5 runtime: show a prompt to erase startup/idle kernels. 2016-11-22 14:45:40 +00:00
Robert Jördens 6799bb097a sawg: adapt to int32/int64 change 2016-11-22 11:57:34 +01:00
Sebastien Bourdeauducq 7498c8bba0 Merge branch 'master' into drtio 2016-11-22 16:07:30 +08:00
Sebastien Bourdeauducq 3459793586 Merge branch 'master' into drtio 2016-11-22 15:15:22 +08:00
Robert Jördens 5e900cf42a runtime.rs: wide rtio data 2016-11-21 23:12:16 +01:00
Robert Jördens 4cd2b36995 Merge branch 'phaser' into phaser2
* phaser:
  runtime: replace a (deliberate) memory leak with an interner.
  compiler: disable remarks.
  runtime: rewrite i2c support code in Rust.
  runtime: rewrite rtio support code in Rust.
2016-11-21 23:11:52 +01:00
Robert Jördens feb95bf3cf Merge branch 'master' into phaser
* master:
  runtime: replace a (deliberate) memory leak with an interner.
  compiler: disable remarks.
  runtime: rewrite i2c support code in Rust.
  runtime: rewrite rtio support code in Rust.
2016-11-21 22:26:52 +01:00
whitequark 1d1e821a74 runtime: replace a (deliberate) memory leak with an interner. 2016-11-21 19:47:56 +00:00
whitequark ac997daf95 compiler: disable remarks. 2016-11-21 19:12:11 +00:00
whitequark 18b7ccea4e runtime: rewrite i2c support code in Rust. 2016-11-21 18:25:43 +00:00
whitequark a825584ac0 runtime: rewrite rtio support code in Rust. 2016-11-21 17:13:09 +00:00
Robert Jördens 4160490e0a Merge branch 'phaser' into phaser2
* phaser: (23 commits)
  RELEASE_NOTES: update
  pipistrello: add some inputs
  Remove last vestiges of nist_qc1.
  Fully drop AD9858 and kc705-nist_qc1 support (closes #576).
  coredevice.dds: reimplement fully in ARTIQ Python.
  compiler: unbreak casts to int32/int64.
  analyses.constness: fix false positive on x[...].
  inferencer: significantly improve the op-assignment diagnostic.
  Fix tests.
  Move mu_to_seconds, seconds_to_mu to Core.
  artiq_devtool: don't crash on invalid utf-8.
  artiq_devtool: detect a race condition during connect.
  llvm_ir_generator: handle no-op coercions.
  conda: use development version of migen/misoc
  Revert accidentally committed code.
  Revert "gateware: increase RTIO FIFO sizes for NIST_CLOCK. Closes #623"
  analyses.invariant_detection: implement (#622).
  Fix whitespace.
  coredevice.dds: work around the round(numpy.float64()) snafu.
  coredevice.dds: update from obsolete int(width=) syntax (fixes #621).
  ...
2016-11-21 17:29:46 +01:00
Robert Jördens f7e8961ab0 Merge branch 'master' into phaser
* master: (23 commits)
  RELEASE_NOTES: update
  pipistrello: add some inputs
  Remove last vestiges of nist_qc1.
  Fully drop AD9858 and kc705-nist_qc1 support (closes #576).
  coredevice.dds: reimplement fully in ARTIQ Python.
  compiler: unbreak casts to int32/int64.
  analyses.constness: fix false positive on x[...].
  inferencer: significantly improve the op-assignment diagnostic.
  Fix tests.
  Move mu_to_seconds, seconds_to_mu to Core.
  artiq_devtool: don't crash on invalid utf-8.
  artiq_devtool: detect a race condition during connect.
  llvm_ir_generator: handle no-op coercions.
  conda: use development version of migen/misoc
  Revert accidentally committed code.
  Revert "gateware: increase RTIO FIFO sizes for NIST_CLOCK. Closes #623"
  analyses.invariant_detection: implement (#622).
  Fix whitespace.
  coredevice.dds: work around the round(numpy.float64()) snafu.
  coredevice.dds: update from obsolete int(width=) syntax (fixes #621).
  ...
2016-11-21 17:29:39 +01:00
Robert Jördens ad264ac070 phaser: 300 MHz sample rate clock/dac 2016-11-21 16:58:07 +01:00
Sebastien Bourdeauducq ef971ef8ba RELEASE_NOTES: update 2016-11-21 23:51:39 +08:00
Sebastien Bourdeauducq 93c310dfa5 pipistrello: add some inputs 2016-11-21 23:43:41 +08:00
whitequark 6aa5d9f6c6 Remove last vestiges of nist_qc1. 2016-11-21 15:36:22 +00:00
whitequark 5e8888d5f3 Fully drop AD9858 and kc705-nist_qc1 support (closes #576). 2016-11-21 15:14:17 +00:00
whitequark f4b7666768 coredevice.dds: reimplement fully in ARTIQ Python.
This commit also drops AD9858 support from software.
2016-11-21 15:13:26 +00:00
whitequark 55ea68da7f compiler: unbreak casts to int32/int64. 2016-11-21 14:20:28 +00:00
whitequark 53b7d59b6a analyses.constness: fix false positive on x[...]. 2016-11-21 14:20:26 +00:00
whitequark 35f4449ef2 inferencer: significantly improve the op-assignment diagnostic.
Before this commit, it displayed incorrect output if an error
appeared on 2nd run and beyond, and displayed messages for trying
to do "num32 -= num64" that made very little sense.
2016-11-21 14:20:24 +00:00
Robert Jördens b3e4a1df03 sawg: adapt basic example 2016-11-21 13:17:01 +01:00
Robert Jördens c73b1af7ab coredevice/sawg: missing comma 2016-11-21 13:16:44 +01:00
Robert Jördens b226dbd257 sawg: unittest data format 2016-11-21 12:35:57 +01:00
Robert Jördens 2f838e3512 rtio: fix i_data/o_data csr endianess 2016-11-21 12:15:26 +01:00
Robert Jördens 174c4be218 phaser: false paths sys<->{jesd,phy.tx} 2016-11-21 09:57:33 +01:00
whitequark 3485c83429 Fix tests. 2016-11-21 06:40:47 +00:00
whitequark 009d396740 Move mu_to_seconds, seconds_to_mu to Core. 2016-11-21 05:37:30 +00:00
whitequark 06ea76336d artiq_devtool: don't crash on invalid utf-8. 2016-11-21 05:37:27 +00:00
whitequark b562b0fbc4 artiq_devtool: detect a race condition during connect. 2016-11-21 03:10:41 +00:00
whitequark 7af41bd29c llvm_ir_generator: handle no-op coercions. 2016-11-21 02:25:34 +00:00
Robert Jördens 9221a275cb sawg: kernel support (wip) 2016-11-20 16:39:53 +01:00
Robert Jördens 74e5013fe5 sawg: fix b delay width 2016-11-20 16:39:22 +01:00
Sebastien Bourdeauducq eb18466820 conda: use development version of migen/misoc 2016-11-20 22:56:48 +08:00
whitequark cdb29f9caa Revert accidentally committed code. 2016-11-20 14:32:59 +00:00
Sebastien Bourdeauducq ad1049d59a Revert "gateware: increase RTIO FIFO sizes for NIST_CLOCK. Closes #623"
This reverts commit 4a62e09bd4.
2016-11-20 21:35:07 +08:00
whitequark f5cca6b09e analyses.invariant_detection: implement (#622). 2016-11-20 12:48:26 +00:00
whitequark 30598720f4 Fix whitespace. 2016-11-20 09:50:00 +00:00
whitequark abf2b32b20 coredevice.dds: work around the round(numpy.float64()) snafu. 2016-11-20 09:49:58 +00:00
whitequark d7f4397924 coredevice.dds: update from obsolete int(width=) syntax (fixes #621). 2016-11-20 09:49:39 +00:00
David Leibrandt 4a62e09bd4 gateware: increase RTIO FIFO sizes for NIST_CLOCK. Closes #623 2016-11-20 15:22:32 +08:00
Robert Jördens 12e39a64cf sawg: reduce f0 oscillator width to 32 2016-11-19 17:07:07 +01:00
Robert Jördens 04813ea29b sawg: wir up limiting, saturating addition 2016-11-19 16:12:27 +01:00
Robert Jördens e53d0bcd5b dsp: add limits support to SatAddMixin 2016-11-19 16:12:27 +01:00
Robert Jördens 97a54046e8 rtio: auto clear output event data and address
This is to support channels where variable length
event data is well-defined through zero-padding.
E.g. in the case of `Spline` zero-padding of events naturally
corresponds to low-order knots.

Use timestamp change as trigger. This assumes that writes to the
timestamp register always precede address and data writes.
It does not break support for ganged writes of the same event
timestamp and data/address to multiple channels or
channel-addresses.
2016-11-19 16:12:27 +01:00
Robert Jördens b714137f76 phaser: 150 MHz rtio/jesd clock 2016-11-19 13:16:30 +01:00
Sebastien Bourdeauducq 02adae7397 drtio: fix link shutdown 2016-11-19 11:01:33 +08:00
Sebastien Bourdeauducq abd1b2a94e drtio: wait longer for remote (bruteforce clock aligner can be slow) 2016-11-19 11:01:09 +08:00
Sebastien Bourdeauducq 381e58434f drtio: handle link restarts at transceiver level 2016-11-19 10:46:56 +08:00
Robert Jördens 0ee47e77ae phaser: fix widths 2016-11-18 17:24:11 +01:00
Robert Jördens bcde26f990 Revert "phaser: cap phy data width to 64 temporarily"
This reverts commit 342b9e977e.
2016-11-18 17:08:44 +01:00
Robert Jördens 641f07119f runtime: support rtio data wider than 64 bit 2016-11-18 17:08:33 +01:00
Sebastien Bourdeauducq ba94ed8f4b drtio: check for absence of disparity errors before claiming RX ready 2016-11-19 00:05:59 +08:00
Robert Jördens 342b9e977e phaser: cap phy data width to 64 temporarily 2016-11-18 15:46:59 +01:00
Robert Jördens 7664b226f2 phaser/conda: bump jesd204b 2016-11-18 15:34:03 +01:00
Robert Jördens 14ddcd2e30 Revert "dsp/Delay: reset_less"
for now

This reverts commit 98193d6fa1.
2016-11-18 15:25:42 +01:00
Robert Jördens d678bb3fb6 phaser: update sawg tests 2016-11-18 15:23:56 +01:00
whitequark 2015fe9de0 doc: update installing_from_source for LLVM 3.9 transitionl 2016-11-18 10:35:36 +00:00
Sebastien Bourdeauducq 4d07974a34 drtio: reset link from CPU 2016-11-18 17:45:33 +08:00
Sebastien Bourdeauducq f040e27041 drtio: add timeout on FIFO get space request 2016-11-18 17:44:48 +08:00
whitequark c7844d5223 runtime: use proper format for git commit.
Fixes #620.
2016-11-17 15:20:21 +00:00
Sebastien Bourdeauducq bb047aabe9 drtio: simpler link layer 2016-11-17 22:32:39 +08:00
Robert Jördens 51f23feeac dsp: implement sawg features 2016-11-17 03:20:37 +01:00
Robert Jördens 98193d6fa1 dsp/Delay: reset_less 2016-11-17 02:36:29 +01:00
Robert Jördens 424a1f8f4e dsp: move test tools 2016-11-16 13:39:19 +01:00
Sebastien Bourdeauducq 09363e1da8 drtio: aux controller unittest 2016-11-16 19:45:28 +08:00
Sebastien Bourdeauducq 140bb0ecee drtio: aux controller fixes 2016-11-16 19:44:03 +08:00
Sebastien Bourdeauducq 7fa9a4efc3 drtio: aux controller unittest WIP 2016-11-15 12:02:53 +08:00
Sebastien Bourdeauducq 6c9965b444 drtio: aux controller fixes 2016-11-15 12:02:41 +08:00
Sebastien Bourdeauducq e1394db861 drtio: aux controller minor fixes 2016-11-14 17:26:30 +08:00
Sebastien Bourdeauducq 84bd962ed5 drtio: integrate aux controller 2016-11-14 17:20:47 +08:00
Sebastien Bourdeauducq a4d92716da drtio: fix aux receiver, add aux transmitter 2016-11-14 17:18:54 +08:00
Robert Jördens b9ce2bb1f0 Merge branch 'phaser' into phaser2
* phaser: (127 commits)
  phaser: use misoc cordic
  phaser: fix DDS dummy cfg
  runtime: disable the Nagle algorithm entirely.
  runtime: buffer RPC send packets.
  runtime: don't print debug messages to the UART.
  runtime: print microsecond timestamps in debug messages.
  artiq_devtool: abort if build failed.
  conda: bump llvmlite-artiq dep.
  conda: bump llvmlite-artiq dep.
  llvm_ir_generator: use !{→unconditionally.}invariant.load metadata.
  artiq_devtool: more robust port forwarding.
  setup: remove paramiko dependency (optional and developer-only)
  artiq_devtool: implement.
  artiq_compile: actually disable attribute writeback.
  conda: use pythonparser 1.0.
  conda: tighten pythonparser dependency (fixes #600).
  doc: clarify kernel_invariant doc (fixes #609).
  compiler: Emit all-kernel_invariant objects as LLVM constants
  conda: update for LLVM 3.9.
  add has_dds, use config flags
  ...
2016-11-13 17:30:37 +01:00
Robert Jördens 70a70320bd phaser: use misoc cordic 2016-11-13 17:29:38 +01:00
Robert Jördens 2e482505c6 phaser: fix DDS dummy cfg 2016-11-13 17:08:59 +01:00
Sebastien Bourdeauducq f2f131e0fb drtio: add aux receiver (untested) 2016-11-14 00:04:53 +08:00
Robert Jördens aedb6747f2 Merge branch 'master' into phaser
* master: (47 commits)
  runtime: disable the Nagle algorithm entirely.
  runtime: buffer RPC send packets.
  runtime: don't print debug messages to the UART.
  runtime: print microsecond timestamps in debug messages.
  artiq_devtool: abort if build failed.
  conda: bump llvmlite-artiq dep.
  conda: bump llvmlite-artiq dep.
  llvm_ir_generator: use !{→unconditionally.}invariant.load metadata.
  artiq_devtool: more robust port forwarding.
  setup: remove paramiko dependency (optional and developer-only)
  artiq_devtool: implement.
  artiq_compile: actually disable attribute writeback.
  conda: use pythonparser 1.0.
  conda: tighten pythonparser dependency (fixes #600).
  doc: clarify kernel_invariant doc (fixes #609).
  compiler: Emit all-kernel_invariant objects as LLVM constants
  conda: update for LLVM 3.9.
  add has_dds, use config flags
  Revert "Revert "Revert "Revert "Update for LLVM 3.9.""""
  Revert "Revert "Revert "Update for LLVM 3.9."""
  ...
2016-11-13 16:54:28 +01:00
whitequark 18c394976e runtime: disable the Nagle algorithm entirely.
See also commit feed91d; that commit fixed the test_rpc_timing test,
but caused frequent hangs elsewhere, which were also caused by buggy
Nagle implementation. Just disable this entirely, as with our
explicit buffering it provides no benefit anyway.
2016-11-13 00:33:24 +00:00
whitequark feed91d8b2 runtime: buffer RPC send packets.
This brings mean RPC time from ~45ms to ~2ms.

The cause of the slowness without buffering is, primarily, that lwip
is severely pessimized by small writes, whether with Nagle on or off.
(In fact, disabling Nagle makes it function *better* on many small
writes, which begs the question of what's the point of having Nagle
there in the first place.) In practical terms, the slowness appears
only when writing a 4-byte buffer (the synchronization segment);
writing buffers of other sizes does not trigger the problem.

This all is extremely confusing and the fix is partly palliative,
but since it seems to work reliably and we're migrating off lwip
I think it is unwise to spend any more time debugging this.
2016-11-12 23:06:33 +00:00
whitequark 3ce1826891 runtime: don't print debug messages to the UART.
It takes ~4ms to print an empty log line because of how slow
the UART is. This makes the log timestamps useless for debugging
performance problems.

After this commit, it takes ~75us to print an empty log line instead,
which pessimizes test_rpc_timing by less than 2ms with tracing
enabled.
2016-11-12 20:26:32 +00:00
whitequark acc5e53b32 runtime: print microsecond timestamps in debug messages. 2016-11-12 20:26:32 +00:00
whitequark dca3fb5c96 artiq_devtool: abort if build failed. 2016-11-12 20:26:32 +00:00
whitequark 7c2b1155ef conda: bump llvmlite-artiq dep. 2016-11-12 13:58:00 +00:00
whitequark 5eb940deb7 conda: bump llvmlite-artiq dep. 2016-11-12 04:09:34 +00:00
whitequark d3ee858d16 llvm_ir_generator: use !{→unconditionally.}invariant.load metadata.
This helps LICM, among other things.
2016-11-12 04:08:58 +00:00
whitequark 8b6418c604 artiq_devtool: more robust port forwarding. 2016-11-11 15:22:07 +00:00
Sebastien Bourdeauducq fbc2420443 setup: remove paramiko dependency (optional and developer-only) 2016-11-11 11:05:37 +08:00
whitequark 3b6cbb1f06 artiq_devtool: implement. 2016-11-10 20:25:15 +00:00
whitequark 0e76cbc414 artiq_compile: actually disable attribute writeback.
I wrote both halves of this condition but forgot to hook
them together.

Fixes #586.
2016-11-10 01:04:36 +00:00
whitequark 67e743d74a conda: use pythonparser 1.0. 2016-11-09 15:19:27 +00:00
whitequark 71f1d38860 conda: tighten pythonparser dependency (fixes #600). 2016-11-09 15:10:53 +00:00
whitequark eee8d05398 doc: clarify kernel_invariant doc (fixes #609). 2016-11-09 14:59:57 +00:00
David Nadlinger bfbdba9205 compiler: Emit all-kernel_invariant objects as LLVM constants
This enables constant propagation optimisations, as verified by
the included test case. This is only a first stop-gap measure, though;
we should support optimisation based on kernel invariants on a more
fine-grained level.
2016-11-09 14:50:48 +00:00
Sebastien Bourdeauducq 8a48d6d66e drtio: fix typo 2016-11-09 22:15:42 +08:00
Sebastien Bourdeauducq 863934c4fa drtio: more reliable link layer init 2016-11-09 22:03:47 +08:00
Sebastien Bourdeauducq c92ccd3b5b drtio: add pulse rate example 2016-11-09 15:29:15 +08:00
Sebastien Bourdeauducq 60e748eabe drtio: better LED demo 2016-11-09 14:53:45 +08:00
Sebastien Bourdeauducq d547c5d922 drtio: fix example ref_period 2016-11-09 14:44:01 +08:00
whitequark 124b257e05 conda: update for LLVM 3.9. 2016-11-08 23:24:03 +00:00
Sebastien Bourdeauducq 99ad9b5917 add has_dds, use config flags 2016-11-08 23:33:03 +08:00
whitequark ec8fe6f8bd Revert "Revert "Revert "Revert "Update for LLVM 3.9.""""
This reverts commit 7b81ed1d18.
2016-11-08 14:22:47 +00:00
whitequark 7b81ed1d18 Revert "Revert "Revert "Update for LLVM 3.9."""
This reverts commit 0d7688017b.
2016-11-08 12:58:20 +00:00
whitequark a8fd697d41 runtime: unbreak 453e8b7.
Running
  rustc --cfg 'foo="1"'
does not result in a statement of the form
  do_thing()
to be compilex in.
2016-11-08 12:57:06 +00:00
whitequark e0297039c9 artiq_run: fix bitrot in .ll/.bc runners. 2016-11-08 12:08:20 +00:00
whitequark 0d7688017b Revert "Revert "Update for LLVM 3.9.""
This reverts commit 5f5975844a.
2016-11-08 11:59:16 +00:00
whitequark 798a5f70df Revert "runtime: remove some redundant libm functions copied inline."
This reverts commit fee75bd50f.

LLVM does not have lround as a libcall and this inhibits LICM.
2016-11-08 11:54:17 +00:00
Sebastien Bourdeauducq 95acc9b9d4 drtio: allow specifying 7series RXSynchronizer initial phase 2016-11-08 16:52:40 +08:00
Sebastien Bourdeauducq bcb5053fb6 drtio: fix master TSC KCSR readout 2016-11-08 16:40:50 +08:00
Sebastien Bourdeauducq 651d538217 Merge branch 'master' into drtio 2016-11-08 16:11:18 +08:00
Sebastien Bourdeauducq 8c86920364 drtio: add examples 2016-11-08 16:11:10 +08:00
David Nadlinger 6e77f65d50 compiler: Clarify recv_rpc value names and documentation [nfc]
Previously, the phi emitted for the pointer parameter to recv_rpc was –
rather confusingly – called "size", and the pseudo-code in the comment
had bit-rotted.

Signed-off-by: David Nadlinger <code@klickverbot.at>
2016-11-07 14:38:21 +00:00
Sebastien Bourdeauducq 78f18a12eb runtime: basic DRTIO init code 2016-11-07 19:34:34 +08:00
Sebastien Bourdeauducq 453e8b7eb3 runtime: support configurations without moninj, log or dds 2016-11-06 23:53:10 +08:00
Sebastien Bourdeauducq 266ae292d9 runtime: support configurations without moninj, log or dds 2016-11-06 23:52:27 +08:00
Sebastien Bourdeauducq c4cd269afc Merge branch 'master' into drtio 2016-11-06 00:13:32 +08:00
Robert Jördens d158c69be0 phaser: fix frequency comment 2016-11-05 16:54:23 +01:00
Sebastien Bourdeauducq 47b9868c68 kc705_drtio_master: pretend drtio is rtio 2016-11-05 23:48:29 +08:00
Sebastien Bourdeauducq de065b7578 kc705_drtio_satellite: set output dir 2016-11-05 23:48:15 +08:00
David Nadlinger 7dcc987dd7 compiler: Fix break/continue targets in loop else blocks
Previously, they would still target the respective labels in the
just-exited loop.

Signed-off-by: David Nadlinger <code@klickverbot.at>
2016-11-05 02:35:01 +00:00
Sebastien Bourdeauducq de47123737 drtio: connect RST and LOCKED on 7series RXSynchronizer MMCM 2016-11-05 00:24:49 +08:00
Sebastien Bourdeauducq 5019b03f10 drtio: add echo and packet count test 2016-11-04 22:24:35 +08:00
Sebastien Bourdeauducq df7294792c drtio: break some RT features into manager, add echo request CSR 2016-11-04 19:38:24 +08:00
Sebastien Bourdeauducq 1145a193dd drtio: fix ack of echo and set_time requests 2016-11-04 18:36:43 +08:00
Sebastien Bourdeauducq 3da1cce783 drtio: add packet counters 2016-11-04 17:53:42 +08:00
whitequark f102f2d4e6 manual: fix rustc invocation. 2016-11-04 09:11:45 +00:00
Sebastien Bourdeauducq 8ec73cb9ec dashboard: pack moninj widgets (#603) 2016-11-04 16:20:46 +08:00
Sebastien Bourdeauducq 747da3da15 drtio: differentiate local and remote unknown packet type errors 2016-11-04 15:17:19 +08:00
Sebastien Bourdeauducq f76aa249ce drtio: squelch 7series RXSynchronizer outputs when MMCM is unlocked 2016-11-04 15:16:48 +08:00
Sebastien Bourdeauducq 9d58b4516c manual: Vivado is now default 2016-11-04 11:54:04 +08:00
whitequark 208f3f8568 manual: fix Rust installation instructions. 2016-11-04 03:35:59 +00:00
Sebastien Bourdeauducq 77bc247744 manual: add missing cd 2016-11-04 00:04:26 +08:00
Sebastien Bourdeauducq a252b88a36 manual: fix binutils patch download URL 2016-11-03 23:56:13 +08:00
Sebastien Bourdeauducq 6a75837261 drtio: fix link_layer remote RX ready detection 2016-11-03 20:15:04 +08:00
Sebastien Bourdeauducq 1d027ffa95 drtio: fix gtx_7series comma alignment 2016-11-03 20:14:11 +08:00
Sebastien Bourdeauducq a4ba34bb2c drtio: cleanup test_full_stack 2016-11-03 20:13:31 +08:00
Sebastien Bourdeauducq ba58a8affd drtio/gtx_7series: paranoid reset deglitching 2016-11-02 18:30:22 +08:00
whitequark 00100148f1 Si5324: actually write value of N32 into registers. 2016-11-02 07:09:04 +00:00
Sebastien Bourdeauducq bee9774bd5 drtio: add link layer status CSR 2016-11-02 13:09:13 +08:00
Sebastien Bourdeauducq 1ed3278783 remove stale TODO 2016-11-02 10:53:54 +08:00
whitequark a6ae254796 Si5324: update to free run from XA/XB, with CKIN1 having priority. 2016-11-01 16:01:24 +00:00
whitequark b30734a105 runtime: fix a race condition with async RPCs.
session.rs has code like:

    while !rpc_queue::empty() {
        try!(process_kern_queued_rpc(stream, &mut session))
    }

    // A

    if mailbox::receive() != 0 {
        try!(process_kern_message(waiter, Some(stream), &mut session));
    }

If both an async and a mailbox RPC (async or large sync) are posted
at point A then they will be processed out of order.
This commit fixes the issue by flushing the async RPC queue before
posting any RPC to the mailbox.
2016-11-01 13:22:22 +00:00
whitequark 6fcd57a41a runtime: fix remaining async RPC bugs. 2016-11-01 10:33:57 +00:00
whitequark 2095d01b84 runtime: dirty hacks to remove allocations in ksupport. 2016-11-01 08:55:49 +00:00
whitequark c1e6d4b67c runtime: fix multiple async RPC bugs. 2016-11-01 06:51:44 +00:00
whitequark 636d4efe81 gateware: rewrite mailbox to use bits_for. 2016-11-01 06:28:43 +00:00
Sebastien Bourdeauducq 43cd970100 make set_dataset and mutate_dataset async RPCs 2016-11-01 11:11:41 +08:00
whitequark 18ae8d54a3 gateware: fix mailbox. 2016-11-01 02:33:00 +00:00
whitequark 898a716b91 runtime: work around mor1kx ignoring low bits of reset address.
Fixes #599.
2016-10-31 18:13:15 +00:00
Sebastien Bourdeauducq 0c1a76d668 unify rtio/drtio kernel interface 2016-11-01 00:30:16 +08:00
whitequark 617e345d16 gateware: fix kernel CPU exec address. 2016-10-31 15:16:35 +00:00
Sebastien Bourdeauducq 07ad00c1ca drtio: split kernel/system CSRs 2016-10-31 18:09:36 +08:00
Sebastien Bourdeauducq 9aa94e1a2d adapt to migen/misoc changes 2016-10-31 00:53:01 +08:00
Sebastien Bourdeauducq 2392113bb6 kc705: use misoc clock for false path 2016-10-30 11:16:04 +08:00
whitequark cd68577dbc compiler: add support for async RPCs. 2016-10-30 00:57:31 +00:00
whitequark 2ac85cd40f runtime: implement prototype background RPCs. 2016-10-29 21:34:25 +00:00
Sebastien Bourdeauducq c656a53532 kc705: clean up clock constraints 2016-10-29 21:28:01 +08:00
Sebastien Bourdeauducq ed4d57c638 use new Migen signal attribute API 2016-10-29 21:19:58 +08:00
Sebastien Bourdeauducq da5208e160 drtio: add master gateware target 2016-10-29 17:31:15 +08:00
Sebastien Bourdeauducq 7c05dccf65 drtio: add support for 125MHz clock on GTX_1000BASE_BX10 2016-10-29 17:30:29 +08:00
Sebastien Bourdeauducq 95def81c03 drtio: squelch frame signals until link layer ready 2016-10-29 17:05:30 +08:00
Sebastien Bourdeauducq 4f6241283c drtio: always use NoRetiming on MultiReg inputs 2016-10-29 16:37:53 +08:00
Robert Jördens b14fcd41e4 ksupport: add ad9154* 2016-10-28 02:39:24 +02:00
Robert Jördens 2a1e529dcf phaser: DDS config dummies 2016-10-28 01:58:08 +02:00
Robert Jördens 8eff8586bb moninj.rs: force u32 dds_ftws 2016-10-28 01:57:55 +02:00
Robert Jördens 6d07a16c62 Merge branch 'master' into phaser
* master: (72 commits)
  gateware: extend mailbox to 3 entries.
  master/worker_db: set default value for archive
  master: keep dataset manager consistent when set_dataset is called with contradictory attributes
  master: archive input datasets. Closes #587
  master: ensure same dataset is in broadcast and local when mutating
  scheduler: default submission arguments, closes #577
  pdq2: sync with pdq2
  doc: clarify usage of pause/check_pause, closes #571
  dashboard/datasets: use scientific spinbox and increase number of decimals, closes #572
  gateware/spi: fix import
  runtime: fix use of $(realpath) in Makefile.
  test: fix printf specifier.
  llvm_ir_generator: make sure RPC allocations are not underaligned.
  runtime: use i64 for watchdog timeout, not i32.
  runtime: port ksupport to Rust.
  runtime: remove some redundant libm functions copied inline.
  language: Add "A" (ampere) as well-known unit for arguments
  conda: misoc 0.4 (csr)
  runtime: cap log level at debug.
  runtime: discard unnecessary sections.
  ...
2016-10-28 01:40:11 +02:00
Robert Jördens c428800caf phaser: spi, sma_gpio: 2.5 V 2016-10-27 15:53:49 +02:00
Robert Jördens 65b2e4464c phaser: sysref/sync diff term 2016-10-27 14:14:56 +02:00
Robert Jördens ea0c304a0c phaser2: wip 2016-10-27 01:00:42 +02:00
Sebastien Bourdeauducq 9bbc6eb0ef drtio: more full stack testing 2016-10-26 22:04:32 +08:00
Sebastien Bourdeauducq 929a7650a8 drtio: fixes 2016-10-26 22:03:44 +08:00
Sebastien Bourdeauducq 45621934fd drtio: forward errors to CSR 2016-10-26 22:03:05 +08:00
Sebastien Bourdeauducq 7f8e53aa5c drtio: more fixes and tests 2016-10-26 11:48:47 +08:00
Sebastien Bourdeauducq 22173b8c70 drtio: full stack unittest 2016-10-26 00:35:22 +08:00
Sebastien Bourdeauducq f763b519f4 drtio: fix channel selection 2016-10-26 00:33:21 +08:00
Sebastien Bourdeauducq ad042de954 drtio: fixes, basic TTL working in simulation 2016-10-25 12:41:16 +08:00
Robert Jördens e981b23548 phaser: use misoc cordic 2016-10-24 19:33:23 +02:00
Robert Jördens d2f776b0d0 phaser: add more tools 2016-10-24 17:39:14 +02:00
Sebastien Bourdeauducq 94e68dbae4 drtio: test_full_stack (WIP) 2016-10-24 23:36:33 +08:00
Sebastien Bourdeauducq a4e85081aa drtio: more simple fixes 2016-10-24 23:32:49 +08:00
Sebastien Bourdeauducq 029e0d95b7 drtio: simple fixes 2016-10-24 23:10:15 +08:00
Sebastien Bourdeauducq c39987b617 drtio: handle underflow/sequence error CSRs 2016-10-24 20:46:55 +08:00
Sebastien Bourdeauducq 7dd6eb2f5e drtio: add RT write controller 2016-10-24 19:50:13 +08:00
Sebastien Bourdeauducq 83bec06226 drtio: fifo level -> fifo space 2016-10-24 15:59:12 +08:00
Sebastien Bourdeauducq aa8e211735 drtio/rt_packets: fix 2016-10-22 13:03:35 +08:00
Sebastien Bourdeauducq 449d1c4dc6 rtio: export CDC modules 2016-10-22 13:03:10 +08:00
Sebastien Bourdeauducq 67c19ab178 drtio: RTPacketMaster RX, untested 2016-10-22 01:04:14 +08:00
Sebastien Bourdeauducq 3b4a40401a drtio: RTPacketMaster TX (WIP) 2016-10-21 22:46:14 +08:00
Sebastien Bourdeauducq 1e313afe64 drtio: CrossDomainNotification 2016-10-21 22:45:45 +08:00
Sebastien Bourdeauducq c71c4c89e0 drtio: change data direction in _CrossDomainRequest 2016-10-21 22:44:47 +08:00
whitequark 6872017449 gateware: extend mailbox to 3 entries. 2016-10-21 12:09:14 +00:00
Sebastien Bourdeauducq 6a88229e6a drtio: CrossDomainRequest 2016-10-20 23:37:59 +08:00
Robert Jördens 062aca2a6b conda/phaser: build-depend on jesd204b 2016-10-19 14:44:54 +02:00
Sebastien Bourdeauducq 6aa13fbf25 master/worker_db: set default value for archive 2016-10-19 20:12:16 +08:00
Sebastien Bourdeauducq 9790c5d9ed drtio/iot: FIFO level 2016-10-19 18:04:03 +08:00
Robert Jördens bf942fc228 ksupport: adapt to dyld_load() 2016-10-18 11:37:27 +02:00
Sebastien Bourdeauducq 71480c4d15 drtio: fix mmcm_mult 2016-10-18 17:28:03 +08:00
Sebastien Bourdeauducq 5d184f8061 master: keep dataset manager consistent when set_dataset is called with contradictory attributes 2016-10-18 17:11:07 +08:00
Sebastien Bourdeauducq 69d96b0158 master: archive input datasets. Closes #587 2016-10-18 17:11:07 +08:00
Sebastien Bourdeauducq ed2624545f master: ensure same dataset is in broadcast and local when mutating 2016-10-18 17:11:07 +08:00
Sebastien Bourdeauducq 1908339d4e scheduler: default submission arguments, closes #577 2016-10-18 17:11:06 +08:00
Robert Jördens 54f05b6fc1 ksupport: kernel_run lookup with dyld (closes #590)
adapt to misoc change
2016-10-18 10:07:07 +02:00
Robert Jördens 78700a67bc sawg: fast-math 2016-10-18 10:05:51 +02:00
Robert Jördens b2327cf808 sawg: core is kernel_invariant 2016-10-18 10:05:51 +02:00
Robert Jördens 0e41725e2d pdq2: sync with pdq2 2016-10-18 09:43:46 +02:00
Sebastien Bourdeauducq 69099691f7 doc: clarify usage of pause/check_pause, closes #571 2016-10-17 20:08:15 +08:00
Sebastien Bourdeauducq 02adccf4a2 dashboard/datasets: use scientific spinbox and increase number of decimals, closes #572 2016-10-17 19:57:59 +08:00
Sebastien Bourdeauducq e7dbed3b02 gateware: KC705 satellite target 2016-10-17 19:23:45 +08:00
Sebastien Bourdeauducq 9752ffe3d1 drtio: various fixes 2016-10-17 19:23:08 +08:00
Sebastien Bourdeauducq cce29e8b83 gateware/spi: fix import 2016-10-17 14:47:19 +08:00
Sebastien Bourdeauducq b6002529cf gateware/spi: fix import 2016-10-17 14:07:11 +08:00
Sebastien Bourdeauducq 85834976d9 gateware/spi: fix import 2016-10-17 14:06:35 +08:00
whitequark 6da1f39670 runtime: fix use of $(realpath) in Makefile. 2016-10-17 00:11:02 +00:00
whitequark f10a4498c7 test: fix printf specifier. 2016-10-16 23:54:29 +00:00
whitequark 2a9e370840 llvm_ir_generator: make sure RPC allocations are not underaligned. 2016-10-16 16:43:03 +00:00
whitequark 7618907cad runtime: use i64 for watchdog timeout, not i32. 2016-10-16 16:32:43 +00:00
whitequark a8c017bfcc runtime: port ksupport to Rust. 2016-10-16 16:32:43 +00:00
whitequark fee75bd50f runtime: remove some redundant libm functions copied inline. 2016-10-16 16:25:29 +00:00
Robert Jördens 6a683c712b phaser: work around for unreliable transciever init 2016-10-16 16:01:23 +02:00
Sebastien Bourdeauducq d3b274fc4d drtio: synchronizer MMCM 2016-10-16 17:40:58 +08:00
Sebastien Bourdeauducq 03d3a85e75 drtio: RX clock alignment and ready 2016-10-15 18:36:27 +08:00
Florent Kermarrec 0259c80015 phaser/kc705: remove transceiver initialization workaround 2016-10-14 19:06:43 +02:00
Robert Jördens 9ba6be8796 phaser: speed up ad9154_test_status 2016-10-14 13:23:14 +02:00
Robert Jördens 4968de053c phaser: update README 2016-10-14 13:21:54 +02:00
Robert Jördens 4b4fd32e3d phaser: add another sawg demo 2016-10-14 13:21:42 +02:00
Robert Jördens d16068dd9b sawg: absolute phase updates 2016-10-14 12:42:08 +02:00
Robert Jördens 9b43f09c1d phaser: cleanup prbs 2016-10-14 11:56:10 +02:00
Robert Jördens b41b9de905 phaser: tag jesd as clock net 2016-10-14 10:46:33 +02:00
Robert Jördens 4ea3dea217 phaser: broad spectrum antibiotics with xilinx false paths 2016-10-14 10:22:03 +02:00
Robert Jördens e400f8d672 phaser: add two more registers before jesd 2016-10-14 09:54:56 +02:00
Robert Jördens 3c9c42c779 phaser: drive rtio from jesd-bufg 2016-10-14 02:26:19 +02:00
Robert Jördens b9de621557 phaser: fix comment 2016-10-14 02:18:58 +02:00
Robert Jördens 2b5a69a80c phaser: rm idle_kernel 2016-10-14 02:18:15 +02:00
Robert Jördens 808874a523 phaser: drive cd_jesd with BUFG 2016-10-14 01:57:48 +02:00
Robert Jördens 342d6d756e phaser: bypass gtx phalign 2016-10-14 00:59:53 +02:00
Robert Jördens 89150c9817 phaser: 10G line rate 2016-10-14 00:53:38 +02:00
Sebastien Bourdeauducq 08e4aa3e3f drtio: GTX WIP 2016-10-14 00:36:13 +08:00
Sebastien Bourdeauducq c548a65ec3 drtio: clock domains 2016-10-14 00:34:59 +08:00
Robert Jördens 42c6658ffe phaser: add some more blinking leds 2016-10-13 15:21:27 +02:00
Robert Jördens 6a456bd7d4 phaser: feed correct sink (crucial) 2016-10-13 15:17:38 +02:00
Robert Jördens b1137563b3 phaser: cleanup dac_setup 2016-10-13 15:02:42 +02:00
Robert Jördens 4c7c479c94 ad9154: add mirrored bits 2016-10-13 15:02:18 +02:00
Robert Jördens c8e45ae3f6 phaser: cleanup jesd phy instantiation a bit 2016-10-13 14:43:24 +02:00
Robert Jördens 01bfe54dde phaser: actually enable stpl 2016-10-13 14:09:29 +02:00
Robert Jördens 78a41eec8f phaser: kc705: syntax 2016-10-13 12:38:32 +02:00
Florent Kermarrec af0e8582a2 phaser: use new jesd clocking 2016-10-13 11:51:06 +02:00
David Nadlinger e037d167f4 language: Add "A" (ampere) as well-known unit for arguments
Signed-off-by: David Nadlinger <code@klickverbot.at>
2016-10-13 12:22:01 +08:00
Robert Jördens 81511feab8 phaser: README: specify versions 2016-10-12 17:13:06 +02:00
Robert Jördens 290498aca0 conda: misoc 0.4 (csr) 2016-10-12 16:34:19 +02:00
Robert Jördens 9c8b21b3f4 phaser: let link settle a bit longer before starting 2016-10-12 16:13:34 +02:00
Robert Jördens 9880b1ebd0 phaser: update README 2016-10-12 16:01:07 +02:00
Robert Jördens 0d1ed247e2 phaser: tweak sawg example 2016-10-12 16:01:07 +02:00
Robert Jördens 2d14864c6d Revert "phaser: 500 MHz dacclock"
This reverts commit 5f737bef76.
2016-10-12 16:01:07 +02:00
Florent Kermarrec 12b8598b84 stpl: fix byte ordering 2016-10-12 15:59:27 +02:00
Robert Jördens 9644a3a362 ad9154: mix mode addr, digital gain must be on 2016-10-12 15:00:53 +02:00
Robert Jördens 4376ef5615 phaser: slow down spi a bit 2016-10-12 14:37:43 +02:00
Robert Jördens 3f1d96b68d phaser: tweak dac_setup 2016-10-12 14:22:57 +02:00
Robert Jördens 466d1e8304 phaser: update stpl 2016-10-12 14:22:21 +02:00
Robert Jördens 5f737bef76 phaser: 500 MHz dacclock 2016-10-12 14:03:08 +02:00
Robert Jördens 3b1d5d7eb6 phaser: verify flags in dac_setup 2016-10-12 12:19:08 +02:00
Robert Jördens 1117fe191b phaser: support core stpl 2016-10-12 12:03:29 +02:00
Robert Jördens f515c11f26 phaser: fix refclk period spec 2016-10-11 20:13:34 +02:00
Robert Jördens bae5b73155 phaser: comment out stpl test 2016-10-11 19:50:19 +02:00
Robert Jördens 2b1cca2e7e phaser: stpl 2016-10-11 19:29:27 +02:00
Sebastien Bourdeauducq 018f6d1b52 drtio: implement basic IOT 2016-10-11 17:59:22 +08:00
Robert Jördens e4d1f6cf1f README_PHASER: update 2016-10-10 18:49:24 +02:00
Robert Jördens 18d18b6685 phaser: add sync ttl input for monitoring 2016-10-10 17:13:23 +02:00
Robert Jördens f5f7acc1f8 ttl_simple: add pure Input
(no Tristate for internal signals)
2016-10-10 17:13:23 +02:00
Robert Jördens e27228fdd5 ad9516: duty cycle correction 2016-10-10 17:13:23 +02:00
Sebastien Bourdeauducq a40b39e9a2 drtio: structure 2016-10-10 23:12:12 +08:00
Florent Kermarrec c08caae171 phaser: use qpll 2016-10-10 17:05:42 +02:00
Robert Jördens 5f7229ef92 ad9154: tweak jesd prbs test 2016-10-09 20:34:15 +02:00
Sebastien Bourdeauducq 87ec333f55 drtio: implement basic writes, errors, fifo levels on satellite 2016-10-10 00:13:41 +08:00
Robert Jördens 1f93658724 phaser/dac_setup: clear sticky bits, use syncmode=9 2016-10-07 18:54:21 +02:00
Robert Jördens 89a30b6f7c phaser: error on startup kernel 2016-10-08 00:02:38 +08:00
Robert Jördens 4e60a6ac71 phaser: tweak sawg example 2016-10-08 00:02:24 +08:00
whitequark 9c3394794e runtime: cap log level at debug. 2016-10-07 14:24:12 +00:00
Robert Jördens 1157a3a54b ad9514_status: more info 2016-10-07 15:42:46 +02:00
Robert Jördens 72932fccec phaser: fix sysref for 250 MHz sample rate 2016-10-07 15:40:00 +02:00
Robert Jördens cfd2fe8627 phaser: fix fpga deviceclock divider 2016-10-07 13:40:45 +02:00
Sebastien Bourdeauducq 23b3302200 drtio: implement TSC load in satellite 2016-10-07 19:30:53 +08:00
Robert Jördens 9b860b26e8 phaser: fix rtio pll inputs 2016-10-07 13:00:42 +02:00
Robert Jördens c846e758f1 phaser: fix startup_kernel/ceil 2016-10-07 12:57:38 +02:00
Robert Jördens 09434ec054 phaser: also adapt rtio_crg 2016-10-07 12:44:22 +02:00
Sebastien Bourdeauducq 43caffc168 drtio: self-checking echo test 2016-10-07 17:31:51 +08:00
whitequark 4d790b452c runtime: discard unnecessary sections. 2016-10-07 08:30:14 +00:00
whitequark 8eeb6ea1b9 packaging: include runtime.rs in MANIFEST. 2016-10-07 07:53:38 +00:00
Sebastien Bourdeauducq 0574e882d2 drtio: basic RT packet echo test 2016-10-07 15:36:32 +08:00
Sebastien Bourdeauducq cb0d1549c6 drtio: add rt_packets TX datapath, fixes 2016-10-07 15:35:29 +08:00
Florent Kermarrec e998a980b3 phaser/startup: use get_configuration_checksum() 2016-10-07 09:00:01 +02:00
Florent Kermarrec b02a7234f6 phaser: use 125MHz refclk for jesd 2016-10-07 08:59:34 +02:00
whitequark ef10344b3e runtime: rewrite isr() in Rust. 2016-10-07 06:27:10 +00:00
whitequark 8be60cc223 runtime: fix KERNELCPU_LAST_ADDRESS after layout change. 2016-10-07 05:53:55 +00:00
whitequark 4f11b071a5 runtime: remove useless handshaking in analyzer. 2016-10-07 05:53:16 +00:00
whitequark b52ecda1d5 runtime: make memory map saner. 2016-10-06 18:05:38 +00:00
whitequark b4bbf44a0a runtime: buffer writes of RPC data.
This improves upload speed ~166×.
2016-10-06 17:32:26 +00:00
whitequark 557bc4bb56 runtime: remove unnecessary buffering. 2016-10-06 17:25:43 +00:00
whitequark edafb08b43 test: fix d6193365. 2016-10-06 16:27:12 +00:00
whitequark d619336503 test: update libartiq_support for changed personality ABI. 2016-10-06 15:44:55 +00:00
whitequark bcdbd00e7b runtime: remove unnecessary null bytes from session protocol. 2016-10-06 15:39:00 +00:00
whitequark 5428a866b3 runtime: the Rust runtime is now just the runtime. 2016-10-06 15:38:45 +00:00
Robert Jördens 4390fea437 phaser status: add statusmode stuff for serdes pll 2016-10-06 17:36:54 +02:00
Robert Jördens 01bc7faacc dac_setup: cleanup, add doc 2016-10-06 17:27:50 +02:00
Robert Jördens fee7831573 phaser: split setup 2016-10-06 16:48:03 +02:00
Robert Jördens 1193ba4bf4 ad9154: merge csr spaces 2016-10-06 16:21:15 +02:00
whitequark 3e829d0d01 Rust: unborrow cache after kernel stops. 2016-10-06 14:19:12 +00:00
whitequark e92f20546a Rust: implement exceptional RPC replies. 2016-10-06 14:08:02 +00:00
whitequark 226fa723bb Rust: implement exceptional kernel termination.
This also adjusts the way backtraces are serialized by kloader.
2016-10-06 13:42:35 +00:00
whitequark 84214ab0d1 Rust: don't panic when loading a kernel twice in same session. 2016-10-06 12:55:19 +00:00
whitequark 6b2789e3db test: add more RPC tests. 2016-10-06 12:54:08 +00:00
Robert Jördens 4d87f0e9e0 phaser: instantiate jesd204b core, wire up 2016-10-06 14:44:22 +02:00
whitequark 2ae30b5a95 Rust: aggregate kernel CPU log messages and print line by line. 2016-10-06 10:56:19 +00:00
whitequark 3362887d75 Rust: implement receiving for all RPC types. 2016-10-06 10:55:54 +00:00
whitequark 516c6fdea9 language: export TTuple. 2016-10-06 10:55:33 +00:00
Sebastien Bourdeauducq 76bac21d14 drtio: RT RX datapath, untested 2016-10-06 18:51:20 +08:00
Robert Jördens f62d60093e README_PHASER: update 2016-10-06 09:58:05 +02:00
whitequark 5a630067cb Rust: implement sending for all RPC types. 2016-10-06 06:31:27 +00:00
Robert Jördens d13f67cf63 phaser: fix README 2016-10-05 19:26:33 +02:00
Robert Jördens c54b6e2f3c phaser: add README 2016-10-05 19:24:34 +02:00
Robert Jördens 4a0eaf0f95 phaser: add jesd204b rtio dds
gateware: add jesd204b awg

gateware: copy phaser (df3825a)
dsp/tools: update satadd mixin
phaser: no DDS stubs
dsp: accu fix
phaser: cleanup/reduce

sawg: kernel support and docs

sawg: coredevice api fixes

sawg: example ddb/experiment

phaser: add conda package

examples/phaser: typo

sawg: adapt tests, fix accu stb

sawg: tweak dds parameters

sawg: move/adapt/extend tests

sawg: test phy, refactor

phaser: non-rtio spi

phaser: target cli update

phaser: ad9154-fmc-ebz pins

phaser: reorganize fmc signal naming

phaser: add test mode stubs

phaser: txen is LVTTL

phaser: clk spi xfer test

phaser: spi for ad9154 and ad9516

phaser: spi tweaks

ad9154: add register map from ad9144.xml

ad9516: add register map from ad9517.xml and manual adaptation

ad9154_reg: just generate getter/setter macros as well

ad9154: reg WIP

ad9154: check and fix registers

kc705: single ended rtio_external_clk

use single ended user_sma_clk_n instead of p/n to free up one clock sma

kc705: mirror clk200 at user_sma_clock_p

ad9516_regs.h: fix B_COUNTER_MSB

phase: wire up clocking differently

needs patched misoc

kc705: feed rtio_external_clock directly

kc705: remove rtio_external_clk for phaser

phaser: spi tweaks

ad9516: some startup

ad9516_reg fixes

phaser: setup ad9516 for supposed 500 MHz operation

ad9516: use full duplex spi

ad9154_reg: add CONFIG_REG_2

ad9154_reg: fixes

phaser: write some ad9154 config

ad9154_reg: fixes

ad9154: more init, and human readable setup

ad9154/ad9516: merge spi support

ad9154: status readout

Revert "kc705: remove rtio_external_clk for phaser"

This reverts commit d500288bb44f2bf2eeb0c2f237aa207b0a8b1366.

Revert "kc705: feed rtio_external_clock directly"

This reverts commit 8dc7825519e3e75b7d3d29c9abf10fc6e3a8b4c5.

Revert "phase: wire up clocking differently"

This reverts commit ad9cc450ffa35abb54b0842d56f6cf6c53c6fbcc.

Revert "kc705: mirror clk200 at user_sma_clock_p"

This reverts commit 7f0dffdcdd28e648af84725682f82ec6e5642eba.

Revert "kc705: single ended rtio_external_clk"

This reverts commit a9426d983fbf5c1cb768da8f1da26d9b7335e9cf.

ad9516: 2000 MHz clock

phaser: test clock dist

phaser: test freqs

ad9154: iostandards

phaser: drop clock monitor

phaser: no separate i2c

phaser: drive rtio from refclk, wire up sysref

phaser: ttl channel for sync

ad9154: 4x interp, status, tweaks

phaser: sync/sysref 33V banks

phaser: sync/sysref LVDS_25 inputs are VCCO tolerant

phaser: user input-only ttls

phaser: rtio fully from refclk

ad9154: reg name usage fix

ad9154: check register modifications

Revert "ad9154: check register modifications"

This reverts commit 45121d90edf89f7bd8703503f9f317ad050f9564.

ad9154: fix status code

ad9154: addrinc, recal serdes pll

phaser: coredevice, example tweaks

sawg: missing import

sawg: type fixes

ad9514: move setup functions

ad9154: msb first also decreasing addr

phaser: use sys4x for rtio internal ref

phaser: move init code to main

phaser: naming cleanup

phaser: cleanup pins

phaser: move spi to kernel cpu

phaser: kernel support for ad9154 spi

ad9154: add r/w methods

ad9154: need return annotations

ad9154: r/w methods are kernels

ad9154_reg: portable helpers

phaser: cleanup startup kernel

ad9154: status test

ad9154: prbs test

ad9154: move setup, document

phaser: more documentation
2016-10-05 16:17:50 +02:00
Robert Jördens 2bc5dc4ecb i2c: cleanup includes 2016-10-05 16:17:50 +02:00
Robert Jördens a91ed8394c rtio: add input-only channel 2016-10-05 16:17:50 +02:00
Robert Jördens 279f0d568d rtio: support differential ttl 2016-10-05 16:17:50 +02:00
whitequark 4cfc4e89b9 Rust: add basic RPC support. 2016-10-05 14:15:53 +00:00
whitequark 0a29c00fcc Rust: implement analyzer. 2016-10-05 05:59:38 +00:00
whitequark 2fefd0ad4a Rust: implement moninj. 2016-10-04 12:42:44 +00:00
whitequark 2e4d19a1ce Rust: add some conditional compilation back to rtio_crg. 2016-10-04 12:42:42 +00:00
whitequark b590c6c7d8 Rust: import --cfg flags generated by misoc. 2016-10-04 08:15:13 +00:00
whitequark 0e2cd38135 Rust: set the SOF_KEEPALIVE flag on session sockets. 2016-10-04 06:42:09 +00:00
whitequark 2b3bc30396 Rust: implement startup kernels. 2016-10-04 06:08:08 +00:00
whitequark 0cd87af386 Rust: don't crash kernel CPU when no flash kernel is present. 2016-10-04 05:27:54 +00:00
whitequark 6bbaff81bf Rust: implement idle kernels. 2016-10-04 05:20:56 +00:00
whitequark 398b709e25 Rust: use try_borrow where applicable. 2016-10-04 03:26:53 +00:00
whitequark 30e997f045 Rust: implement idle kernels and session takeover. 2016-10-02 04:37:24 +00:00
whitequark 8bced9dcb5 Rust: implement cache. 2016-10-01 18:24:53 +00:00
whitequark d825393e81 Rust: implement watchdogs. 2016-10-01 16:26:57 +00:00
whitequark 5701b2095b Rust: implement all messages used in the kernel interface. 2016-10-01 16:10:09 +00:00
whitequark ab3bd67412 Rust: style (NFC). 2016-10-01 16:10:09 +00:00
whitequark 999290fe52 runtime: link ksupport with libm, not runtime.
We need libm for the %g format specifier.
2016-10-01 16:10:09 +00:00
whitequark d3dcb4b8a2 runtime: remove useless copy of flush_cpu_dcache().
ksupport used to not link to libbase, I think.
2016-10-01 16:10:09 +00:00
whitequark b3b1ea71c5 Rust: implement basic communication with kernel CPU. 2016-10-01 04:20:27 +00:00
Sebastien Bourdeauducq 1e0c6d6d5d drtio: monitor received link_init 2016-09-30 11:25:06 +08:00
whitequark 1cbb187136 runtime: eliminate va_list from kernel interface. 2016-09-30 03:07:27 +00:00
whitequark 7cfa667d98 runtime: eliminate struct dyld_info from kernel interface. 2016-09-30 03:03:35 +00:00
whitequark c6a57d2043 Rust: port mailbox routines. 2016-09-30 00:15:20 +00:00
whitequark 55b2535477 Rust: print git commit during startup. 2016-09-29 22:04:52 +00:00
whitequark 9d00023401 Rust: move a few things around (NFC). 2016-09-29 20:56:35 +00:00
whitequark 9c18f1b555 Rust: port clock, rtio_crg routines. 2016-09-29 20:42:40 +00:00
whitequark 83940ae4a6 Rust: add support for artiq_coreconfig. 2016-09-29 18:54:08 +00:00
whitequark 1e392cca64 runtime: remove "test mode" functionality. 2016-09-29 14:48:26 +00:00
whitequark 3263def5c8 Rust: use generated CSR functions. 2016-09-29 14:04:42 +00:00
whitequark fdcb27ccff Rust: add support for artiq_corelog. 2016-09-28 18:25:25 +00:00
Sebastien Bourdeauducq cefb9e1405 drtio: add full link layer 2016-09-27 21:41:57 +08:00
whitequark b14c19a886 Rust: add skeleton session protocol implementation.
Only ident requests are supported right now.
2016-09-27 13:37:17 +00:00
whitequark 89d4621c09 Rust: fix TcpStream::read. 2016-09-27 13:37:17 +00:00
whitequark b8137103c3 Rust: fix prelude. 2016-09-27 13:37:17 +00:00
whitequark 9562d8d1df Rust: liblwip: call tcp_recved where appropriate. 2016-09-27 13:37:17 +00:00
Sebastien Bourdeauducq 08772f7a71 drtio: add RX ready signaling 2016-09-27 19:02:54 +08:00
Sebastien Bourdeauducq 95d7cba34a drtio: fixes, add aux packet test 2016-09-27 12:46:01 +08:00
Sebastien Bourdeauducq e59142e344 drtio: use additive scrambler reset by link init 2016-09-27 11:38:05 +08:00
Sebastien Bourdeauducq 8a92c2c7e5 drtio: add RX link layer, fixes, simple loopback demo 2016-09-27 11:23:29 +08:00
Sebastien Bourdeauducq 4e47decdbc drtio: add scrambler/descrambler and test 2016-09-26 14:14:14 +08:00
Sebastien Bourdeauducq fa83ad0d9c drtio: add TX link layer 2016-09-26 12:53:10 +08:00
Robert Jördens fdadf550fb RELEASE_NOTES: 2.0 2016-09-24 18:53:36 +02:00
Sebastien Bourdeauducq 2701b914e2 conda: update migen version requirements 2016-09-24 21:02:19 +08:00
Sebastien Bourdeauducq 8280e72e90 gateware: use new misoc CSR mapping API 2016-09-24 20:48:37 +08:00
whitequark 956f64906d Rust: fix incorrect use of lwip API. 2016-09-23 05:20:15 +00:00
whitequark ce05eee80c Rust: style fix. 2016-09-23 05:20:04 +00:00
Sebastien Bourdeauducq fac0c68cd1 novatech409b: fix get_status 2016-09-23 11:03:50 +08:00
Sebastien Bourdeauducq 2d6171e8c4 dashboard: make state restore failure on experiment opening non-fatal 2016-09-21 19:23:06 +08:00
Robert Jördens 2bb90a4449 pipistrello: shrink a few more fifos 2016-09-21 02:29:05 +02:00
whitequark 9a24a81f14 Rust: update network stack to provide blocking impls. 2016-09-20 14:03:31 +00:00
whitequark dec394bc13 Rust: port std::error into libstd_artiq.
See https://github.com/jethrogb/rust-core_io/issues/3.
2016-09-20 14:02:53 +00:00
whitequark 1c7e1dd645 Rust: import core_io crate into libstd_artiq.
Unfortunately the crate does not work out of the box with custom
Rust builds, and forking it makes little sense over just embedding
it here. See https://github.com/jethrogb/rust-core_io/issues/2.
2016-09-20 08:28:00 +00:00
Robert Jördens 52f935dcfb README: GPLv3+ 2016-09-15 09:51:33 -04:00
Robert Jördens e4d1d0a309 RELEASE_NOTES: 2.0rc2 2016-09-14 21:54:32 -04:00
whitequark ed60ba8c4c compiler: skip kernel_invariant linting for exception types. 2016-09-14 23:34:57 +00:00
whitequark feeb089505 compiler: warn about unused kernel_invariant entries.
Fixes #543.
2016-09-14 23:28:55 +00:00
whitequark 494cfca41c coreanalyzer: fix rtio_log message extraction.
Fixes #550.
2016-09-14 10:18:00 +00:00
Sebastien Bourdeauducq c7c8ad126f pc_rpc: raise AttributeError immediately for nonexistent RPC methods. Closes #534 2016-09-14 11:22:07 +08:00
Sebastien Bourdeauducq f010a74479 dashboard: remember experiment editor scroll positions 2016-09-14 10:53:24 +08:00
Sebastien Bourdeauducq 55363e2ff9 dashboard: save/restore MDI window states when they are closed. Closes #559 2016-09-14 10:53:24 +08:00
Sebastien Bourdeauducq 89417a47b2 gui: use bare QSpinBox for integer NumberEntries. Closes #558 2016-09-14 10:53:24 +08:00
whitequark b100770e05 runtime: expose strlen (implicitly required for comparing strings).
Fixes #557.
2016-09-10 00:13:44 +00:00
Sebastien Bourdeauducq 82fbd3e9c9 doc: CCBs, applet setup from experiment 2016-09-09 23:25:29 +08:00
Sebastien Bourdeauducq 387688354c master: optimize repository scan, closes #546 2016-09-09 19:19:01 +08:00
Sebastien Bourdeauducq 4ef5eb2644 doc: move VADJ, closes #554 2016-09-09 18:40:58 +08:00
whitequark 25ec99930c Also serialize numpy.int{32,64} like int in RPC return values.
Fixes #555.
2016-09-09 08:52:18 +00:00
Sebastien Bourdeauducq 811f123a17 applets: add disable_applet_group 2016-09-09 13:12:10 +08:00
Sebastien Bourdeauducq 769b1e2393 applets: fix ccb group creation 2016-09-09 13:08:30 +08:00
Sebastien Bourdeauducq 4bdbc5b259 applets: use a different workaround to disable editing
True to itself, Qt did not miss the opportunity to trash widgets inside
QTreeWidgetItems when they are moved by drag-and-drop. Problem known for
more than 6 years and still not fixed as of Qt 5.7.
2016-09-09 12:55:01 +08:00
Sebastien Bourdeauducq 6144839beb applets: support group-level CCB policies 2016-09-09 11:38:55 +08:00
Sebastien Bourdeauducq 615807afb4 applets: fix indices 2016-09-09 11:16:43 +08:00
Sebastien Bourdeauducq ebb0ba17f5 applets: separate create/create+enable CCB policies 2016-09-09 10:02:32 +08:00
Sebastien Bourdeauducq ff20ed2710 applets: two column table, remove spurious Qt text editors 2016-09-09 09:07:31 +08:00
Sebastien Bourdeauducq 6aaf6c8789 language/environment: only call prepare automatically if it exists 2016-09-09 09:06:59 +08:00
Sebastien Bourdeauducq 7efd990541 language: set NoScan default repetitions to 1 2016-09-08 11:03:55 +08:00
raghu 9b937e08f4 added repetitions for no scan, repetitions set to one when disable other scans selected. Closes #532 2016-09-08 11:03:00 +08:00
Sebastien Bourdeauducq 73bbe2ae66 RELEASE_NOTES: clarify 2016-09-07 20:21:10 +08:00
Sebastien Bourdeauducq 5fbcdacec7 environment: call prepare for children by default, closes #545 2016-09-07 20:20:20 +08:00
Sebastien Bourdeauducq 1cb8f642b4 test: level-based TTL APIs (#218) 2016-09-07 17:37:49 +08:00
Sebastien Bourdeauducq 2b282456dc coredevice/ttl: fix imports 2016-09-07 17:37:14 +08:00
Sebastien Bourdeauducq 486fe97649 ttl: add level-based APIs (#218) 2016-09-07 16:55:21 +08:00
Sebastien Bourdeauducq a7dd356d30 rtio/phy/ttl: support 'set sensitivity and sample' command (#218) 2016-09-07 15:42:09 +08:00
whitequark 269cedd782 Rust: integrate lwip with the I/O scheduler. 2016-09-06 22:53:02 +00:00
Sebastien Bourdeauducq b7b6e7b9db examples: code applet 2016-09-07 00:56:39 +08:00
Sebastien Bourdeauducq b982832ddc gui/applets: support passing command line arguments to code applets 2016-09-07 00:56:39 +08:00
whitequark bf863053b3 Rust: implement bindings for lwip TCP/UDP stacks. 2016-09-06 16:49:49 +00:00
Sebastien Bourdeauducq 5d293d14c6 gui/applets: fix teardown of half-initialized applets 2016-09-06 23:06:31 +08:00
Sebastien Bourdeauducq f6b5d6d20f gui/applets: fix handling of process creation failure 2016-09-06 23:01:04 +08:00
Sebastien Bourdeauducq 996dfcafc6 dashboard: fix 'disable other scans' 2016-09-06 22:50:12 +08:00
Sebastien Bourdeauducq 56e3c80623 dashboard: support for code applets 2016-09-06 22:38:34 +08:00
Sebastien Bourdeauducq deb51eaaa1 gui: update version number in logo 2016-09-05 23:04:44 +08:00
Sebastien Bourdeauducq 524ba803e1 artiq_client: add show ccb 2016-09-05 19:07:35 +08:00
Sebastien Bourdeauducq 71eb65c527 artiq_client: fix 'show log', closes #552 2016-09-05 15:37:35 +08:00
Sebastien Bourdeauducq e45c089428 master, dashboard: support applet requests from experiments 2016-09-05 00:53:44 +08:00
Sebastien Bourdeauducq 549e09e06b applets: simplify command lines 2016-09-04 23:32:09 +08:00
Sebastien Bourdeauducq 8f6c4451ac gui/applets: support groups, creating and deleting applet groups, renaming groups, moving applets from one group to another and reordering applets and groups via drag-and-drop 2016-09-04 23:09:26 +08:00
Robert Jördens 9fd9235e44 RELEASE_NOTES: 2.0rc1 2016-09-04 16:34:58 +02:00
Robert Jördens 5b713ea385 conda: fix nist_clock summary 2016-09-02 19:06:36 +02:00
Sebastien Bourdeauducq c414026b29 import_cache: make sure last line ends with \n as linecache does. Closes #547 2016-09-02 11:01:28 +08:00
Sebastien Bourdeauducq dbc08bde8a gui: fix layout and scan disable bugs with argument recomputation 2016-09-02 10:50:25 +08:00
Sebastien Bourdeauducq ef2195fe68 dashboard: fix argument recomputation for experiments outside repository. Closes #548 2016-09-02 08:30:42 +08:00
Sebastien Bourdeauducq 019fe25594 RELEASE_NOTES: None arguments during experiment examination (#545) 2016-09-02 08:20:49 +08:00
whitequark 49ba8aec18 Rust: implement a basic scheduler. 2016-08-30 11:20:04 +00:00
Robert Jördens 051e6e0447 spi: use misoc SPIMachine, closes #314 2016-08-26 14:08:12 +02:00
Robert Jördens 91b59cd584 conda: misoc 0.3 2016-08-26 14:01:00 +02:00
Robert Jördens c38e2cda9d doc/manual: no analytics_id with rtd 2016-08-25 22:21:29 +02:00
Robert Jördens 0a4d4e30ef doc: use sphinx_rtd_theme 2016-08-25 21:52:46 +02:00
Robert Jördens 8753785ef7 doc/rtio: cleanup 2016-08-25 20:42:44 +02:00
Robert Jördens 9f7c33ca84 doc/rtio: make vis coloring consistent 2016-08-25 19:23:06 +02:00
Robert Jördens c2e0e0bd7e doc/rtio: vis RTIOUndeflow tweak 2016-08-25 19:14:31 +02:00
Robert Jördens 8f952fdb98 doc/rtio: vis RTIOUnderflow 2016-08-25 19:06:11 +02:00
Robert Jördens 446dcf2123 doc/rtio: input vis 2016-08-25 18:42:16 +02:00
Robert Jördens eb180da730 doc/rtio: vis: now_mu -> now since not didactically relevant 2016-08-25 18:18:02 +02:00
Robert Jördens aabe53e5fa doc/rtio: handover vis, tweak other vis's 2016-08-25 18:15:48 +02:00
Robert Jördens 7481d4e732 doc/rtio: sync() visualization 2016-08-25 14:51:34 +02:00
Robert Jördens aee0345ed7 doc: ship wavedrom js b/c https 2016-08-25 12:56:36 +02:00
Robert Jördens 60919c2ea7 doc: use wavedrom to visualize stuff 2016-08-25 12:17:05 +02:00
Robert Jördens 552146bd08 doc/rtio: fix description of idle kernel/reset 2016-08-25 12:17:05 +02:00
Robert Jördens 69ea3d3cc0 doc: rtio concepts, closes #451 2016-08-24 17:39:03 +02:00
Robert Jördens df876a4e06 doc: expand/refine getting_started_core 2016-08-23 18:01:34 +02:00
Robert Jördens 5adda1c4c8 doc: cleanup git checkout instructions (see #542) 2016-08-23 18:00:54 +02:00
whitequark 9a0c3dae93 doc: add our binutils patch to installing_from_source. 2016-08-21 19:55:59 +00:00
whitequark cea57e2b46 doc: update installing_from_source. 2016-08-21 02:16:48 +00:00
whitequark 58efaad5c6 Merge branch 'rust' 2016-08-17 11:49:55 +00:00
whitequark f26f446724 artiq_run: unbreak 2016-08-17 10:20:04 +00:00
whitequark 4c6cad2977 Add a Rust component in the runtime. 2016-08-17 09:07:19 +00:00
714 changed files with 77186 additions and 25940 deletions

1
.gitattributes vendored
View File

@ -1 +0,0 @@
artiq/_version.py export-subst

49
.github/ISSUE_TEMPLATE/1_Bug_Report.md vendored Normal file
View File

@ -0,0 +1,49 @@
---
name: Bug report
about: Report a bug in ARTIQ
---
<!-- Above are non-Markdown tags for Github auto-prompting issue type. Template based on pylint: https://raw.githubusercontent.com/PyCQA/pylint/master/.github/ISSUE_TEMPLATE/ -->
# Bug Report
<!-- Thanks for reporting a bug report to ARTIQ! You can also discuss issues and ask questions on IRC (the [#m-labs channel on freenode](https://webchat.freenode.net/?channels=m-labs) or on the [forum](https://forum.m-labs.hk). Please check Github/those forums to avoid posting a repeat issue.
Context helps us fix issues faster, so please include the following when relevant:
-->
## One-Line Summary
Short summary.
## Issue Details
### Steps to Reproduce
1. Step 1.
2. Step 2.
3. Step 3.
### Expected Behavior
Behavior
### Actual (undesired) Behavior
* Text description
* Log message, tracebacks, screen shots where relevant
### Your System (omit irrelevant parts)
* Operating System:
* ARTIQ version: (with recent versions of ARTIQ, run ``artiq_client --version``)
* Version of the gateware and runtime loaded in the core device: (in the output of ``artiq_coremgmt -D .... log``)
* If using Conda, output of `conda list` (please submit as a file attachment, as this tends to be long)
* Hardware involved:
<!--
For in-depth information on bug reporting, see:
http://www.chiark.greenend.org.uk/~sgtatham/bugs.html https://developer.mozilla.org/en-US/docs/Mozilla/QA/Bug_writing_guidelines
-->

View File

@ -0,0 +1,28 @@
---
name: Feature request
about: Suggest an idea for ARTIQ
---
<!--
Hi there! Thank you for wanting to make ARTIQ better.
Before you submit this, make sure that this feature wasn't
already requested or if it is not already implemented in the master branch.
Based on pylint: https://raw.githubusercontent.com/PyCQA/pylint/master/.github/ISSUE_TEMPLATE/2_Feature_request.md
-->
# ARTIQ Feature Request
## Problem this request addresses
A clear and concise description of what the problem is.
## Describe the solution you'd like
A clear and concise description of what you want to happen.
## Additional context
Add any other context about the feature request here.

29
.github/ISSUE_TEMPLATE/3_Question.md vendored Normal file
View File

@ -0,0 +1,29 @@
---
name: Support question
about: Questions about ARTIQ that are not covered in the documentation
---
# Question
<!--
Make sure you check the ARTIQ documentation before posting a question.
Don't forget you can search it!
Beta version: https://m-labs.hk/artiq/manual-beta/
Stable version: https://m-labs.hk/artiq/manual/
The forum is also a very good place for questions: https://forum.m-labs.hk/
Can also ask on IRC: https://webchat.freenode.net/?channels=m-labs or
check mailing list archives: https://ssl.serverraum.org/lists-archive/artiq/
Remember: if you have this question then others probably do too! The best way of thanking the people who help you with this issue is to contribute to ARTIQ by submitting a pull request to update the documentation.
-->
## Category: FILL_IN
<!-- One-word category this question falls into: GUI, installation/setup, devices, development, documentation, etc. -->
## Description
Question text

69
.github/pull_request_template.md vendored Normal file
View File

@ -0,0 +1,69 @@
<!--
Thank you for submitting a PR to ARTIQ!
To ease the process of reviewing your PR, do make sure to complete the following boxes.
You can also read more about contributing to ARTIQ in this document:
https://github.com/m-labs/artiq/blob/master/CONTRIBUTING.rst#contributing-code
Based on https://raw.githubusercontent.com/PyCQA/pylint/master/.github/PULL_REQUEST_TEMPLATE.md
-->
# ARTIQ Pull Request
## Description of Changes
### Related Issue
<!--
If this PR fixes a particular issue, use the following to automatically close that issue
once this PR gets merged:
Closes #XXX
-->
## Type of Changes
<!-- Leave ONLY the corresponding lines for the applicable type of change: -->
| | Type |
| ------------- | ------------- |
| ✓ | :bug: Bug fix |
| ✓ | :sparkles: New feature |
| ✓ | :hammer: Refactoring |
| ✓ | :scroll: Docs |
## Steps (Choose relevant, delete irrelevant before submitting)
### All Pull Requests
- [x] Use correct spelling and grammar.
- [ ] Update [RELEASE_NOTES.rst](../RELEASE_NOTES.rst) if there are noteworthy changes, especially if there are changes to existing APIs.
- [ ] Close/update issues.
- [ ] Check the copyright situation of your changes and sign off your patches (`git commit --signoff`, see [copyright](../CONTRIBUTING.rst#copyright-and-sign-off)).
### Code Changes
- [ ] Run `flake8` to check code style (follow PEP-8 style). `flake8` has issues with parsing Migen/gateware code, ignore as necessary.
- [ ] Test your changes or have someone test them. Mention what was tested and how.
- [ ] Add and check docstrings and comments
- [ ] Check, test, and update the [unittests in /artiq/test/](../artiq/test/) or [gateware simulations in /artiq/gateware/test](../artiq/gateware/test)
### Documentation Changes
- [ ] Check, test, and update the documentation in [doc/](../doc/). Build documentation (`cd doc/manual/; make html`) to ensure no errors.
### Git Logistics
- [ ] Split your contribution into logically separate changes (`git rebase --interactive`). Merge/squash/fixup commits that just fix or amend previous commits. Remove unintended changes & cleanup. See [tutorial](https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase).
- [ ] Write short & meaningful commit messages. Review each commit for messages (`git show`). Format:
```
topic: description. < 50 characters total.
Longer description. < 70 characters per line
```
### Licensing
See [copyright & licensing for more info](https://github.com/m-labs/artiq/blob/master/CONTRIBUTING.rst#copyright-and-sign-off).
ARTIQ files that do not contain a license header are copyrighted by M-Labs Limited and are licensed under LGPLv3+.

24
.gitignore vendored
View File

@ -6,6 +6,8 @@ __pycache__/
*.bin
*.elf
*.fbi
*.pcap
*.prof
.ipynb_checkpoints
/doc/manual/_build
/build
@ -14,20 +16,20 @@ __pycache__/
/.coverage
/artiq/test/lit/*/Output/
/artiq/binaries
/artiq/firmware/target/
/misoc_*/
/artiq_*/
/artiq/test/results
/artiq/examples/master/results
/artiq/examples/master/last_rid.pyon
/artiq/examples/master/dataset_db.pyon
/artiq/examples/sim/results
/artiq/examples/sim/dataset_db.pyon
/artiq/examples/*/results
/artiq/examples/*/last_rid.pyon
/artiq/examples/*/dataset_db.pyon
# recommended location for testbed
/run
# alternatively, when testing ad-hoc experiments at the root:
# when testing ad-hoc experiments at the root:
/repository/
/results
/last_rid.pyon
/dataset_db.pyon
/device_db.pyon
/test*.py
/dataset_db.mdb
/dataset_db.mdb-lock
/device_db*.py
/test*

4
.gitmodules vendored
View File

@ -1,4 +0,0 @@
[submodule "artiq/runtime/lwip"]
path = artiq/runtime/lwip
url = https://github.com/m-labs/lwip
ignore = untracked

View File

@ -7,9 +7,8 @@ Reporting Issues/Bugs
Thanks for `reporting issues to ARTIQ
<https://github.com/m-labs/artiq/issues/new>`_! You can also discuss issues and
ask questions on IRC (the `#m-labs channel on freenode
<https://webchat.freenode.net/?channels=m-labs>`_) or on the `mailing list
<https://ssl.serverraum.org/lists/listinfo/artiq>`_.
ask questions on IRC (the #m-labs channel on OFTC), the `Mattermost chat
<https://chat.m-labs.hk>`_, or on the `forum <https://forum.m-labs.hk>`_.
The best bug reports are those which contain sufficient information. With
accurate and comprehensive context, an issue can be resolved quickly and
@ -17,19 +16,19 @@ efficiently. Please consider adding the following data to your issue
report if possible:
* A clear and unique summary that fits into one line. Also check that
this issue has not jet been reported. If it has, add additional information there.
this issue has not yet been reported. If it has, add additional information there.
* Precise steps to reproduce (list of actions that leads to the issue)
* Expected behavior (what should happen)
* Actual behavior (what happens instead)
* Logging message, trace backs, screen shots where relevant
* Components involved:
* Components involved (omit irrelevant parts):
* Operating system
* Conda version
* ARTIQ version (package or git commit id, versions for bitstream, BIOS,
runtime and host software)
* Operating System
* ARTIQ version (with recent versions of ARTIQ, run ``artiq_client --version``)
* Version of the gateware and runtime loaded in the core device (in the output of ``artiq_coremgmt -D .... log``)
* Hardware involved
For in-depth information on bug reporting, see:
http://www.chiark.greenend.org.uk/~sgtatham/bugs.html
@ -42,16 +41,37 @@ Contributing Code
ARTIQ welcomes contributions. Write bite-sized patches that can stand alone,
clean them up, write proper commit messages, add docstrings and unittests. Then
``git rebase`` them onto the current master or merge the current master. Verify
that the testsuite passes. Then prepare a pull request or send patches to the
`mailing list <https://ssl.serverraum.org/lists/listinfo/artiq>`_ to be
discussed. Expect your contribution to be held up to coding standards (e.g. use
``flake8`` to check yourself).
that the testsuite passes. Then submit a pull request. Expect your contribution
to be held up to coding standards (e.g. use ``flake8`` to check yourself).
Checklist for Code Contributions
--------------------------------
- Test your changes or have someone test them. Mention what was tested and how.
- Use correct spelling and grammar. Use your code editor to help you with
syntax, spelling, and style
- Style: PEP-8 (``flake8``)
- Add, check docstrings and comments
- Split your contribution into logically separate changes (``git rebase
--interactive``). Merge (squash, fixup) commits that just fix previous commits
or amend them. Remove unintended changes. Clean up your commits.
- Check the copyright situation of your changes and sign off your patches
(``git commit --signoff``, see also below)
- Write meaningful commit messages containing the area of the change
and a concise description (50 characters or less) in the first line.
Describe everything else in the long explanation.
- Review each of your commits for the above items (``git show``)
- Update ``RELEASE_NOTES.md`` if there are noteworthy changes, especially if
there are changes to existing APIs
- Check, test, and update the documentation in `doc/`
- Check, test, and update the unittests
- Close and/or update issues
Copyright and Sign-Off
----------------------
Authors retain copyright of their contributions to ARTIQ, but whenever possible
should use the GNU GPL version 3 license for them to be merged.
should use the GNU LGPL version 3 license for them to be merged.
Works of US government employees are not copyrighted but can also be merged.
@ -95,4 +115,4 @@ then you just add a line saying
using your legal name (sorry, no pseudonyms or anonymous contributions.)
ARTIQ files that do not contain a license header are copyrighted by M-Labs Limited
and are licensed under GNU GPL version 3.
and are licensed under GNU LGPL version 3 or later.

20
DEVELOPER_NOTES.rst Normal file
View File

@ -0,0 +1,20 @@
Sharing development boards
==========================
To avoid conflicts for development boards on the server, while using a board you must hold the corresponding lock file present in the ``/tmp`` folder of the machine to which the board is connected. Holding the lock file grants you exclusive access to the board.
For example, to lock the KC705 until ENTER is pressed:
::
ssh rpi-1.m-labs.hk "flock /tmp/board_lock-kc705-1 -c 'echo locked; read; echo unlocked'"
If the board is already locked by another user, the ``flock`` commands above will wait for the lock to be released.
To determine which user is locking a board, use a command such as:
::
ssh rpi-1.m-labs.hk "fuser -v /tmp/board_lock-kc705-1"
Deleting git branches
=====================
Never use ``git push origin :branch`` nor ``git push origin --delete branch``, as this can delete code that others have pushed without warning. Instead, always delete branches using the GitHub web interface that lets you check better if the branch you are deleting has been fully merged.

827
LICENSE
View File

@ -1,674 +1,165 @@
GNU GENERAL PUBLIC LICENSE
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

674
LICENSE.GPL-3 Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@ -1,5 +1,8 @@
graft artiq/runtime
graft artiq/firmware
graft artiq/examples
include artiq/gui/logo*.svg
include versioneer.py
include artiq/_version.py
include artiq/coredevice/coredevice_generic.schema.json
include artiq/compiler/kernel.ld
include artiq/afws.pem

View File

@ -4,30 +4,60 @@
.. image:: https://raw.githubusercontent.com/m-labs/artiq/master/doc/logo/artiq.png
:target: https://m-labs.hk/artiq
ARTIQ (Advanced Real-Time Infrastructure for Quantum physics) is the next-generation control system for quantum information experiments.
It is developed by `M-Labs <https://m-labs.hk>`_ for and in partnership with the `Ion Storage Group at NIST <http://www.nist.gov/pml/div688/grp10/index.cfm>`_ as free software.
It is offered to the entire research community as a solution equally applicable to other challenging control tasks outside the field of ion trapping.
ARTIQ (Advanced Real-Time Infrastructure for Quantum physics) is a leading-edge control and data acquisition system for quantum information experiments.
It is maintained and developed by `M-Labs <https://m-labs.hk>`_ and the initial development was for and in partnership with the `Ion Storage Group at NIST <https://www.nist.gov/pml/time-and-frequency-division/ion-storage>`_. ARTIQ is free software and offered to the entire research community as a solution equally applicable to other challenging control tasks, including outside the field of ion trapping. Many laboratories around the world have adopted ARTIQ as their control system, with over a hundred Sinara hardware crates deployed, and some have `contributed <https://m-labs.hk/experiment-control/funding/>`_ to it.
The system features a high-level programming language that helps describing complex experiments, which is compiled and executed on dedicated hardware with nanosecond timing resolution and sub-microsecond latency. It includes graphical user interfaces to parametrize and schedule experiments and to visualize and explore the results.
ARTIQ uses FPGA hardware to perform its time-critical tasks.
It is designed to be portable to hardware platforms from different vendors and FPGA manufacturers.
Currently, one configuration of a `low-cost open hardware FPGA board <http://pipistrello.saanlima.com/>`_ and several different configurations of a `high-end FPGA evaluation kit <http://www.xilinx.com/products/boards-and-kits/ek-k7-kc705-g.html>`_ are used and supported.
Any of these FPGA platforms can be combined with any number of additional peripherals, either already accessible from ARTIQ or made accessible with little effort.
ARTIQ uses FPGA hardware to perform its time-critical tasks. The `Sinara hardware <https://github.com/sinara-hw>`_, and in particular the Kasli FPGA carrier, is designed to work with ARTIQ.
ARTIQ is designed to be portable to hardware platforms from different vendors and FPGA manufacturers.
Several different configurations of a `FPGA evaluation kit <https://www.xilinx.com/products/boards-and-kits/ek-k7-kc705-g.html>`_ and of a `Zynq evaluation kit <https://www.xilinx.com/products/boards-and-kits/ek-z7-zc706-g.html>`_ are also used and supported. FPGA platforms can be combined with any number of additional peripherals, either already accessible from ARTIQ or made accessible with little effort.
Custom hardware components with widely extended capabilities and advanced support for scalable and fully distributed real-time control of experiments `are being designed <https://github.com/m-labs/artiq-hardware>`_.
ARTIQ and its dependencies are available in the form of `conda packages <https://conda.anaconda.org/m-labs/label/main>`_ for both Linux and Windows.
ARTIQ and its dependencies are available in the form of Nix packages (for Linux) and MSYS2 packages (for Windows). See `the manual <https://m-labs.hk/experiment-control/resources/>`_ for installation instructions.
Packages containing pre-compiled binary images to be loaded onto the hardware platforms are supplied for each configuration.
Like any open source software ARTIQ can equally be built and installed directly from `source <https://github.com/m-labs/artiq>`_.
ARTIQ is supported by M-Labs and developed openly.
Components, features, fixes, improvements, and extensions are funded by and developed for the partnering research groups.
Components, features, fixes, improvements, and extensions are often `funded <https://m-labs.hk/experiment-control/funding/>`_ by and developed for the partnering research groups.
Technologies employed include `Python <https://www.python.org/>`_, `Migen <https://github.com/m-labs/migen>`_, `MiSoC <https://github.com/m-labs/misoc>`_/`mor1kx <https://github.com/openrisc/mor1kx>`_, `LLVM <http://llvm.org/>`_/`llvmlite <https://github.com/numba/llvmlite>`_, and `Qt5 <http://www.qt.io/>`_.
Core technologies employed include `Python <https://www.python.org/>`_, `Migen <https://github.com/m-labs/migen>`_, `Migen-AXI <https://github.com/peteut/migen-axi>`_, `Rust <https://www.rust-lang.org/>`_, `MiSoC <https://github.com/m-labs/misoc>`_/`VexRiscv <https://github.com/SpinalHDL/VexRiscv>`_, `LLVM <https://llvm.org/>`_/`llvmlite <https://github.com/numba/llvmlite>`_, and `Qt5 <https://www.qt.io/>`_.
Website: https://m-labs.hk/artiq
`Cite ARTIQ <http://dx.doi.org/10.5281/zenodo.51303>`_ as ``Bourdeauducq, Sébastien et al. (2016). ARTIQ 1.0. Zenodo. 10.5281/zenodo.51303``.
Copyright (C) 2014-2016 M-Labs Limited. Licensed under GNU GPL version 3.
License
=======
Copyright (C) 2014-2023 M-Labs Limited.
ARTIQ is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ARTIQ is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with ARTIQ. If not, see <http://www.gnu.org/licenses/>.
The ARTIQ manifesto
===================
The free and open dissemination of methods and results is central to scientific progress.
The ARTIQ and Sinara authors, contributors, and supporters consider the free and open exchange of scientific tools to be equally important and have chosen the licensing terms of ARTIQ and Sinara accordingly. ARTIQ, including its gateware, the firmware, and the ARTIQ tools and libraries are licensed as LGPLv3+. The Sinara hardware designs are licensed under CERN OHL.
This ensures that a user of ARTIQ or Sinara hardware designs obtains broad rights to use, redistribute, study, and modify them.
The following statements are intended to clarify the interpretation and application of the licensing terms:
* There is no requirement to distribute any unmodified, modified, or extended versions of ARTIQ. Only when distributing ARTIQ the source needs to be made available.
* Unmodified, modified, or extended versions of ARTIQ can be distributed freely under the terms of the LGPLv3+.
* Your ``Experiments``, ``Applets``, and ARTIQ device drivers are considered "Applications" (see the LGPLv3+) and can be (but don't have to be) distributed under the terms of your choice. The public distribution under a free and open license is encouraged, however.
* Similarly, distribution and licensing of your experiment data, calibrations, or measurement results is entirely at your discretion.
* Other features, changes, and additions are considered modifications of ARTIQ and inherit the LGPLv3+. Those include for example adding new RTIO ``Phys``, compiler optimizations, compiler features, ports of the compiler to other target CPUs, dashboard or browser features that are not in applets, as well as scheduler, master and runtime modifications.
* Analogously to the established practice in the Linux kernel, we do not consider components that are developed and used independently to be modifications of ARTIQ.
* For example, when developing a ``Phy`` for an independently developed and used gateware component, that gateware component is not considered a modification of ARTIQ (but the ``Phy`` is).

View File

@ -3,8 +3,532 @@
Release notes
=============
unreleased [2.x]
----------------
ARTIQ-8 (Unreleased)
--------------------
Highlights:
* New hardware support:
- Support for Shuttler, a 16-channel 125MSPS DAC card intended for ion transport.
Waveform generator and user API are similar to the NIST PDQ.
- Implemented Phaser-servo. This requires recent gateware on Phaser.
- Almazny v1.2 with finer RF switch control.
- Metlino and Sayma support has been dropped due to complications with synchronous RTIO clocking.
- More user LEDs are exposed to RTIO on Kasli.
- Implemented Phaser-MIQRO support. This requires the proprietary Phaser MIQRO gateware
variant from QUARTIQ.
- Sampler: fixed ADC MU to Volt conversion factor for Sampler v2.2+.
For earlier hardware versions, specify the hardware version in the device
database file (e.g. ``"hw_rev": "v2.1"``) to use the correct conversion factor.
* Support for distributed DMA, where DMA is run directly on satellites for corresponding
RTIO events, increasing bandwidth in scenarios with heavy satellite usage.
* Support for subkernels, where kernels are run on satellite device CPUs to offload some
of the processing and RTIO operations.
* CPU (on softcore platforms) and AXI bus (on Zynq) are now clocked synchronously with the RTIO
clock, to facilitate implementation of local processing on DRTIO satellites, and to slightly
reduce RTIO latency.
* Support for DRTIO-over-EEM, used with Shuttler.
* Added channel names to RTIO error messages.
* GUI:
- Implemented Applet Request Interfaces which allow applets to modify datasets and set the
current values of widgets in the dashboard's experiment windows.
- Implemented a new EntryArea widget which allows argument entry widgets to be used in applets.
- The "Close all applets" command (shortcut: Ctrl-Alt-W) now ignores docked applets,
making it a convenient way to clean up after exploratory work without destroying a
carefully arranged default workspace.
- Hotkeys now organize experiment windows in the order they were last interacted with:
+ CTRL+SHIFT+T tiles experiment windows
+ CTRL+SHIFT+C cascades experiment windows
* Persistent datasets are now stored in a LMDB database for improved performance.
* Python's built-in types (such as ``float``, or ``List[...]``) can now be used in type annotations on
kernel functions.
* Full Python 3.10 support.
* MSYS2 packaging for Windows, which replaces Conda. Conda packages are still available to
support legacy installations, but may be removed in a future release.
Breaking changes:
* ``SimpleApplet`` now calls widget constructors with an additional ``ctl`` parameter for control
operations, which includes dataset operations. It can be ignored if not needed. For an example usage,
refer to the ``big_number.py`` applet.
* ``SimpleApplet`` and ``TitleApplet`` now call ``data_changed`` with additional parameters. Derived applets
should change the function signature as below:
::
# SimpleApplet
def data_changed(self, value, metadata, persist, mods)
# SimpleApplet (old version)
def data_changed(self, data, mods)
# TitleApplet
def data_changed(self, value, metadata, persist, mods, title)
# TitleApplet (old version)
def data_changed(self, data, mods, title)
Accesses to the data argument should be replaced as below:
::
data[key][0] ==> persist[key]
data[key][1] ==> value[key]
* The ``ndecimals`` parameter in ``NumberValue`` and ``Scannable`` has been renamed to ``precision``.
Parameters after and including ``scale`` in both constructors are now keyword-only.
Refer to the updated ``no_hardware/arguments_demo.py`` example for current usage.
* Almazny v1.2 is incompatible with the legacy versions and is the default.
To use legacy versions, specify ``almazny_hw_rev`` in the JSON description.
* kasli_generic.py has been merged into kasli.py, and the demonstration designs without JSON descriptions
have been removed. The base classes remain present in kasli.py to support third-party flows without
JSON descriptions.
* Legacy PYON databases should be converted to LMDB with the script below:
::
from sipyco import pyon
import lmdb
old = pyon.load_file("dataset_db.pyon")
new = lmdb.open("dataset_db.mdb", subdir=False, map_size=2**30)
with new.begin(write=True) as txn:
for key, value in old.items():
txn.put(key.encode(), pyon.encode((value, {})).encode())
new.close()
* ``artiq.wavesynth`` has been removed.
ARTIQ-7
-------
Highlights:
* New hardware support:
- Kasli-SoC, a new EEM carrier based on a Zynq SoC, enabling much faster kernel execution
(see: https://arxiv.org/abs/2111.15290).
- DRTIO support on Zynq-based devices (Kasli-SoC and ZC706).
- DRTIO support on KC705.
- HVAMP_8CH 8 channel HV amplifier for Fastino / Zotinos
- Almazny mezzanine board for Mirny
- Phaser: improved documentation, exposed the DAC coarse mixer and ``sif_sync``, exposed upconverter calibration
and enabling/disabling of upconverter LO & RF outputs, added helpers to align Phaser updates to the
RTIO timeline (``get_next_frame_mu()``).
- Urukul: ``get()``, ``get_mu()``, ``get_att()``, and ``get_att_mu()`` functions added for AD9910 and AD9912.
* Softcore targets now use the RISC-V architecture (VexRiscv) instead of OR1K (mor1kx).
* Gateware FPU is supported on KC705 and Kasli 2.0.
* Faster compilation for large arrays/lists.
* Faster exception handling.
* Several exception handling bugs fixed.
* Support for a simpler shared library system with faster calls into the runtime. This is only used by the NAC3
compiler (nac3ld) and improves RTIO output performance (test_pulse_rate) by 9-10%.
* Moninj improvements:
- Urukul monitoring and frequency setting (through dashboard) is now supported.
- Core device moninj is now proxied via the ``aqctl_moninj_proxy`` controller.
* The configuration entry ``rtio_clock`` supports multiple clocking settings, deprecating the usage
of compile-time options.
* Added support for 100MHz RTIO clock in DRTIO.
* Previously detected RTIO async errors are reported to the host after each kernel terminates and a
warning is logged. The warning is additional to the one already printed in the core device log
immediately upon detection of the error.
* Extended Kasli gateware JSON description with configuration for SPI over DIO.
* TTL outputs can be now configured to work as a clock generator from the JSON.
* On Kasli, the number of FIFO lanes in the scalable events dispatcher (SED) can now be configured in
the JSON.
* ``artiq_ddb_template`` generates edge-counter keys that start with the key of the corresponding
TTL device (e.g. ``ttl_0_counter`` for the edge counter on TTL device ``ttl_0``).
* ``artiq_master`` now has an ``--experiment-subdir`` option to scan only a subdirectory of the
repository when building the list of experiments.
* Experiments can now be submitted by-content.
* The master can now optionally log all experiments submitted into a CSV file.
* Removed worker DB warning for writing a dataset that is also in the archive.
* Experiments can now call ``scheduler.check_termination()`` to test if the user
has requested graceful termination.
* ARTIQ command-line programs and controllers now exit cleanly on Ctrl-C.
* ``artiq_coremgmt reboot`` now reloads gateware as well, providing a more thorough and reliable
device reset (7-series FPGAs only).
* Firmware and gateware can now be built on-demand on the M-Labs server using ``afws_client``
(subscribers only). Self-compilation remains possible.
* Easier-to-use packaging via Nix Flakes.
* Python 3.10 support (experimental).
Breaking changes:
* Due to the new RISC-V CPU, the device database entry for the core device needs to be updated.
The ``target`` parameter needs to be set to ``rv32ima`` for Kasli 1.x and to ``rv32g`` for all
other boards. Freshly generated device database templates already contain this update.
* Updated Phaser-Upconverter default frequency 2.875 GHz. The new default uses the target PFD
frequency of the hardware design.
* ``Phaser.init()`` now disables all Kasli-oscillators. This avoids full power RF output being
generated for some configurations.
* Phaser: fixed coarse mixer frequency configuration
* Mirny: Added extra delays in ``ADF5356.sync()``. This avoids the need of an extra delay before
calling ``ADF5356.init()``.
* The deprecated ``set_dataset(..., save=...)`` is no longer supported.
* The ``PCA9548`` I2C switch class was renamed to ``I2CSwitch``, to accommodate support for PCA9547,
and possibly other switches in future. Readback has been removed, and now only one channel per
switch is supported.
ARTIQ-6
-------
Highlights:
* New hardware support:
- Phaser, a quad channel 1GS/s RF generator card with dual IQ upconverter and dual 5MS/s
ADC and FPGA.
- Zynq SoC core device (ZC706), enabling kernels to run on 1 GHz CPU core with a floating-point
unit for faster computations. This currently requires an external
repository (https://git.m-labs.hk/m-labs/artiq-zynq).
- Mirny 4-channel wide-band PLL/VCO-based microwave frequency synthesiser
- Fastino 32-channel, 3MS/s per channel, 16-bit DAC EEM
- Kasli 2.0, an improved core device with 12 built-in EEM slots, faster FPGA, 4 SFPs, and
high-precision clock recovery circuitry for DRTIO (to be supported in ARTIQ-7).
* ARTIQ Python (core device kernels):
- Multidimensional arrays are now available on the core device, using NumPy syntax.
Elementwise operations (e.g. ``+``, ``/``), matrix multiplication (``@``) and
multidimensional indexing are supported; slices and views are not yet.
- Trigonometric and other common math functions from NumPy are now available on the
core device (e.g. ``numpy.sin``), both for scalar arguments and implicitly
broadcast across multidimensional arrays.
- Failed assertions now raise ``AssertionError``\ s instead of aborting kernel
execution.
* Performance improvements:
- SERDES TTL inputs can now detect edges on pulses that are shorter
than the RTIO period (https://github.com/m-labs/artiq/issues/1432)
- Improved performance for kernel RPC involving list and array.
* Coredevice SI to mu conversions now always return valid codes, or raise a ``ValueError``.
* Zotino now exposes ``voltage_to_mu()``
* ``ad9910``:
- The maximum amplitude scale factor is now ``0x3fff`` (was ``0x3ffe`` before).
- The default single-tone profile is now 7 (was 0).
- Added option to ``set_mu()`` that affects the ASF, FTW and POW registers
instead of the single-tone profile register.
* Mirny now supports HW revision independent, human readable ``clk_sel`` parameters:
"XO", "SMA", and "MMCX". Passing an integer is backwards compatible.
* Dashboard:
- Applets now restart if they are running and a ccb call changes their spec
- A "Quick Open" dialog to open experiments by typing part of their name can
be brought up Ctrl-P (Ctrl+Return to immediately submit the selected entry
with the default arguments).
- The Applets dock now has a context menu command to quickly close all open
applets (shortcut: Ctrl-Alt-W).
* Experiment results are now always saved to HDF5, even if ``run()`` fails.
* Core device: ``panic_reset 1`` now correctly resets the kernel CPU as well if
communication CPU panic occurs.
* NumberValue accepts a ``type`` parameter specifying the output as ``int`` or ``float``
* A parameter ``--identifier-str`` has been added to many targets to aid
with reproducible builds.
* Python 3.7 support in Conda packages.
* `kasli_generic` JSON descriptions are now validated against a
schema. Description defaults have moved from Python to the
schema. Warns if ARTIQ version is too old.
Breaking changes:
* ``artiq_netboot`` has been moved to its own repository at
https://git.m-labs.hk/m-labs/artiq-netboot
* Core device watchdogs have been removed.
* The ARTIQ compiler now implements arrays following NumPy semantics, rather than as a
thin veneer around lists. Most prior use cases of NumPy arrays in kernels should work
unchanged with the new implementation, but the behavior might differ slightly in some
cases (for instance, non-rectangular arrays are not currently supported).
* ``quamash`` has been replaced with ``qasync``.
* Protocols are updated to use device endian.
* Analyzer dump format includes a byte for device endianness.
* To support variable numbers of Urukul cards in the future, the
``artiq.coredevice.suservo.SUServo`` constructor now accepts two device name lists,
``cpld_devices`` and ``dds_devices``, rather than four individual arguments.
* Experiment classes with underscore-prefixed names are now ignored when ``artiq_client``
determines which experiment to submit (consistent with ``artiq_run``).
ARTIQ-5
-------
Highlights:
* Performance improvements:
- Faster RTIO event submission (1.5x improvement in pulse rate test)
See: https://github.com/m-labs/artiq/issues/636
- Faster compilation times (3 seconds saved on kernel compilation time on a typical
medium-size experiment)
See: https://github.com/m-labs/artiq/commit/611bcc4db4ed604a32d9678623617cd50e968cbf
* Improved packaging and build system:
- new continuous integration/delivery infrastructure based on Nix and Hydra,
providing reproducibility, speed and independence.
- rolling release process (https://github.com/m-labs/artiq/issues/1326).
- firmware, gateware and device database templates are automatically built for all
supported Kasli variants.
- new JSON description format for generic Kasli systems.
- Nix packages are now supported.
- many Conda problems worked around.
- controllers are now out-of-tree.
- split packages that enable lightweight applications that communicate with ARTIQ,
e.g. controllers running on non-x86 single-board computers.
* Improved Urukul support:
- AD9910 RAM mode.
- Configurable refclk divider and PLL bypass.
- More reliable phase synchronization at high sample rates.
- Synchronization calibration data can be read from EEPROM.
* A gateware-level input edge counter has been added, which offers higher
throughput and increased flexibility over the usual TTL input PHYs where
edge timestamps are not required. See ``artiq.coredevice.edge_counter`` for
the core device driver and ``artiq.gateware.rtio.phy.edge_counter``/
``artiq.gateware.eem.DIO.add_std`` for the gateware components.
* With DRTIO, Siphaser uses a better calibration mechanism.
See: https://github.com/m-labs/artiq/commit/cc58318500ecfa537abf24127f2c22e8fe66e0f8
* Schedule updates can be sent to influxdb (artiq_influxdb_schedule).
* Experiments can now programatically set their default pipeline, priority, and flush flag.
* List datasets can now be efficiently appended to from experiments using
``artiq.language.environment.HasEnvironment.append_to_dataset``.
* The core device now supports IPv6.
* To make development easier, the bootloader can receive firmware and secondary FPGA
gateware from the network.
* Python 3.7 compatibility (Nix and source builds only, no Conda).
* Various other bugs from 4.0 fixed.
* Preliminary Sayma v2 and Metlino hardware support.
Breaking changes:
* The ``artiq.coredevice.ad9910.AD9910`` and
``artiq.coredevice.ad9914.AD9914`` phase reference timestamp parameters
have been renamed to ``ref_time_mu`` for consistency, as they are in machine
units.
* The controller manager now ignores device database entries without the
``command`` key set to facilitate sharing of devices between multiple
masters.
* The meaning of the ``-d/--dir`` and ``--srcbuild`` options of ``artiq_flash``
has changed.
* Controllers for third-party devices are now out-of-tree.
* ``aqctl_corelog`` now filters log messages below the ``WARNING`` level by default.
This behavior can be changed using the ``-v`` and ``-q`` options like the other
programs.
* On Kasli the firmware now starts with a unique default MAC address
from EEPROM if `mac` is absent from the flash config.
* The ``-e/--experiment`` switch of ``artiq_run`` and ``artiq_compile``
has been renamed ``-c/--class-name``.
* ``artiq_devtool`` has been removed.
* Much of ``artiq.protocols`` has been moved to a separate package ``sipyco``.
``artiq_rpctool`` has been renamed to ``sipyco_rpctool``.
ARTIQ-4
-------
4.0
***
* The ``artiq.coredevice.ttl`` drivers no longer track the timestamps of
submitted events in software, requiring the user to explicitly specify the
timeout for ``count()``/``timestamp_mu()``. Support for ``sync()`` has been dropped.
Now that RTIO has gained DMA support, there is no longer a reliable way for
the kernel CPU to track the individual events submitted on any one channel.
Requiring the timeouts to be specified explicitly ensures consistent API
behavior. To make this more convenient, the ``TTLInOut.gate_*()`` functions
now return the cursor position at the end of the gate, e.g.::
ttl_input.count(ttl_input.gate_rising(100 * us))
In most situations that is, unless the timeline cursor is rewound after the
respective ``gate_*()`` call simply passing ``now_mu()`` is also a valid
upgrade path::
ttl_input.count(now_mu())
The latter might use up more timeline slack than necessary, though.
In place of ``TTL(In)Out.sync``, the new ``Core.wait_until_mu()`` method can
be used, which blocks execution until the hardware RTIO cursor reaches the
given timestamp::
ttl_output.pulse(10 * us)
self.core.wait_until_mu(now_mu())
* RTIO outputs use a new architecture called Scalable Event Dispatcher (SED),
which allows building systems with large number of RTIO channels more
efficiently.
From the user perspective, collision errors become asynchronous, and non-
monotonic timestamps on any combination of channels are generally allowed
(instead of producing sequence errors).
RTIO inputs are not affected.
* The DDS channel number for the NIST CLOCK target has changed.
* The dashboard configuration files are now stored one-per-master, keyed by the
server address argument and the notify port.
* The master now has a ``--name`` argument. If given, the dashboard is labelled
with this name rather than the server address.
* ``artiq_flash`` targets Kasli by default. Use ``-t kc705`` to flash a KC705
instead.
* ``artiq_flash -m/--adapter`` has been changed to ``artiq_flash -V/--variant``.
* The ``proxy`` action of ``artiq_flash`` is determined automatically and should
not be specified manually anymore.
* ``kc705_dds`` has been renamed ``kc705``.
* The ``-H/--hw-adapter`` option of ``kc705`` has been renamed ``-V/--variant``.
* SPI masters have been switched from misoc-spi to misoc-spi2. This affects
all out-of-tree RTIO core device drivers using those buses. See the various
commits on e.g. the ``ad53xx`` driver for an example how to port from the old
to the new bus.
* The ``ad5360`` coredevice driver has been renamed to ``ad53xx`` and the API
has changed to better support Zotino.
* ``artiq.coredevice.dds`` has been renamed to ``artiq.coredevice.ad9914`` and
simplified. DDS batch mode is no longer supported. The ``core_dds`` device
is no longer necessary.
* The configuration entry ``startup_clock`` is renamed ``rtio_clock``. Switching
clocks dynamically (i.e. without device restart) is no longer supported.
* ``set_dataset(..., save=True)`` has been renamed
``set_dataset(..., archive=True)``.
* On the AD9914 DDS, when switching to ``PHASE_MODE_CONTINUOUS`` from another mode,
use the returned value of the last ``set_mu`` call as the phase offset for
``PHASE_MODE_CONTINUOUS`` to avoid a phase discontinuity. This is no longer done
automatically. If one phase glitch when entering ``PHASE_MODE_CONTINUOUS`` is not
an issue, this recommendation can be ignored.
ARTIQ-3
-------
3.7
***
No further notes.
3.6
***
No further notes.
3.5
***
No further notes.
3.4
***
No further notes.
3.3
***
No further notes.
3.2
***
* To accommodate larger runtimes, the flash layout as changed. As a result, the
contents of the flash storage will be lost when upgrading. Set the values back
(IP, MAC address, startup kernel, etc.) after the upgrade.
3.1
***
No further notes.
3.0
***
* The ``--embed`` option of applets is replaced with the environment variable
``ARTIQ_APPLET_EMBED``. The GUI sets this enviroment variable itself and the
user simply needs to remove the ``--embed`` argument.
* ``EnvExperiment``'s ``prepare`` calls ``prepare`` for all its children.
* Dynamic ``__getattr__``'s returning RPC target methods are not supported anymore.
Controller driver classes must define all their methods intended for RPC as
members.
* Datasets requested by experiments are by default archived into their HDF5
output. If this behavior is undesirable, turn it off by passing
``archive=False`` to ``get_dataset``.
* ``seconds_to_mu`` and ``mu_to_seconds`` have become methods of the core
device driver (use e.g. ``self.core.seconds_to_mu()``).
* AD9858 DDSes and NIST QC1 hardware are no longer supported.
* The DDS class names and setup options have changed, this requires an update of
the device database.
* ``int(a, width=b)`` has been removed. Use ``int32(a)`` and ``int64(a)``.
* The KC705 gateware target has been renamed ``kc705_dds``.
* ``artiq.coredevice.comm_tcp`` has been renamed ``artiq.coredevice.comm_kernel``,
and ``Comm`` has been renamed ``CommKernel``.
* The "collision" and "busy" RTIO errors are reported through the log instead of
raising exceptions.
* Results are still saved when ``analyze`` raises an exception.
* ``LinearScan`` and ``RandomScan`` have been consolidated into RangeScan.
* The Pipistrello is no longer supported. For a low-cost ARTIQ setup, use either
ARTIQ 2.x with Pipistrello, or the future ARTIQ 4.x with Kasli. Note that the
Pipistrello board has also been discontinued by the manufacturer but its design
files are freely available.
* The device database is now generated by an executable Python script. To migrate
an existing database, add ``device_db = `` at the beginning, and replace any PYON
identifiers (``true``, ``null``, ...) with their Python equivalents
(``True``, ``None`` ...).
* Controllers are now named ``aqctl_XXX`` instead of ``XXX_controller``.
* In the device database, the ``comm`` device has been folded into the ``core`` device.
Move the "host" argument into the ``core`` device, and remove the ``comm`` device.
* The core device log now contains important information about events such as
RTIO collisions. A new controller ``aqctl_corelog`` must be running to forward
those logs to the master. See the example device databases to see how to
instantiate this controller. Using ``artiq_session`` ensures that a controller
manager is running simultaneously with the master.
* Experiments scheduled with the "flush pipeline" option now proceed when there
are lower-priority experiments in the pipeline. Only experiments at the current
(or higher) priority level are flushed.
* The PDQ(2/3) driver has been removed and is now being maintained out-of tree
at https://github.com/m-labs/pdq. All SPI/USB driver layers, Mediator,
CompoundPDQ and examples/documentation has been moved.
* The master now rotates log files at midnight, rather than based on log size.
* The results keys ``start_time`` and ``run_time`` are now stored as doubles of UNIX time,
rather than ints. The file names are still based on local time.
* Packages are no longer available for 32-bit Windows.
ARTIQ-2
-------
2.5
***
No further notes.
2.4
***
No further notes.
2.3
***
* When using conda, add the conda-forge channel before installing ARTIQ.
2.2
***
No further notes.
2.1
***
No further notes.
2.0
***
No further notes.
2.0rc2
******
No further notes.
2.0rc1
******
* The format of the influxdb pattern file is simplified. The procedure to
edit patterns is also changed to modifying the pattern file and calling:
@ -34,6 +558,8 @@ unreleased [2.x]
(i.e. grouping by day and then by hour, instead of by day and then by minute)
* The ``parent`` keyword argument of ``HasEnvironment`` (and ``EnvExperiment``)
has been replaced. Pass the parent as first argument instead.
* During experiment examination (and a fortiori repository scan), the values of
all arguments are set to ``None`` regardless of any default values supplied.
* In the dashboard's experiment windows, partial or full argument recomputation
takes into account the repository revision field.
* By default, ``NumberValue`` and ``Scannable`` infer the scale from the unit
@ -50,39 +576,43 @@ unreleased [2.x]
numpy.int64). If you pass an integer as a RPC argument, the target function
receives a numpy type.
ARTIQ-1
-------
1.3
---
***
No further notes.
1.2
---
***
No further notes.
1.1
---
***
* TCA6424A.set converts the "outputs" value to little-endian before programming
it into the registers.
1.0
---
***
No further notes.
1.0rc4
------
******
* setattr_argument and setattr_device add their key to kernel_invariants.
1.0rc3
------
******
* The HDF5 format has changed.
@ -96,7 +626,7 @@ No further notes.
1.0rc2
------
******
* The CPU speed in the pipistrello gateware has been reduced from 83 1/3 MHz to
75 MHz. This will reduce the achievable sustained pulse rate and latency
@ -106,7 +636,7 @@ No further notes.
1.0rc1
------
******
* Experiments (your code) should use ``from artiq.experiment import *``
(and not ``from artiq import *`` as previously)

View File

@ -1,23 +0,0 @@
Release process
===============
Maintain ``RELEASE_NOTES.rst`` with a list of new features and API changes in each major release.
Major releases
--------------
1. Create branch release-X from master.
2. Tag the next commit in master X+1.0.dev.
3. Ensure that release versions of all packages required are available under the ``main`` label in conda. Ensure that new packages in ``main`` do not break older ARTIQ releases.
4. In the release-X branch, remove any unfinished features.
5. Test and fix any problems found. Apply fixes to both master and release-X.
6. If you have willing testers for release candidates, tag X.0rc1 in the release-X branch, have it build, and point testers there. Iterate over the previous points with new release candidates if necessary.
7. Tag X.0 in the release-X branch, build it, and copy its packages to ``main`` channel.
8. Mint a new DOI from Zenodo and update the README/introduction.
Minor (bugfix) releases
-----------------------
1. Backport bugfixes from the master branch or fix bugs specific to old releases into the currently maintained release-X branch(es).
2. When significant bugs have been fixed, tag X.Y+1.
3. To help dealing with regressions, no new features or refactorings should be implemented in release-X branches. Those happen in the master branch, and then a new release-X+1 branch is created.

View File

@ -1,6 +1,6 @@
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
from ._version import get_version
__version__ = get_version()
del get_version
import os
__artiq_dir__ = os.path.dirname(os.path.abspath(__file__))

View File

@ -1,486 +1,7 @@
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains the computed version number.
# This file is released into the public domain. Generated by
# versioneer-0.15+dev (https://github.com/warner/python-versioneer)
"""Git implementation of _version.py."""
import errno
import os
import re
import subprocess
import sys
def get_rev():
return os.getenv("VERSIONEER_REV", default="unknown")
def get_keywords():
"""Get the keywords needed to look up the version information."""
# these strings will be replaced by git during git-archive.
# setup.py/versioneer.py will grep for the variable names, so they must
# each be defined on a line of their own. _version.py will just call
# get_keywords().
git_refnames = "$Format:%d$"
git_full = "$Format:%H$"
keywords = {"refnames": git_refnames, "full": git_full}
return keywords
class VersioneerConfig:
"""Container for Versioneer configuration parameters."""
def get_config():
"""Create, populate and return the VersioneerConfig() object."""
# these strings are filled in when 'setup.py versioneer' creates
# _version.py
cfg = VersioneerConfig()
cfg.VCS = "git"
cfg.style = "pep440"
cfg.tag_prefix = ""
cfg.parentdir_prefix = "artiq-"
cfg.versionfile_source = "artiq/_version.py"
cfg.verbose = False
return cfg
class NotThisMethod(Exception):
"""Exception raised if a method is not valid for the current scenario."""
LONG_VERSION_PY = {}
HANDLERS = {}
def register_vcs_handler(vcs, method): # decorator
"""Decorator to mark a method as the handler for a particular VCS."""
def decorate(f):
"""Store f in HANDLERS[vcs][method]."""
if vcs not in HANDLERS:
HANDLERS[vcs] = {}
HANDLERS[vcs][method] = f
return f
return decorate
def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False):
"""Call the given command(s)."""
assert isinstance(commands, list)
p = None
for c in commands:
try:
dispcmd = str([c] + args)
# remember shell=False, so use git.cmd on windows, not just git
p = subprocess.Popen([c] + args, cwd=cwd, stdout=subprocess.PIPE,
stderr=(subprocess.PIPE if hide_stderr
else None))
break
except EnvironmentError:
e = sys.exc_info()[1]
if e.errno == errno.ENOENT:
continue
if verbose:
print("unable to run %s" % dispcmd)
print(e)
return None
else:
if verbose:
print("unable to find command, tried %s" % (commands,))
return None
stdout = p.communicate()[0].strip()
if sys.version_info[0] >= 3:
stdout = stdout.decode()
if p.returncode != 0:
if verbose:
print("unable to run %s (error)" % dispcmd)
return None
return stdout
def versions_from_parentdir(parentdir_prefix, root, verbose):
"""Try to determine the version from the parent directory name.
Source tarballs conventionally unpack into a directory that includes
both the project name and a version string.
"""
dirname = os.path.basename(root)
if not dirname.startswith(parentdir_prefix):
if verbose:
print("guessing rootdir is '%s', but '%s' doesn't start with "
"prefix '%s'" % (root, dirname, parentdir_prefix))
raise NotThisMethod("rootdir doesn't start with parentdir_prefix")
return {"version": dirname[len(parentdir_prefix):],
"full-revisionid": None,
"dirty": False, "error": None}
@register_vcs_handler("git", "get_keywords")
def git_get_keywords(versionfile_abs):
"""Extract version information from the given file."""
# the code embedded in _version.py can just fetch the value of these
# keywords. When used from setup.py, we don't want to import _version.py,
# so we do it with a regexp instead. This function is not used from
# _version.py.
keywords = {}
try:
f = open(versionfile_abs, "r")
for line in f.readlines():
if line.strip().startswith("git_refnames ="):
mo = re.search(r'=\s*"(.*)"', line)
if mo:
keywords["refnames"] = mo.group(1)
if line.strip().startswith("git_full ="):
mo = re.search(r'=\s*"(.*)"', line)
if mo:
keywords["full"] = mo.group(1)
f.close()
except EnvironmentError:
pass
return keywords
@register_vcs_handler("git", "keywords")
def git_versions_from_keywords(keywords, tag_prefix, verbose):
"""Get version information from git keywords."""
if not keywords:
raise NotThisMethod("no keywords at all, weird")
refnames = keywords["refnames"].strip()
if refnames.startswith("$Format"):
if verbose:
print("keywords are unexpanded, not using")
raise NotThisMethod("unexpanded keywords, not a git-archive tarball")
refs = set([r.strip() for r in refnames.strip("()").split(",")])
# starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of
# just "foo-1.0". If we see a "tag: " prefix, prefer those.
TAG = "tag: "
tags = set([r[len(TAG):] for r in refs if r.startswith(TAG)])
if not tags:
# Either we're using git < 1.8.3, or there really are no tags. We use
# a heuristic: assume all version tags have a digit. The old git %d
# expansion behaves like git log --decorate=short and strips out the
# refs/heads/ and refs/tags/ prefixes that would let us distinguish
# between branches and tags. By ignoring refnames without digits, we
# filter out many common branch names like "release" and
# "stabilization", as well as "HEAD" and "master".
tags = set([r for r in refs if re.search(r'\d', r)])
if verbose:
print("discarding '%s', no digits" % ",".join(refs-tags))
if verbose:
print("likely tags: %s" % ",".join(sorted(tags)))
for ref in sorted(tags):
# sorting will prefer e.g. "2.0" over "2.0rc1"
if ref.startswith(tag_prefix):
r = ref[len(tag_prefix):]
if verbose:
print("picking %s" % r)
return {"version": r,
"full-revisionid": keywords["full"].strip(),
"dirty": False, "error": None
}
# no suitable tags, so version is "0+unknown", but full hex is still there
if verbose:
print("no suitable tags, using unknown + full revision id")
return {"version": "0+unknown",
"full-revisionid": keywords["full"].strip(),
"dirty": False, "error": "no suitable tags"}
@register_vcs_handler("git", "pieces_from_vcs")
def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
"""Get version from 'git describe' in the root of the source tree.
This only gets called if the git-archive 'subst' keywords were *not*
expanded, and _version.py hasn't already been rewritten with a short
version string, meaning we're inside a checked out source tree.
"""
if not os.path.exists(os.path.join(root, ".git")):
if verbose:
print("no .git in %s" % root)
raise NotThisMethod("no .git directory")
GITS = ["git"]
if sys.platform == "win32":
GITS = ["git.cmd", "git.exe"]
# if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty]
# if there isn't one, this yields HEX[-dirty] (no NUM)
describe_out = run_command(GITS, ["describe", "--tags", "--dirty",
"--always", "--long",
"--match", "%s*" % tag_prefix],
cwd=root)
# --long was added in git-1.5.5
if describe_out is None:
raise NotThisMethod("'git describe' failed")
describe_out = describe_out.strip()
full_out = run_command(GITS, ["rev-parse", "HEAD"], cwd=root)
if full_out is None:
raise NotThisMethod("'git rev-parse' failed")
full_out = full_out.strip()
pieces = {}
pieces["long"] = full_out
pieces["short"] = full_out[:7] # maybe improved later
pieces["error"] = None
# parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty]
# TAG might have hyphens.
git_describe = describe_out
# look for -dirty suffix
dirty = git_describe.endswith("-dirty")
pieces["dirty"] = dirty
if dirty:
git_describe = git_describe[:git_describe.rindex("-dirty")]
# now we have TAG-NUM-gHEX or HEX
if "-" in git_describe:
# TAG-NUM-gHEX
mo = re.search(r'^(.+)-(\d+)-g([0-9a-f]+)$', git_describe)
if not mo:
# unparseable. Maybe git-describe is misbehaving?
pieces["error"] = ("unable to parse git-describe output: '%s'"
% describe_out)
return pieces
# tag
full_tag = mo.group(1)
if not full_tag.startswith(tag_prefix):
if verbose:
fmt = "tag '%s' doesn't start with prefix '%s'"
print(fmt % (full_tag, tag_prefix))
pieces["error"] = ("tag '%s' doesn't start with prefix '%s'"
% (full_tag, tag_prefix))
return pieces
pieces["closest-tag"] = full_tag[len(tag_prefix):]
# distance: number of commits since tag
pieces["distance"] = int(mo.group(2))
# commit: short hex revision ID
pieces["short"] = mo.group(3)
else:
# HEX: no tags
pieces["closest-tag"] = None
count_out = run_command(GITS, ["rev-list", "HEAD", "--count"],
cwd=root)
pieces["distance"] = int(count_out) # total number of commits
return pieces
def plus_or_dot(pieces):
"""Return a + if we don't already have one, else return a ."""
if "+" in pieces.get("closest-tag", ""):
return "."
return "+"
def render_pep440(pieces):
"""Build up version string, with post-release "local version identifier".
Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you
get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty
Exceptions:
1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty]
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
if pieces["distance"] or pieces["dirty"]:
rendered += plus_or_dot(pieces)
rendered += "%d.g%s" % (pieces["distance"], pieces["short"])
if pieces["dirty"]:
rendered += ".dirty"
else:
# exception #1
rendered = "0+untagged.%d.g%s" % (pieces["distance"],
pieces["short"])
if pieces["dirty"]:
rendered += ".dirty"
return rendered
def render_pep440_pre(pieces):
"""TAG[.post.devDISTANCE] -- No -dirty.
Exceptions:
1: no tags. 0.post.devDISTANCE
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
if pieces["distance"]:
rendered += ".post.dev%d" % pieces["distance"]
else:
# exception #1
rendered = "0.post.dev%d" % pieces["distance"]
return rendered
def render_pep440_post(pieces):
"""TAG[.postDISTANCE[.dev0]+gHEX] .
The ".dev0" means dirty. Note that .dev0 sorts backwards
(a dirty tree will appear "older" than the corresponding clean one),
but you shouldn't be releasing software with -dirty anyways.
Exceptions:
1: no tags. 0.postDISTANCE[.dev0]
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
if pieces["distance"] or pieces["dirty"]:
rendered += ".post%d" % pieces["distance"]
if pieces["dirty"]:
rendered += ".dev0"
rendered += plus_or_dot(pieces)
rendered += "g%s" % pieces["short"]
else:
# exception #1
rendered = "0.post%d" % pieces["distance"]
if pieces["dirty"]:
rendered += ".dev0"
rendered += "+g%s" % pieces["short"]
return rendered
def render_pep440_old(pieces):
"""TAG[.postDISTANCE[.dev0]] .
The ".dev0" means dirty.
Eexceptions:
1: no tags. 0.postDISTANCE[.dev0]
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
if pieces["distance"] or pieces["dirty"]:
rendered += ".post%d" % pieces["distance"]
if pieces["dirty"]:
rendered += ".dev0"
else:
# exception #1
rendered = "0.post%d" % pieces["distance"]
if pieces["dirty"]:
rendered += ".dev0"
return rendered
def render_git_describe(pieces):
"""TAG[-DISTANCE-gHEX][-dirty].
Like 'git describe --tags --dirty --always'.
Exceptions:
1: no tags. HEX[-dirty] (note: no 'g' prefix)
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
if pieces["distance"]:
rendered += "-%d-g%s" % (pieces["distance"], pieces["short"])
else:
# exception #1
rendered = pieces["short"]
if pieces["dirty"]:
rendered += "-dirty"
return rendered
def render_git_describe_long(pieces):
"""TAG-DISTANCE-gHEX[-dirty].
Like 'git describe --tags --dirty --always -long'.
The distance/hash is unconditional.
Exceptions:
1: no tags. HEX[-dirty] (note: no 'g' prefix)
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
rendered += "-%d-g%s" % (pieces["distance"], pieces["short"])
else:
# exception #1
rendered = pieces["short"]
if pieces["dirty"]:
rendered += "-dirty"
return rendered
def render(pieces, style):
"""Render the given version pieces into the requested style."""
if pieces["error"]:
return {"version": "unknown",
"full-revisionid": pieces.get("long"),
"dirty": None,
"error": pieces["error"]}
if not style or style == "default":
style = "pep440" # the default
if style == "pep440":
rendered = render_pep440(pieces)
elif style == "pep440-pre":
rendered = render_pep440_pre(pieces)
elif style == "pep440-post":
rendered = render_pep440_post(pieces)
elif style == "pep440-old":
rendered = render_pep440_old(pieces)
elif style == "git-describe":
rendered = render_git_describe(pieces)
elif style == "git-describe-long":
rendered = render_git_describe_long(pieces)
else:
raise ValueError("unknown style '%s'" % style)
return {"version": rendered, "full-revisionid": pieces["long"],
"dirty": pieces["dirty"], "error": None}
def get_versions():
"""Get version information or return default if unable to do so."""
# I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we have
# __file__, we can work backwards from there to the root. Some
# py2exe/bbfreeze/non-CPython implementations don't do __file__, in which
# case we can only use expanded keywords.
cfg = get_config()
verbose = cfg.verbose
try:
return git_versions_from_keywords(get_keywords(), cfg.tag_prefix,
verbose)
except NotThisMethod:
pass
try:
root = os.path.realpath(__file__)
# versionfile_source is the relative path from the top of the source
# tree (where the .git directory might live) to this file. Invert
# this to find the root from __file__.
for i in cfg.versionfile_source.split('/'):
root = os.path.dirname(root)
except NameError:
return {"version": "0+unknown", "full-revisionid": None,
"dirty": None,
"error": "unable to find root of source tree"}
try:
pieces = git_pieces_from_vcs(cfg.tag_prefix, root, verbose)
return render(pieces, cfg.style)
except NotThisMethod:
pass
try:
if cfg.parentdir_prefix:
return versions_from_parentdir(cfg.parentdir_prefix, root, verbose)
except NotThisMethod:
pass
return {"version": "0+unknown", "full-revisionid": None,
"dirty": None,
"error": "unable to compute version"}
def get_version():
return os.getenv("VERSIONEER_OVERRIDE", default="8.0+unknown.beta")

View File

@ -1,22 +1,96 @@
#!/usr/bin/env python3.5
from PyQt5 import QtWidgets
#!/usr/bin/env python3
from PyQt5 import QtWidgets, QtCore, QtGui
from artiq.applets.simple import SimpleApplet
from artiq.tools import scale_from_metadata
from artiq.gui.tools import LayoutWidget
class NumberWidget(QtWidgets.QLCDNumber):
def __init__(self, args):
QtWidgets.QLCDNumber.__init__(self)
self.setDigitCount(args.digit_count)
class QResponsiveLCDNumber(QtWidgets.QLCDNumber):
doubleClicked = QtCore.pyqtSignal()
def mouseDoubleClickEvent(self, event):
self.doubleClicked.emit()
class QCancellableLineEdit(QtWidgets.QLineEdit):
editCancelled = QtCore.pyqtSignal()
def keyPressEvent(self, event):
if event.key() == QtCore.Qt.Key_Escape:
self.editCancelled.emit()
else:
super().keyPressEvent(event)
class NumberWidget(LayoutWidget):
def __init__(self, args, req):
LayoutWidget.__init__(self)
self.dataset_name = args.dataset
self.req = req
self.metadata = dict()
def data_changed(self, data, mods):
self.number_area = QtWidgets.QStackedWidget()
self.addWidget(self.number_area, 0, 0)
self.unit_area = QtWidgets.QLabel()
self.unit_area.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTop)
self.addWidget(self.unit_area, 0, 1)
self.lcd_widget = QResponsiveLCDNumber()
self.lcd_widget.setDigitCount(args.digit_count)
self.lcd_widget.doubleClicked.connect(self.start_edit)
self.number_area.addWidget(self.lcd_widget)
self.edit_widget = QCancellableLineEdit()
self.edit_widget.setValidator(QtGui.QDoubleValidator())
self.edit_widget.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
self.edit_widget.editCancelled.connect(self.cancel_edit)
self.edit_widget.returnPressed.connect(self.confirm_edit)
self.number_area.addWidget(self.edit_widget)
font = QtGui.QFont()
font.setPointSize(60)
self.edit_widget.setFont(font)
unit_font = QtGui.QFont()
unit_font.setPointSize(20)
self.unit_area.setFont(unit_font)
self.number_area.setCurrentWidget(self.lcd_widget)
def start_edit(self):
# QLCDNumber value property contains the value of zero
# if the displayed value is not a number.
self.edit_widget.setText(str(self.lcd_widget.value()))
self.edit_widget.selectAll()
self.edit_widget.setFocus()
self.number_area.setCurrentWidget(self.edit_widget)
def confirm_edit(self):
scale = scale_from_metadata(self.metadata)
val = float(self.edit_widget.text())
val *= scale
self.req.set_dataset(self.dataset_name, val, **self.metadata)
self.number_area.setCurrentWidget(self.lcd_widget)
def cancel_edit(self):
self.number_area.setCurrentWidget(self.lcd_widget)
def data_changed(self, value, metadata, persist, mods):
try:
n = float(data[self.dataset_name][1])
self.metadata = metadata[self.dataset_name]
# This applet will degenerate other scalar types to native float on edit
# Use the dashboard ChangeEditDialog for consistent type casting
val = float(value[self.dataset_name])
scale = scale_from_metadata(self.metadata)
val /= scale
except (KeyError, ValueError, TypeError):
n = "---"
self.display(n)
val = "---"
unit = self.metadata.get("unit", "")
self.unit_area.setText(unit)
self.lcd_widget.display(val)
def main():

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python3.5
#!/usr/bin/env python3
import PyQt5 # make sure pyqtgraph imports Qt5
import pyqtgraph
@ -7,13 +7,13 @@ from artiq.applets.simple import SimpleApplet
class Image(pyqtgraph.ImageView):
def __init__(self, args):
def __init__(self, args, req):
pyqtgraph.ImageView.__init__(self)
self.args = args
def data_changed(self, data, mods):
def data_changed(self, value, metadata, persist, mods):
try:
img = data[self.args.img][1]
img = value[self.args.img]
except KeyError:
return
self.setImage(img)

View File

@ -1,33 +1,47 @@
#!/usr/bin/env python3.5
#!/usr/bin/env python3
import PyQt5 # make sure pyqtgraph imports Qt5
import PyQt5 # make sure pyqtgraph imports Qt5
from PyQt5.QtCore import QTimer
import pyqtgraph
from artiq.applets.simple import TitleApplet
class HistogramPlot(pyqtgraph.PlotWidget):
def __init__(self, args):
def __init__(self, args, req):
pyqtgraph.PlotWidget.__init__(self)
self.args = args
self.timer = QTimer()
self.timer.setSingleShot(True)
self.timer.timeout.connect(self.length_warning)
def data_changed(self, data, mods, title):
def data_changed(self, value, metadata, persist, mods, title):
try:
y = data[self.args.y][1]
y = value[self.args.y]
if self.args.x is None:
x = None
else:
x = data[self.args.x][1]
x = value[self.args.x]
except KeyError:
return
if x is None:
x = list(range(len(y)+1))
if len(y) and len(x) == len(y) + 1:
self.timer.stop()
self.clear()
self.plot(x, y, stepMode=True, fillLevel=0,
brush=(0, 0, 255, 150))
self.setTitle(title)
else:
if not self.timer.isActive():
self.timer.start(1000)
def length_warning(self):
self.clear()
text = "⚠️ dataset lengths mismatch:\n"\
"There should be one more bin boundaries than there are Y values"
self.addItem(pyqtgraph.TextItem(text))
def main():

View File

@ -1,40 +1,59 @@
#!/usr/bin/env python3.5
#!/usr/bin/env python3
import numpy as np
import PyQt5 # make sure pyqtgraph imports Qt5
from PyQt5.QtCore import QTimer
import pyqtgraph
from artiq.applets.simple import TitleApplet
class XYPlot(pyqtgraph.PlotWidget):
def __init__(self, args):
def __init__(self, args, req):
pyqtgraph.PlotWidget.__init__(self)
self.args = args
self.timer = QTimer()
self.timer.setSingleShot(True)
self.timer.timeout.connect(self.length_warning)
self.mismatch = {'X values': False,
'Error bars': False,
'Fit values': False}
def data_changed(self, data, mods, title):
def data_changed(self, value, metadata, persist, mods, title):
try:
y = data[self.args.y][1]
y = value[self.args.y]
except KeyError:
return
x = data.get(self.args.x, (False, None))[1]
x = value.get(self.args.x, (False, None))
if x is None:
x = np.arange(len(y))
error = data.get(self.args.error, (False, None))[1]
fit = data.get(self.args.fit, (False, None))[1]
error = value.get(self.args.error, (False, None))
fit = value.get(self.args.fit, (False, None))
if not len(y) or len(y) != len(x):
return
self.mismatch['X values'] = True
else:
self.mismatch['X values'] = False
if error is not None and hasattr(error, "__len__"):
if not len(error):
error = None
elif len(error) != len(y):
return
self.mismatch['Error bars'] = True
else:
self.mismatch['Error bars'] = False
if fit is not None:
if not len(fit):
fit = None
elif len(fit) != len(y):
return
self.mismatch['Fit values'] = True
else:
self.mismatch['Fit values'] = False
if not any(self.mismatch.values()):
self.timer.stop()
else:
if not self.timer.isActive():
self.timer.start(1000)
return
self.clear()
self.plot(x, y, pen=None, symbol="x")
@ -50,6 +69,13 @@ class XYPlot(pyqtgraph.PlotWidget):
xi = np.argsort(x)
self.plot(x[xi], fit[xi])
def length_warning(self):
self.clear()
text = "⚠️ dataset lengths mismatch:\n"
errors = ', '.join([k for k, v in self.mismatch.items() if v])
text = ' '.join([errors, "should have the same length as Y values"])
self.addItem(pyqtgraph.TextItem(text))
def main():
applet = TitleApplet(XYPlot)

View File

@ -1,7 +1,8 @@
#!/usr/bin/env python3.5
#!/usr/bin/env python3
import numpy as np
from PyQt5 import QtWidgets
from PyQt5.QtCore import QTimer
import pyqtgraph
from artiq.applets.simple import SimpleApplet
@ -21,7 +22,7 @@ def _compute_ys(histogram_bins, histograms_counts):
# pyqtgraph.GraphicsWindow fails to behave like a regular Qt widget
# and breaks embedding. Do not use as top widget.
class XYHistPlot(QtWidgets.QSplitter):
def __init__(self, args):
def __init__(self, args, req):
QtWidgets.QSplitter.__init__(self)
self.resize(1000, 600)
self.setWindowTitle("XY/Histogram")
@ -37,6 +38,10 @@ class XYHistPlot(QtWidgets.QSplitter):
self.hist_plot_data = None
self.args = args
self.timer = QTimer()
self.timer.setSingleShot(True)
self.timer.timeout.connect(self.length_warning)
self.mismatch = {'bins': False, 'xs': False}
def _set_full_data(self, xs, histogram_bins, histograms_counts):
self.xy_plot.clear()
@ -59,9 +64,9 @@ class XYHistPlot(QtWidgets.QSplitter):
point.histogram_index = index
point.histogram_counts = counts
self.hist_plot_data = self.hist_plot.plot(
stepMode=True, fillLevel=0,
brush=(0, 0, 255, 150))
text = "click on a data point at the left\n"\
"to see the corresponding histogram"
self.hist_plot.addItem(pyqtgraph.TextItem(text))
def _set_partial_data(self, xs, histograms_counts):
ys = _compute_ys(self.histogram_bins, histograms_counts)
@ -87,8 +92,17 @@ class XYHistPlot(QtWidgets.QSplitter):
else:
self.arrow.setPos(position)
self.selected_index = spot_item.histogram_index
self.hist_plot_data.setData(x=self.histogram_bins,
y=spot_item.histogram_counts)
if self.hist_plot_data is None:
self.hist_plot.clear()
self.hist_plot_data = self.hist_plot.plot(
x=self.histogram_bins,
y=spot_item.histogram_counts,
stepMode=True, fillLevel=0,
brush=(0, 0, 255, 150))
else:
self.hist_plot_data.setData(x=self.histogram_bins,
y=spot_item.histogram_counts)
def _can_use_partial(self, mods):
if self.hist_plot_data is None:
@ -110,18 +124,48 @@ class XYHistPlot(QtWidgets.QSplitter):
return False
return True
def data_changed(self, data, mods):
def data_changed(self, value, metadata, persist, mods):
try:
xs = data[self.args.xs][1]
histogram_bins = data[self.args.histogram_bins][1]
histograms_counts = data[self.args.histograms_counts][1]
xs = value[self.args.xs]
histogram_bins = value[self.args.histogram_bins]
histograms_counts = value[self.args.histograms_counts]
except KeyError:
return
if len(xs) != histograms_counts.shape[0]:
self.mismatch['xs'] = True
else:
self.mismatch['xs'] = False
if histograms_counts.shape[1] != len(histogram_bins) - 1:
self.mismatch['bins'] = True
else:
self.mismatch['bins'] = False
if any(self.mismatch.values()):
if not self.timer.isActive():
self.timer.start(1000)
return
else:
self.timer.stop()
if self._can_use_partial(mods):
self._set_partial_data(xs, histograms_counts)
else:
self._set_full_data(xs, histogram_bins, histograms_counts)
def length_warning(self):
self.xy_plot.clear()
self.hist_plot.clear()
text = "⚠️ dataset lengths mismatch:\n\n"
if self.mismatch['bins']:
text = ''.join([text,
"bin boundaries should have the same length\n"
"as the first dimension of histogram counts."])
if self.mismatch['bins'] and self.mismatch['xs']:
text = ''.join([text, '\n\n'])
if self.mismatch['xs']:
text = ''.join([text,
"point abscissas should have the same length\n"
"as the second dimension of histogram counts."])
self.xy_plot.addItem(pyqtgraph.TextItem(text))
def main():
applet = SimpleApplet(XYHistPlot)

View File

@ -0,0 +1,34 @@
#!/usr/bin/env python3
from PyQt5 import QtWidgets
from artiq.applets.simple import SimpleApplet
class ProgressWidget(QtWidgets.QProgressBar):
def __init__(self, args, req):
QtWidgets.QProgressBar.__init__(self)
self.setMinimum(args.min)
self.setMaximum(args.max)
self.dataset_value = args.value
def data_changed(self, value, metadata, persist, mods):
try:
val = round(value[self.dataset_value])
except (KeyError, ValueError, TypeError):
val = 0
self.setValue(val)
def main():
applet = SimpleApplet(ProgressWidget)
applet.add_dataset("value", "counter")
applet.argparser.add_argument("--min", type=int, default=0,
help="minimum (left) value of the bar")
applet.argparser.add_argument("--max", type=int, default=100,
help="maximum (right) value of the bar")
applet.run()
if __name__ == "__main__":
main()

View File

@ -4,16 +4,115 @@ import asyncio
import os
import string
from quamash import QEventLoop, QtWidgets, QtCore
from qasync import QEventLoop, QtWidgets, QtCore
from artiq.protocols.sync_struct import Subscriber, process_mod
from artiq.protocols import pyon
from artiq.protocols.pipe_ipc import AsyncioChildComm
from sipyco.sync_struct import Subscriber, process_mod
from sipyco.pc_rpc import AsyncioClient as RPCClient
from sipyco import pyon
from sipyco.pipe_ipc import AsyncioChildComm
from artiq.language.scan import ScanObject
logger = logging.getLogger(__name__)
class _AppletRequestInterface:
def __init__(self):
raise NotImplementedError
def set_dataset(self, key, value, unit=None, scale=None, precision=None, persist=None):
"""
Set a dataset.
See documentation of ``artiq.language.environment.set_dataset``.
"""
raise NotImplementedError
def mutate_dataset(self, key, index, value):
"""
Mutate a dataset.
See documentation of ``artiq.language.environment.mutate_dataset``.
"""
raise NotImplementedError
def append_to_dataset(self, key, value):
"""
Append to a dataset.
See documentation of ``artiq.language.environment.append_to_dataset``.
"""
raise NotImplementedError
def set_argument_value(self, expurl, name, value):
"""
Temporarily set the value of an argument in a experiment in the dashboard.
The value resets to default value when recomputing the argument.
:param expurl: Experiment URL identifying the experiment in the dashboard. Example: 'repo:ArgumentsDemo'.
:param name: Name of the argument in the experiment.
:param value: Object representing the new temporary value of the argument. For ``Scannable`` arguments, this parameter
should be a ``ScanObject``. The type of the ``ScanObject`` will be set as the selected type when this function is called.
"""
raise NotImplementedError
class AppletRequestIPC(_AppletRequestInterface):
def __init__(self, ipc):
self.ipc = ipc
def set_dataset(self, key, value, unit=None, scale=None, precision=None, persist=None):
metadata = {}
if unit is not None:
metadata["unit"] = unit
if scale is not None:
metadata["scale"] = scale
if precision is not None:
metadata["precision"] = precision
self.ipc.set_dataset(key, value, metadata, persist)
def mutate_dataset(self, key, index, value):
mod = {"action": "setitem", "path": [key, 1], "key": index, "value": value}
self.ipc.update_dataset(mod)
def append_to_dataset(self, key, value):
mod = {"action": "append", "path": [key, 1], "x": value}
self.ipc.update_dataset(mod)
def set_argument_value(self, expurl, name, value):
if isinstance(value, ScanObject):
value = value.describe()
self.ipc.set_argument_value(expurl, name, value)
class AppletRequestRPC(_AppletRequestInterface):
def __init__(self, loop, dataset_ctl):
self.loop = loop
self.dataset_ctl = dataset_ctl
self.background_tasks = set()
def _background(self, coro, *args, **kwargs):
task = self.loop.create_task(coro(*args, **kwargs))
self.background_tasks.add(task)
task.add_done_callback(self.background_tasks.discard)
def set_dataset(self, key, value, unit=None, scale=None, precision=None, persist=None):
metadata = {}
if unit is not None:
metadata["unit"] = unit
if scale is not None:
metadata["scale"] = scale
if precision is not None:
metadata["precision"] = precision
self._background(self.dataset_ctl.set, key, value, metadata=metadata, persist=persist)
def mutate_dataset(self, key, index, value):
mod = {"action": "setitem", "path": [key, 1], "key": index, "value": value}
self._background(self.dataset_ctl.update, mod)
def append_to_dataset(self, key, value):
mod = {"action": "append", "path": [key, 1], "x": value}
self._background(self.dataset_ctl.update, mod)
class AppletIPCClient(AsyncioChildComm):
def set_close_cb(self, close_cb):
self.close_cb = close_cb
@ -64,12 +163,30 @@ class AppletIPCClient(AsyncioChildComm):
exc_info=True)
self.close_cb()
def subscribe(self, datasets, init_cb, mod_cb):
def subscribe(self, datasets, init_cb, mod_cb, dataset_prefixes=[], *, loop):
self.write_pyon({"action": "subscribe",
"datasets": datasets})
"datasets": datasets,
"dataset_prefixes": dataset_prefixes})
self.init_cb = init_cb
self.mod_cb = mod_cb
asyncio.ensure_future(self.listen())
self.listen_task = loop.create_task(self.listen())
def set_dataset(self, key, value, metadata, persist=None):
self.write_pyon({"action": "set_dataset",
"key": key,
"value": value,
"metadata": metadata,
"persist": persist})
def update_dataset(self, mod):
self.write_pyon({"action": "update_dataset",
"mod": mod})
def set_argument_value(self, expurl, name, value):
self.write_pyon({"action": "set_argument_value",
"expurl": expurl,
"name": name,
"value": value})
class SimpleApplet:
@ -91,12 +208,11 @@ class SimpleApplet:
"for dataset notifications "
"(ignored in embedded mode)")
group.add_argument(
"--port", default=3250, type=int,
help="TCP port to connect to")
self.argparser.add_argument(
"--embed", default=None, help="embed into GUI",
metavar="IPC_ADDRESS")
"--port-notify", default=3250, type=int,
help="TCP port to connect to for notifications (ignored in embedded mode)")
group.add_argument(
"--port-control", default=3251, type=int,
help="TCP port to connect to for control (ignored in embedded mode)")
self._arggroup_datasets = self.argparser.add_argument_group("datasets")
@ -114,26 +230,43 @@ class SimpleApplet:
def args_init(self):
self.args = self.argparser.parse_args()
self.embed = os.getenv("ARTIQ_APPLET_EMBED")
self.datasets = {getattr(self.args, arg.replace("-", "_"))
for arg in self.dataset_args}
# Optional prefixes (dataset sub-trees) to match subscriptions against;
# currently only used by out-of-tree subclasses (ndscan).
self.dataset_prefixes = []
def quamash_init(self):
def qasync_init(self):
app = QtWidgets.QApplication([])
self.loop = QEventLoop(app)
asyncio.set_event_loop(self.loop)
def ipc_init(self):
if self.args.embed is not None:
self.ipc = AppletIPCClient(self.args.embed)
if self.embed is not None:
self.ipc = AppletIPCClient(self.embed)
self.loop.run_until_complete(self.ipc.connect())
def ipc_close(self):
if self.args.embed is not None:
if self.embed is not None:
self.ipc.close()
def req_init(self):
if self.embed is None:
dataset_ctl = RPCClient()
self.loop.run_until_complete(dataset_ctl.connect_rpc(
self.args.server, self.args.port_control, "master_dataset_db"))
self.req = AppletRequestRPC(self.loop, dataset_ctl)
else:
self.req = AppletRequestIPC(self.ipc)
def req_close(self):
if self.embed is None:
self.req.dataset_ctl.close_rpc()
def create_main_widget(self):
self.main_widget = self.main_widget_class(self.args)
if self.args.embed is not None:
self.main_widget = self.main_widget_class(self.args, self.req)
if self.embed is not None:
self.ipc.set_close_cb(self.main_widget.close)
if os.name == "nt":
# HACK: if the window has a frame, there will be garbage
@ -165,22 +298,35 @@ class SimpleApplet:
self.data = data
return data
def is_dataset_subscribed(self, key):
if key in self.datasets:
return True
for prefix in self.dataset_prefixes:
if key.startswith(prefix):
return True
return False
def filter_mod(self, mod):
if self.args.embed is not None:
if self.embed is not None:
# the parent already filters for us
return True
if mod["action"] == "init":
return True
if mod["path"]:
return mod["path"][0] in self.datasets
return self.is_dataset_subscribed(mod["path"][0])
elif mod["action"] in {"setitem", "delitem"}:
return mod["key"] in self.datasets
return self.is_dataset_subscribed(mod["key"])
else:
return False
def emit_data_changed(self, data, mod_buffer):
self.main_widget.data_changed(data, mod_buffer)
persist = dict()
value = dict()
metadata = dict()
for k, d in data.items():
persist[k], value[k], metadata[k] = d
self.main_widget.data_changed(value, metadata, persist, mod_buffer)
def flush_mod_buffer(self):
self.emit_data_changed(self.data, self.mod_buffer)
@ -195,36 +341,42 @@ class SimpleApplet:
self.mod_buffer.append(mod)
else:
self.mod_buffer = [mod]
asyncio.get_event_loop().call_later(self.args.update_delay,
self.flush_mod_buffer)
self.loop.call_later(self.args.update_delay,
self.flush_mod_buffer)
else:
self.emit_data_changed(self.data, [mod])
def subscribe(self):
if self.args.embed is None:
if self.embed is None:
self.subscriber = Subscriber("datasets",
self.sub_init, self.sub_mod)
self.loop.run_until_complete(self.subscriber.connect(
self.args.server, self.args.port))
self.args.server, self.args.port_notify))
else:
self.ipc.subscribe(self.datasets, self.sub_init, self.sub_mod)
self.ipc.subscribe(self.datasets, self.sub_init, self.sub_mod,
dataset_prefixes=self.dataset_prefixes,
loop=self.loop)
def unsubscribe(self):
if self.args.embed is None:
if self.embed is None:
self.loop.run_until_complete(self.subscriber.close())
def run(self):
self.args_init()
self.quamash_init()
self.qasync_init()
try:
self.ipc_init()
try:
self.create_main_widget()
self.subscribe()
self.req_init()
try:
self.loop.run_forever()
self.create_main_widget()
self.subscribe()
try:
self.loop.run_forever()
finally:
self.unsubscribe()
finally:
self.unsubscribe()
self.req_close()
finally:
self.ipc_close()
finally:
@ -263,4 +415,9 @@ class TitleApplet(SimpleApplet):
title = self.args.title
else:
title = None
self.main_widget.data_changed(data, mod_buffer, title)
persist = dict()
value = dict()
metadata = dict()
for k, d in data.items():
persist[k], value[k], metadata[k] = d
self.main_widget.data_changed(value, metadata, persist, mod_buffer, title)

View File

@ -3,10 +3,11 @@ import asyncio
from PyQt5 import QtCore, QtWidgets
from sipyco.pc_rpc import AsyncioClient as RPCClient
from artiq.tools import short_format
from artiq.gui.tools import LayoutWidget, QRecursiveFilterProxyModel
from artiq.gui.models import DictSyncTreeSepModel
from artiq.protocols.pc_rpc import AsyncioClient as RPCClient
# reduced read-only version of artiq.dashboard.datasets
@ -19,11 +20,46 @@ class Model(DictSyncTreeSepModel):
DictSyncTreeSepModel.__init__(self, ".", ["Dataset", "Value"], init)
def convert(self, k, v, column):
return short_format(v[1])
return short_format(v[1], v[2])
class DatasetCtl:
def __init__(self, master_host, master_port):
self.master_host = master_host
self.master_port = master_port
async def _execute_rpc(self, op_name, key_or_mod, value=None, persist=None, metadata=None):
logger.info("Starting %s operation on %s", op_name, key_or_mod)
try:
remote = RPCClient()
await remote.connect_rpc(self.master_host, self.master_port,
"master_dataset_db")
try:
if op_name == "set":
await remote.set(key_or_mod, value, persist, metadata)
elif op_name == "update":
await remote.update(key_or_mod)
else:
logger.error("Invalid operation: %s", op_name)
return
finally:
remote.close_rpc()
except:
logger.error("Failed %s operation on %s", op_name,
key_or_mod, exc_info=True)
else:
logger.info("Finished %s operation on %s", op_name,
key_or_mod)
async def set(self, key, value, persist=None, metadata=None):
await self._execute_rpc("set", key, value, persist, metadata)
async def update(self, mod):
await self._execute_rpc("update", mod)
class DatasetsDock(QtWidgets.QDockWidget):
def __init__(self, datasets_sub, master_host, master_port):
def __init__(self, dataset_sub, dataset_ctl):
QtWidgets.QDockWidget.__init__(self, "Datasets")
self.setObjectName("Datasets")
self.setFeatures(QtWidgets.QDockWidget.DockWidgetMovable |
@ -61,10 +97,9 @@ class DatasetsDock(QtWidgets.QDockWidget):
self.table.addAction(upload_action)
self.set_model(Model(dict()))
datasets_sub.add_setmodel_callback(self.set_model)
dataset_sub.add_setmodel_callback(self.set_model)
self.master_host = master_host
self.master_port = master_port
self.dataset_ctl = dataset_ctl
def _search_datasets(self):
if hasattr(self, "table_model_filter"):
@ -81,30 +116,14 @@ class DatasetsDock(QtWidgets.QDockWidget):
self.table_model_filter.setSourceModel(self.table_model)
self.table.setModel(self.table_model_filter)
async def _upload_dataset(self, name, value,):
logger.info("Uploading dataset '%s' to master...", name)
try:
remote = RPCClient()
await remote.connect_rpc(self.master_host, self.master_port,
"master_dataset_db")
try:
await remote.set(name, value)
finally:
remote.close_rpc()
except:
logger.error("Failed uploading dataset '%s'",
name, exc_info=True)
else:
logger.info("Finished uploading dataset '%s'", name)
def upload_clicked(self):
idx = self.table.selectedIndexes()
if idx:
idx = self.table_model_filter.mapToSource(idx[0])
key = self.table_model.index_to_key(idx)
if key is not None:
persist, value = self.table_model.backing_store[key]
asyncio.ensure_future(self._upload_dataset(key, value))
persist, value, metadata = self.table_model.backing_store[key]
asyncio.ensure_future(self.dataset_ctl.set(key, value, metadata=metadata))
def save_state(self):
return bytes(self.table.header().saveState())

View File

@ -7,24 +7,17 @@ from collections import OrderedDict
from PyQt5 import QtCore, QtGui, QtWidgets
import h5py
from sipyco import pyon
from artiq import __artiq_dir__ as artiq_dir
from artiq.gui.tools import LayoutWidget, log_level_to_name, get_open_file_name
from artiq.gui.entries import argty_to_entry
from artiq.protocols import pyon
from artiq.gui.tools import (LayoutWidget, WheelFilter,
log_level_to_name, get_open_file_name)
from artiq.gui.entries import procdesc_to_entry
from artiq.master.worker import Worker, log_worker_exception
logger = logging.getLogger(__name__)
class _WheelFilter(QtCore.QObject):
def eventFilter(self, obj, event):
if (event.type() == QtCore.QEvent.Wheel and
event.modifiers() != QtCore.Qt.NoModifier):
event.ignore()
return True
return False
class _ArgumentEditor(QtWidgets.QTreeWidget):
def __init__(self, dock):
QtWidgets.QTreeWidget.__init__(self)
@ -45,10 +38,10 @@ class _ArgumentEditor(QtWidgets.QTreeWidget):
self.setStyleSheet("QTreeWidget {background: " +
self.palette().midlight().color().name() + " ;}")
self.viewport().installEventFilter(_WheelFilter(self.viewport()))
self.viewport().installEventFilter(WheelFilter(self.viewport(), True))
self._groups = dict()
self._arg_to_entry_widgetitem = dict()
self._arg_to_widgets = dict()
self._dock = dock
if not self._dock.arguments:
@ -59,12 +52,15 @@ class _ArgumentEditor(QtWidgets.QTreeWidget):
gradient.setColorAt(1, self.palette().midlight().color())
for name, argument in self._dock.arguments.items():
try:
entry = argty_to_entry[argument["desc"]["ty"]](argument)
except:
print(name, argument)
widgets = dict()
self._arg_to_widgets[name] = widgets
entry = procdesc_to_entry(argument["desc"])(argument)
widget_item = QtWidgets.QTreeWidgetItem([name])
self._arg_to_entry_widgetitem[name] = entry, widget_item
if argument["tooltip"]:
widget_item.setToolTip(0, argument["tooltip"])
widgets["entry"] = entry
widgets["widget_item"] = widget_item
for col in range(3):
widget_item.setBackground(col, gradient)
@ -77,6 +73,7 @@ class _ArgumentEditor(QtWidgets.QTreeWidget):
else:
self._get_group(argument["group"]).addChild(widget_item)
fix_layout = LayoutWidget()
widgets["fix_layout"] = fix_layout
fix_layout.addWidget(entry)
self.setItemWidget(widget_item, 1, fix_layout)
@ -146,16 +143,18 @@ class _ArgumentEditor(QtWidgets.QTreeWidget):
argument = self._dock.arguments[name]
procdesc = arginfo[name][0]
state = argty_to_entry[procdesc["ty"]].default_state(procdesc)
state = procdesc_to_entry(procdesc).default_state(procdesc)
argument["desc"] = procdesc
argument["state"] = state
old_entry, widget_item = self._arg_to_entry_widgetitem[name]
old_entry.deleteLater()
widgets = self._arg_to_widgets[name]
entry = argty_to_entry[procdesc["ty"]](argument)
self._arg_to_entry_widgetitem[name] = entry, widget_item
self.setItemWidget(widget_item, 1, entry)
widgets["entry"].deleteLater()
widgets["entry"] = procdesc_to_entry(procdesc)(argument)
widgets["fix_layout"] = LayoutWidget()
widgets["fix_layout"].addWidget(widgets["entry"])
self.setItemWidget(widgets["widget_item"], 1, widgets["fix_layout"])
self.updateGeometries()
def save_state(self):
expanded = []
@ -252,8 +251,9 @@ class _ExperimentDock(QtWidgets.QMdiSubWindow):
def dropEvent(self, ev):
for uri in ev.mimeData().urls():
if uri.scheme() == "file":
logger.debug("Loading HDF5 arguments from %s", uri.path())
asyncio.ensure_future(self.load_hdf5_task(uri.path()))
filename = QtCore.QDir.toNativeSeparators(uri.toLocalFile())
logger.debug("Loading HDF5 arguments from %s", filename)
asyncio.ensure_future(self.load_hdf5_task(filename))
break
async def compute_arginfo(self):
@ -314,7 +314,7 @@ class _ExperimentDock(QtWidgets.QMdiSubWindow):
"class_name": class_name,
"log_level": self.options["log_level"],
"arguments": {
name: argty_to_entry[argument["desc"]["ty"]].state_to_value(
name: procdesc_to_entry(argument["desc"]).state_to_value(
argument["state"])
for name, argument in self.arguments.items()},
}
@ -370,9 +370,9 @@ class _ExperimentDock(QtWidgets.QMdiSubWindow):
class LocalDatasetDB:
def __init__(self, datasets_sub):
self.datasets_sub = datasets_sub
datasets_sub.add_setmodel_callback(self.init)
def __init__(self, dataset_sub):
self.dataset_sub = dataset_sub
dataset_sub.add_setmodel_callback(self.init)
def init(self, data):
self._data = data
@ -381,24 +381,24 @@ class LocalDatasetDB:
return self._data.backing_store[key][1]
def update(self, mod):
self.datasets_sub.update(mod)
self.dataset_sub.update(mod)
class ExperimentsArea(QtWidgets.QMdiArea):
def __init__(self, root, datasets_sub):
def __init__(self, root, dataset_sub):
QtWidgets.QMdiArea.__init__(self)
self.pixmap = QtGui.QPixmap(os.path.join(
artiq_dir, "gui", "logo20.svg"))
artiq_dir, "gui", "logo_ver.svg"))
self.current_dir = root
self.dataset = None
self.open_experiments = []
self._ddb = LocalDatasetDB(datasets_sub)
self._ddb = LocalDatasetDB(dataset_sub)
self.worker_handlers = {
"get_device_db": lambda: {},
"get_device": lambda k: {"type": "dummy"},
"get_device": lambda key, resolve_alias=False: {"type": "dummy"},
"get_dataset": self._ddb.get,
"update_dataset": self._ddb.update,
}
@ -465,11 +465,12 @@ class ExperimentsArea(QtWidgets.QMdiArea):
def initialize_submission_arguments(self, arginfo):
arguments = OrderedDict()
for name, (procdesc, group) in arginfo.items():
state = argty_to_entry[procdesc["ty"]].default_state(procdesc)
for name, (procdesc, group, tooltip) in arginfo.items():
state = procdesc_to_entry(procdesc).default_state(procdesc)
arguments[name] = {
"desc": procdesc,
"group": group,
"tooltip": tooltip,
"state": state # mutated by entries
}
return arguments
@ -500,11 +501,16 @@ class ExperimentsArea(QtWidgets.QMdiArea):
exc_info=True)
dock = _ExperimentDock(self, expurl, {})
asyncio.ensure_future(dock._recompute_arguments())
dock.setAttribute(QtCore.Qt.WA_DeleteOnClose)
self.addSubWindow(dock)
dock.show()
dock.sigClosed.connect(partial(self.on_dock_closed, dock))
self.open_experiments.append(dock)
return dock
def set_argument_value(self, expurl, name, value):
logger.warning("Unable to set argument '%s', dropping change. "
"'set_argument_value' not supported in browser.", name)
def on_dock_closed(self, dock):
self.open_experiments.remove(dock)

View File

@ -5,7 +5,8 @@ from datetime import datetime
import h5py
from PyQt5 import QtCore, QtWidgets, QtGui
from artiq.protocols import pyon
from sipyco import pyon
logger = logging.getLogger(__name__)
@ -41,7 +42,7 @@ class ThumbnailIconProvider(QtWidgets.QFileIconProvider):
except KeyError:
return
try:
img = QtGui.QImage.fromData(t.value)
img = QtGui.QImage.fromData(t[()])
except:
logger.warning("unable to read thumbnail from %s",
info.filePath(), exc_info=True)
@ -70,7 +71,7 @@ class ZoomIconView(QtWidgets.QListView):
self._char_width = QtGui.QFontMetrics(self.font()).averageCharWidth()
self.setViewMode(self.IconMode)
w = self._char_width*self.default_size
self.setIconSize(QtCore.QSize(w, w*self.aspect))
self.setIconSize(QtCore.QSize(w, int(w*self.aspect)))
self.setFlow(self.LeftToRight)
self.setResizeMode(self.Adjust)
self.setWrapping(True)
@ -101,13 +102,14 @@ class Hdf5FileSystemModel(QtWidgets.QFileSystemModel):
h5 = open_h5(info)
if h5 is not None:
try:
expid = pyon.decode(h5["expid"].value)
start_time = datetime.fromtimestamp(h5["start_time"].value)
expid = pyon.decode(h5["expid"][()]) if "expid" in h5 else dict()
start_time = datetime.fromtimestamp(h5["start_time"][()]) if "start_time" in h5 else "<none>"
v = ("artiq_version: {}\nrepo_rev: {}\nfile: {}\n"
"class_name: {}\nrid: {}\nstart_time: {}").format(
h5["artiq_version"].value, expid["repo_rev"],
expid["file"], expid["class_name"],
h5["rid"].value, start_time)
h5["artiq_version"].asstr()[()] if "artiq_version" in h5 else "<none>",
expid.get("repo_rev", "<none>"),
expid.get("file", "<none>"), expid.get("class_name", "<none>"),
h5["rid"][()] if "rid" in h5 else "<none>", start_time)
return v
except:
logger.warning("unable to read metadata from %s",
@ -173,23 +175,45 @@ class FilesDock(QtWidgets.QDockWidget):
logger.debug("loading datasets from %s", info.filePath())
with f:
try:
expid = pyon.decode(f["expid"].value)
start_time = datetime.fromtimestamp(f["start_time"].value)
expid = pyon.decode(f["expid"][()]) if "expid" in f else dict()
start_time = datetime.fromtimestamp(f["start_time"][()]) if "start_time" in f else "<none>"
v = {
"artiq_version": f["artiq_version"].value,
"repo_rev": expid["repo_rev"],
"file": expid["file"],
"class_name": expid["class_name"],
"rid": f["rid"].value,
"artiq_version": f["artiq_version"].asstr()[()] if "artiq_version" in f else "<none>",
"repo_rev": expid.get("repo_rev", "<none>"),
"file": expid.get("file", "<none>"),
"class_name": expid.get("class_name", "<none>"),
"rid": f["rid"][()] if "rid" in f else "<none>",
"start_time": start_time,
}
self.metadata_changed.emit(v)
except:
logger.warning("unable to read metadata from %s",
info.filePath(), exc_info=True)
rd = {}
if "archive" in f:
def visitor(k, v):
if isinstance(v, h5py.Dataset):
# v.attrs is a non-serializable h5py.AttributeManager, need to convert to dict
# See https://docs.h5py.org/en/stable/high/attr.html#h5py.AttributeManager
rd[k] = (True, v[()], dict(v.attrs))
f["archive"].visititems(visitor)
if "datasets" in f:
rd = {k: (True, v.value) for k, v in f["datasets"].items()}
self.datasets.init(rd)
def visitor(k, v):
if isinstance(v, h5py.Dataset):
if k in rd:
logger.warning("dataset '%s' is both in archive "
"and outputs", k)
# v.attrs is a non-serializable h5py.AttributeManager, need to convert to dict
# See https://docs.h5py.org/en/stable/high/attr.html#h5py.AttributeManager
rd[k] = (True, v[()], dict(v.attrs))
f["datasets"].visititems(visitor)
self.datasets.init(rd)
self.dataset_changed.emit(info.filePath())
def list_activated(self, idx):

78
artiq/build_soc.py Normal file
View File

@ -0,0 +1,78 @@
import os
import subprocess
from migen import *
from migen.build.platforms.sinara import kasli
from misoc.interconnect.csr import *
from misoc.integration.builder import *
from artiq.gateware.amp import AMPSoC
from artiq import __version__ as artiq_version
from artiq import __artiq_dir__ as artiq_dir
__all__ = ["add_identifier", "build_artiq_soc"]
def get_identifier_string(soc, suffix="", add_class_name=True):
r = artiq_version
if suffix or add_class_name:
r += ";"
if add_class_name:
r += getattr(soc, "class_name_override", soc.__class__.__name__.lower())
r += suffix
return r
class ReprogrammableIdentifier(Module, AutoCSR):
def __init__(self, ident):
self.address = CSRStorage(8)
self.data = CSRStatus(8)
contents = list(ident.encode())
l = len(contents)
if l > 255:
raise ValueError("Identifier string must be 255 characters or less")
contents.insert(0, l)
for i in range(8):
self.specials += Instance("ROM256X1", name="identifier_str"+str(i),
i_A0=self.address.storage[0], i_A1=self.address.storage[1],
i_A2=self.address.storage[2], i_A3=self.address.storage[3],
i_A4=self.address.storage[4], i_A5=self.address.storage[5],
i_A6=self.address.storage[6], i_A7=self.address.storage[7],
o_O=self.data.status[i],
p_INIT=sum(1 << j if c & (1 << i) else 0 for j, c in enumerate(contents)))
def add_identifier(soc, *args, gateware_identifier_str=None, **kwargs):
if hasattr(soc, "identifier"):
raise ValueError
identifier_str = get_identifier_string(soc, *args, **kwargs)
soc.submodules.identifier = ReprogrammableIdentifier(gateware_identifier_str or identifier_str)
soc.config["IDENTIFIER_STR"] = identifier_str
def build_artiq_soc(soc, argdict):
firmware_dir = os.path.join(artiq_dir, "firmware")
builder = Builder(soc, **argdict)
builder.software_packages = []
builder.add_software_package("bootloader", os.path.join(firmware_dir, "bootloader"))
is_kasli_v1 = isinstance(soc.platform, kasli.Platform) and soc.platform.hw_rev in ("v1.0", "v1.1")
kernel_cpu_type = "vexriscv" if is_kasli_v1 else "vexriscv-g"
builder.add_software_package("libm", cpu_type=kernel_cpu_type)
builder.add_software_package("libprintf", cpu_type=kernel_cpu_type)
builder.add_software_package("libunwind", cpu_type=kernel_cpu_type)
builder.add_software_package("ksupport", os.path.join(firmware_dir, "ksupport"), cpu_type=kernel_cpu_type)
# Generate unwinder for soft float target (ARTIQ runtime)
# If the kernel lacks FPU, then the runtime unwinder is already generated
if not is_kasli_v1:
builder.add_software_package("libunwind")
if not soc.config["DRTIO_ROLE"] == "satellite":
builder.add_software_package("runtime", os.path.join(firmware_dir, "runtime"))
else:
builder.add_software_package("satman", os.path.join(firmware_dir, "satman"))
try:
builder.build()
except subprocess.CalledProcessError as e:
raise SystemExit("Command {} failed".format(" ".join(e.cmd)))

View File

@ -1,3 +1,3 @@
from .constness import Constness
from .domination import DominatorTree
from .devirtualization import Devirtualization
from .invariant_detection import InvariantDetection

View File

@ -1,30 +0,0 @@
"""
:class:`Constness` checks that no attribute marked
as constant is ever set.
"""
from pythonparser import algorithm, diagnostic
from .. import types
class Constness(algorithm.Visitor):
def __init__(self, engine):
self.engine = engine
self.in_assign = False
def visit_Assign(self, node):
self.visit(node.value)
self.in_assign = True
self.visit(node.targets)
self.in_assign = False
def visit_AttributeT(self, node):
self.generic_visit(node)
if self.in_assign:
typ = node.value.type.find()
if types.is_instance(typ) and node.attr in typ.constant_attributes:
diag = diagnostic.Diagnostic("error",
"cannot assign to constant attribute '{attr}' of class '{class}'",
{"attr": node.attr, "class": typ.name},
node.loc)
self.engine.process(diag)
return

View File

@ -0,0 +1,49 @@
"""
:class:`InvariantDetection` determines which attributes can be safely
marked kernel invariant.
"""
from pythonparser import diagnostic
from .. import ir, types
class InvariantDetection:
def __init__(self, engine):
self.engine = engine
def process(self, functions):
self.attr_locs = dict()
self.attr_written = set()
for func in functions:
self.process_function(func)
for key in self.attr_locs:
if key not in self.attr_written:
typ, attr = key
if attr in typ.constant_attributes:
continue
diag = diagnostic.Diagnostic("note",
"attribute '{attr}' of type '{type}' is never written to; " +
"it could be marked as kernel invariant to potentially increase performance",
{"attr": attr,
"type": typ.name},
self.attr_locs[key])
self.engine.process(diag)
def process_function(self, func):
for block in func.basic_blocks:
for insn in block.instructions:
if not isinstance(insn, (ir.GetAttr, ir.SetAttr)):
continue
if not types.is_instance(insn.object().type):
continue
key = (insn.object().type, insn.attr)
if isinstance(insn, ir.GetAttr):
if types.is_method(insn.type):
continue
if key not in self.attr_locs and insn.loc is not None:
self.attr_locs[key] = insn.loc
elif isinstance(insn, ir.SetAttr):
self.attr_written.add(key)

View File

@ -21,13 +21,19 @@ class scoped(object):
set of variables resolved as globals
"""
class remote(object):
"""
:ivar remote_fn: (bool) whether function is ran on a remote device,
meaning arguments are received remotely and return is sent remotely
"""
# Typed versions of untyped nodes
class argT(ast.arg, commontyped):
pass
class ClassDefT(ast.ClassDef):
_types = ("constructor_type",)
class FunctionDefT(ast.FunctionDef, scoped):
class FunctionDefT(ast.FunctionDef, scoped, remote):
_types = ("signature_type",)
class QuotedFunctionDefT(FunctionDefT):
"""
@ -58,7 +64,7 @@ class BinOpT(ast.BinOp, commontyped):
pass
class BoolOpT(ast.BoolOp, commontyped):
pass
class CallT(ast.Call, commontyped):
class CallT(ast.Call, commontyped, remote):
"""
:ivar iodelay: (:class:`iodelay.Expr`)
:ivar arg_exprs: (dict of str to :class:`iodelay.Expr`)

View File

@ -38,6 +38,9 @@ class TInt(types.TMono):
def one():
return 1
def TInt8():
return TInt(types.TValue(8))
def TInt32():
return TInt(types.TValue(32))
@ -67,6 +70,14 @@ class TStr(types.TMono):
def __init__(self):
super().__init__("str")
class TBytes(types.TMono):
def __init__(self):
super().__init__("bytes")
class TByteArray(types.TMono):
def __init__(self):
super().__init__("bytearray")
class TList(types.TMono):
def __init__(self, elt=None):
if elt is None:
@ -74,13 +85,27 @@ class TList(types.TMono):
super().__init__("list", {"elt": elt})
class TArray(types.TMono):
def __init__(self, elt=None):
def __init__(self, elt=None, num_dims=1):
if elt is None:
elt = types.TVar()
super().__init__("array", {"elt": elt})
if isinstance(num_dims, int):
# Make TArray more convenient to instantiate from (ARTIQ) user code.
num_dims = types.TValue(num_dims)
# For now, enforce number of dimensions to be known, as we'd otherwise
# need to implement custom unification logic for the type of `shape`.
# Default to 1 to keep compatibility with old user code from before
# multidimensional array support.
assert isinstance(num_dims.value, int), "Number of dimensions must be resolved"
super().__init__("array", {"elt": elt, "num_dims": num_dims})
self.attributes = OrderedDict([
("buffer", types._TPointer(elt)),
("shape", types.TTuple([TInt32()] * num_dims.value)),
])
def _array_printer(typ, printer, depth, max_depth):
return "numpy.array(elt={})".format(printer.name(typ["elt"], depth, max_depth))
return "numpy.array(elt={}, num_dims={})".format(
printer.name(typ["elt"], depth, max_depth), typ["num_dims"].value)
types.TypePrinter.custom_printers["array"] = _array_printer
class TRange(types.TMono):
@ -101,18 +126,23 @@ class TException(types.TMono):
# * File, line and column where it was raised (str, int, int).
# * Message, which can contain substitutions {0}, {1} and {2} (str).
# * Three 64-bit integers, parameterizing the message (numpy.int64).
# These attributes are prefixed with `#` so that users cannot access them,
# and we don't have to do string allocation in the runtime.
# #__name__ is now a string key in the host. TStr may not be an actual
# CSlice in the runtime, they might be a CSlice with length = i32::MAX and
# ptr = string key in the host.
# Keep this in sync with the function ARTIQIRGenerator.alloc_exn.
attributes = OrderedDict([
("__name__", TStr()),
("__file__", TStr()),
("__line__", TInt32()),
("__col__", TInt32()),
("__func__", TStr()),
("__message__", TStr()),
("__param0__", TInt64()),
("__param1__", TInt64()),
("__param2__", TInt64()),
("#__name__", TInt32()),
("#__file__", TStr()),
("#__line__", TInt32()),
("#__col__", TInt32()),
("#__func__", TStr()),
("#__message__", TStr()),
("#__param0__", TInt64()),
("#__param1__", TInt64()),
("#__param2__", TInt64()),
])
def __init__(self, name="Exception", id=0):
@ -126,10 +156,10 @@ def fn_int():
return types.TConstructor(TInt())
def fn_int32():
return types.TConstructor(TInt32())
return types.TBuiltinFunction("int32")
def fn_int64():
return types.TConstructor(TInt64())
return types.TBuiltinFunction("int64")
def fn_float():
return types.TConstructor(TFloat())
@ -137,11 +167,19 @@ def fn_float():
def fn_str():
return types.TConstructor(TStr())
def fn_bytes():
return types.TConstructor(TBytes())
def fn_bytearray():
return types.TConstructor(TByteArray())
def fn_list():
return types.TConstructor(TList())
def fn_array():
return types.TConstructor(TArray())
# numpy.array() is actually a "magic" macro that is expanded in-place, but
# just as for builtin functions, we do not want to quote it, etc.
return types.TBuiltinFunction("array")
def fn_Exception():
return types.TExceptionConstructor(TException("Exception"))
@ -155,6 +193,9 @@ def fn_ValueError():
def fn_ZeroDivisionError():
return types.TExceptionConstructor(TException("ZeroDivisionError"))
def fn_RuntimeError():
return types.TExceptionConstructor(TException("RuntimeError"))
def fn_range():
return types.TBuiltinFunction("range")
@ -164,6 +205,9 @@ def fn_len():
def fn_round():
return types.TBuiltinFunction("round")
def fn_abs():
return types.TBuiltinFunction("abs")
def fn_min():
return types.TBuiltinFunction("min")
@ -188,9 +232,6 @@ def obj_interleave():
def obj_sequential():
return types.TBuiltin("sequential")
def fn_watchdog():
return types.TBuiltinFunction("watchdog")
def fn_delay():
return types.TBuiltinFunction("delay")
@ -203,15 +244,15 @@ def fn_delay_mu():
def fn_at_mu():
return types.TBuiltinFunction("at_mu")
def fn_mu_to_seconds():
return types.TBuiltinFunction("mu_to_seconds")
def fn_seconds_to_mu():
return types.TBuiltinFunction("seconds_to_mu")
def fn_rtio_log():
return types.TBuiltinFunction("rtio_log")
def fn_subkernel_await():
return types.TBuiltinFunction("subkernel_await")
def fn_subkernel_preload():
return types.TBuiltinFunction("subkernel_preload")
# Accessors
def is_none(typ):
@ -242,6 +283,12 @@ def is_float(typ):
def is_str(typ):
return types.is_mono(typ, "str")
def is_bytes(typ):
return types.is_mono(typ, "bytes")
def is_bytearray(typ):
return types.is_mono(typ, "bytearray")
def is_numeric(typ):
typ = typ.find()
return isinstance(typ, types.TMono) and \
@ -260,7 +307,12 @@ def is_array(typ, elt=None):
return types.is_mono(typ, "array")
def is_listish(typ, elt=None):
return is_list(typ, elt) or is_array(typ, elt) or (elt is None and is_str(typ))
if is_list(typ, elt) or is_array(typ, elt):
return True
elif elt is None:
return is_str(typ) or is_bytes(typ) or is_bytearray(typ)
else:
return False
def is_range(typ, elt=None):
if elt is not None:
@ -276,15 +328,16 @@ def is_exception(typ, name=None):
typ.name == name
def is_iterable(typ):
typ = typ.find()
return isinstance(typ, types.TMono) and \
typ.name in ('list', 'array', 'range')
return is_listish(typ) or is_range(typ)
def get_iterable_elt(typ):
if is_iterable(typ):
# TODO: Arrays count as listish, but this returns the innermost element type for
# n-dimensional arrays, rather than the n-1 dimensional result of iterating over
# the first axis, which makes the name a bit misleading.
if is_str(typ) or is_bytes(typ) or is_bytearray(typ):
return TInt8()
elif types._is_pointer(typ) or is_iterable(typ):
return typ.find()["elt"].find()
elif is_str(typ):
return TInt(types.TValue(8))
else:
assert False
@ -297,6 +350,6 @@ def is_allocated(typ):
return not (is_none(typ) or is_bool(typ) or is_int(typ) or
is_float(typ) or is_range(typ) or
types._is_pointer(typ) or types.is_function(typ) or
types.is_c_function(typ) or types.is_rpc(typ) or
types.is_method(typ) or types.is_tuple(typ) or
types.is_value(typ))
types.is_external_function(typ) or types.is_rpc(typ) or
types.is_subkernel(typ) or types.is_method(typ) or
types.is_tuple(typ) or types.is_value(typ))

File diff suppressed because it is too large Load Diff

View File

@ -29,7 +29,10 @@ def hook_exec_module(self, module):
fn = module.__file__
try:
with tokenize.open(fn) as fp:
cache[fn] = fp.readlines()
lines = fp.readlines()
if lines and not lines[-1].endswith("\n"):
lines[-1] += "\n"
cache[fn] = lines
except:
logger.warning("failed to add '%s' to cache", fn, exc_info=True)
else:

View File

@ -36,12 +36,47 @@ class TKeyword(types.TMono):
def is_keyword(typ):
return isinstance(typ, TKeyword)
class TExceptionTypeInfo(types.TMono):
def __init__(self):
super().__init__("exntypeinfo")
def is_exn_typeinfo(typ):
return isinstance(typ, TExceptionTypeInfo)
# See rpc_proto.rs and comm_kernel.py:_{send,receive}_rpc_value.
def rpc_tag(typ, error_handler):
typ = typ.find()
if types.is_tuple(typ):
assert len(typ.elts) < 256
return b"t" + bytes([len(typ.elts)]) + \
b"".join([rpc_tag(elt_type, error_handler)
for elt_type in typ.elts])
elif builtins.is_none(typ):
return b"n"
elif builtins.is_bool(typ):
return b"b"
elif builtins.is_int(typ, types.TValue(32)):
return b"i"
elif builtins.is_int(typ, types.TValue(64)):
return b"I"
elif builtins.is_float(typ):
return b"f"
elif builtins.is_str(typ):
return b"s"
elif builtins.is_bytes(typ):
return b"B"
elif builtins.is_bytearray(typ):
return b"A"
elif builtins.is_list(typ):
return b"l" + rpc_tag(builtins.get_iterable_elt(typ), error_handler)
elif builtins.is_array(typ):
num_dims = typ["num_dims"].value
return b"a" + bytes([num_dims]) + rpc_tag(typ["elt"], error_handler)
elif builtins.is_range(typ):
return b"r" + rpc_tag(builtins.get_iterable_elt(typ), error_handler)
elif is_keyword(typ):
return b"k" + rpc_tag(typ.params["value"], error_handler)
elif types.is_function(typ) or types.is_method(typ) or types.is_rpc(typ):
raise ValueError("RPC tag for functional value")
elif '__objectid__' in typ.attributes:
return b"O"
else:
error_handler(typ)
class Value:
"""
@ -100,6 +135,7 @@ class NamedValue(Value):
def __init__(self, typ, name):
super().__init__(typ)
self.name, self.function = name, None
self.is_removed = False
def set_name(self, new_name):
if self.function is not None:
@ -200,7 +236,7 @@ class Instruction(User):
self.drop_references()
# Check this after drop_references in case this
# is a self-referencing phi.
assert not any(self.uses)
assert all(use.is_removed for use in self.uses)
def replace_with(self, value):
self.replace_all_uses_with(value)
@ -310,6 +346,7 @@ class BasicBlock(NamedValue):
:ivar instructions: (list of :class:`Instruction`)
"""
_dump_loc = True
def __init__(self, instructions, name=""):
super().__init__(TBasicBlock(), name)
@ -334,7 +371,7 @@ class BasicBlock(NamedValue):
self.remove_from_parent()
# Check this after erasing instructions in case the block
# loops into itself.
assert not any(self.uses)
assert all(use.is_removed for use in self.uses)
def prepend(self, insn):
assert isinstance(insn, Instruction)
@ -385,12 +422,12 @@ class BasicBlock(NamedValue):
lines = ["{}:".format(escape_name(self.name))]
if self.function is not None:
lines[0] += " ; predecessors: {}".format(
", ".join([escape_name(pred.name) for pred in self.predecessors()]))
", ".join(sorted([escape_name(pred.name) for pred in self.predecessors()])))
# Annotated instructions
loc = None
for insn in self.instructions:
if loc != insn.loc:
if self._dump_loc and loc != insn.loc:
loc = insn.loc
if loc is None:
@ -416,7 +453,13 @@ class BasicBlock(NamedValue):
class Argument(NamedValue):
"""
A function argument.
:ivar loc: (:class:`pythonparser.source.Range` or None)
source location
"""
def __init__(self, typ, name):
super().__init__(typ, name)
self.loc = None
def as_entity(self, type_printer):
return self.as_operand(type_printer)
@ -663,6 +706,81 @@ class SetLocal(Instruction):
def value(self):
return self.operands[1]
class GetArgFromRemote(Instruction):
"""
An instruction that receives function arguments from remote
(ie. subkernel in DRTIO context)
:ivar arg_name: (string) argument name
:ivar arg_type: argument type
"""
"""
:param arg_name: (string) argument name
:param arg_type: argument type
"""
def __init__(self, arg_name, arg_type, name=""):
assert isinstance(arg_name, str)
super().__init__([], arg_type, name)
self.arg_name = arg_name
self.arg_type = arg_type
def copy(self, mapper):
self_copy = super().copy(mapper)
self_copy.arg_name = self.arg_name
self_copy.arg_type = self.arg_type
return self_copy
def opcode(self):
return "getargfromremote({})".format(repr(self.arg_name))
class GetOptArgFromRemote(GetArgFromRemote):
"""
An instruction that may or may not retrieve an optional function argument
from remote, depending on number of values received by firmware.
:ivar rcv_count: number of received values,
determined by firmware
:ivar index: (integer) index of the current argument,
in reference to remote arguments
"""
"""
:param rcv_count: number of received valuese
:param index: (integer) index of the current argument,
in reference to remote arguments
"""
def __init__(self, arg_name, arg_type, rcv_count, index, name=""):
super().__init__(arg_name, arg_type, name)
self.rcv_count = rcv_count
self.index = index
def copy(self, mapper):
self_copy = super().copy(mapper)
self_copy.rcv_count = self.rcv_count
self_copy.index = self.index
return self_copy
def opcode(self):
return "getoptargfromremote({})".format(repr(self.arg_name))
class SubkernelAwaitArgs(Instruction):
"""
A builtin instruction that takes min and max received messages as operands,
and a list of received types.
:ivar arg_types: (list of types) types of passed arguments (including optional)
"""
"""
:param arg_types: (list of types) types of passed arguments (including optional)
"""
def __init__(self, operands, arg_types, name=None):
assert isinstance(arg_types, list)
self.arg_types = arg_types
super().__init__(operands, builtins.TNone(), name)
class GetAttr(Instruction):
"""
An intruction that loads an attribute from an object,
@ -685,7 +803,7 @@ class GetAttr(Instruction):
typ = obj.type.attributes[attr]
else:
typ = obj.type.constructor.attributes[attr]
if types.is_function(typ) or types.is_rpc(typ):
if types.is_function(typ) or types.is_rpc(typ) or types.is_subkernel(typ):
typ = types.TMethod(obj.type, typ)
super().__init__([obj], typ, name)
self.attr = attr
@ -738,6 +856,33 @@ class SetAttr(Instruction):
def value(self):
return self.operands[1]
class Offset(Instruction):
"""
An intruction that adds an offset to a pointer (indexes into a list).
This is used to represent internally generated pointer arithmetic, and must
remain inside the same object (see :class:`GetElem` and LLVM's GetElementPtr).
"""
"""
:param lst: (:class:`Value`) list
:param index: (:class:`Value`) index
"""
def __init__(self, base, offset, name=""):
assert isinstance(base, Value)
assert isinstance(offset, Value)
typ = types._TPointer(builtins.get_iterable_elt(base.type))
super().__init__([base, offset], typ, name)
def opcode(self):
return "offset"
def base(self):
return self.operands[0]
def index(self):
return self.operands[1]
class GetElem(Instruction):
"""
An intruction that loads an element from a list.
@ -755,7 +900,7 @@ class GetElem(Instruction):
def opcode(self):
return "getelem"
def list(self):
def base(self):
return self.operands[0]
def index(self):
@ -781,7 +926,7 @@ class SetElem(Instruction):
def opcode(self):
return "setelem"
def list(self):
def base(self):
return self.operands[0]
def index(self):
@ -840,6 +985,7 @@ class Arith(Instruction):
def rhs(self):
return self.operands[1]
class Compare(Instruction):
"""
A comparison operation on numbers.
@ -1119,14 +1265,18 @@ class IndirectBranch(Terminator):
class Return(Terminator):
"""
A return instruction.
:param remote_return: (bool)
marks a return in subkernel context,
where the return value is sent back through DRTIO
"""
"""
:param value: (:class:`Value`) return value
"""
def __init__(self, value, name=""):
def __init__(self, value, remote_return=False, name=""):
assert isinstance(value, Value)
super().__init__([value], builtins.TNone(), name)
self.remote_return = remote_return
def opcode(self):
return "return"
@ -1175,9 +1325,9 @@ class Raise(Terminator):
if len(self.operands) > 1:
return self.operands[1]
class Reraise(Terminator):
class Resume(Terminator):
"""
A reraise instruction.
A resume instruction.
"""
"""
@ -1191,7 +1341,7 @@ class Reraise(Terminator):
super().__init__(operands, builtins.TNone(), name)
def opcode(self):
return "reraise"
return "resume"
def exception_target(self):
if len(self.operands) > 0:
@ -1277,6 +1427,7 @@ class LandingPad(Terminator):
def __init__(self, cleanup, name=""):
super().__init__([cleanup], builtins.TException(), name)
self.types = []
self.has_cleanup = True
def copy(self, mapper):
self_copy = super().copy(mapper)

70
artiq/compiler/kernel.ld Normal file
View File

@ -0,0 +1,70 @@
/* Force ld to make the ELF header as loadable. */
PHDRS
{
headers PT_LOAD FILEHDR PHDRS ;
text PT_LOAD ;
data PT_LOAD ;
dynamic PT_DYNAMIC ;
eh_frame PT_GNU_EH_FRAME ;
}
SECTIONS
{
/* Push back .text section enough so that ld.lld not complain */
. = SIZEOF_HEADERS;
.text :
{
*(.text .text.*)
} : text
.rodata :
{
*(.rodata .rodata.*)
}
.eh_frame :
{
KEEP(*(.eh_frame))
} : text
.eh_frame_hdr :
{
KEEP(*(.eh_frame_hdr))
} : text : eh_frame
.got :
{
*(.got)
} : text
.got.plt :
{
*(.got.plt)
} : text
.data :
{
*(.data .data.*)
} : data
.dynamic :
{
*(.dynamic)
} : data : dynamic
.bss (NOLOAD) : ALIGN(4)
{
__bss_start = .;
*(.sbss .sbss.* .bss .bss.*);
. = ALIGN(4);
_end = .;
}
/* Kernel stack grows downward from end of memory, so put guard page after
* all the program contents. Note: This requires all loaded sections (at
* least those accessed) to be explicitly listed in the above!
*/
. = ALIGN(0x1000);
_sstack_guard = .;
}

132
artiq/compiler/math_fns.py Normal file
View File

@ -0,0 +1,132 @@
r"""
The :mod:`math_fns` module lists math-related functions from NumPy recognized
by the ARTIQ compiler so host function objects can be :func:`match`\ ed to
the compiler type metadata describing their core device analogue.
"""
from collections import OrderedDict
import numpy
from . import builtins, types
# Some special mathematical functions are exposed via their scipy.special
# equivalents. Since the rest of the ARTIQ core does not depend on SciPy,
# gracefully handle it not being present, making the functions simply not
# available.
try:
import scipy.special as scipy_special
except ImportError:
scipy_special = None
#: float -> float numpy.* math functions for which llvm.* intrinsics exist.
unary_fp_intrinsics = [(name, "llvm." + name + ".f64") for name in [
"sin",
"cos",
"exp",
"exp2",
"log",
"log10",
"log2",
"fabs",
"floor",
"ceil",
"trunc",
"sqrt",
]] + [
# numpy.rint() seems to (NumPy 1.19.0, Python 3.8.5, Linux x86_64)
# implement round-to-even, but unfortunately, rust-lang/libm only
# provides round(), which always rounds away from zero.
#
# As there is no equivalent of the latter in NumPy (nor any other
# basic rounding function), expose round() as numpy.rint anyway,
# even if the rounding modes don't match up, so there is some way
# to do rounding on the core device. (numpy.round() has entirely
# different semantics; it rounds to a configurable number of
# decimals.)
("rint", "llvm.round.f64"),
]
#: float -> float numpy.* math functions lowered to runtime calls.
unary_fp_runtime_calls = [
("tan", "tan"),
("arcsin", "asin"),
("arccos", "acos"),
("arctan", "atan"),
("sinh", "sinh"),
("cosh", "cosh"),
("tanh", "tanh"),
("arcsinh", "asinh"),
("arccosh", "acosh"),
("arctanh", "atanh"),
("expm1", "expm1"),
("cbrt", "cbrt"),
]
#: float -> float numpy.* math functions lowered to runtime calls.
unary_fp_runtime_calls = [
("tan", "tan"),
("arcsin", "asin"),
("arccos", "acos"),
("arctan", "atan"),
("sinh", "sinh"),
("cosh", "cosh"),
("tanh", "tanh"),
("arcsinh", "asinh"),
("arccosh", "acosh"),
("arctanh", "atanh"),
("expm1", "expm1"),
("cbrt", "cbrt"),
]
scipy_special_unary_runtime_calls = [
("erf", "erf"),
("erfc", "erfc"),
("gamma", "tgamma"),
("gammaln", "lgamma"),
("j0", "j0"),
("j1", "j1"),
("y0", "y0"),
("y1", "y1"),
]
# Not mapped: jv/yv, libm only supports integer orders.
#: (float, float) -> float numpy.* math functions lowered to runtime calls.
binary_fp_runtime_calls = [
("arctan2", "atan2"),
("copysign", "copysign"),
("fmax", "fmax"),
("fmin", "fmin"),
# ("ldexp", "ldexp"), # One argument is an int; would need a bit more plumbing.
("hypot", "hypot"),
("nextafter", "nextafter"),
]
#: Array handling builtins (special treatment due to allocations).
numpy_builtins = ["transpose"]
def fp_runtime_type(name, arity):
args = [("arg{}".format(i), builtins.TFloat()) for i in range(arity)]
return types.TExternalFunction(
OrderedDict(args),
builtins.TFloat(),
name,
# errno isn't observable from ARTIQ Python.
flags={"nounwind", "nowrite"},
broadcast_across_arrays=True)
math_fn_map = {
getattr(numpy, symbol): fp_runtime_type(mangle, arity=1)
for symbol, mangle in (unary_fp_intrinsics + unary_fp_runtime_calls)
}
for symbol, mangle in binary_fp_runtime_calls:
math_fn_map[getattr(numpy, symbol)] = fp_runtime_type(mangle, arity=2)
for name in numpy_builtins:
math_fn_map[getattr(numpy, name)] = types.TBuiltinFunction("numpy." + name)
if scipy_special is not None:
for symbol, mangle in scipy_special_unary_runtime_calls:
math_fn_map[getattr(scipy_special, symbol)] = fp_runtime_type(mangle, arity=1)
def match(obj):
return math_fn_map.get(obj, None)

View File

@ -10,7 +10,7 @@ string and infers types for it using a trivial :module:`prelude`.
import os
from pythonparser import source, diagnostic, parse_buffer
from . import prelude, types, transforms, analyses, validators
from . import prelude, types, transforms, analyses, validators, embedding
class Source:
def __init__(self, source_buffer, engine=None):
@ -18,7 +18,7 @@ class Source:
self.engine = diagnostic.Engine(all_errors_are_fatal=True)
else:
self.engine = engine
self.embedding_map = None
self.embedding_map = embedding.EmbeddingMap()
self.name, _ = os.path.splitext(os.path.basename(source_buffer.name))
asttyped_rewriter = transforms.ASTTypedRewriter(engine=engine,
@ -40,53 +40,60 @@ class Source:
return cls(source.Buffer(f.read(), filename, 1), engine=engine)
class Module:
def __init__(self, src, ref_period=1e-6):
def __init__(self, src, ref_period=1e-6, attribute_writeback=True, remarks=False):
self.attribute_writeback = attribute_writeback
self.engine = src.engine
self.embedding_map = src.embedding_map
self.name = src.name
self.globals = src.globals
int_monomorphizer = transforms.IntMonomorphizer(engine=self.engine)
cast_monomorphizer = transforms.CastMonomorphizer(engine=self.engine)
inferencer = transforms.Inferencer(engine=self.engine)
monomorphism_validator = validators.MonomorphismValidator(engine=self.engine)
escape_validator = validators.EscapeValidator(engine=self.engine)
iodelay_estimator = transforms.IODelayEstimator(engine=self.engine,
ref_period=ref_period)
constness = analyses.Constness(engine=self.engine)
constness_validator = validators.ConstnessValidator(engine=self.engine)
artiq_ir_generator = transforms.ARTIQIRGenerator(engine=self.engine,
module_name=src.name,
ref_period=ref_period)
ref_period=ref_period,
embedding_map=self.embedding_map)
dead_code_eliminator = transforms.DeadCodeEliminator(engine=self.engine)
local_access_validator = validators.LocalAccessValidator(engine=self.engine)
local_demoter = transforms.LocalDemoter()
constant_hoister = transforms.ConstantHoister()
devirtualization = analyses.Devirtualization()
interleaver = transforms.Interleaver(engine=self.engine)
invariant_detection = analyses.InvariantDetection(engine=self.engine)
int_monomorphizer.visit(src.typedtree)
cast_monomorphizer.visit(src.typedtree)
inferencer.visit(src.typedtree)
monomorphism_validator.visit(src.typedtree)
escape_validator.visit(src.typedtree)
iodelay_estimator.visit_fixpoint(src.typedtree)
constness.visit(src.typedtree)
constness_validator.visit(src.typedtree)
devirtualization.visit(src.typedtree)
self.artiq_ir = artiq_ir_generator.visit(src.typedtree)
artiq_ir_generator.annotate_calls(devirtualization)
dead_code_eliminator.process(self.artiq_ir)
interleaver.process(self.artiq_ir)
local_access_validator.process(self.artiq_ir)
local_demoter.process(self.artiq_ir)
constant_hoister.process(self.artiq_ir)
if remarks:
invariant_detection.process(self.artiq_ir)
# for subkernels: main kernel inferencer output, to be passed to further compilations
self.subkernel_arg_types = inferencer.subkernel_arg_types
def build_llvm_ir(self, target):
"""Compile the module to LLVM IR for the specified target."""
llvm_ir_generator = transforms.LLVMIRGenerator(
engine=self.engine, module_name=self.name, target=target,
embedding_map=self.embedding_map)
return llvm_ir_generator.process(self.artiq_ir, attribute_writeback=True)
def entry_point(self):
"""Return the name of the function that is the entry point of this module."""
if self.name != "":
return self.name + ".__modinit__"
else:
return "__modinit__"
return llvm_ir_generator.process(self.artiq_ir,
attribute_writeback=self.attribute_writeback)
def __repr__(self):
printer = types.TypePrinter()

View File

@ -11,42 +11,52 @@ def globals():
"bool": builtins.fn_bool(),
"int": builtins.fn_int(),
"float": builtins.fn_float(),
"str": builtins.fn_str(),
"bytes": builtins.fn_bytes(),
"bytearray": builtins.fn_bytearray(),
"list": builtins.fn_list(),
"array": builtins.fn_array(),
"range": builtins.fn_range(),
"int32": builtins.fn_int32(),
"int64": builtins.fn_int64(),
# Exception constructors
"Exception": builtins.fn_Exception(),
"IndexError": builtins.fn_IndexError(),
"ValueError": builtins.fn_ValueError(),
"ZeroDivisionError": builtins.fn_ZeroDivisionError(),
"RuntimeError": builtins.fn_RuntimeError(),
# Built-in Python functions
"len": builtins.fn_len(),
"round": builtins.fn_round(),
"abs": builtins.fn_abs(),
"min": builtins.fn_min(),
"max": builtins.fn_max(),
"print": builtins.fn_print(),
# ARTIQ decorators
"kernel": builtins.fn_kernel(),
"subkernel": builtins.fn_kernel(),
"portable": builtins.fn_kernel(),
"rpc": builtins.fn_kernel(),
# ARTIQ context managers
"parallel": builtins.obj_parallel(),
"interleave": builtins.obj_interleave(),
"sequential": builtins.obj_sequential(),
"watchdog": builtins.fn_watchdog(),
# ARTIQ time management functions
"delay": builtins.fn_delay(),
"now_mu": builtins.fn_now_mu(),
"delay_mu": builtins.fn_delay_mu(),
"at_mu": builtins.fn_at_mu(),
"mu_to_seconds": builtins.fn_mu_to_seconds(),
"seconds_to_mu": builtins.fn_seconds_to_mu(),
# ARTIQ utility functions
"rtio_log": builtins.fn_rtio_log(),
"core_log": builtins.fn_print(),
# ARTIQ subkernel utility functions
"subkernel_await": builtins.fn_subkernel_await(),
"subkernel_preload": builtins.fn_subkernel_preload(),
}

View File

@ -1,6 +1,6 @@
import os, sys, tempfile, subprocess
from artiq.compiler import types
from llvmlite_artiq import ir as ll, binding as llvm
import os, sys, tempfile, subprocess, io
from artiq.compiler import types, ir
from llvmlite import ir as ll, binding as llvm
llvm.initialize()
llvm.initialize_all_targets()
@ -8,40 +8,46 @@ llvm.initialize_all_asmprinters()
class RunTool:
def __init__(self, pattern, **tempdata):
self.files = []
self.pattern = pattern
self.tempdata = tempdata
def maketemp(self, data):
f = tempfile.NamedTemporaryFile()
f.write(data)
f.flush()
self.files.append(f)
return f
self._pattern = pattern
self._tempdata = tempdata
self._tempnames = {}
self._tempfiles = {}
def __enter__(self):
tempfiles = {}
tempnames = {}
for key in self.tempdata:
tempfiles[key] = self.maketemp(self.tempdata[key])
tempnames[key] = tempfiles[key].name
for key, data in self._tempdata.items():
if data is None:
fd, filename = tempfile.mkstemp()
os.close(fd)
self._tempnames[key] = filename
else:
with tempfile.NamedTemporaryFile(delete=False) as f:
f.write(data)
self._tempnames[key] = f.name
cmdline = []
for argument in self.pattern:
cmdline.append(argument.format(**tempnames))
for argument in self._pattern:
cmdline.append(argument.format(**self._tempnames))
process = subprocess.Popen(cmdline, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
# https://bugs.python.org/issue17023
windows = os.name == "nt"
process = subprocess.Popen(cmdline, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
universal_newlines=True, shell=windows)
stdout, stderr = process.communicate()
if process.returncode != 0:
raise Exception("{} invocation failed: {}".
format(cmdline[0], stderr.decode('utf-8')))
format(cmdline[0], stderr))
tempfiles["__stdout__"] = stdout.decode('utf-8')
return tempfiles
self._tempfiles["__stdout__"] = io.StringIO(stdout)
for key in self._tempdata:
if self._tempdata[key] is None:
self._tempfiles[key] = open(self._tempnames[key], "rb")
return self._tempfiles
def __exit__(self, exc_typ, exc_value, exc_trace):
for f in self.files:
f.close()
for file in self._tempfiles.values():
file.close()
for filename in self._tempnames.values():
os.unlink(filename)
def _dump(target, kind, suffix, content):
if target is not None:
@ -63,37 +69,46 @@ class Target:
generated by the ARTIQ compiler will be deployed.
:var triple: (string)
LLVM target triple, e.g. ``"or1k"``
LLVM target triple, e.g. ``"riscv32"``
:var data_layout: (string)
LLVM target data layout, e.g. ``"E-m:e-p:32:32-i64:32-f64:32-v64:32-v128:32-a:0:32-n32"``
:var features: (list of string)
LLVM target CPU features, e.g. ``["mul", "div", "ffl1"]``
:var additional_linker_options: (list of string)
Linker options for the target in addition to the target-independent ones, e.g. ``["--target2=rel"]``
:var print_function: (string)
Name of a formatted print functions (with the signature of ``printf``)
provided by the target, e.g. ``"printf"``.
:var now_pinning: (boolean)
Whether the target implements the now-pinning RTIO optimization.
"""
triple = "unknown"
data_layout = ""
features = []
additional_linker_options = []
print_function = "printf"
now_pinning = True
tool_ld = "ld.lld"
tool_strip = "llvm-strip"
tool_symbolizer = "llvm-symbolizer"
tool_cxxfilt = "llvm-cxxfilt"
def __init__(self):
def __init__(self, subkernel_id=None):
self.llcontext = ll.Context()
self.subkernel_id = subkernel_id
def target_machine(self):
lltarget = llvm.Target.from_triple(self.triple)
llmachine = lltarget.create_target_machine(
features=",".join(["+{}".format(f) for f in self.features]),
reloc="pic", codemodel="default")
llmachine.set_verbose(True)
reloc="pic", codemodel="default",
abiname="ilp32d" if isinstance(self, RV32GTarget) else "")
llmachine.set_asm_verbosity(True)
return llmachine
def optimize(self, llmodule):
llmachine = self.target_machine()
llpassmgr = llvm.create_module_pass_manager()
llmachine.target_data.add_pass(llpassmgr)
llmachine.add_analysis_passes(llpassmgr)
# Register our alias analysis passes.
llpassmgr.add_basic_alias_analysis_pass()
@ -130,8 +145,12 @@ class Target:
print("====== MODULE_SIGNATURE DUMP ======", file=sys.stderr)
print(module, file=sys.stderr)
if os.getenv("ARTIQ_IR_NO_LOC") is not None:
ir.BasicBlock._dump_loc = False
type_printer = types.TypePrinter()
_dump(os.getenv("ARTIQ_DUMP_IR"), "ARTIQ IR", ".txt",
suffix = "_subkernel_{}".format(self.subkernel_id) if self.subkernel_id is not None else ""
_dump(os.getenv("ARTIQ_DUMP_IR"), "ARTIQ IR", suffix + ".txt",
lambda: "\n".join(fn.as_entity(type_printer) for fn in module.artiq_ir))
llmod = module.build_llvm_ir(self)
@ -143,12 +162,12 @@ class Target:
_dump("", "LLVM IR (broken)", ".ll", lambda: str(llmod))
raise
_dump(os.getenv("ARTIQ_DUMP_UNOPT_LLVM"), "LLVM IR (generated)", "_unopt.ll",
_dump(os.getenv("ARTIQ_DUMP_UNOPT_LLVM"), "LLVM IR (generated)", suffix + "_unopt.ll",
lambda: str(llparsedmod))
self.optimize(llparsedmod)
_dump(os.getenv("ARTIQ_DUMP_LLVM"), "LLVM IR (optimized)", ".ll",
_dump(os.getenv("ARTIQ_DUMP_LLVM"), "LLVM IR (optimized)", suffix + ".ll",
lambda: str(llparsedmod))
return llparsedmod
@ -159,30 +178,35 @@ class Target:
_dump(os.getenv("ARTIQ_DUMP_ASM"), "Assembly", ".s",
lambda: llmachine.emit_assembly(llmodule))
_dump(os.getenv("ARTIQ_DUMP_OBJ"), "Object file", ".o",
lambda: llmachine.emit_object(llmodule))
return llmachine.emit_object(llmodule)
def link(self, objects, init_fn):
def link(self, objects):
"""Link the relocatable objects into a shared library for this target."""
with RunTool([self.triple + "-ld", "-shared", "--eh-frame-hdr", "-init", init_fn] +
with RunTool([self.tool_ld, "-shared", "--eh-frame-hdr"] +
self.additional_linker_options +
["-T" + os.path.join(os.path.dirname(__file__), "kernel.ld")] +
["{{obj{}}}".format(index) for index in range(len(objects))] +
["-x"] +
["-o", "{output}"],
output=b"",
output=None,
**{"obj{}".format(index): obj for index, obj in enumerate(objects)}) \
as results:
library = results["output"].read()
_dump(os.getenv("ARTIQ_DUMP_ELF"), "Shared library", ".so",
_dump(os.getenv("ARTIQ_DUMP_ELF"), "Shared library", ".elf",
lambda: library)
return library
def compile_and_link(self, modules):
return self.link([self.assemble(self.compile(module)) for module in modules],
init_fn=modules[0].entry_point())
return self.link([self.assemble(self.compile(module)) for module in modules])
def strip(self, library):
with RunTool([self.triple + "-strip", "--strip-debug", "{library}", "-o", "{output}"],
library=library, output=b"") \
with RunTool([self.tool_strip, "--strip-debug", "{library}", "-o", "{output}"],
library=library, output=None) \
as results:
return results["output"].read()
@ -194,12 +218,13 @@ class Target:
# just after the call. Offset them back to get an address somewhere
# inside the call instruction (or its delay slot), since that's what
# the backtrace entry should point at.
last_inlined = None
offset_addresses = [hex(addr - 1) for addr in addresses]
with RunTool([self.triple + "-addr2line", "--addresses", "--functions", "--inlines",
"--demangle", "--exe={library}"] + offset_addresses,
with RunTool([self.tool_symbolizer, "--addresses", "--functions", "--inlines",
"--demangle", "--output-style=GNU", "--exe={library}"] + offset_addresses,
library=library) \
as results:
lines = iter(results["__stdout__"].rstrip().split("\n"))
lines = iter(results["__stdout__"].read().rstrip().split("\n"))
backtrace = []
while True:
try:
@ -209,30 +234,76 @@ class Target:
if address_or_function[:2] == "0x":
address = int(address_or_function[2:], 16) + 1 # remove offset
function = next(lines)
inlined = False
else:
address = backtrace[-1][4] # inlined
function = address_or_function
inlined = True
location = next(lines)
filename, line = location.rsplit(":", 1)
if filename == "??" or filename == "<synthesized>":
continue
if line == "?":
line = -1
else:
line = int(line)
# can't get column out of addr2line D:
backtrace.append((filename, int(line), -1, function, address))
if inlined:
last_inlined.append((filename, line, -1, function, address))
else:
last_inlined = []
backtrace.append((filename, line, -1, function, address,
last_inlined))
return backtrace
def demangle(self, names):
with RunTool([self.triple + "-c++filt"] + names) as results:
return results["__stdout__"].rstrip().split("\n")
if not any(names):
return names
with RunTool([self.tool_cxxfilt] + names) as results:
return results["__stdout__"].read().rstrip().split("\n")
class NativeTarget(Target):
def __init__(self):
super().__init__()
self.triple = llvm.get_default_triple()
self.data_layout = str(llvm.targets.Target.from_default_triple().create_target_machine().target_data)
class OR1KTarget(Target):
triple = "or1k-linux"
data_layout = "E-m:e-p:32:32-i8:8:8-i16:16:16-i64:32:32-" \
"f64:32:32-v64:32:32-v128:32:32-a0:0:32-n32"
features = ["mul", "div", "ffl1", "cmov", "addc"]
class RV32IMATarget(Target):
triple = "riscv32-unknown-linux"
data_layout = "e-m:e-p:32:32-i64:64-n32-S128"
features = ["m", "a"]
additional_linker_options = ["-m", "elf32lriscv"]
print_function = "core_log"
now_pinning = True
tool_ld = "ld.lld"
tool_strip = "llvm-strip"
tool_symbolizer = "llvm-symbolizer"
tool_cxxfilt = "llvm-cxxfilt"
class RV32GTarget(Target):
triple = "riscv32-unknown-linux"
data_layout = "e-m:e-p:32:32-i64:64-n32-S128"
features = ["m", "a", "f", "d"]
additional_linker_options = ["-m", "elf32lriscv"]
print_function = "core_log"
now_pinning = True
tool_ld = "ld.lld"
tool_strip = "llvm-strip"
tool_symbolizer = "llvm-symbolizer"
tool_cxxfilt = "llvm-cxxfilt"
class CortexA9Target(Target):
triple = "armv7-unknown-linux-gnueabihf"
data_layout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
features = ["dsp", "fp16", "neon", "vfp3"]
additional_linker_options = ["-m", "armelf_linux_eabi", "--target2=rel"]
print_function = "core_log"
now_pinning = False
tool_ld = "ld.lld"
tool_strip = "llvm-strip"
tool_symbolizer = "llvm-symbolizer"
tool_cxxfilt = "llvm-cxxfilt"

View File

@ -1,4 +1,4 @@
import sys, os
import sys, os, tokenize
from artiq.master.databases import DeviceDB
from artiq.master.worker_db import DeviceManager
@ -24,10 +24,10 @@ def main():
else:
compile_only = False
ddb_path = os.path.join(os.path.dirname(sys.argv[1]), "device_db.pyon")
ddb_path = os.path.join(os.path.dirname(sys.argv[1]), "device_db.py")
dmgr = DeviceManager(DeviceDB(ddb_path))
with open(sys.argv[1]) as f:
with tokenize.open(sys.argv[1]) as f:
testcase_code = compile(f.read(), f.name, "exec")
testcase_vars = {'__name__': 'testbench', 'dmgr': dmgr}
exec(testcase_code, testcase_vars)
@ -38,8 +38,6 @@ def main():
core.compile(testcase_vars["entrypoint"], (), {})
else:
core.run(testcase_vars["entrypoint"], (), {})
print(core.comm.get_log())
core.comm.clear_log()
except CompileError as error:
if not diag:
exit(1)

View File

@ -1,8 +1,9 @@
import sys, fileinput, os
from pythonparser import source, diagnostic, algorithm, parse_buffer
from .. import prelude, types
from ..transforms import ASTTypedRewriter, Inferencer, IntMonomorphizer
from ..transforms import ASTTypedRewriter, Inferencer, IntMonomorphizer, CastMonomorphizer
from ..transforms import IODelayEstimator
from ..validators import ConstnessValidator
class Printer(algorithm.Visitor):
"""
@ -83,7 +84,9 @@ def main():
parsed, comments = parse_buffer(buf, engine=engine)
typed = ASTTypedRewriter(engine=engine, prelude=prelude.globals()).visit(parsed)
Inferencer(engine=engine).visit(typed)
ConstnessValidator(engine=engine).visit(typed)
if monomorphize:
CastMonomorphizer(engine=engine).visit(typed)
IntMonomorphizer(engine=engine).visit(typed)
Inferencer(engine=engine).visit(typed)
if iodelay:

View File

@ -1,8 +1,12 @@
import sys, fileinput
import sys, os, fileinput
from pythonparser import diagnostic
from .. import ir
from ..module import Module, Source
def main():
if os.getenv("ARTIQ_IR_NO_LOC") is not None:
ir.BasicBlock._dump_loc = False
def process_diagnostic(diag):
print("\n".join(diag.render()))
if diag.level in ("fatal", "error"):

View File

@ -1,6 +1,6 @@
import os, sys, fileinput, ctypes
from pythonparser import diagnostic
from llvmlite_artiq import binding as llvm
from llvmlite import binding as llvm
from ..module import Module, Source
from ..targets import NativeTarget

View File

@ -1,6 +1,6 @@
import sys, fileinput
from pythonparser import diagnostic
from llvmlite_artiq import ir as ll
from llvmlite import ir as ll
from ..module import Module, Source
from ..targets import NativeTarget

View File

@ -1,7 +1,7 @@
import sys, os
from pythonparser import diagnostic
from ..module import Module, Source
from ..targets import OR1KTarget
from ..targets import RV32GTarget
from . import benchmark
def main():
@ -30,7 +30,7 @@ def main():
benchmark(lambda: Module(source),
"ARTIQ transforms and validators")
benchmark(lambda: OR1KTarget().compile_and_link([module]),
benchmark(lambda: RV32GTarget().compile_and_link([module]),
"LLVM optimization and linking")
if __name__ == "__main__":

View File

@ -1,13 +1,14 @@
import sys, os
import sys, os, tokenize
from pythonparser import diagnostic
from ...language.environment import ProcessArgumentManager
from ...master.databases import DeviceDB, DatasetDB
from ...master.worker_db import DeviceManager, DatasetManager
from ..module import Module
from ..embedding import Stitcher
from ..targets import OR1KTarget
from ..targets import RV32GTarget
from . import benchmark
def main():
if not len(sys.argv) == 2:
print("Expected exactly one module filename", file=sys.stderr)
@ -21,16 +22,17 @@ def main():
engine = diagnostic.Engine()
engine.process = process_diagnostic
with open(sys.argv[1]) as f:
with tokenize.open(sys.argv[1]) as f:
testcase_code = compile(f.read(), f.name, "exec")
testcase_vars = {'__name__': 'testbench'}
exec(testcase_code, testcase_vars)
device_db_path = os.path.join(os.path.dirname(sys.argv[1]), "device_db.pyon")
device_db_path = os.path.join(os.path.dirname(sys.argv[1]), "device_db.py")
device_mgr = DeviceManager(DeviceDB(device_db_path))
dataset_db_path = os.path.join(os.path.dirname(sys.argv[1]), "dataset_db.pyon")
dataset_mgr = DatasetManager(DatasetDB(dataset_db_path))
dataset_db_path = os.path.join(os.path.dirname(sys.argv[1]), "dataset_db.mdb")
dataset_db = DatasetDB(dataset_db_path)
dataset_mgr = DatasetManager()
argument_mgr = ProcessArgumentManager({})
@ -44,10 +46,10 @@ def main():
stitcher = embed()
module = Module(stitcher)
target = OR1KTarget()
target = RV32GTarget()
llvm_ir = target.compile(module)
elf_obj = target.assemble(llvm_ir)
elf_shlib = target.link([elf_obj], init_fn=module.entry_point())
elf_shlib = target.link([elf_obj])
benchmark(lambda: embed(),
"ARTIQ embedding")
@ -61,11 +63,13 @@ def main():
benchmark(lambda: target.assemble(llvm_ir),
"LLVM machine code emission")
benchmark(lambda: target.link([elf_obj], init_fn=module.entry_point()),
benchmark(lambda: target.link([elf_obj]),
"Linking")
benchmark(lambda: target.strip(elf_shlib),
"Stripping debug information")
dataset_db.close_db()
if __name__ == "__main__":
main()

View File

@ -1,7 +1,7 @@
import sys, os
from pythonparser import diagnostic
from ..module import Module, Source
from ..targets import OR1KTarget
from ..targets import RV32GTarget
def main():
if not len(sys.argv) > 1:
@ -20,7 +20,7 @@ def main():
for filename in sys.argv[1:]:
modules.append(Module(Source.from_filename(filename, engine=engine)))
llobj = OR1KTarget().compile_and_link(modules)
llobj = RV32GTarget().compile_and_link(modules)
basename, ext = os.path.splitext(sys.argv[-1])
with open(basename + ".so", "wb") as f:

View File

@ -1,8 +1,12 @@
from .asttyped_rewriter import ASTTypedRewriter
from .inferencer import Inferencer
from .int_monomorphizer import IntMonomorphizer
from .cast_monomorphizer import CastMonomorphizer
from .iodelay_estimator import IODelayEstimator
from .artiq_ir_generator import ARTIQIRGenerator
from .dead_code_eliminator import DeadCodeEliminator
from .llvm_ir_generator import LLVMIRGenerator
from .local_demoter import LocalDemoter
from .constant_hoister import ConstantHoister
from .interleaver import Interleaver
from .typedtree_printer import TypedtreePrinter
from .llvm_ir_generator import LLVMIRGenerator

File diff suppressed because it is too large Load Diff

View File

@ -238,7 +238,7 @@ class ASTTypedRewriter(algorithm.Transformer):
body=node.body, decorator_list=node.decorator_list,
keyword_loc=node.keyword_loc, name_loc=node.name_loc,
arrow_loc=node.arrow_loc, colon_loc=node.colon_loc, at_locs=node.at_locs,
loc=node.loc)
loc=node.loc, remote_fn=False)
try:
self.env_stack.append(node.typing_env)
@ -331,8 +331,13 @@ class ASTTypedRewriter(algorithm.Transformer):
n=node.n, loc=node.loc)
def visit_Str(self, node):
return asttyped.StrT(type=builtins.TStr(),
s=node.s,
if isinstance(node.s, str):
typ = builtins.TStr()
elif isinstance(node.s, bytes):
typ = builtins.TBytes()
else:
assert False
return asttyped.StrT(type=typ, s=node.s,
begin_loc=node.begin_loc, end_loc=node.end_loc, loc=node.loc)
def visit_Name(self, node):
@ -434,8 +439,9 @@ class ASTTypedRewriter(algorithm.Transformer):
def visit_Call(self, node):
node = self.generic_visit(node)
node = asttyped.CallT(type=types.TVar(), iodelay=None, arg_exprs={},
func=node.func, args=node.args, keywords=node.keywords,
node = asttyped.CallT(type=types.TVar(), iodelay=None, arg_exprs={},
remote_fn=False, func=node.func,
args=node.args, keywords=node.keywords,
starargs=node.starargs, kwargs=node.kwargs,
star_loc=node.star_loc, dstar_loc=node.dstar_loc,
begin_loc=node.begin_loc, end_loc=node.end_loc, loc=node.loc)
@ -509,7 +515,7 @@ class ASTTypedRewriter(algorithm.Transformer):
visit_DictComp = visit_unsupported
visit_Ellipsis = visit_unsupported
visit_GeneratorExp = visit_unsupported
visit_Set = visit_unsupported
# visit_Set = visit_unsupported
visit_SetComp = visit_unsupported
visit_Starred = visit_unsupported
visit_Yield = visit_unsupported

View File

@ -0,0 +1,47 @@
"""
:class:`CastMonomorphizer` uses explicit casts to monomorphize
expressions of undetermined integer type to either 32 or 64 bits.
"""
from pythonparser import algorithm, diagnostic
from .. import types, builtins, asttyped
class CastMonomorphizer(algorithm.Visitor):
def __init__(self, engine):
self.engine = engine
def visit_CallT(self, node):
if (types.is_builtin(node.func.type, "int") or
types.is_builtin(node.func.type, "int32") or
types.is_builtin(node.func.type, "int64")):
typ = node.type.find()
if (not types.is_var(typ["width"]) and
len(node.args) == 1 and
builtins.is_int(node.args[0].type) and
types.is_var(node.args[0].type.find()["width"])):
if isinstance(node.args[0], asttyped.BinOpT):
# Binary operations are a bit special: they can widen, and so their
# return type is indeterminate until both argument types are fully known.
# In case we first monomorphize the return type, and then some argument type,
# and argument type is wider than return type, we'll introduce a conflict.
return
node.args[0].type.unify(typ)
if types.is_builtin(node.func.type, "int") or \
types.is_builtin(node.func.type, "round"):
typ = node.type.find()
if types.is_var(typ["width"]):
typ["width"].unify(types.TValue(32))
self.generic_visit(node)
def visit_CoerceT(self, node):
if isinstance(node.value, asttyped.NumT) and \
builtins.is_int(node.type) and \
builtins.is_int(node.value.type) and \
not types.is_var(node.type["width"]) and \
types.is_var(node.value.type["width"]):
node.value.type.unify(node.type)
self.generic_visit(node)

View File

@ -0,0 +1,43 @@
"""
:class:`ConstantHoister` is a code motion transform:
it moves any invariant loads to the earliest point where
they may be executed.
"""
from .. import types, ir
class ConstantHoister:
def process(self, functions):
for func in functions:
self.process_function(func)
def process_function(self, func):
entry = func.entry()
worklist = set(func.instructions())
moved = set()
while len(worklist) > 0:
insn = worklist.pop()
if (isinstance(insn, ir.GetAttr) and insn not in moved and
types.is_instance(insn.object().type) and
insn.attr in insn.object().type.constant_attributes):
has_variant_operands = False
index_in_entry = 0
for operand in insn.operands:
if isinstance(operand, ir.Argument):
pass
elif isinstance(operand, ir.Instruction) and operand.basic_block == entry:
index_in_entry = entry.index(operand) + 1
else:
has_variant_operands = True
break
if has_variant_operands:
continue
insn.remove_from_parent()
entry.instructions.insert(index_in_entry, insn)
moved.add(insn)
for use in insn.uses:
worklist.add(use)

View File

@ -15,13 +15,26 @@ class DeadCodeEliminator:
self.process_function(func)
def process_function(self, func):
modified = True
while modified:
modified = False
for block in list(func.basic_blocks):
if not any(block.predecessors()) and block != func.entry():
self.remove_block(block)
modified = True
# defer removing those blocks, so our use checks will ignore deleted blocks
preserve = [func.entry()]
work_list = [func.entry()]
while any(work_list):
block = work_list.pop()
for succ in block.successors():
if succ not in preserve:
preserve.append(succ)
work_list.append(succ)
to_be_removed = []
for block in func.basic_blocks:
if block not in preserve:
block.is_removed = True
to_be_removed.append(block)
for insn in block.instructions:
insn.is_removed = True
for block in to_be_removed:
self.remove_block(block)
modified = True
while modified:
@ -33,7 +46,8 @@ class DeadCodeEliminator:
# it also has to run after the interleaver, but interleaver
# doesn't like to work with IR before DCE.
if isinstance(insn, (ir.Phi, ir.Alloc, ir.GetAttr, ir.GetElem, ir.Coerce,
ir.Arith, ir.Compare, ir.Select, ir.Quote, ir.Closure)) \
ir.Arith, ir.Compare, ir.Select, ir.Quote, ir.Closure,
ir.Offset)) \
and not any(insn.uses):
insn.erase()
modified = True
@ -41,6 +55,8 @@ class DeadCodeEliminator:
def remove_block(self, block):
# block.uses are updated while iterating
for use in set(block.uses):
if use.is_removed:
continue
if isinstance(use, ir.Phi):
use.remove_incoming_block(block)
if not any(use.operands):
@ -55,6 +71,8 @@ class DeadCodeEliminator:
def remove_instruction(self, insn):
for use in set(insn.uses):
if use.is_removed:
continue
if isinstance(use, ir.Phi):
use.remove_incoming_value(insn)
if not any(use.operands):

View File

@ -5,6 +5,31 @@
from collections import OrderedDict
from pythonparser import algorithm, diagnostic, ast
from .. import asttyped, types, builtins
from .typedtree_printer import TypedtreePrinter
from artiq.experiment import kernel
def is_nested_empty_list(node):
"""If the passed AST node is an empty list, or a regularly nested list thereof,
returns the number of nesting layers, or ``None`` otherwise.
For instance, ``is_nested_empty_list([]) == 1`` and
``is_nested_empty_list([[], []]) == 2``, but
``is_nested_empty_list([[[]], []]) == None`` as the number of nesting layers doesn't
match.
"""
if not isinstance(node, ast.List):
return None
if not node.elts:
return 1
result = is_nested_empty_list(node.elts[0])
if result is None:
return None
for elt in node.elts[:1]:
if result != is_nested_empty_list(elt):
return None
return result + 1
class Inferencer(algorithm.Visitor):
"""
@ -21,6 +46,7 @@ class Inferencer(algorithm.Visitor):
self.function = None # currently visited function, for Return inference
self.in_loop = False
self.has_return = False
self.subkernel_arg_types = dict()
def _unify(self, typea, typeb, loca, locb, makenotes=None, when=""):
try:
@ -153,7 +179,7 @@ class Inferencer(algorithm.Visitor):
# Convert to a method.
attr_type = types.TMethod(object_type, attr_type)
self._unify_method_self(attr_type, attr_name, attr_loc, loc, value_node.loc)
elif types.is_rpc(attr_type):
elif types.is_rpc(attr_type) or types.is_subkernel(attr_type):
# Convert to a method. We don't have to bother typechecking
# the self argument, since for RPCs anything goes.
attr_type = types.TMethod(object_type, attr_type)
@ -179,7 +205,18 @@ class Inferencer(algorithm.Visitor):
self.engine.process(diag)
def _unify_iterable(self, element, collection):
if builtins.is_iterable(collection.type):
if builtins.is_bytes(collection.type) or builtins.is_bytearray(collection.type):
self._unify(element.type, builtins.get_iterable_elt(collection.type),
element.loc, None)
elif builtins.is_array(collection.type):
array_type = collection.type.find()
elem_dims = array_type["num_dims"].value - 1
if elem_dims > 0:
elem_type = builtins.TArray(array_type["elt"], types.TValue(elem_dims))
else:
elem_type = array_type["elt"]
self._unify(element.type, elem_type, element.loc, collection.loc)
elif builtins.is_iterable(collection.type) and not builtins.is_str(collection.type):
rhs_type = collection.type.find()
rhs_wrapped_lhs_type = types.TMono(rhs_type.name, {"elt": element.type})
self._unify(rhs_wrapped_lhs_type, rhs_type,
@ -195,15 +232,15 @@ class Inferencer(algorithm.Visitor):
self.generic_visit(node)
value = node.value
if types.is_tuple(value.type):
diag = diagnostic.Diagnostic("error",
"multi-dimensional slices are not supported", {},
node.loc, [])
self.engine.process(diag)
for elt in value.type.find().elts:
self._unify(elt, builtins.TInt(),
value.loc, None)
else:
self._unify(value.type, builtins.TInt(),
value.loc, None)
def visit_SliceT(self, node):
self.generic_visit(node)
if (node.lower, node.upper, node.step) == (None, None, None):
self._unify(node.type, builtins.TInt32(),
node.loc, None)
@ -223,16 +260,78 @@ class Inferencer(algorithm.Visitor):
def visit_SubscriptT(self, node):
self.generic_visit(node)
if isinstance(node.slice, ast.Index):
self._unify_iterable(element=node, collection=node.value)
if types.is_tuple(node.value.type):
if (not isinstance(node.slice, ast.Index) or
not isinstance(node.slice.value, ast.Num)):
diag = diagnostic.Diagnostic(
"error", "tuples can only be indexed by a constant", {},
node.slice.loc, []
)
self.engine.process(diag)
return
tuple_type = node.value.type.find()
index = node.slice.value.n
if index < 0 or index >= len(tuple_type.elts):
diag = diagnostic.Diagnostic(
"error",
"index {index} is out of range for tuple of size {size}",
{"index": index, "size": len(tuple_type.elts)},
node.slice.loc, []
)
self.engine.process(diag)
return
self._unify(node.type, tuple_type.elts[index], node.loc, node.value.loc)
elif isinstance(node.slice, ast.Index):
if types.is_tuple(node.slice.value.type):
if types.is_var(node.value.type):
return
if not builtins.is_array(node.value.type):
diag = diagnostic.Diagnostic(
"error",
"multi-dimensional indexing only supported for arrays, not {type}",
{"type": types.TypePrinter().name(node.value.type)},
node.loc, [])
self.engine.process(diag)
return
num_idxs = len(node.slice.value.type.find().elts)
array_type = node.value.type.find()
num_dims = array_type["num_dims"].value
remaining_dims = num_dims - num_idxs
if remaining_dims < 0:
diag = diagnostic.Diagnostic(
"error",
"too many indices for array of dimension {num_dims}",
{"num_dims": num_dims}, node.slice.loc, [])
self.engine.process(diag)
return
if remaining_dims == 0:
self._unify(node.type, array_type["elt"], node.loc,
node.value.loc)
else:
self._unify(
node.type,
builtins.TArray(array_type["elt"], remaining_dims))
else:
self._unify_iterable(element=node, collection=node.value)
elif isinstance(node.slice, ast.Slice):
self._unify(node.type, node.value.type,
node.loc, node.value.loc)
else: # ExtSlice
pass # error emitted above
if builtins.is_array(node.value.type):
if node.slice.step is not None:
diag = diagnostic.Diagnostic(
"error",
"strided slicing not yet supported for NumPy arrays", {},
node.slice.step.loc, [])
self.engine.process(diag)
return
self._unify(node.type, node.value.type, node.loc, node.value.loc)
else: # ExtSlice
pass # error emitted above
def visit_IfExpT(self, node):
self.generic_visit(node)
self._unify(node.test.type, builtins.TBool(), node.test.loc, None)
self._unify(node.body.type, node.orelse.type,
node.body.loc, node.orelse.loc)
self._unify(node.type, node.body.type,
@ -261,21 +360,36 @@ class Inferencer(algorithm.Visitor):
node.operand.loc)
self.engine.process(diag)
else: # UAdd, USub
if types.is_var(operand_type):
return
if builtins.is_numeric(operand_type):
self._unify(node.type, operand_type,
node.loc, None)
elif not types.is_var(operand_type):
diag = diagnostic.Diagnostic("error",
"expected unary '{op}' operand to be of numeric type, not {type}",
{"op": node.op.loc.source(),
"type": types.TypePrinter().name(operand_type)},
node.operand.loc)
self.engine.process(diag)
self._unify(node.type, operand_type, node.loc, None)
return
if builtins.is_array(operand_type):
elt = operand_type.find()["elt"]
if builtins.is_numeric(elt):
self._unify(node.type, operand_type, node.loc, None)
return
if types.is_var(elt):
return
diag = diagnostic.Diagnostic("error",
"expected unary '{op}' operand to be of numeric type, not {type}",
{"op": node.op.loc.source(),
"type": types.TypePrinter().name(operand_type)},
node.operand.loc)
self.engine.process(diag)
def visit_CoerceT(self, node):
self.generic_visit(node)
if builtins.is_numeric(node.type) and builtins.is_numeric(node.value.type):
pass
elif (builtins.is_array(node.type) and builtins.is_array(node.value.type)
and builtins.is_numeric(node.type.find()["elt"])
and builtins.is_numeric(node.value.type.find()["elt"])):
pass
else:
printer = types.TypePrinter()
note = diagnostic.Diagnostic("note",
@ -293,21 +407,31 @@ class Inferencer(algorithm.Visitor):
return coerced_node
elif isinstance(coerced_node, asttyped.CoerceT):
node = coerced_node
node.type, node.other_value = typ, other_node
node.type.unify(typ)
node.other_value = other_node
else:
node = asttyped.CoerceT(type=typ, value=coerced_node, other_value=other_node,
loc=coerced_node.loc)
self.visit(node)
return node
def _coerce_numeric(self, nodes, map_return=lambda typ: typ):
def _coerce_numeric(self, nodes, map_return=lambda typ: typ, map_node_type =lambda typ:typ):
# See https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex.
node_types = []
for node in nodes:
if isinstance(node, asttyped.CoerceT):
node_types.append(node.value.type)
# If we already know exactly what we coerce this value to, use that type,
# or we'll get an unification error in case the coerced type is not the same
# as the type of the coerced value.
# Otherwise, use the potentially more specific subtype when considering possible
# coercions, or we may get stuck.
if node.type.fold(False, lambda acc, ty: acc or types.is_var(ty)):
node_types.append(node.value.type)
else:
node_types.append(node.type)
else:
node_types.append(node.type)
node_types = [map_node_type(typ) for typ in node_types]
if any(map(types.is_var, node_types)): # not enough info yet
return
elif not all(map(builtins.is_numeric, node_types)):
@ -339,8 +463,125 @@ class Inferencer(algorithm.Visitor):
else:
assert False
def _coerce_binary_broadcast_op(self, left, right, map_return_elt, op_loc):
def num_dims(typ):
if builtins.is_array(typ):
# TODO: If number of dimensions is ever made a non-fixed parameter,
# need to acutally unify num_dims in _coerce_binop/….
return typ.find()["num_dims"].value
return 0
left_dims = num_dims(left.type)
right_dims = num_dims(right.type)
if left_dims != right_dims and left_dims != 0 and right_dims != 0:
# Mismatch (only scalar broadcast supported for now).
note1 = diagnostic.Diagnostic("note", "operand of dimension {num_dims}",
{"num_dims": left_dims}, left.loc)
note2 = diagnostic.Diagnostic("note", "operand of dimension {num_dims}",
{"num_dims": right_dims}, right.loc)
diag = diagnostic.Diagnostic(
"error", "dimensions of '{op}' array operands must match",
{"op": op_loc.source()}, op_loc, [left.loc, right.loc], [note1, note2])
self.engine.process(diag)
return
def map_node_type(typ):
if not builtins.is_array(typ):
# This is a single value broadcast across the array.
return typ
return typ.find()["elt"]
# Figure out result type, handling broadcasts.
result_dims = left_dims if left_dims else right_dims
def map_return(typ):
elt = map_return_elt(typ)
result = builtins.TArray(elt=elt, num_dims=result_dims)
left = builtins.TArray(elt=elt, num_dims=left_dims) if left_dims else elt
right = builtins.TArray(elt=elt, num_dims=right_dims) if right_dims else elt
return (result, left, right)
return self._coerce_numeric((left, right),
map_return=map_return,
map_node_type=map_node_type)
def _coerce_binop(self, op, left, right):
if isinstance(op, (ast.BitAnd, ast.BitOr, ast.BitXor,
if isinstance(op, ast.MatMult):
if types.is_var(left.type) or types.is_var(right.type):
return
def num_dims(operand):
if not builtins.is_array(operand.type):
diag = diagnostic.Diagnostic(
"error",
"expected matrix multiplication operand to be of array type, not {type}",
{
"op": op.loc.source(),
"type": types.TypePrinter().name(operand.type)
}, op.loc, [operand.loc])
self.engine.process(diag)
return
num_dims = operand.type.find()["num_dims"].value
if num_dims not in (1, 2):
diag = diagnostic.Diagnostic(
"error",
"expected matrix multiplication operand to be 1- or 2-dimensional, not {type}",
{
"op": op.loc.source(),
"type": types.TypePrinter().name(operand.type)
}, op.loc, [operand.loc])
self.engine.process(diag)
return
return num_dims
left_dims = num_dims(left)
if not left_dims:
return
right_dims = num_dims(right)
if not right_dims:
return
def map_node_type(typ):
return typ.find()["elt"]
def map_return(typ):
if left_dims == 1:
if right_dims == 1:
result_dims = 0
else:
result_dims = 1
elif right_dims == 1:
result_dims = 1
else:
result_dims = 2
result = typ if result_dims == 0 else builtins.TArray(
typ, result_dims)
return (result, builtins.TArray(typ, left_dims),
builtins.TArray(typ, right_dims))
return self._coerce_numeric((left, right),
map_return=map_return,
map_node_type=map_node_type)
elif builtins.is_array(left.type) or builtins.is_array(right.type):
# Operations on arrays are element-wise (possibly using broadcasting).
# TODO: Allow only for integer arrays.
# allowed_int_array_ops = (ast.BitAnd, ast.BitOr, ast.BitXor, ast.LShift,
# ast.RShift)
allowed_array_ops = (ast.Add, ast.Mult, ast.FloorDiv, ast.Mod,
ast.Pow, ast.Sub, ast.Div)
if not isinstance(op, allowed_array_ops):
diag = diagnostic.Diagnostic(
"error", "operator '{op}' not valid for array types",
{"op": op.loc.source()}, op.loc)
self.engine.process(diag)
return
def map_result(typ):
if isinstance(op, ast.Div):
return builtins.TFloat()
return typ
return self._coerce_binary_broadcast_op(left, right, map_result, op.loc)
elif isinstance(op, (ast.BitAnd, ast.BitOr, ast.BitXor,
ast.LShift, ast.RShift)):
# bitwise operators require integers
for operand in (left, right):
@ -394,7 +635,8 @@ class Inferencer(algorithm.Visitor):
self._unify(left.type, right.type,
left.loc, right.loc)
return left.type, left.type, right.type
elif builtins.is_str(left.type) or builtins.is_str(right.type):
elif (builtins.is_str(left.type) or builtins.is_str(right.type) or
builtins.is_bytes(left.type) or builtins.is_bytes(right.type)):
self._unify(left.type, right.type,
left.loc, right.loc)
return left.type, left.type, right.type
@ -438,7 +680,7 @@ class Inferencer(algorithm.Visitor):
# division always returns a float
return self._coerce_numeric((left, right),
lambda typ: (builtins.TFloat(), builtins.TFloat(), builtins.TFloat()))
else: # MatMult
else:
diag = diagnostic.Diagnostic("error",
"operator '{op}' is not supported", {"op": op.loc.source()},
op.loc)
@ -622,14 +864,28 @@ class Inferencer(algorithm.Visitor):
self._unify(node.type, builtins.TBool(),
node.loc, None)
elif types.is_builtin(typ, "int"):
valid_forms = lambda: [
valid_form("int() -> numpy.int?"),
valid_form("int(x:'a) -> numpy.int?"),
valid_form("int(x:'a, width=?) -> numpy.int?")
]
elif types.is_builtin(typ, "int") or \
types.is_builtin(typ, "int32") or types.is_builtin(typ, "int64"):
if types.is_builtin(typ, "int"):
valid_forms = lambda: [
valid_form("int() -> numpy.int?"),
valid_form("int(x:'a) -> numpy.int? where 'a is numeric")
]
result_typ = builtins.TInt()
elif types.is_builtin(typ, "int32"):
valid_forms = lambda: [
valid_form("numpy.int32() -> numpy.int32"),
valid_form("numpy.int32(x:'a) -> numpy.int32 where 'a is numeric")
]
result_typ = builtins.TInt32()
elif types.is_builtin(typ, "int64"):
valid_forms = lambda: [
valid_form("numpy.int64() -> numpy.int64"),
valid_form("numpy.int64(x:'a) -> numpy.int64 where 'a is numeric")
]
result_typ = builtins.TInt64()
self._unify(node.type, builtins.TInt(),
self._unify(node.type, result_typ,
node.loc, None)
if len(node.args) == 0 and len(node.keywords) == 0:
@ -639,20 +895,7 @@ class Inferencer(algorithm.Visitor):
pass # undetermined yet
elif len(node.args) == 1 and len(node.keywords) == 0 and \
builtins.is_numeric(node.args[0].type):
self._unify(node.type, builtins.TInt(),
node.loc, None)
elif len(node.args) == 1 and len(node.keywords) == 1 and \
builtins.is_numeric(node.args[0].type) and \
node.keywords[0].arg == 'width':
width = node.keywords[0].value
if not (isinstance(width, asttyped.NumT) and isinstance(width.n, int)):
diag = diagnostic.Diagnostic("error",
"the width argument of int() must be an integer literal", {},
node.keywords[0].loc)
self.engine.process(diag)
return
self._unify(node.type, builtins.TInt(types.TValue(width.n)),
self._unify(node.type, result_typ,
node.loc, None)
else:
diagnose(valid_forms())
@ -675,28 +918,116 @@ class Inferencer(algorithm.Visitor):
pass
else:
diagnose(valid_forms())
elif types.is_builtin(typ, "list") or types.is_builtin(typ, "array"):
if types.is_builtin(typ, "list"):
valid_forms = lambda: [
valid_form("list() -> list(elt='a)"),
valid_form("list(x:'a) -> list(elt='b) where 'a is iterable")
]
elif types.is_builtin(typ, "str"):
diag = diagnostic.Diagnostic("error",
"strings currently cannot be constructed", {},
node.loc)
self.engine.process(diag)
elif types.is_builtin(typ, "array"):
valid_forms = lambda: [
valid_form("array(x:'a) -> array(elt='b) where 'a is iterable"),
valid_form("array(x:'a, dtype:'b) -> array(elt='b) where 'a is iterable")
]
self._unify(node.type, builtins.TList(),
node.loc, None)
elif types.is_builtin(typ, "array"):
valid_forms = lambda: [
valid_form("array() -> array(elt='a)"),
valid_form("array(x:'a) -> array(elt='b) where 'a is iterable")
]
explicit_dtype = None
keywords_acceptable = False
if len(node.keywords) == 0:
keywords_acceptable = True
elif len(node.keywords) == 1:
if node.keywords[0].arg == "dtype":
keywords_acceptable = True
explicit_dtype = node.keywords[0].value
if len(node.args) == 1 and keywords_acceptable:
arg, = node.args
self._unify(node.type, builtins.TArray(),
node.loc, None)
num_empty_dims = is_nested_empty_list(arg)
if num_empty_dims is not None:
# As a special case, following the behaviour of numpy.array (and
# repr() on ndarrays), consider empty lists to be exactly of the
# number of dimensions given, instead of potentially containing an
# unknown number of extra dimensions.
num_dims = num_empty_dims
# The ultimate element type will be TVar initially, but we might be
# able to resolve it from context.
elt = arg.type
for _ in range(num_dims):
assert builtins.is_list(elt)
elt = elt.find()["elt"]
else:
# In the absence of any other information (there currently isn't a way
# to specify any), assume that all iterables are expandable into a
# (runtime-checked) rectangular array of the innermost element type.
elt = arg.type
num_dims = 0
expected_dims = (node.type.find()["num_dims"].value
if builtins.is_array(node.type) else -1)
while True:
if num_dims == expected_dims:
# If we already know the number of dimensions of the result,
# stop so we can disambiguate the (innermost) element type of
# the argument if it is still unknown.
break
if types.is_var(elt):
# Can't make progress here because we don't know how many more
# dimensions might be "hidden" inside.
return
if not builtins.is_iterable(elt) or builtins.is_str(elt):
break
if builtins.is_array(elt):
num_dims += elt.find()["num_dims"].value
else:
num_dims += 1
elt = builtins.get_iterable_elt(elt)
if explicit_dtype is not None:
# TODO: Factor out type detection; support quoted type constructors
# (TList(TInt32), …)?
typ = explicit_dtype.type
if types.is_builtin(typ, "int32"):
elt = builtins.TInt32()
elif types.is_builtin(typ, "int64"):
elt = builtins.TInt64()
elif types.is_constructor(typ):
elt = typ.find().instance
else:
diag = diagnostic.Diagnostic(
"error",
"dtype argument of {builtin}() must be a valid constructor",
{"builtin": typ.find().name},
node.func.loc,
notes=[note])
self.engine.process(diag)
return
if num_dims == 0:
note = diagnostic.Diagnostic(
"note", "this expression has type {type}",
{"type": types.TypePrinter().name(arg.type)}, arg.loc)
diag = diagnostic.Diagnostic(
"error",
"the argument of {builtin}() must be of an iterable type",
{"builtin": typ.find().name},
node.func.loc,
notes=[note])
self.engine.process(diag)
return
self._unify(node.type,
builtins.TArray(elt, types.TValue(num_dims)),
node.loc, arg.loc)
else:
assert False
diagnose(valid_forms())
elif types.is_builtin(typ, "list"):
valid_forms = lambda: [
valid_form("list() -> list(elt='a)"),
valid_form("list(x:'a) -> list(elt='b) where 'a is iterable")
]
self._unify(node.type, builtins.TList(), node.loc, None)
if len(node.args) == 0 and len(node.keywords) == 0:
pass # []
pass # []
elif len(node.args) == 1 and len(node.keywords) == 0:
arg, = node.args
@ -779,7 +1110,6 @@ class Inferencer(algorithm.Visitor):
elif types.is_builtin(typ, "round"):
valid_forms = lambda: [
valid_form("round(x:float) -> numpy.int?"),
valid_form("round(x:float, width=?) -> numpy.int?")
]
self._unify(node.type, builtins.TInt(),
@ -790,19 +1120,28 @@ class Inferencer(algorithm.Visitor):
self._unify(arg.type, builtins.TFloat(),
arg.loc, None)
elif len(node.args) == 1 and len(node.keywords) == 1 and \
builtins.is_numeric(node.args[0].type) and \
node.keywords[0].arg == 'width':
width = node.keywords[0].value
if not (isinstance(width, asttyped.NumT) and isinstance(width.n, int)):
diag = diagnostic.Diagnostic("error",
"the width argument of round() must be an integer literal", {},
node.keywords[0].loc)
self.engine.process(diag)
return
else:
diagnose(valid_forms())
elif types.is_builtin(typ, "abs"):
fn = typ.name
self._unify(node.type, builtins.TInt(types.TValue(width.n)),
node.loc, None)
valid_forms = lambda: [
valid_form("abs(x:numpy.int?) -> numpy.int?"),
valid_form("abs(x:float) -> float")
]
if len(node.args) == 1 and len(node.keywords) == 0:
(arg,) = node.args
if builtins.is_int(arg.type) or builtins.is_float(arg.type):
self._unify(arg.type, node.type,
arg.loc, node.loc)
elif types.is_var(arg.type):
pass # undetermined yet
else:
diag = diagnostic.Diagnostic("error",
"the arguments of abs() must be of a numeric type", {},
node.func.loc)
self.engine.process(diag)
else:
diagnose(valid_forms())
elif types.is_builtin(typ, "min") or types.is_builtin(typ, "max"):
@ -851,21 +1190,69 @@ class Inferencer(algorithm.Visitor):
diagnose(valid_forms())
elif types.is_builtin(typ, "make_array"):
valid_forms = lambda: [
valid_form("numpy.full(count:int32, value:'a) -> numpy.array(elt='a)")
valid_form("numpy.full(count:int32, value:'a) -> array(elt='a, num_dims=1)"),
valid_form("numpy.full(shape:(int32,)*'b, value:'a) -> array(elt='a, num_dims='b)"),
]
self._unify(node.type, builtins.TArray(),
node.loc, None)
if len(node.args) == 2 and len(node.keywords) == 0:
arg0, arg1 = node.args
self._unify(arg0.type, builtins.TInt32(),
arg0.loc, None)
if types.is_var(arg0.type):
return # undetermined yet
elif types.is_tuple(arg0.type):
num_dims = len(arg0.type.find().elts)
self._unify(arg0.type, types.TTuple([builtins.TInt32()] * num_dims),
arg0.loc, None)
else:
num_dims = 1
self._unify(arg0.type, builtins.TInt32(),
arg0.loc, None)
self._unify(node.type, builtins.TArray(num_dims=num_dims),
node.loc, None)
self._unify(arg1.type, node.type.find()["elt"],
arg1.loc, None)
else:
diagnose(valid_forms())
elif types.is_builtin(typ, "numpy.transpose"):
valid_forms = lambda: [
valid_form("transpose(x: array(elt='a, num_dims=1)) -> array(elt='a, num_dims=1)"),
valid_form("transpose(x: array(elt='a, num_dims=2)) -> array(elt='a, num_dims=2)")
]
if len(node.args) == 1 and len(node.keywords) == 0:
arg, = node.args
if types.is_var(arg.type):
pass # undetermined yet
elif not builtins.is_array(arg.type):
note = diagnostic.Diagnostic(
"note", "this expression has type {type}",
{"type": types.TypePrinter().name(arg.type)}, arg.loc)
diag = diagnostic.Diagnostic(
"error",
"the argument of {builtin}() must be an array",
{"builtin": typ.find().name},
node.func.loc,
notes=[note])
self.engine.process(diag)
else:
num_dims = arg.type.find()["num_dims"].value
if num_dims not in (1, 2):
note = diagnostic.Diagnostic(
"note", "argument is {num_dims}-dimensional",
{"num_dims": num_dims}, arg.loc)
diag = diagnostic.Diagnostic(
"error",
"{builtin}() is currently only supported for up to "
"two-dimensional arrays", {"builtin": typ.find().name},
node.func.loc,
notes=[note])
self.engine.process(diag)
else:
self._unify(node.type, arg.type, node.loc, None)
else:
diagnose(valid_forms())
elif types.is_builtin(typ, "rtio_log"):
valid_forms = lambda: [
valid_form("rtio_log(channel:str, args...) -> None"),
@ -899,15 +1286,6 @@ class Inferencer(algorithm.Visitor):
elif types.is_builtin(typ, "at_mu"):
simple_form("at_mu(time_mu:numpy.int64) -> None",
[builtins.TInt64()])
elif types.is_builtin(typ, "mu_to_seconds"):
simple_form("mu_to_seconds(time_mu:numpy.int64) -> float",
[builtins.TInt64()], builtins.TFloat())
elif types.is_builtin(typ, "seconds_to_mu"):
simple_form("seconds_to_mu(time:float) -> numpy.int64",
[builtins.TFloat()], builtins.TInt64())
elif types.is_builtin(typ, "watchdog"):
simple_form("watchdog(time:float) -> [builtin context manager]",
[builtins.TFloat()], builtins.TNone())
elif types.is_constructor(typ):
# An user-defined class.
self._unify(node.type, typ.find().instance,
@ -916,6 +1294,55 @@ class Inferencer(algorithm.Visitor):
# Ignored.
self._unify(node.type, builtins.TNone(),
node.loc, None)
elif types.is_builtin(typ, "subkernel_await"):
valid_forms = lambda: [
valid_form("subkernel_await(f: subkernel) -> f return type"),
valid_form("subkernel_await(f: subkernel, timeout: numpy.int64) -> f return type")
]
if 1 <= len(node.args) <= 2:
arg0 = node.args[0].type
if types.is_var(arg0):
pass # undetermined yet
else:
if types.is_method(arg0):
fn = types.get_method_function(arg0)
elif types.is_function(arg0) or types.is_subkernel(arg0):
fn = arg0
else:
diagnose(valid_forms())
self._unify(node.type, fn.ret,
node.loc, None)
if len(node.args) == 2:
arg1 = node.args[1]
if types.is_var(arg1.type):
pass
elif builtins.is_int(arg1.type):
# promote to TInt64
self._unify(arg1.type, builtins.TInt64(),
arg1.loc, None)
else:
diagnose(valid_forms())
else:
diagnose(valid_forms())
elif types.is_builtin(typ, "subkernel_preload"):
valid_forms = lambda: [
valid_form("subkernel_preload(f: subkernel) -> None")
]
if len(node.args) == 1:
arg0 = node.args[0].type
if types.is_var(arg0):
pass # undetermined yet
else:
if types.is_method(arg0):
fn = types.get_method_function(arg0)
elif types.is_function(arg0) or types.is_subkernel(arg0):
fn = arg0
else:
diagnose(valid_forms())
self._unify(node.type, fn.ret,
node.loc, None)
else:
diagnose(valid_forms())
else:
assert False
@ -954,6 +1381,7 @@ class Inferencer(algorithm.Visitor):
typ_args = typ.args
typ_optargs = typ.optargs
typ_ret = typ.ret
typ_func = typ
else:
typ_self = types.get_method_self(typ)
typ_func = types.get_method_function(typ)
@ -991,11 +1419,43 @@ class Inferencer(algorithm.Visitor):
self.engine.process(diag)
return
# Array broadcasting for functions explicitly marked as such.
if len(node.args) == typ_arity and types.is_broadcast_across_arrays(typ):
if typ_arity == 1:
arg_type = node.args[0].type.find()
if builtins.is_array(arg_type):
typ_arg, = typ_args.values()
self._unify(typ_arg, arg_type["elt"], node.args[0].loc, None)
self._unify(node.type, builtins.TArray(typ_ret, arg_type["num_dims"]),
node.loc, None)
return
elif typ_arity == 2:
if any(builtins.is_array(arg.type) for arg in node.args):
ret, arg0, arg1 = self._coerce_binary_broadcast_op(
node.args[0], node.args[1], lambda t: typ_ret, node.loc)
node.args[0] = self._coerce_one(arg0, node.args[0],
other_node=node.args[1])
node.args[1] = self._coerce_one(arg1, node.args[1],
other_node=node.args[0])
self._unify(node.type, ret, node.loc, None)
return
if types.is_subkernel(typ_func) and typ_func.sid not in self.subkernel_arg_types:
self.subkernel_arg_types[typ_func.sid] = []
for actualarg, (formalname, formaltyp) in \
zip(node.args, list(typ_args.items()) + list(typ_optargs.items())):
self._unify(actualarg.type, formaltyp,
actualarg.loc, None)
passed_args[formalname] = actualarg.loc
if types.is_subkernel(typ_func):
if types.is_instance(actualarg.type):
# objects cannot be passed to subkernels, as rpc code doesn't support them
diag = diagnostic.Diagnostic("error",
"argument '{name}' of type: {typ} is not supported in subkernels",
{"name": formalname, "typ": actualarg.type},
actualarg.loc, [])
self.engine.process(diag)
self.subkernel_arg_types[typ_func.sid].append((formalname, formaltyp))
for keyword in node.keywords:
if keyword.arg in passed_args:
@ -1012,10 +1472,21 @@ class Inferencer(algorithm.Visitor):
elif keyword.arg in typ_optargs:
self._unify(keyword.value.type, typ_optargs[keyword.arg],
keyword.value.loc, None)
else:
note = diagnostic.Diagnostic("note",
"extraneous argument", {},
keyword.loc)
diag = diagnostic.Diagnostic("error",
"this function of type {type} does not accept argument '{name}'",
{"type": types.TypePrinter().name(node.func.type),
"name": keyword.arg},
node.func.loc, [], [note])
self.engine.process(diag)
return
passed_args[keyword.arg] = keyword.arg_loc
for formalname in typ_args:
if formalname not in passed_args:
if formalname not in passed_args and not node.remote_fn:
note = diagnostic.Diagnostic("note",
"the called function is of type {type}",
{"type": types.TypePrinter().name(node.func.type)},
@ -1049,22 +1520,10 @@ class Inferencer(algorithm.Visitor):
if coerced:
return_type, target_type, value_type = coerced
try:
node.target.type.unify(target_type)
except types.UnificationError as e:
printer = types.TypePrinter()
note = diagnostic.Diagnostic("note",
"expression of type {typec}",
{"typec": printer.name(node.value.type)},
node.value.loc)
diag = diagnostic.Diagnostic("error",
"expression of type {typea} has to be coerced to {typeb}, "
"which makes assignment invalid",
{"typea": printer.name(node.target.type),
"typeb": printer.name(target_type)},
node.op.loc, [node.target.loc], [note])
self.engine.process(diag)
return
if isinstance(node.value, asttyped.CoerceT):
orig_value_type = node.value.value.type
else:
orig_value_type = node.value.type
try:
node.target.type.unify(return_type)
@ -1072,17 +1531,34 @@ class Inferencer(algorithm.Visitor):
printer = types.TypePrinter()
note = diagnostic.Diagnostic("note",
"expression of type {typec}",
{"typec": printer.name(node.value.type)},
{"typec": printer.name(orig_value_type)},
node.value.loc)
diag = diagnostic.Diagnostic("error",
"the result of this operation has type {typeb}, "
"which makes assignment to a slot of type {typea} invalid",
"which cannot be assigned to a left-hand side of type {typea}",
{"typea": printer.name(node.target.type),
"typeb": printer.name(return_type)},
node.op.loc, [node.target.loc], [note])
self.engine.process(diag)
return
try:
node.target.type.unify(target_type)
except types.UnificationError as e:
printer = types.TypePrinter()
note = diagnostic.Diagnostic("note",
"expression of type {typec}",
{"typec": printer.name(orig_value_type)},
node.value.loc)
diag = diagnostic.Diagnostic("error",
"this operation requires the left-hand side of type {typea} "
"to be coerced to {typeb}, which cannot be done",
{"typea": printer.name(node.target.type),
"typeb": printer.name(target_type)},
node.op.loc, [node.target.loc], [note])
self.engine.process(diag)
return
node.value = self._coerce_one(value_type, node.value, other_node=node.target)
def visit_ForT(self, node):
@ -1115,9 +1591,7 @@ class Inferencer(algorithm.Visitor):
typ = node.context_expr.type
if (types.is_builtin(typ, "interleave") or types.is_builtin(typ, "sequential") or
types.is_builtin(typ, "parallel") or
(isinstance(node.context_expr, asttyped.CallT) and
types.is_builtin(node.context_expr.func.type, "watchdog"))):
types.is_builtin(typ, "parallel")):
# builtin context managers
if node.optional_vars is not None:
self._unify(node.optional_vars.type, builtins.TNone(),
@ -1275,7 +1749,14 @@ class Inferencer(algorithm.Visitor):
def visit_FunctionDefT(self, node):
for index, decorator in enumerate(node.decorator_list):
if types.is_builtin(decorator.type, "kernel") or \
def eval_attr(attr):
if isinstance(attr.value, asttyped.QuoteT):
return getattr(attr.value.value, attr.attr)
return getattr(eval_attr(attr.value), attr.attr)
if isinstance(decorator, asttyped.AttributeT):
decorator = eval_attr(decorator)
if id(decorator) == id(kernel) or \
types.is_builtin(decorator.type, "kernel") or \
isinstance(decorator, asttyped.CallT) and \
types.is_builtin(decorator.func.type, "kernel"):
continue

View File

@ -5,7 +5,7 @@ do not.
"""
from pythonparser import algorithm, diagnostic
from .. import types, builtins
from .. import types, builtins, asttyped
class IntMonomorphizer(algorithm.Visitor):
def __init__(self, engine):
@ -26,12 +26,3 @@ class IntMonomorphizer(algorithm.Visitor):
return
node.type["width"].unify(types.TValue(width))
def visit_CallT(self, node):
self.generic_visit(node)
if types.is_builtin(node.func.type, "int") or \
types.is_builtin(node.func.type, "round"):
typ = node.type.find()
if types.is_var(typ["width"]):
typ["width"].unify(types.TValue(32))

View File

@ -280,7 +280,7 @@ class IODelayEstimator(algorithm.Visitor):
context="as an argument for delay_mu()")
call_delay = value
elif not types.is_builtin(typ):
if types.is_function(typ) or types.is_rpc(typ):
if types.is_function(typ) or types.is_rpc(typ) or types.is_subkernel(typ):
offset = 0
elif types.is_method(typ):
offset = 1
@ -288,7 +288,7 @@ class IODelayEstimator(algorithm.Visitor):
else:
assert False
if types.is_rpc(typ):
if types.is_rpc(typ) or types.is_subkernel(typ):
call_delay = iodelay.Const(0)
else:
delay = typ.find().delay.find()
@ -311,13 +311,20 @@ class IODelayEstimator(algorithm.Visitor):
args[arg_name] = arg_node
free_vars = delay.duration.free_vars()
node.arg_exprs = {
arg: self.evaluate(args[arg], abort=abort,
context="in the expression for argument '{}' "
"that affects I/O delay".format(arg))
for arg in free_vars
}
call_delay = delay.duration.fold(node.arg_exprs)
try:
node.arg_exprs = {
arg: self.evaluate(args[arg], abort=abort,
context="in the expression for argument '{}' "
"that affects I/O delay".format(arg))
for arg in free_vars
}
call_delay = delay.duration.fold(node.arg_exprs)
except KeyError as e:
if getattr(node, "remote_fn", False):
note = diagnostic.Diagnostic("note",
"function called here", {},
node.loc)
self.abort("due to arguments passed remotely", node.loc, note)
else:
assert False
else:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,51 @@
"""
:class:`LocalDemoter` is a constant propagation transform:
it replaces reads of any local variable with only one write
in a function without closures with the value that was written.
:class:`LocalAccessValidator` must be run before this transform
to ensure that the transformation it performs is sound.
"""
from collections import defaultdict
from .. import ir
class LocalDemoter:
def process(self, functions):
for func in functions:
self.process_function(func)
def process_function(self, func):
env_safe = {}
env_gets = defaultdict(lambda: set())
env_sets = defaultdict(lambda: set())
for insn in func.instructions():
if isinstance(insn, (ir.GetLocal, ir.SetLocal)):
if "$" in insn.var_name:
continue
env = insn.environment()
if env not in env_safe:
for use in env.uses:
if not isinstance(use, (ir.GetLocal, ir.SetLocal)):
env_safe[env] = False
break
else:
env_safe[env] = True
if not env_safe[env]:
continue
if isinstance(insn, ir.SetLocal):
env_sets[(env, insn.var_name)].add(insn)
else:
env_gets[(env, insn.var_name)].add(insn)
for (env, var_name) in env_sets:
if len(env_sets[(env, var_name)]) == 1:
set_insn = next(iter(env_sets[(env, var_name)]))
for get_insn in env_gets[(env, var_name)]:
get_insn.replace_all_uses_with(set_insn.value())
get_insn.erase()

View File

@ -0,0 +1,89 @@
"""
:class:`TypedtreePrinter` prints a human-readable representation of typedtrees.
"""
from pythonparser import algorithm, ast
from .. import types, asttyped
class TypedtreePrinter(algorithm.Visitor):
def __init__(self):
self.str = None
self.level = None
self.last_nl = None
self.type_printer = None
def print(self, node):
try:
self.str = ""
self.level = 0
self.last_nl = 0
self.type_printer = types.TypePrinter()
self.visit(node)
self._nl()
return self.str
finally:
self.str = None
self.level = None
self.last_nl = 0
self.type_printer = None
def _nl(self):
# self.str += "·"
if len(self.str) != self.last_nl:
self.str += "\n" + (" " * self.level)
self.last_nl = len(self.str)
def _indent(self):
self.level += 1
self._nl()
def _dedent(self):
self._nl()
self.level -= 1
self.str = self.str[:-2]
self.last_nl -= 2
def visit(self, obj):
if isinstance(obj, ast.AST):
attrs = set(obj._fields) - {'ctx'}
if isinstance(obj, asttyped.commontyped):
attrs.update(set(obj._types))
for attr in set(attrs):
if not getattr(obj, attr):
attrs.remove(attr) # omit falsey stuff
self.str += obj.__class__.__name__ + "("
if len(attrs) > 1:
self._indent()
for attr in attrs:
if len(attrs) > 1:
self._nl()
self.str += attr + "="
self.visit(getattr(obj, attr))
if len(attrs) > 1:
self._nl()
if len(attrs) > 1:
self._dedent()
self.str += ")"
elif isinstance(obj, types.Type):
self.str += self.type_printer.name(obj, max_depth=0)
elif isinstance(obj, list):
self.str += "["
if len(obj) > 1:
self._indent()
for elem in obj:
if len(obj) > 1:
self._nl()
self.visit(elem)
if len(obj) > 1:
self._nl()
if len(obj) > 1:
self._dedent()
self.str += "]"
else:
self.str += repr(obj)

View File

@ -3,6 +3,7 @@ The :mod:`types` module contains the classes describing the types
in :mod:`asttyped`.
"""
import builtins
import string
from collections import OrderedDict
from . import iodelay
@ -55,38 +56,39 @@ class TVar(Type):
def __init__(self):
self.parent = self
self.rank = 0
def find(self):
if self.parent is self:
parent = self.parent
if parent is self:
return self
else:
# The recursive find() invocation is turned into a loop
# because paths resulting from unification of large arrays
# can easily cause a stack overflow.
root = self
while root.__class__ == TVar:
if root is root.parent:
break
else:
root = root.parent
# path compression
iter = self
while iter.__class__ == TVar:
if iter is iter.parent:
break
else:
iter, iter.parent = iter.parent, root
return root
while parent.__class__ == TVar and root is not parent:
_, parent = root, root.parent = parent, parent.parent
return root.parent
def unify(self, other):
other = other.find()
if self.parent is self:
self.parent = other
if other is self:
return
x = other.find()
y = self.find()
if x is y:
return
if y.__class__ == TVar:
if x.__class__ == TVar:
if x.rank < y.rank:
x, y = y, x
y.parent = x
if x.rank == y.rank:
x.rank += 1
else:
y.parent = x
else:
self.find().unify(other)
y.unify(x)
def fold(self, accum, fn):
if self.parent is self:
@ -95,6 +97,8 @@ class TVar(Type):
return self.find().fold(accum, fn)
def __repr__(self):
if getattr(builtins, "__in_sphinx__", False):
return str(self)
if self.parent is self:
return "<artiq.compiler.types.TVar %d>" % id(self)
else:
@ -124,6 +128,8 @@ class TMono(Type):
return self
def unify(self, other):
if other is self:
return
if isinstance(other, TMono) and self.name == other.name:
assert self.params.keys() == other.params.keys()
for param in self.params:
@ -139,6 +145,8 @@ class TMono(Type):
return fn(accum, self)
def __repr__(self):
if getattr(builtins, "__in_sphinx__", False):
return str(self)
return "artiq.compiler.types.TMono(%s, %s)" % (repr(self.name), repr(self.params))
def __getitem__(self, param):
@ -171,6 +179,8 @@ class TTuple(Type):
return self
def unify(self, other):
if other is self:
return
if isinstance(other, TTuple) and len(self.elts) == len(other.elts):
for selfelt, otherelt in zip(self.elts, other.elts):
selfelt.unify(otherelt)
@ -185,6 +195,8 @@ class TTuple(Type):
return fn(accum, self)
def __repr__(self):
if getattr(builtins, "__in_sphinx__", False):
return str(self)
return "artiq.compiler.types.TTuple(%s)" % repr(self.elts)
def __eq__(self, other):
@ -194,9 +206,14 @@ class TTuple(Type):
def __ne__(self, other):
return not (self == other)
def __hash__(self):
return hash(tuple(self.elts))
class _TPointer(TMono):
def __init__(self):
super().__init__("pointer")
def __init__(self, elt=None):
if elt is None:
elt = TMono("int", {"width": 8}) # i8*
super().__init__("pointer", params={"elt": elt})
class TFunction(Type):
"""
@ -234,6 +251,8 @@ class TFunction(Type):
return self
def unify(self, other):
if other is self:
return
if isinstance(other, TFunction) and \
self.args.keys() == other.args.keys() and \
self.optargs.keys() == other.optargs.keys():
@ -256,6 +275,8 @@ class TFunction(Type):
return fn(accum, self)
def __repr__(self):
if getattr(builtins, "__in_sphinx__", False):
return str(self)
return "artiq.compiler.types.TFunction({}, {}, {})".format(
repr(self.args), repr(self.optargs), repr(self.ret))
@ -270,20 +291,29 @@ class TFunction(Type):
def __hash__(self):
return hash((_freeze(self.args), _freeze(self.optargs), self.ret))
class TCFunction(TFunction):
class TExternalFunction(TFunction):
"""
A function type of a runtime-provided C function.
A type of an externally-provided function.
:ivar name: (str) C function name
:ivar flags: (set of str) C function flags.
This can be any function following the C ABI, such as provided by the
C/Rust runtime, or a compiler backend intrinsic. The mangled name to link
against is encoded as part of the type.
:ivar name: (str) external symbol name.
This will be the symbol linked against (following any extra C name
mangling rules).
:ivar flags: (set of str) function flags.
Flag ``nounwind`` means the function never raises an exception.
Flag ``nowrite`` means the function never writes any memory
Flag ``nowrite`` means the function never accesses any memory
that the ARTIQ Python code can observe.
:ivar broadcast_across_arrays: (bool)
If True, the function is transparently applied element-wise when called
with TArray arguments.
"""
attributes = OrderedDict()
def __init__(self, args, ret, name, flags={}):
def __init__(self, args, ret, name, flags=set(), broadcast_across_arrays=False):
assert isinstance(flags, set)
for flag in flags:
assert flag in {'nounwind', 'nowrite'}
@ -291,9 +321,12 @@ class TCFunction(TFunction):
self.name = name
self.delay = TFixedDelay(iodelay.Const(0))
self.flags = flags
self.broadcast_across_arrays = broadcast_across_arrays
def unify(self, other):
if isinstance(other, TCFunction) and \
if other is self:
return
if isinstance(other, TExternalFunction) and \
self.name == other.name:
super().unify(other)
elif isinstance(other, TVar):
@ -308,20 +341,24 @@ class TRPC(Type):
:ivar ret: (:class:`Type`)
return type
:ivar service: (int) RPC service number
:ivar is_async: (bool) whether the RPC blocks until return
"""
attributes = OrderedDict()
def __init__(self, ret, service):
def __init__(self, ret, service, is_async=False):
assert isinstance(ret, Type)
self.ret, self.service = ret, service
self.ret, self.service, self.is_async = ret, service, is_async
def find(self):
return self
def unify(self, other):
if other is self:
return
if isinstance(other, TRPC) and \
self.service == other.service:
self.service == other.service and \
self.is_async == other.is_async:
self.ret.unify(other.ret)
elif isinstance(other, TVar):
other.unify(self)
@ -333,11 +370,14 @@ class TRPC(Type):
return fn(accum, self)
def __repr__(self):
if getattr(builtins, "__in_sphinx__", False):
return str(self)
return "artiq.compiler.types.TRPC({})".format(repr(self.ret))
def __eq__(self, other):
return isinstance(other, TRPC) and \
self.service == other.service
self.service == other.service and \
self.is_async == other.is_async
def __ne__(self, other):
return not (self == other)
@ -345,6 +385,50 @@ class TRPC(Type):
def __hash__(self):
return hash(self.service)
class TSubkernel(TFunction):
"""
A kernel to be run on a satellite.
:ivar args: (:class:`collections.OrderedDict` of string to :class:`Type`)
function arguments
:ivar ret: (:class:`Type`)
return type
:ivar sid: (int) subkernel ID number
:ivar destination: (int) satellite destination number
"""
attributes = OrderedDict()
def __init__(self, args, optargs, ret, sid, destination):
assert isinstance(ret, Type)
super().__init__(args, optargs, ret)
self.sid, self.destination = sid, destination
self.delay = TFixedDelay(iodelay.Const(0))
def unify(self, other):
if other is self:
return
if isinstance(other, TSubkernel) and \
self.sid == other.sid and \
self.destination == other.destination:
self.ret.unify(other.ret)
elif isinstance(other, TVar):
other.unify(self)
else:
raise UnificationError(self, other)
def __repr__(self):
if getattr(builtins, "__in_sphinx__", False):
return str(self)
return "artiq.compiler.types.TSubkernel({})".format(repr(self.ret))
def __eq__(self, other):
return isinstance(other, TSubkernel) and \
self.sid == other.sid
def __hash__(self):
return hash(self.sid)
class TBuiltin(Type):
"""
An instance of builtin type. Every instance of a builtin
@ -360,6 +444,8 @@ class TBuiltin(Type):
return self
def unify(self, other):
if other is self:
return
if self != other:
raise UnificationError(self, other)
@ -367,6 +453,8 @@ class TBuiltin(Type):
return fn(accum, self)
def __repr__(self):
if getattr(builtins, "__in_sphinx__", False):
return str(self)
return "artiq.compiler.types.{}({})".format(type(self).__name__, repr(self.name))
def __eq__(self, other):
@ -382,6 +470,11 @@ class TBuiltin(Type):
class TBuiltinFunction(TBuiltin):
"""
A type of a builtin function.
Builtin functions are treated specially throughout all stages of the
compilation process according to their name (e.g. calls may not actually
lower to a function call). See :class:`TExternalFunction` for externally
defined functions that are otherwise regular.
"""
class TConstructor(TBuiltin):
@ -422,6 +515,8 @@ class TInstance(TMono):
self.constant_attributes = set()
def __repr__(self):
if getattr(builtins, "__in_sphinx__", False):
return str(self)
return "artiq.compiler.types.TInstance({}, {})".format(
repr(self.name), repr(self.attributes))
@ -437,6 +532,8 @@ class TModule(TMono):
self.constant_attributes = set()
def __repr__(self):
if getattr(builtins, "__in_sphinx__", False):
return str(self)
return "artiq.compiler.types.TModule({}, {})".format(
repr(self.name), repr(self.attributes))
@ -465,6 +562,8 @@ class TValue(Type):
return self
def unify(self, other):
if other is self:
return
if isinstance(other, TVar):
other.unify(self)
elif self != other:
@ -474,6 +573,8 @@ class TValue(Type):
return fn(accum, self)
def __repr__(self):
if getattr(builtins, "__in_sphinx__", False):
return str(self)
return "artiq.compiler.types.TValue(%s)" % repr(self.value)
def __eq__(self, other):
@ -532,6 +633,8 @@ class TDelay(Type):
return not (self == other)
def __repr__(self):
if getattr(builtins, "__in_sphinx__", False):
return str(self)
if self.duration is None:
return "<{}.TIndeterminateDelay>".format(__name__)
elif self.cause is None:
@ -555,13 +658,15 @@ def is_mono(typ, name=None, **params):
if not isinstance(typ, TMono):
return False
params_match = True
if name is not None and typ.name != name:
return False
for param in params:
if param not in typ.params:
return False
params_match = params_match and \
typ.params[param].find() == params[param].find()
return name is None or (typ.name == name and params_match)
if typ.params[param].find() != params[param].find():
return False
return True
def is_polymorphic(typ):
return typ.fold(False, lambda accum, typ: accum or is_var(typ))
@ -583,12 +688,15 @@ def is_function(typ):
def is_rpc(typ):
return isinstance(typ.find(), TRPC)
def is_c_function(typ, name=None):
def is_subkernel(typ):
return isinstance(typ.find(), TSubkernel)
def is_external_function(typ, name=None):
typ = typ.find()
if name is None:
return isinstance(typ, TCFunction)
return isinstance(typ, TExternalFunction)
else:
return isinstance(typ, TCFunction) and \
return isinstance(typ, TExternalFunction) and \
typ.name == name
def is_builtin(typ, name=None):
@ -599,6 +707,23 @@ def is_builtin(typ, name=None):
return isinstance(typ, TBuiltin) and \
typ.name == name
def is_builtin_function(typ, name=None):
typ = typ.find()
if name is None:
return isinstance(typ, TBuiltinFunction)
else:
return isinstance(typ, TBuiltinFunction) and \
typ.name == name
def is_broadcast_across_arrays(typ):
# For now, broadcasting is only exposed to predefined external functions, and
# statically selected. Might be extended to user-defined functions if the design
# pans out.
typ = typ.find()
if not isinstance(typ, TExternalFunction):
return False
return typ.broadcast_across_arrays
def is_constructor(typ, name=None):
typ = typ.find()
if name is not None:
@ -703,12 +828,14 @@ class TypePrinter(object):
else:
return "%s(%s)" % (typ.name, ", ".join(
["%s=%s" % (k, self.name(typ.params[k], depth + 1)) for k in typ.params]))
elif isinstance(typ, _TPointer):
return "{}*".format(self.name(typ["elt"], depth + 1))
elif isinstance(typ, TTuple):
if len(typ.elts) == 1:
return "(%s,)" % self.name(typ.elts[0], depth + 1)
else:
return "(%s)" % ", ".join([self.name(typ, depth + 1) for typ in typ.elts])
elif isinstance(typ, (TFunction, TCFunction)):
elif isinstance(typ, (TFunction, TExternalFunction)):
args = []
args += [ "%s:%s" % (arg, self.name(typ.args[arg], depth + 1))
for arg in typ.args]
@ -722,12 +849,18 @@ class TypePrinter(object):
elif not (delay.is_fixed() and iodelay.is_zero(delay.duration)):
signature += " " + self.name(delay, depth + 1)
if isinstance(typ, TCFunction):
if isinstance(typ, TExternalFunction):
return "[ffi {}]{}".format(repr(typ.name), signature)
elif isinstance(typ, TFunction):
return signature
elif isinstance(typ, TRPC):
return "[rpc #{}](...)->{}".format(typ.service, self.name(typ.ret, depth + 1))
return "[rpc{} #{}](...)->{}".format(typ.service,
" async" if typ.is_async else "",
self.name(typ.ret, depth + 1))
elif isinstance(typ, TSubkernel):
return "<subkernel{} dest#{}>->{}".format(typ.sid,
typ.destination,
self.name(typ.ret, depth + 1))
elif isinstance(typ, TBuiltinFunction):
return "<function {}>".format(typ.name)
elif isinstance(typ, (TConstructor, TExceptionConstructor)):

View File

@ -1,3 +1,4 @@
from .monomorphism import MonomorphismValidator
from .escape import EscapeValidator
from .local_access import LocalAccessValidator
from .constness import ConstnessValidator

View File

@ -0,0 +1,58 @@
"""
:class:`ConstnessValidator` checks that no attribute marked
as constant is ever set.
"""
from pythonparser import algorithm, diagnostic
from .. import types, builtins
class ConstnessValidator(algorithm.Visitor):
def __init__(self, engine):
self.engine = engine
self.in_assign = False
def visit_Assign(self, node):
self.visit(node.value)
self.in_assign = True
self.visit(node.targets)
self.in_assign = False
def visit_AugAssign(self, node):
self.visit(node.value)
self.in_assign = True
self.visit(node.target)
self.in_assign = False
def visit_SubscriptT(self, node):
old_in_assign, self.in_assign = self.in_assign, False
self.visit(node.value)
self.visit(node.slice)
self.in_assign = old_in_assign
if self.in_assign and builtins.is_bytes(node.value.type):
diag = diagnostic.Diagnostic("error",
"type {typ} is not mutable",
{"typ": "bytes"},
node.loc)
self.engine.process(diag)
def visit_AttributeT(self, node):
old_in_assign, self.in_assign = self.in_assign, False
self.visit(node.value)
self.in_assign = old_in_assign
if self.in_assign:
typ = node.value.type.find()
if types.is_instance(typ) and node.attr in typ.constant_attributes:
diag = diagnostic.Diagnostic("error",
"cannot assign to constant attribute '{attr}' of class '{class}'",
{"attr": node.attr, "class": typ.name},
node.loc)
self.engine.process(diag)
return
if builtins.is_array(typ):
diag = diagnostic.Diagnostic("error",
"array attributes cannot be assigned to",
{}, node.loc)
self.engine.process(diag)
return

View File

@ -51,10 +51,6 @@ class Region:
(other.range.begin_pos <= self.range.begin_pos <= other.range.end_pos and \
self.range.end_pos > other.range.end_pos)
def contract(self, other):
if not self.range:
self.range = other.range
def outlives(lhs, rhs):
if not isinstance(lhs, Region): # lhs lives nonlexically
return True
@ -69,8 +65,11 @@ class Region:
class RegionOf(algorithm.Visitor):
"""
Visit an expression and return the list of regions that must
be alive for the expression to execute.
Visit an expression and return the region that must be alive for the
expression to execute.
For expressions involving multiple regions, the shortest-lived one is
returned.
"""
def __init__(self, env_stack, youngest_region):
@ -100,11 +99,23 @@ class RegionOf(algorithm.Visitor):
visit_BinOpT = visit_sometimes_allocating
def visit_CallT(self, node):
if types.is_c_function(node.func.type, "cache_get"):
if types.is_external_function(node.func.type, "cache_get"):
# The cache is borrow checked dynamically
return Global()
else:
self.visit_sometimes_allocating(node)
if (types.is_builtin_function(node.func.type, "array")
or types.is_builtin_function(node.func.type, "make_array")
or types.is_builtin_function(node.func.type, "numpy.transpose")):
# While lifetime tracking across function calls in general is currently
# broken (see below), these special builtins that allocate an array on
# the stack of the caller _always_ allocate regardless of the parameters,
# and we can thus handle them without running into the precision issue
# mentioned in commit ae999db.
return self.visit_allocating(node)
# FIXME: Return statement missing here, but see m-labs/artiq#1497 and
# commit ae999db.
self.visit_sometimes_allocating(node)
# Value lives as long as the object/container, if it's mutable,
# or else forever
@ -157,7 +168,7 @@ class RegionOf(algorithm.Visitor):
visit_NameConstantT = visit_immutable
visit_NumT = visit_immutable
visit_EllipsisT = visit_immutable
visit_UnaryOpT = visit_immutable
visit_UnaryOpT = visit_sometimes_allocating # possibly array op
visit_CompareT = visit_immutable
# Value lives forever
@ -298,37 +309,32 @@ class EscapeValidator(algorithm.Visitor):
# and exceptions can only refer to strings, so we don't actually check
# this property. But we will need to, if string operations are ever added.
def visit_assignment(self, target, value, is_aug_assign=False):
value_region = self._region_of(value) if not is_aug_assign else self.youngest_region
# If this is a variable, we might need to contract the live range.
if isinstance(value_region, Region):
for name in self._names_of(target):
region = self._region_of(name)
if isinstance(region, Region):
region.contract(value_region)
def visit_assignment(self, target, value):
value_region = self._region_of(value)
# If we assign to an attribute of a quoted value, there will be no names
# in the assignment lhs.
target_names = self._names_of(target) or []
# Adopt the value region for any variables declared on the lhs.
for name in target_names:
region = self._region_of(name)
if isinstance(region, Region) and not region.present():
# Find the name's environment to overwrite the region.
for env in self.env_stack[::-1]:
if name.id in env:
env[name.id] = value_region
break
# The assigned value should outlive the assignee
target_regions = [self._region_of(name) for name in target_names]
for target_region in target_regions:
if not Region.outlives(value_region, target_region):
if is_aug_assign:
target_desc = "the assignment target, allocated here,"
else:
target_desc = "the assignment target"
note = diagnostic.Diagnostic("note",
"this expression has type {type}",
{"type": types.TypePrinter().name(value.type)},
value.loc)
diag = diagnostic.Diagnostic("error",
"the assigned value does not outlive the assignment target", {},
value.loc, [target.loc],
notes=self._diagnostics_for(target_region, target.loc,
target_desc) +
"the assignment target") +
self._diagnostics_for(value_region, value.loc,
"the assigned value"))
self.engine.process(diag)
@ -338,10 +344,20 @@ class EscapeValidator(algorithm.Visitor):
self.visit_assignment(target, node.value)
def visit_AugAssign(self, node):
if builtins.is_allocated(node.target.type):
# If the target is mutable, op-assignment will allocate
# in the youngest region.
self.visit_assignment(node.target, node.value, is_aug_assign=True)
if builtins.is_list(node.target.type):
note = diagnostic.Diagnostic("note",
"try using `{lhs} = {lhs} {op} {rhs}` instead",
{"lhs": node.target.loc.source(),
"rhs": node.value.loc.source(),
"op": node.op.loc.source()[:-1]},
node.loc)
diag = diagnostic.Diagnostic("error",
"lists cannot be mutated in-place", {},
node.op.loc, [node.target.loc],
notes=[note])
self.engine.process(diag)
self.visit_assignment(node.target, node.value)
def visit_Return(self, node):
region = self._region_of(node.value)

View File

@ -1,11 +1,3 @@
from artiq.coredevice import exceptions, dds, spi
from artiq.coredevice.exceptions import (RTIOUnderflow, RTIOSequenceError,
RTIOCollision, RTIOOverflow, RTIOBusy)
from artiq.coredevice.dds import (PHASE_MODE_CONTINUOUS, PHASE_MODE_ABSOLUTE,
PHASE_MODE_TRACKING)
from artiq.coredevice.exceptions import (RTIOUnderflow, RTIOOverflow)
__all__ = []
__all__ += ["RTIOUnderflow", "RTIOSequenceError", "RTIOCollision",
"RTIOOverflow", "RTIOBusy"]
__all__ += ["PHASE_MODE_CONTINUOUS", "PHASE_MODE_ABSOLUTE",
"PHASE_MODE_TRACKING"]
__all__ = ["RTIOUnderflow", "RTIOOverflow"]

View File

@ -1,175 +0,0 @@
from artiq.language.core import (kernel, portable, delay_mu, delay,
seconds_to_mu)
from artiq.language.units import ns, us
from artiq.coredevice import spi
# Designed from the data sheets and somewhat after the linux kernel
# iio driver.
_AD5360_SPI_CONFIG = (0*spi.SPI_OFFLINE | 0*spi.SPI_CS_POLARITY |
0*spi.SPI_CLK_POLARITY | 1*spi.SPI_CLK_PHASE |
0*spi.SPI_LSB_FIRST | 0*spi.SPI_HALF_DUPLEX)
_AD5360_CMD_DATA = 3 << 22
_AD5360_CMD_OFFSET = 2 << 22
_AD5360_CMD_GAIN = 1 << 22
_AD5360_CMD_SPECIAL = 0 << 22
@portable
def _AD5360_WRITE_CHANNEL(c):
return (c + 8) << 16
_AD5360_SPECIAL_NOP = 0 << 16
_AD5360_SPECIAL_CONTROL = 1 << 16
_AD5360_SPECIAL_OFS0 = 2 << 16
_AD5360_SPECIAL_OFS1 = 3 << 16
_AD5360_SPECIAL_READ = 5 << 16
@portable
def _AD5360_READ_CHANNEL(ch):
return (ch + 8) << 7
_AD5360_READ_X1A = 0x000 << 7
_AD5360_READ_X1B = 0x040 << 7
_AD5360_READ_OFFSET = 0x080 << 7
_AD5360_READ_GAIN = 0x0c0 << 7
_AD5360_READ_CONTROL = 0x101 << 7
_AD5360_READ_OFS0 = 0x102 << 7
_AD5360_READ_OFS1 = 0x103 << 7
class AD5360:
"""
Support for the Analog devices AD53[67][0123]
multi-channel Digital to Analog Converters
:param spi_device: Name of the SPI bus this device is on.
:param ldac_device: Name of the TTL device that LDAC is connected to
(optional). Needs to be explicitly initialized to high.
:param chip_select: Value to drive on the chip select lines
during transactions.
"""
def __init__(self, dmgr, spi_device, ldac_device=None, chip_select=1):
self.core = dmgr.get("core")
self.bus = dmgr.get(spi_device)
if ldac_device is not None:
self.ldac = dmgr.get(ldac_device)
self.chip_select = chip_select
@kernel
def setup_bus(self, write_div=4, read_div=7):
"""Configure the SPI bus and the SPI transaction parameters
for this device. This method has to be called before any other method
if the bus has been used to access a different device in the meantime.
This method advances the timeline by the duration of two
RTIO-to-Wishbone bus transactions.
:param write_div: Write clock divider.
:param read_div: Read clock divider.
"""
# write: 2*8ns >= 10ns = t_6 (clk falling to cs_n rising)
# read: 4*8*ns >= 25ns = t_22 (clk falling to miso valid)
self.bus.set_config_mu(_AD5360_SPI_CONFIG, write_div, read_div)
self.bus.set_xfer(self.chip_select, 24, 0)
@kernel
def write(self, data):
"""Write 24 bits of data.
This method advances the timeline by the duration of the SPI transfer
and the required CS high time.
"""
self.bus.write(data << 8)
delay_mu(self.bus.ref_period_mu) # get to 20ns min cs high
@kernel
def write_offsets(self, value=0x1fff):
"""Write the OFS0 and OFS1 offset DACs.
This method advances the timeline by twice the duration of
:meth:`write`.
:param value: Value to set both offset registers to.
"""
value &= 0x3fff
self.write(_AD5360_CMD_SPECIAL | _AD5360_SPECIAL_OFS0 | value)
self.write(_AD5360_CMD_SPECIAL | _AD5360_SPECIAL_OFS1 | value)
@kernel
def write_channel(self, channel=0, value=0, op=_AD5360_CMD_DATA):
"""Write to a channel register.
This method advances the timeline by the duration of :meth:`write`.
:param channel: Channel number to write to.
:param value: 16 bit value to write to the register.
:param op: Operation to perform, one of :const:`_AD5360_CMD_DATA`,
:const:`_AD5360_CMD_OFFSET`, :const:`_AD5360_CMD_GAIN`
(default: :const:`_AD5360_CMD_DATA`).
"""
channel &= 0x3f
value &= 0xffff
self.write(op | _AD5360_WRITE_CHANNEL(channel) | value)
@kernel
def read_channel_sync(self, channel=0, op=_AD5360_READ_X1A):
"""Read a channel register.
This method advances the timeline by the duration of :meth:`write` plus
three RTIO-to-Wishbone transactions.
:param channel: Channel number to read from.
:param op: Operation to perform, one of :const:`_AD5360_READ_X1A`,
:const:`_AD5360_READ_X1B`, :const:`_AD5360_READ_OFFSET`,
:const:`_AD5360_READ_GAIN` (default: :const:`_AD5360_READ_X1A`).
:return: The 16 bit register value.
"""
channel &= 0x3f
self.write(_AD5360_CMD_SPECIAL | _AD5360_SPECIAL_READ | op |
_AD5360_READ_CHANNEL(channel))
self.bus.set_xfer(self.chip_select, 0, 24)
self.write(_AD5360_CMD_SPECIAL | _AD5360_SPECIAL_NOP)
self.bus.read_async()
self.bus.set_xfer(self.chip_select, 24, 0)
return self.bus.input_async() & 0xffff
@kernel
def load(self):
"""Pulse the LDAC line.
This method advances the timeline by two RTIO clock periods (16 ns).
"""
self.ldac.off()
# t13 = 10ns ldac pulse width low
delay_mu(2*self.bus.ref_period_mu)
self.ldac.on()
@kernel
def set(self, values, op=_AD5360_CMD_DATA):
"""Write to several channels and pulse LDAC to update the channels.
This method does not advance the timeline. Write events are scheduled
in the past. The DACs will synchronously start changing their output
levels `now`.
:param values: List of 16 bit values to write to the channels.
:param op: Operation to perform, one of :const:`_AD5360_CMD_DATA`,
:const:`_AD5360_CMD_OFFSET`, :const:`_AD5360_CMD_GAIN`
(default: :const:`_AD5360_CMD_DATA`).
"""
# compensate all delays that will be applied
delay_mu(-len(values)*(self.bus.xfer_period_mu +
self.bus.write_period_mu +
self.bus.ref_period_mu) -
3*self.bus.ref_period_mu -
seconds_to_mu(1.5*us))
for i in range(len(values)):
self.write_channel(i, values[i], op)
delay_mu(3*self.bus.ref_period_mu + # latency alignment ttl to spi
seconds_to_mu(1.5*us)) # t10 max busy low for one channel
self.load()
delay_mu(-2*self.bus.ref_period_mu) # load(), t13

393
artiq/coredevice/ad53xx.py Normal file
View File

@ -0,0 +1,393 @@
""""RTIO driver for the Analog Devices AD53[67][0123] family of multi-channel
Digital to Analog Converters.
Output event replacement is not supported and issuing commands at the same
time is an error.
"""
# Designed from the data sheets and somewhat after the linux kernel
# iio driver.
from numpy import int32
from artiq.language.core import (kernel, portable, delay_mu, delay, now_mu,
at_mu)
from artiq.language.units import ns, us
from artiq.coredevice import spi2 as spi
SPI_AD53XX_CONFIG = (0*spi.SPI_OFFLINE | 1*spi.SPI_END |
0*spi.SPI_INPUT | 0*spi.SPI_CS_POLARITY |
0*spi.SPI_CLK_POLARITY | 1*spi.SPI_CLK_PHASE |
0*spi.SPI_LSB_FIRST | 0*spi.SPI_HALF_DUPLEX)
AD53XX_CMD_DATA = 3 << 22
AD53XX_CMD_OFFSET = 2 << 22
AD53XX_CMD_GAIN = 1 << 22
AD53XX_CMD_SPECIAL = 0 << 22
AD53XX_SPECIAL_NOP = 0 << 16
AD53XX_SPECIAL_CONTROL = 1 << 16
AD53XX_SPECIAL_OFS0 = 2 << 16
AD53XX_SPECIAL_OFS1 = 3 << 16
AD53XX_SPECIAL_READ = 5 << 16
AD53XX_SPECIAL_AB0 = 6 << 16
AD53XX_SPECIAL_AB1 = 7 << 16
AD53XX_SPECIAL_AB2 = 8 << 16
AD53XX_SPECIAL_AB3 = 9 << 16
AD53XX_SPECIAL_AB = 11 << 16
# incorporate the channel offset (8, table 17) here
AD53XX_READ_X1A = 0x008 << 7
AD53XX_READ_X1B = 0x048 << 7
AD53XX_READ_OFFSET = 0x088 << 7
AD53XX_READ_GAIN = 0x0C8 << 7
AD53XX_READ_CONTROL = 0x101 << 7
AD53XX_READ_OFS0 = 0x102 << 7
AD53XX_READ_OFS1 = 0x103 << 7
AD53XX_READ_AB0 = 0x106 << 7
AD53XX_READ_AB1 = 0x107 << 7
AD53XX_READ_AB2 = 0x108 << 7
AD53XX_READ_AB3 = 0x109 << 7
@portable
def ad53xx_cmd_write_ch(channel, value, op):
"""Returns the word that must be written to the DAC to set a DAC
channel register to a given value.
:param channel: DAC channel to write to (8 bits)
:param value: 16-bit value to write to the register
:param op: The channel register to write to, one of
:const:`AD53XX_CMD_DATA`, :const:`AD53XX_CMD_OFFSET` or
:const:`AD53XX_CMD_GAIN`.
:return: The 24-bit word to be written to the DAC
"""
return op | (channel + 8) << 16 | (value & 0xffff)
@portable
def ad53xx_cmd_read_ch(channel, op):
"""Returns the word that must be written to the DAC to read a given
DAC channel register.
:param channel: DAC channel to read (8 bits)
:param op: The channel register to read, one of
:const:`AD53XX_READ_X1A`, :const:`AD53XX_READ_X1B`,
:const:`AD53XX_READ_OFFSET`, :const:`AD53XX_READ_GAIN` etc.
:return: The 24-bit word to be written to the DAC to initiate read
"""
return AD53XX_CMD_SPECIAL | AD53XX_SPECIAL_READ | (op + (channel << 7))
# maintain function definition for backward compatibility
@portable
def voltage_to_mu(voltage, offset_dacs=0x2000, vref=5.):
"""Returns the 16-bit DAC register value required to produce a given output
voltage, assuming offset and gain errors have been trimmed out.
The 16-bit register value may also be used with 14-bit DACs. The additional
bits are disregarded by 14-bit DACs.
Also used to return offset register value required to produce a given
voltage when the DAC register is set to mid-scale.
An offset of V can be used to trim out a DAC offset error of -V.
:param voltage: Voltage in SI units.
Valid voltages are: [-2*vref, + 2*vref - 1 LSB] + voltage offset.
:param offset_dacs: Register value for the two offset DACs
(default: 0x2000)
:param vref: DAC reference voltage (default: 5.)
:return: The 16-bit DAC register value
"""
code = int(round((1 << 16) * (voltage / (4. * vref)) + offset_dacs * 0x4))
if code < 0x0 or code > 0xffff:
raise ValueError("Invalid DAC voltage!")
return code
class _DummyTTL:
@portable
def on(self):
pass
@portable
def off(self):
pass
class AD53xx:
"""Analog devices AD53[67][0123] family of multi-channel Digital to Analog
Converters.
:param spi_device: SPI bus device name
:param ldac_device: LDAC RTIO TTLOut channel name (optional)
:param clr_device: CLR RTIO TTLOut channel name (optional)
:param chip_select: Value to drive on SPI chip select lines during
transactions (default: 1)
:param div_write: SPI clock divider for write operations (default: 4,
50MHz max SPI clock with {t_high, t_low} >=8ns)
:param div_read: SPI clock divider for read operations (default: 16, not
optimized for speed; datasheet says t22: 25ns min SCLK edge to SDO
valid, and suggests the SPI speed for reads should be <=20 MHz)
:param vref: DAC reference voltage (default: 5.)
:param offset_dacs: Initial register value for the two offset DACs, device
dependent and must be set correctly for correct voltage to mu
conversions. Knowledge of his state is not transferred between
experiments. (default: 8192)
:param core_device: Core device name (default: "core")
"""
kernel_invariants = {"bus", "ldac", "clr", "chip_select", "div_write",
"div_read", "vref", "core"}
def __init__(self, dmgr, spi_device, ldac_device=None, clr_device=None,
chip_select=1, div_write=4, div_read=16, vref=5.,
offset_dacs=8192, core="core"):
self.bus = dmgr.get(spi_device)
self.bus.update_xfer_duration_mu(div_write, 24)
if ldac_device is None:
self.ldac = _DummyTTL()
else:
self.ldac = dmgr.get(ldac_device)
if clr_device is None:
self.clr = _DummyTTL()
else:
self.clr = dmgr.get(clr_device)
self.chip_select = chip_select
self.div_write = div_write
self.div_read = div_read
self.vref = vref
self.offset_dacs = offset_dacs
self.core = dmgr.get(core)
@kernel
def init(self, blind=False):
"""Configures the SPI bus, drives LDAC and CLR high, programmes
the offset DACs, and enables overtemperature shutdown.
This method must be called before any other method at start-up or if
the SPI bus has been accessed by another device.
:param blind: If ``True``, do not attempt to read back control register
or check for overtemperature.
"""
self.ldac.on()
self.clr.on()
self.bus.set_config_mu(SPI_AD53XX_CONFIG, 24, self.div_write,
self.chip_select)
self.write_offset_dacs_mu(self.offset_dacs)
if not blind:
ctrl = self.read_reg(channel=0, op=AD53XX_READ_CONTROL)
if ctrl == 0xffff:
raise ValueError("DAC not found")
if ctrl & 0b10000:
raise ValueError("DAC over temperature")
delay(25*us)
self.bus.write( # enable power and overtemperature shutdown
(AD53XX_CMD_SPECIAL | AD53XX_SPECIAL_CONTROL | 0b0010) << 8)
if not blind:
ctrl = self.read_reg(channel=0, op=AD53XX_READ_CONTROL)
if (ctrl & 0b10111) != 0b00010:
raise ValueError("DAC CONTROL readback mismatch")
delay(15*us)
@kernel
def read_reg(self, channel=0, op=AD53XX_READ_X1A):
"""Read a DAC register.
This method advances the timeline by the duration of two SPI transfers
plus two RTIO coarse cycles plus 270 ns and consumes all slack.
:param channel: Channel number to read from (default: 0)
:param op: Operation to perform, one of :const:`AD53XX_READ_X1A`,
:const:`AD53XX_READ_X1B`, :const:`AD53XX_READ_OFFSET`,
:const:`AD53XX_READ_GAIN` etc. (default: :const:`AD53XX_READ_X1A`).
:return: The 16 bit register value
"""
self.bus.write(ad53xx_cmd_read_ch(channel, op) << 8)
self.bus.set_config_mu(SPI_AD53XX_CONFIG | spi.SPI_INPUT, 24,
self.div_read, self.chip_select)
delay(270*ns) # t_21 min sync high in readback
self.bus.write((AD53XX_CMD_SPECIAL | AD53XX_SPECIAL_NOP) << 8)
self.bus.set_config_mu(SPI_AD53XX_CONFIG, 24, self.div_write,
self.chip_select)
# FIXME: the int32 should not be needed to resolve unification
return self.bus.read() & int32(0xffff)
@kernel
def write_offset_dacs_mu(self, value):
"""Program the OFS0 and OFS1 offset DAC registers.
Writes to the offset DACs take effect immediately without requiring
a LDAC. This method advances the timeline by the duration of two SPI
transfers.
:param value: Value to set both offset DAC registers to
"""
value &= 0x3fff
self.offset_dacs = value
self.bus.write((AD53XX_CMD_SPECIAL | AD53XX_SPECIAL_OFS0 | value) << 8)
self.bus.write((AD53XX_CMD_SPECIAL | AD53XX_SPECIAL_OFS1 | value) << 8)
@kernel
def write_gain_mu(self, channel, gain=0xffff):
"""Program the gain register for a DAC channel.
The DAC output is not updated until LDAC is pulsed (see :meth:`load`).
This method advances the timeline by the duration of one SPI transfer.
:param gain: 16-bit gain register value (default: 0xffff)
"""
self.bus.write(
ad53xx_cmd_write_ch(channel, gain, AD53XX_CMD_GAIN) << 8)
@kernel
def write_offset_mu(self, channel, offset=0x8000):
"""Program the offset register for a DAC channel.
The DAC output is not updated until LDAC is pulsed (see :meth:`load`).
This method advances the timeline by the duration of one SPI transfer.
:param offset: 16-bit offset register value (default: 0x8000)
"""
self.bus.write(
ad53xx_cmd_write_ch(channel, offset, AD53XX_CMD_OFFSET) << 8)
@kernel
def write_offset(self, channel, voltage):
"""Program the DAC offset voltage for a channel.
An offset of +V can be used to trim out a DAC offset error of -V.
The DAC output is not updated until LDAC is pulsed (see :meth:`load`).
This method advances the timeline by the duration of one SPI transfer.
:param voltage: the offset voltage
"""
self.write_offset_mu(channel, voltage_to_mu(voltage, self.offset_dacs,
self.vref))
@kernel
def write_dac_mu(self, channel, value):
"""Program the DAC input register for a channel.
The DAC output is not updated until LDAC is pulsed (see :meth:`load`).
This method advances the timeline by the duration of one SPI transfer.
"""
self.bus.write(
ad53xx_cmd_write_ch(channel, value, AD53XX_CMD_DATA) << 8)
@kernel
def write_dac(self, channel, voltage):
"""Program the DAC output voltage for a channel.
The DAC output is not updated until LDAC is pulsed (see :meth:`load`).
This method advances the timeline by the duration of one SPI transfer.
"""
self.write_dac_mu(channel, voltage_to_mu(voltage, self.offset_dacs,
self.vref))
@kernel
def load(self):
"""Pulse the LDAC line.
Note that there is a <= 1.5us "BUSY" period (t10) after writing to a
DAC input/gain/offset register. All DAC registers may be programmed
normally during the busy period, however LDACs during the busy period
cause the DAC output to change *after* the BUSY period has completed,
instead of the usual immediate update on LDAC behaviour.
This method advances the timeline by two RTIO clock periods.
"""
self.ldac.off()
delay_mu(2*self.bus.ref_period_mu) # t13 = 10ns ldac pulse width low
self.ldac.on()
@kernel
def set_dac_mu(self, values, channels=list(range(40))):
"""Program multiple DAC channels and pulse LDAC to update the DAC
outputs.
This method does not advance the timeline; write events are scheduled
in the past. The DACs will synchronously start changing their output
levels `now`.
If no LDAC device was defined, the LDAC pulse is skipped.
See :meth:`load`.
:param values: list of DAC values to program
:param channels: list of DAC channels to program. If not specified,
we program the DAC channels sequentially, starting at 0.
"""
t0 = now_mu()
# t10: max busy period after writing to DAC registers
t_10 = self.core.seconds_to_mu(1500*ns)
# compensate all delays that will be applied
delay_mu(-t_10-len(values)*self.bus.xfer_duration_mu)
for i in range(len(values)):
self.write_dac_mu(channels[i], values[i])
delay_mu(t_10)
self.load()
at_mu(t0)
@kernel
def set_dac(self, voltages, channels=list(range(40))):
"""Program multiple DAC channels and pulse LDAC to update the DAC
outputs.
This method does not advance the timeline; write events are scheduled
in the past. The DACs will synchronously start changing their output
levels `now`.
If no LDAC device was defined, the LDAC pulse is skipped.
:param voltages: list of voltages to program the DAC channels to
:param channels: list of DAC channels to program. If not specified,
we program the DAC channels sequentially, starting at 0.
"""
values = [voltage_to_mu(voltage, self.offset_dacs, self.vref)
for voltage in voltages]
self.set_dac_mu(values, channels)
@kernel
def calibrate(self, channel, vzs, vfs):
""" Two-point calibration of a DAC channel.
Programs the offset and gain register to trim out DAC errors. Does not
take effect until LDAC is pulsed (see :meth:`load`).
Calibration consists of measuring the DAC output voltage for a channel
with the DAC set to zero-scale (0x0000) and full-scale (0xffff).
Note that only negative offsets and full-scale errors (DAC gain too
high) can be calibrated in this fashion.
:param channel: The number of the calibrated channel
:params vzs: Measured voltage with the DAC set to zero-scale (0x0000)
:params vfs: Measured voltage with the DAC set to full-scale (0xffff)
"""
offset_err = voltage_to_mu(vzs, self.offset_dacs, self.vref)
gain_err = voltage_to_mu(vfs, self.offset_dacs, self.vref) - (
offset_err + 0xffff)
assert offset_err <= 0
assert gain_err >= 0
self.core.break_realtime()
self.write_offset_mu(channel, 0x8000-offset_err)
self.write_gain_mu(channel, 0xffff-gain_err)
@portable
def voltage_to_mu(self, voltage):
"""Returns the 16-bit DAC register value required to produce a given
output voltage, assuming offset and gain errors have been trimmed out.
The 16-bit register value may also be used with 14-bit DACs. The
additional bits are disregarded by 14-bit DACs.
:param voltage: Voltage in SI units.
Valid voltages are: [-2*vref, + 2*vref - 1 LSB] + voltage offset.
:return: The 16-bit DAC register value
"""
return voltage_to_mu(voltage, self.offset_dacs, self.vref)

1121
artiq/coredevice/ad9910.py Normal file

File diff suppressed because it is too large Load Diff

272
artiq/coredevice/ad9912.py Normal file
View File

@ -0,0 +1,272 @@
from numpy import int32, int64
from artiq.language.types import TInt32, TInt64, TFloat, TTuple, TBool
from artiq.language.core import kernel, delay, portable
from artiq.language.units import ms, us, ns
from artiq.coredevice.ad9912_reg import *
from artiq.coredevice import spi2 as spi
from artiq.coredevice import urukul
class AD9912:
"""
AD9912 DDS channel on Urukul
This class supports a single DDS channel and exposes the DDS,
the digital step attenuator, and the RF switch.
:param chip_select: Chip select configuration. On Urukul this is an
encoded chip select and not "one-hot".
:param cpld_device: Name of the Urukul CPLD this device is on.
:param sw_device: Name of the RF switch device. The RF switch is a
TTLOut channel available as the :attr:`sw` attribute of this instance.
:param pll_n: DDS PLL multiplier. The DDS sample clock is
f_ref/clk_div*pll_n where f_ref is the reference frequency and clk_div
is the reference clock divider (both set in the parent Urukul CPLD
instance).
:param pll_en: PLL enable bit, set to 0 to bypass PLL (default: 1).
Note that when bypassing the PLL the red front panel LED may remain on.
"""
def __init__(self, dmgr, chip_select, cpld_device, sw_device=None,
pll_n=10, pll_en=1):
self.kernel_invariants = {"cpld", "core", "bus", "chip_select",
"pll_n", "pll_en", "ftw_per_hz"}
self.cpld = dmgr.get(cpld_device)
self.core = self.cpld.core
self.bus = self.cpld.bus
assert 4 <= chip_select <= 7
self.chip_select = chip_select
if sw_device:
self.sw = dmgr.get(sw_device)
self.kernel_invariants.add("sw")
self.pll_en = pll_en
self.pll_n = pll_n
if pll_en:
sysclk = self.cpld.refclk / [1, 1, 2, 4][self.cpld.clk_div] * pll_n
else:
sysclk = self.cpld.refclk
assert sysclk <= 1e9
self.ftw_per_hz = 1 / sysclk * (int64(1) << 48)
@kernel
def write(self, addr: TInt32, data: TInt32, length: TInt32):
"""Variable length write to a register.
Up to 4 bytes.
:param addr: Register address
:param data: Data to be written: int32
:param length: Length in bytes (1-4)
"""
assert length > 0
assert length <= 4
self.bus.set_config_mu(urukul.SPI_CONFIG, 16,
urukul.SPIT_DDS_WR, self.chip_select)
self.bus.write((addr | ((length - 1) << 13)) << 16)
self.bus.set_config_mu(urukul.SPI_CONFIG | spi.SPI_END, length * 8,
urukul.SPIT_DDS_WR, self.chip_select)
self.bus.write(data << (32 - length * 8))
@kernel
def read(self, addr: TInt32, length: TInt32) -> TInt32:
"""Variable length read from a register.
Up to 4 bytes.
:param addr: Register address
:param length: Length in bytes (1-4)
:return: Data read
"""
assert length > 0
assert length <= 4
self.bus.set_config_mu(urukul.SPI_CONFIG, 16,
urukul.SPIT_DDS_WR, self.chip_select)
self.bus.write((addr | ((length - 1) << 13) | 0x8000) << 16)
self.bus.set_config_mu(urukul.SPI_CONFIG | spi.SPI_END
| spi.SPI_INPUT, length * 8,
urukul.SPIT_DDS_RD, self.chip_select)
self.bus.write(0)
data = self.bus.read()
if length < 4:
data &= (1 << (length * 8)) - 1
return data
@kernel
def init(self):
"""Initialize and configure the DDS.
Sets up SPI mode, confirms chip presence, powers down unused blocks,
and configures the PLL. Does not wait for PLL lock. Uses the
IO_UPDATE signal multiple times.
"""
# SPI mode
self.write(AD9912_SER_CONF, 0x99, length=1)
self.cpld.io_update.pulse(2 * us)
# Verify chip ID and presence
prodid = self.read(AD9912_PRODIDH, length=2)
if (prodid != 0x1982) and (prodid != 0x1902):
raise ValueError("Urukul AD9912 product id mismatch")
delay(50 * us)
# HSTL power down, CMOS power down
pwrcntrl1 = 0x80 | ((~self.pll_en & 1) << 4)
self.write(AD9912_PWRCNTRL1, pwrcntrl1, length=1)
self.cpld.io_update.pulse(2 * us)
if self.pll_en:
self.write(AD9912_N_DIV, self.pll_n // 2 - 2, length=1)
self.cpld.io_update.pulse(2 * us)
# I_cp = 375 µA, VCO high range
self.write(AD9912_PLLCFG, 0b00000101, length=1)
self.cpld.io_update.pulse(2 * us)
delay(1 * ms)
@kernel
def set_att_mu(self, att: TInt32):
"""Set digital step attenuator in machine units.
This method will write the attenuator settings of all four channels.
.. seealso:: :meth:`artiq.coredevice.urukul.CPLD.set_att_mu`
:param att: Attenuation setting, 8 bit digital.
"""
self.cpld.set_att_mu(self.chip_select - 4, att)
@kernel
def set_att(self, att: TFloat):
"""Set digital step attenuator in SI units.
This method will write the attenuator settings of all four channels.
.. seealso:: :meth:`artiq.coredevice.urukul.CPLD.set_att`
:param att: Attenuation in dB. Higher values mean more attenuation.
"""
self.cpld.set_att(self.chip_select - 4, att)
@kernel
def get_att_mu(self) -> TInt32:
"""Get digital step attenuator value in machine units.
.. seealso:: :meth:`artiq.coredevice.urukul.CPLD.get_channel_att_mu`
:return: Attenuation setting, 8 bit digital.
"""
return self.cpld.get_channel_att_mu(self.chip_select - 4)
@kernel
def get_att(self) -> TFloat:
"""Get digital step attenuator value in SI units.
.. seealso:: :meth:`artiq.coredevice.urukul.CPLD.get_channel_att`
:return: Attenuation in dB.
"""
return self.cpld.get_channel_att(self.chip_select - 4)
@kernel
def set_mu(self, ftw: TInt64, pow_: TInt32 = 0):
"""Set profile 0 data in machine units.
After the SPI transfer, the shared IO update pin is pulsed to
activate the data.
:param ftw: Frequency tuning word: 48 bit unsigned.
:param pow_: Phase tuning word: 16 bit unsigned.
"""
# streaming transfer of FTW and POW
self.bus.set_config_mu(urukul.SPI_CONFIG, 16,
urukul.SPIT_DDS_WR, self.chip_select)
self.bus.write((AD9912_POW1 << 16) | (3 << 29))
self.bus.set_config_mu(urukul.SPI_CONFIG, 32,
urukul.SPIT_DDS_WR, self.chip_select)
self.bus.write((pow_ << 16) | (int32(ftw >> 32) & 0xffff))
self.bus.set_config_mu(urukul.SPI_CONFIG | spi.SPI_END, 32,
urukul.SPIT_DDS_WR, self.chip_select)
self.bus.write(int32(ftw))
self.cpld.io_update.pulse(10 * ns)
@kernel
def get_mu(self) -> TTuple([TInt64, TInt32]):
"""Get the frequency tuning word and phase offset word.
.. seealso:: :meth:`get`
:return: A tuple ``(ftw, pow)``.
"""
# Read data
high = self.read(AD9912_POW1, 4)
self.core.break_realtime() # Regain slack to perform second read
low = self.read(AD9912_FTW3, 4)
# Extract and return fields
ftw = (int64(high & 0xffff) << 32) | (int64(low) & int64(0xffffffff))
pow_ = (high >> 16) & 0x3fff
return ftw, pow_
@portable(flags={"fast-math"})
def frequency_to_ftw(self, frequency: TFloat) -> TInt64:
"""Returns the 48-bit frequency tuning word corresponding to the given
frequency.
"""
return int64(round(self.ftw_per_hz * frequency)) & (
(int64(1) << 48) - 1)
@portable(flags={"fast-math"})
def ftw_to_frequency(self, ftw: TInt64) -> TFloat:
"""Returns the frequency corresponding to the given
frequency tuning word.
"""
return ftw / self.ftw_per_hz
@portable(flags={"fast-math"})
def turns_to_pow(self, phase: TFloat) -> TInt32:
"""Returns the 16-bit phase offset word corresponding to the given
phase.
"""
return int32(round((1 << 14) * phase)) & 0xffff
@portable(flags={"fast-math"})
def pow_to_turns(self, pow_: TInt32) -> TFloat:
"""Return the phase in turns corresponding to a given phase offset
word.
:param pow_: Phase offset word.
:return: Phase in turns.
"""
return pow_ / (1 << 14)
@kernel
def set(self, frequency: TFloat, phase: TFloat = 0.0):
"""Set profile 0 data in SI units.
.. seealso:: :meth:`set_mu`
:param frequency: Frequency in Hz
:param phase: Phase tuning word in turns
"""
self.set_mu(self.frequency_to_ftw(frequency),
self.turns_to_pow(phase))
@kernel
def get(self) -> TTuple([TFloat, TFloat]):
"""Get the frequency and phase.
.. seealso:: :meth:`get_mu`
:return: A tuple ``(frequency, phase)``.
"""
# Get values
ftw, pow_ = self.get_mu()
# Convert and return
return self.ftw_to_frequency(ftw), self.pow_to_turns(pow_)
@kernel
def cfg_sw(self, state: TBool):
"""Set CPLD CFG RF switch state. The RF switch is controlled by the
logical or of the CPLD configuration shift register
RF switch bit and the SW TTL line (if used).
:param state: CPLD CFG RF switch bit
"""
self.cpld.cfg_sw(self.chip_select - 4, state)

View File

@ -0,0 +1,384 @@
# auto-generated, do not edit
from artiq.language.core import portable
from artiq.language.types import TInt32
AD9912_SER_CONF = 0x000
# default: 0x00, access: R/W
@portable
def AD9912_SDOACTIVE_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 0
@portable
def AD9912_SDOACTIVE_GET(x: TInt32) -> TInt32:
return (x >> 0) & 0x1
# default: 0x00, access: R/W
@portable
def AD9912_LSBFIRST_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 1
@portable
def AD9912_LSBFIRST_GET(x: TInt32) -> TInt32:
return (x >> 1) & 0x1
# default: 0x00, access: R/W
@portable
def AD9912_SOFTRESET_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 2
@portable
def AD9912_SOFTRESET_GET(x: TInt32) -> TInt32:
return (x >> 2) & 0x1
# default: 0x01, access: R/W
@portable
def AD9912_LONGINSN_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 3
@portable
def AD9912_LONGINSN_GET(x: TInt32) -> TInt32:
return (x >> 3) & 0x1
# default: 0x01, access: R/W
@portable
def AD9912_LONGINSN_M_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 4
@portable
def AD9912_LONGINSN_M_GET(x: TInt32) -> TInt32:
return (x >> 4) & 0x1
# default: 0x00, access: R/W
@portable
def AD9912_SOFTRESET_M_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 5
@portable
def AD9912_SOFTRESET_M_GET(x: TInt32) -> TInt32:
return (x >> 5) & 0x1
# default: 0x00, access: R/W
@portable
def AD9912_LSBFIRST_M_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 6
@portable
def AD9912_LSBFIRST_M_GET(x: TInt32) -> TInt32:
return (x >> 6) & 0x1
# default: 0x00, access: R/W
@portable
def AD9912_SDOACTIVE_M_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 7
@portable
def AD9912_SDOACTIVE_M_GET(x: TInt32) -> TInt32:
return (x >> 7) & 0x1
AD9912_PRODIDL = 0x002
AD9912_PRODIDH = 0x003
AD9912_SER_OPT1 = 0x004
# default: 0x00, access: R/W
@portable
def AD9912_READ_BUF_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 0
@portable
def AD9912_READ_BUF_GET(x: TInt32) -> TInt32:
return (x >> 0) & 0x1
AD9912_SER_OPT2 = 0x005
# default: 0x00, access: R/W
@portable
def AD9912_RED_UPDATE_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 0
@portable
def AD9912_RED_UPDATE_GET(x: TInt32) -> TInt32:
return (x >> 0) & 0x1
AD9912_PWRCNTRL1 = 0x010
# default: 0x00, access: R/W
@portable
def AD9912_PD_DIGITAL_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 0
@portable
def AD9912_PD_DIGITAL_GET(x: TInt32) -> TInt32:
return (x >> 0) & 0x1
# default: 0x00, access: R/W
@portable
def AD9912_PD_FULL_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 1
@portable
def AD9912_PD_FULL_GET(x: TInt32) -> TInt32:
return (x >> 1) & 0x1
# default: 0x00, access: R/W
@portable
def AD9912_PD_SYSCLK_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 4
@portable
def AD9912_PD_SYSCLK_GET(x: TInt32) -> TInt32:
return (x >> 4) & 0x1
# default: 0x00, access: R/W
@portable
def AD9912_EN_DOUBLER_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 5
@portable
def AD9912_EN_DOUBLER_GET(x: TInt32) -> TInt32:
return (x >> 5) & 0x1
# default: 0x01, access: R/W
@portable
def AD9912_EN_CMOS_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 6
@portable
def AD9912_EN_CMOS_GET(x: TInt32) -> TInt32:
return (x >> 6) & 0x1
# default: 0x01, access: R/W
@portable
def AD9912_PD_HSTL_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 7
@portable
def AD9912_PD_HSTL_GET(x: TInt32) -> TInt32:
return (x >> 7) & 0x1
AD9912_PWRCNTRL2 = 0x012
# default: 0x00, access: R/W
@portable
def AD9912_DDS_RESET_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 0
@portable
def AD9912_DDS_RESET_GET(x: TInt32) -> TInt32:
return (x >> 0) & 0x1
AD9912_PWRCNTRL3 = 0x013
# default: 0x00, access: R/W
@portable
def AD9912_S_DIV_RESET_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 1
@portable
def AD9912_S_DIV_RESET_GET(x: TInt32) -> TInt32:
return (x >> 1) & 0x1
# default: 0x00, access: R/W
@portable
def AD9912_S_DIV2_RESET_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 3
@portable
def AD9912_S_DIV2_RESET_GET(x: TInt32) -> TInt32:
return (x >> 3) & 0x1
# default: 0x00, access: R/W
@portable
def AD9912_PD_FUND_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 7
@portable
def AD9912_PD_FUND_GET(x: TInt32) -> TInt32:
return (x >> 7) & 0x1
AD9912_N_DIV = 0x020
AD9912_PLLCFG = 0x022
# default: 0x00, access: R/W
@portable
def AD9912_PLL_ICP_SET(x: TInt32) -> TInt32:
return (x & 0x3) << 0
@portable
def AD9912_PLL_ICP_GET(x: TInt32) -> TInt32:
return (x >> 0) & 0x3
# default: 0x01, access: R/W
@portable
def AD9912_VCO_RANGE_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 2
@portable
def AD9912_VCO_RANGE_GET(x: TInt32) -> TInt32:
return (x >> 2) & 0x1
# default: 0x00, access: R/W
@portable
def AD9912_PLL_REF2X_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 3
@portable
def AD9912_PLL_REF2X_GET(x: TInt32) -> TInt32:
return (x >> 3) & 0x1
# default: 0x00, access: R/W
@portable
def AD9912_VCO_AUTO_RANGE_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 7
@portable
def AD9912_VCO_AUTO_RANGE_GET(x: TInt32) -> TInt32:
return (x >> 7) & 0x1
AD9912_S_DIVL = 0x104
AD9912_S_DIVH = 0x105
AD9912_S_DIV_CFG = 0x106
# default: 0x01, access: R/W
@portable
def AD9912_S_DIV2_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 0
@portable
def AD9912_S_DIV2_GET(x: TInt32) -> TInt32:
return (x >> 0) & 0x1
# default: 0x00, access: R/W
@portable
def AD9912_S_DIV_FALL_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 7
@portable
def AD9912_S_DIV_FALL_GET(x: TInt32) -> TInt32:
return (x >> 7) & 0x1
AD9912_FTW0 = 0x1a6
AD9912_FTW1 = 0x1a7
AD9912_FTW2 = 0x1a8
AD9912_FTW3 = 0x1a9
AD9912_FTW4 = 0x1aa
AD9912_FTW5 = 0x1ab
AD9912_POW0 = 0x1ac
AD9912_POW1 = 0x1ad
AD9912_HSTL = 0x200
# default: 0x01, access: R/W
@portable
def AD9912_HSTL_CFG_SET(x: TInt32) -> TInt32:
return (x & 0x3) << 0
@portable
def AD9912_HSTL_CFG_GET(x: TInt32) -> TInt32:
return (x >> 0) & 0x3
# default: 0x01, access: R/W
@portable
def AD9912_HSTL_OPOL_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 4
@portable
def AD9912_HSTL_OPOL_GET(x: TInt32) -> TInt32:
return (x >> 4) & 0x1
AD9912_CMOS = 0x201
# default: 0x00, access: R/W
@portable
def AD9912_CMOS_MUX_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 0
@portable
def AD9912_CMOS_MUX_GET(x: TInt32) -> TInt32:
return (x >> 0) & 0x1
AD9912_FSC0 = 0x40b
AD9912_FSC1 = 0x40c
AD9912_HSR_A_CFG = 0x500
# default: 0x00, access: R/W
@portable
def AD9912_HSR_A_HARMONIC_SET(x: TInt32) -> TInt32:
return (x & 0xf) << 0
@portable
def AD9912_HSR_A_HARMONIC_GET(x: TInt32) -> TInt32:
return (x >> 0) & 0xf
# default: 0x00, access: R/W
@portable
def AD9912_HSR_A_MAG2X_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 6
@portable
def AD9912_HSR_A_MAG2X_GET(x: TInt32) -> TInt32:
return (x >> 6) & 0x1
# default: 0x00, access: R/W
@portable
def AD9912_HSR_A_EN_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 7
@portable
def AD9912_HSR_A_EN_GET(x: TInt32) -> TInt32:
return (x >> 7) & 0x1
AD9912_HSR_A_MAG = 0x501
AD9912_HSR_A_POW0 = 0x503
AD9912_HSR_A_POW1 = 0x504
AD9912_HSR_B_CFG = 0x505
# default: 0x00, access: R/W
@portable
def AD9912_HSR_B_HARMONIC_SET(x: TInt32) -> TInt32:
return (x & 0xf) << 0
@portable
def AD9912_HSR_B_HARMONIC_GET(x: TInt32) -> TInt32:
return (x >> 0) & 0xf
# default: 0x00, access: R/W
@portable
def AD9912_HSR_B_MAG2X_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 6
@portable
def AD9912_HSR_B_MAG2X_GET(x: TInt32) -> TInt32:
return (x >> 6) & 0x1
# default: 0x00, access: R/W
@portable
def AD9912_HSR_B_EN_SET(x: TInt32) -> TInt32:
return (x & 0x1) << 7
@portable
def AD9912_HSR_B_EN_GET(x: TInt32) -> TInt32:
return (x >> 7) & 0x1
AD9912_HSR_B_MAG = 0x506
AD9912_HSR_B_POW0 = 0x508
AD9912_HSR_B_POW1 = 0x509

349
artiq/coredevice/ad9914.py Normal file
View File

@ -0,0 +1,349 @@
"""
Driver for the AD9914 DDS (with parallel bus) on RTIO.
"""
from artiq.language.core import *
from artiq.language.types import *
from artiq.language.units import *
from artiq.coredevice.rtio import rtio_output
from numpy import int32, int64
__all__ = [
"AD9914",
"PHASE_MODE_CONTINUOUS", "PHASE_MODE_ABSOLUTE", "PHASE_MODE_TRACKING"
]
_PHASE_MODE_DEFAULT = -1
PHASE_MODE_CONTINUOUS = 0
PHASE_MODE_ABSOLUTE = 1
PHASE_MODE_TRACKING = 2
AD9914_REG_CFR1L = 0x01
AD9914_REG_CFR1H = 0x03
AD9914_REG_CFR2L = 0x05
AD9914_REG_CFR2H = 0x07
AD9914_REG_CFR3L = 0x09
AD9914_REG_CFR3H = 0x0b
AD9914_REG_CFR4L = 0x0d
AD9914_REG_CFR4H = 0x0f
AD9914_REG_DRGFL = 0x11
AD9914_REG_DRGFH = 0x13
AD9914_REG_DRGBL = 0x15
AD9914_REG_DRGBH = 0x17
AD9914_REG_DRGAL = 0x19
AD9914_REG_DRGAH = 0x1b
AD9914_REG_POW = 0x31
AD9914_REG_ASF = 0x33
AD9914_REG_USR0 = 0x6d
AD9914_FUD = 0x80
AD9914_GPIO = 0x81
class AD9914:
"""Driver for one AD9914 DDS channel.
The time cursor is not modified by any function in this class.
Output event replacement is not supported and issuing commands at the same
time is an error.
:param sysclk: DDS system frequency. The DDS system clock must be a
phase-locked multiple of the RTIO clock.
:param bus_channel: RTIO channel number of the DDS bus.
:param channel: channel number (on the bus) of the DDS device to control.
"""
kernel_invariants = {"core", "sysclk", "bus_channel", "channel",
"rtio_period_mu", "sysclk_per_mu", "write_duration_mu",
"dac_cal_duration_mu", "init_duration_mu", "init_sync_duration_mu",
"set_duration_mu", "set_x_duration_mu", "exit_x_duration_mu"}
def __init__(self, dmgr, sysclk, bus_channel, channel, core_device="core"):
self.core = dmgr.get(core_device)
self.sysclk = sysclk
self.bus_channel = bus_channel
self.channel = channel
self.phase_mode = PHASE_MODE_CONTINUOUS
self.rtio_period_mu = int64(8)
self.sysclk_per_mu = int32(self.sysclk * self.core.ref_period)
self.write_duration_mu = 5 * self.rtio_period_mu
self.dac_cal_duration_mu = 147000 * self.rtio_period_mu
self.init_duration_mu = 13 * self.write_duration_mu + self.dac_cal_duration_mu
self.init_sync_duration_mu = 21 * self.write_duration_mu + 2 * self.dac_cal_duration_mu
self.set_duration_mu = 7 * self.write_duration_mu
self.set_x_duration_mu = 7 * self.write_duration_mu
self.exit_x_duration_mu = 3 * self.write_duration_mu
@staticmethod
def get_rtio_channels(bus_channel, channel, **kwargs):
# return only first entry, as there are several devices with the same RTIO channel
if channel == 0:
return [(bus_channel, None)]
return []
@kernel
def write(self, addr, data):
rtio_output((self.bus_channel << 8) | addr, data)
delay_mu(self.write_duration_mu)
@kernel
def init(self):
"""Resets and initializes the DDS channel.
This needs to be done for each DDS channel before it can be used, and
it is recommended to use the startup kernel for this purpose.
"""
delay_mu(-self.init_duration_mu)
self.write(AD9914_GPIO, (1 << self.channel) << 1);
# Note another undocumented "feature" of the AD9914:
# Programmable modulus breaks if the digital ramp enable bit is
# not set at the same time.
self.write(AD9914_REG_CFR1H, 0x0000) # Enable cosine output
self.write(AD9914_REG_CFR2L, 0x8900) # Enable matched latency
self.write(AD9914_REG_CFR2H, 0x0089) # Enable profile mode + programmable modulus + DRG
self.write(AD9914_REG_DRGAL, 0) # Programmable modulus A = 0
self.write(AD9914_REG_DRGAH, 0)
self.write(AD9914_REG_DRGBH, 0x8000) # Programmable modulus B == 2**31
self.write(AD9914_REG_DRGBL, 0x0000)
self.write(AD9914_REG_ASF, 0x0fff) # Set amplitude to maximum
self.write(AD9914_REG_CFR4H, 0x0105) # Enable DAC calibration
self.write(AD9914_FUD, 0)
delay_mu(self.dac_cal_duration_mu)
self.write(AD9914_REG_CFR4H, 0x0005) # Disable DAC calibration
self.write(AD9914_FUD, 0)
@kernel
def init_sync(self, sync_delay):
"""Resets and initializes the DDS channel as well as configures
the AD9914 DDS for synchronisation. The synchronisation procedure
follows the steps outlined in the AN-1254 application note.
This needs to be done for each DDS channel before it can be used, and
it is recommended to use the startup kernel for this.
This function cannot be used in a batch; the correct way of
initializing multiple DDS channels is to call this function
sequentially with a delay between the calls. 10ms provides a good
timing margin.
:param sync_delay: integer from 0 to 0x3f that sets the value of
SYNC_OUT (bits 3-5) and SYNC_IN (bits 0-2) delay ADJ bits.
"""
delay_mu(-self.init_sync_duration_mu)
self.write(AD9914_GPIO, (1 << self.channel) << 1)
self.write(AD9914_REG_CFR4H, 0x0105) # Enable DAC calibration
self.write(AD9914_FUD, 0)
delay_mu(self.dac_cal_duration_mu)
self.write(AD9914_REG_CFR4H, 0x0005) # Disable DAC calibration
self.write(AD9914_FUD, 0)
self.write(AD9914_REG_CFR2L, 0x8b00) # Enable matched latency and sync_out
self.write(AD9914_FUD, 0)
# Set cal with sync and set sync_out and sync_in delay
self.write(AD9914_REG_USR0, 0x0840 | (sync_delay & 0x3f))
self.write(AD9914_FUD, 0)
self.write(AD9914_REG_CFR4H, 0x0105) # Enable DAC calibration
self.write(AD9914_FUD, 0)
delay_mu(self.dac_cal_duration_mu)
self.write(AD9914_REG_CFR4H, 0x0005) # Disable DAC calibration
self.write(AD9914_FUD, 0)
self.write(AD9914_REG_CFR1H, 0x0000) # Enable cosine output
self.write(AD9914_REG_CFR2H, 0x0089) # Enable profile mode + programmable modulus + DRG
self.write(AD9914_REG_DRGAL, 0) # Programmable modulus A = 0
self.write(AD9914_REG_DRGAH, 0)
self.write(AD9914_REG_DRGBH, 0x8000) # Programmable modulus B == 2**31
self.write(AD9914_REG_DRGBL, 0x0000)
self.write(AD9914_REG_ASF, 0x0fff) # Set amplitude to maximum
self.write(AD9914_FUD, 0)
@kernel
def set_phase_mode(self, phase_mode):
"""Sets the phase mode of the DDS channel. Supported phase modes are:
* :const:`PHASE_MODE_CONTINUOUS`: the phase accumulator is unchanged when
switching frequencies. The DDS phase is the sum of the phase
accumulator and the phase offset. The only discrete jumps in the
DDS output phase come from changes to the phase offset.
* :const:`PHASE_MODE_ABSOLUTE`: the phase accumulator is reset when
switching frequencies. Thus, the phase of the DDS at the time of
the frequency change is equal to the phase offset.
* :const:`PHASE_MODE_TRACKING`: when switching frequencies, the phase
accumulator is set to the value it would have if the DDS had been
running at the specified frequency since the start of the
experiment.
.. warning:: This setting may become inconsistent when used as part of
a DMA recording. When using DMA, it is recommended to specify the
phase mode explicitly when calling :meth:`set` or :meth:`set_mu`.
"""
self.phase_mode = phase_mode
@kernel
def set_mu(self, ftw, pow=0, phase_mode=_PHASE_MODE_DEFAULT,
asf=0x0fff, ref_time_mu=-1):
"""Sets the DDS channel to the specified frequency and phase.
This uses machine units (FTW and POW). The frequency tuning word width
is 32, the phase offset word width is 16, and the amplitude scale factor
width is 12.
The "frequency update" pulse is sent to the DDS with a fixed latency
with respect to the current position of the time cursor.
:param ftw: frequency to generate.
:param pow: adds an offset to the phase.
:param phase_mode: if specified, overrides the default phase mode set
by :meth:`set_phase_mode` for this call.
:param ref_time_mu: reference time used to compute phase. Specifying this
makes it easier to have a well-defined phase relationship between
DDSes on the same bus that are updated at a similar time.
:return: Resulting phase offset word after application of phase
tracking offset. When using :const:`PHASE_MODE_CONTINUOUS` in
subsequent calls, use this value as the "current" phase.
"""
if phase_mode == _PHASE_MODE_DEFAULT:
phase_mode = self.phase_mode
if ref_time_mu < 0:
ref_time_mu = now_mu()
delay_mu(-self.set_duration_mu)
self.write(AD9914_GPIO, (1 << self.channel) << 1)
self.write(AD9914_REG_DRGFL, ftw & 0xffff)
self.write(AD9914_REG_DRGFH, (ftw >> 16) & 0xffff)
# We need the RTIO fine timestamp clock to be phase-locked
# to DDS SYSCLK, and divided by an integer self.sysclk_per_mu.
if phase_mode == PHASE_MODE_CONTINUOUS:
# Do not clear phase accumulator on FUD
# Disable autoclear phase accumulator and enables OSK.
self.write(AD9914_REG_CFR1L, 0x0108)
else:
# Clear phase accumulator on FUD
# Enable autoclear phase accumulator and enables OSK.
self.write(AD9914_REG_CFR1L, 0x2108)
fud_time = now_mu() + 2 * self.write_duration_mu
pow -= int32((ref_time_mu - fud_time) * self.sysclk_per_mu * ftw >> (32 - 16))
if phase_mode == PHASE_MODE_TRACKING:
pow += int32(ref_time_mu * self.sysclk_per_mu * ftw >> (32 - 16))
self.write(AD9914_REG_POW, pow)
self.write(AD9914_REG_ASF, asf)
self.write(AD9914_FUD, 0)
return pow
@portable(flags={"fast-math"})
def frequency_to_ftw(self, frequency):
"""Returns the 32-bit frequency tuning word corresponding to the given
frequency.
"""
return int32(round(float(int64(2)**32*frequency/self.sysclk)))
@portable(flags={"fast-math"})
def ftw_to_frequency(self, ftw):
"""Returns the frequency corresponding to the given frequency tuning
word.
"""
return ftw*self.sysclk/int64(2)**32
@portable(flags={"fast-math"})
def turns_to_pow(self, turns):
"""Returns the 16-bit phase offset word corresponding to the given
phase in turns."""
return round(float(turns*2**16)) & 0xffff
@portable(flags={"fast-math"})
def pow_to_turns(self, pow):
"""Returns the phase in turns corresponding to the given phase offset
word."""
return pow/2**16
@portable(flags={"fast-math"})
def amplitude_to_asf(self, amplitude):
"""Returns 12-bit amplitude scale factor corresponding to given
amplitude."""
code = round(float(amplitude * 0x0fff))
if code < 0 or code > 0xfff:
raise ValueError("Invalid AD9914 amplitude!")
return code
@portable(flags={"fast-math"})
def asf_to_amplitude(self, asf):
"""Returns the amplitude corresponding to the given amplitude scale
factor."""
return asf/0x0fff
@kernel
def set(self, frequency, phase=0.0, phase_mode=_PHASE_MODE_DEFAULT,
amplitude=1.0):
"""Like :meth:`set_mu`, but uses Hz and turns."""
return self.pow_to_turns(
self.set_mu(self.frequency_to_ftw(frequency),
self.turns_to_pow(phase), phase_mode,
self.amplitude_to_asf(amplitude)))
# Extended-resolution functions
@kernel
def set_x_mu(self, xftw, amplitude=0x0fff):
"""Set the DDS frequency and amplitude with an extended-resolution
(63-bit) frequency tuning word.
Phase control is not implemented in this mode; the phase offset
can assume any value.
After this function has been called, exit extended-resolution mode
before calling functions that use standard-resolution mode.
"""
delay_mu(-self.set_x_duration_mu)
self.write(AD9914_GPIO, (1 << self.channel) << 1)
self.write(AD9914_REG_DRGAL, xftw & 0xffff)
self.write(AD9914_REG_DRGAH, (xftw >> 16) & 0x7fff)
self.write(AD9914_REG_DRGFL, (xftw >> 31) & 0xffff)
self.write(AD9914_REG_DRGFH, (xftw >> 47) & 0xffff)
self.write(AD9914_REG_ASF, amplitude)
self.write(AD9914_FUD, 0)
@kernel
def exit_x(self):
"""Exits extended-resolution mode."""
delay_mu(-self.exit_x_duration_mu)
self.write(AD9914_GPIO, (1 << self.channel) << 1)
self.write(AD9914_REG_DRGAL, 0)
self.write(AD9914_REG_DRGAH, 0)
@portable(flags={"fast-math"})
def frequency_to_xftw(self, frequency):
"""Returns the 63-bit frequency tuning word corresponding to the given
frequency (extended resolution mode).
"""
return int64(round(2.0*float(int64(2)**62)*frequency/self.sysclk)) & (
(int64(1) << 63) - 1)
@portable(flags={"fast-math"})
def xftw_to_frequency(self, xftw):
"""Returns the frequency corresponding to the given frequency tuning
word (extended resolution mode).
"""
return xftw*self.sysclk/(2.0*float(int64(2)**62))
@kernel
def set_x(self, frequency, amplitude=1.0):
"""Like :meth:`set_x_mu`, but uses Hz and turns.
Note that the precision of ``float`` is less than the precision
of the extended frequency tuning word.
"""
self.set_x_mu(self.frequency_to_xftw(frequency),
self.amplitude_to_asf(amplitude))

598
artiq/coredevice/adf5356.py Normal file
View File

@ -0,0 +1,598 @@
"""RTIO driver for the Analog Devices ADF[45]35[56] family of GHz PLLs
on Mirny-style prefixed SPI buses.
"""
# https://github.com/analogdevicesinc/linux/blob/master/Documentation/devicetree/bindings/iio/frequency/adf5355.txt
# https://github.com/analogdevicesinc/linux/blob/master/drivers/iio/frequency/adf5355.c
# https://www.analog.com/media/en/technical-documentation/data-sheets/ADF5355.pdf
# https://www.analog.com/media/en/technical-documentation/data-sheets/ADF5355.pdf
# https://www.analog.com/media/en/technical-documentation/user-guides/EV-ADF5355SD1Z-UG-1087.pdf
from artiq.language.core import kernel, portable, delay
from artiq.language.units import us, GHz, MHz
from artiq.language.types import TInt32, TInt64
from artiq.coredevice import spi2 as spi
from artiq.coredevice.adf5356_reg import *
from numpy import int32, int64, floor, ceil
SPI_CONFIG = (
0 * spi.SPI_OFFLINE
| 0 * spi.SPI_END
| 0 * spi.SPI_INPUT
| 1 * spi.SPI_CS_POLARITY
| 0 * spi.SPI_CLK_POLARITY
| 0 * spi.SPI_CLK_PHASE
| 0 * spi.SPI_LSB_FIRST
| 0 * spi.SPI_HALF_DUPLEX
)
ADF5356_MIN_VCO_FREQ = int64(3.4 * GHz)
ADF5356_MAX_VCO_FREQ = int64(6.8 * GHz)
ADF5356_MAX_FREQ_PFD = int32(125.0 * MHz)
ADF5356_MODULUS1 = int32(1 << 24)
ADF5356_MAX_MODULUS2 = int32(1 << 28) # FIXME: ADF5356 has 28 bits MOD2
ADF5356_MAX_R_CNT = int32(1023)
class ADF5356:
"""Analog Devices AD[45]35[56] family of GHz PLLs.
:param cpld_device: Mirny CPLD device name
:param sw_device: Mirny RF switch device name
:param channel: Mirny RF channel index
:param ref_doubler: enable/disable reference clock doubler
:param ref_divider: enable/disable reference clock divide-by-2
:param core_device: Core device name (default: "core")
"""
kernel_invariants = {"cpld", "sw", "channel", "core", "sysclk"}
def __init__(
self,
dmgr,
cpld_device,
sw_device,
channel,
ref_doubler=False,
ref_divider=False,
core="core",
):
self.cpld = dmgr.get(cpld_device)
self.sw = dmgr.get(sw_device)
self.channel = channel
self.core = dmgr.get(core)
self.ref_doubler = ref_doubler
self.ref_divider = ref_divider
self.sysclk = self.cpld.refclk
assert 10 <= self.sysclk / 1e6 <= 600
self._init_registers()
@staticmethod
def get_rtio_channels(**kwargs):
return []
@kernel
def init(self, blind=False):
"""
Initialize and configure the PLL.
:param blind: Do not attempt to verify presence.
"""
if not blind:
# MUXOUT = VDD
self.regs[4] = ADF5356_REG4_MUXOUT_UPDATE(self.regs[4], 1)
self.sync()
delay(1000 * us)
if not self.read_muxout():
raise ValueError("MUXOUT not high")
delay(800 * us)
# MUXOUT = DGND
self.regs[4] = ADF5356_REG4_MUXOUT_UPDATE(self.regs[4], 2)
self.sync()
delay(1000 * us)
if self.read_muxout():
raise ValueError("MUXOUT not low")
delay(800 * us)
# MUXOUT = digital lock-detect
self.regs[4] = ADF5356_REG4_MUXOUT_UPDATE(self.regs[4], 6)
else:
self.sync()
@kernel
def set_att(self, att):
"""Set digital step attenuator in SI units.
This method will write the attenuator settings of the channel.
.. seealso:: :meth:`artiq.coredevice.mirny.Mirny.set_att`
:param att: Attenuation in dB.
"""
self.cpld.set_att(self.channel, att)
@kernel
def set_att_mu(self, att):
"""Set digital step attenuator in machine units.
:param att: Attenuation setting, 8 bit digital.
"""
self.cpld.set_att_mu(self.channel, att)
@kernel
def write(self, data):
self.cpld.write_ext(self.channel | 4, 32, data)
@kernel
def read_muxout(self):
"""
Read the state of the MUXOUT line.
By default, this is configured to be the digital lock detection.
"""
return bool(self.cpld.read_reg(0) & (1 << (self.channel + 8)))
@kernel
def set_output_power_mu(self, n):
"""
Set the power level at output A of the PLL chip in machine units.
This driver defaults to `n = 3` at init.
:param n: output power setting, 0, 1, 2, or 3 (see ADF5356 datasheet, fig. 44).
"""
if n not in [0, 1, 2, 3]:
raise ValueError("invalid power setting")
self.regs[6] = ADF5356_REG6_RF_OUTPUT_A_POWER_UPDATE(self.regs[6], n)
self.sync()
@portable
def output_power_mu(self):
"""
Return the power level at output A of the PLL chip in machine units.
"""
return ADF5356_REG6_RF_OUTPUT_A_POWER_GET(self.regs[6])
@kernel
def enable_output(self):
"""
Enable output A of the PLL chip. This is the default after init.
"""
self.regs[6] |= ADF5356_REG6_RF_OUTPUT_A_ENABLE(1)
self.sync()
@kernel
def disable_output(self):
"""
Disable output A of the PLL chip.
"""
self.regs[6] &= ~ADF5356_REG6_RF_OUTPUT_A_ENABLE(1)
self.sync()
@kernel
def set_frequency(self, f):
"""
Output given frequency on output A.
:param f: 53.125 MHz <= f <= 6800 MHz
"""
freq = int64(round(f))
if freq > ADF5356_MAX_VCO_FREQ:
raise ValueError("Requested too high frequency")
# select minimal output divider
rf_div_sel = 0
while freq < ADF5356_MIN_VCO_FREQ:
freq <<= 1
rf_div_sel += 1
if (1 << rf_div_sel) > 64:
raise ValueError("Requested too low frequency")
# choose reference divider that maximizes PFD frequency
self.regs[4] = ADF5356_REG4_R_COUNTER_UPDATE(
self.regs[4], self._compute_reference_counter()
)
f_pfd = self.f_pfd()
# choose prescaler
if freq > int64(6e9):
self.regs[0] |= ADF5356_REG0_PRESCALER(1) # 8/9
n_min, n_max = 75, 65535
# adjust reference divider to be able to match n_min constraint
while n_min * f_pfd > freq:
r = ADF5356_REG4_R_COUNTER_GET(self.regs[4])
self.regs[4] = ADF5356_REG4_R_COUNTER_UPDATE(self.regs[4], r + 1)
f_pfd = self.f_pfd()
else:
self.regs[0] &= ~ADF5356_REG0_PRESCALER(1) # 4/5
n_min, n_max = 23, 32767
# calculate PLL parameters
n, frac1, (frac2_msb, frac2_lsb), (mod2_msb, mod2_lsb) = calculate_pll(
freq, f_pfd
)
if not (n_min <= n <= n_max):
raise ValueError("Invalid INT value")
# configure PLL
self.regs[0] = ADF5356_REG0_INT_VALUE_UPDATE(self.regs[0], n)
self.regs[1] = ADF5356_REG1_MAIN_FRAC_VALUE_UPDATE(self.regs[1], frac1)
self.regs[2] = ADF5356_REG2_AUX_FRAC_LSB_VALUE_UPDATE(self.regs[2], frac2_lsb)
self.regs[2] = ADF5356_REG2_AUX_MOD_LSB_VALUE_UPDATE(self.regs[2], mod2_lsb)
self.regs[13] = ADF5356_REG13_AUX_FRAC_MSB_VALUE_UPDATE(
self.regs[13], frac2_msb
)
self.regs[13] = ADF5356_REG13_AUX_MOD_MSB_VALUE_UPDATE(self.regs[13], mod2_msb)
self.regs[6] = ADF5356_REG6_RF_DIVIDER_SELECT_UPDATE(self.regs[6], rf_div_sel)
self.regs[6] = ADF5356_REG6_CP_BLEED_CURRENT_UPDATE(
self.regs[6], int32(floor(24 * f_pfd / (61.44 * MHz)))
)
self.regs[9] = ADF5356_REG9_VCO_BAND_DIVISION_UPDATE(
self.regs[9], int32(ceil(f_pfd / 160e3))
)
# commit
self.sync()
@kernel
def sync(self):
"""
Write all registers to the device. Attempts to lock the PLL.
"""
f_pfd = self.f_pfd()
delay(200 * us) # Slack
if f_pfd <= 75.0 * MHz:
for i in range(13, 0, -1):
self.write(self.regs[i])
delay(200 * us)
self.write(self.regs[0] | ADF5356_REG0_AUTOCAL(1))
else:
# AUTOCAL AT HALF PFD FREQUENCY
# calculate PLL at f_pfd/2
n, frac1, (frac2_msb, frac2_lsb), (mod2_msb, mod2_lsb) = calculate_pll(
self.f_vco(), f_pfd >> 1
)
delay(200 * us) # Slack
self.write(
13
| ADF5356_REG13_AUX_FRAC_MSB_VALUE(frac2_msb)
| ADF5356_REG13_AUX_MOD_MSB_VALUE(mod2_msb)
)
for i in range(12, 4, -1):
self.write(self.regs[i])
self.write(
ADF5356_REG4_R_COUNTER_UPDATE(self.regs[4], 2 * self.ref_counter())
)
self.write(self.regs[3])
self.write(
2
| ADF5356_REG2_AUX_MOD_LSB_VALUE(mod2_lsb)
| ADF5356_REG2_AUX_FRAC_LSB_VALUE(frac2_lsb)
)
self.write(1 | ADF5356_REG1_MAIN_FRAC_VALUE(frac1))
delay(200 * us)
self.write(ADF5356_REG0_INT_VALUE(n) | ADF5356_REG0_AUTOCAL(1))
# RELOCK AT WANTED PFD FREQUENCY
for i in [4, 2, 1]:
self.write(self.regs[i])
# force-disable autocal
self.write(self.regs[0] & ~ADF5356_REG0_AUTOCAL(1))
@portable
def f_pfd(self) -> TInt64:
"""
Return the PFD frequency for the cached set of registers.
"""
r = ADF5356_REG4_R_COUNTER_GET(self.regs[4])
d = ADF5356_REG4_R_DOUBLER_GET(self.regs[4])
t = ADF5356_REG4_R_DIVIDER_GET(self.regs[4])
return self._compute_pfd_frequency(r, d, t)
@portable
def f_vco(self) -> TInt64:
"""
Return the VCO frequency for the cached set of registers.
"""
return int64(
self.f_pfd()
* (
self.pll_n()
+ (self.pll_frac1() + self.pll_frac2() / self.pll_mod2())
/ ADF5356_MODULUS1
)
)
@portable
def pll_n(self) -> TInt32:
"""
Return the PLL integer value (INT) for the cached set of registers.
"""
return ADF5356_REG0_INT_VALUE_GET(self.regs[0])
@portable
def pll_frac1(self) -> TInt32:
"""
Return the main fractional value (FRAC1) for the cached set of registers.
"""
return ADF5356_REG1_MAIN_FRAC_VALUE_GET(self.regs[1])
@portable
def pll_frac2(self) -> TInt32:
"""
Return the auxiliary fractional value (FRAC2) for the cached set of registers.
"""
return (
ADF5356_REG13_AUX_FRAC_MSB_VALUE_GET(self.regs[13]) << 14
) | ADF5356_REG2_AUX_FRAC_LSB_VALUE_GET(self.regs[2])
@portable
def pll_mod2(self) -> TInt32:
"""
Return the auxiliary modulus value (MOD2) for the cached set of registers.
"""
return (
ADF5356_REG13_AUX_MOD_MSB_VALUE_GET(self.regs[13]) << 14
) | ADF5356_REG2_AUX_MOD_LSB_VALUE_GET(self.regs[2])
@portable
def ref_counter(self) -> TInt32:
"""
Return the reference counter value (R) for the cached set of registers.
"""
return ADF5356_REG4_R_COUNTER_GET(self.regs[4])
@portable
def output_divider(self) -> TInt32:
"""
Return the value of the output A divider.
"""
return 1 << ADF5356_REG6_RF_DIVIDER_SELECT_GET(self.regs[6])
def info(self):
"""
Return a summary of high-level parameters as a dict.
"""
prescaler = ADF5356_REG0_PRESCALER_GET(self.regs[0])
return {
# output
"f_outA": self.f_vco() / self.output_divider(),
"f_outB": self.f_vco() * 2,
"output_divider": self.output_divider(),
# PLL parameters
"f_vco": self.f_vco(),
"pll_n": self.pll_n(),
"pll_frac1": self.pll_frac1(),
"pll_frac2": self.pll_frac2(),
"pll_mod2": self.pll_mod2(),
"prescaler": "4/5" if prescaler == 0 else "8/9",
# reference / PFD
"sysclk": self.sysclk,
"ref_doubler": self.ref_doubler,
"ref_divider": self.ref_divider,
"ref_counter": self.ref_counter(),
"f_pfd": self.f_pfd(),
}
@portable
def _init_registers(self):
"""
Initialize cached registers with sensible defaults.
"""
# fill with control bits
self.regs = [int32(i) for i in range(ADF5356_NUM_REGS)]
# REG2
# ====
# avoid divide-by-zero
self.regs[2] |= ADF5356_REG2_AUX_MOD_LSB_VALUE(1)
# REG4
# ====
# single-ended reference mode is recommended
# for references up to 250 MHz, even if the signal is differential
if self.sysclk <= 250 * MHz:
self.regs[4] |= ADF5356_REG4_REF_MODE(0)
else:
self.regs[4] |= ADF5356_REG4_REF_MODE(1)
# phase detector polarity: positive
self.regs[4] |= ADF5356_REG4_PD_POLARITY(1)
# charge pump current: 0.94 mA
self.regs[4] |= ADF5356_REG4_CURRENT_SETTING(2)
# MUXOUT: digital lock detect
self.regs[4] |= ADF5356_REG4_MUX_LOGIC(1) # 3v3 logic
self.regs[4] |= ADF5356_REG4_MUXOUT(6)
# setup reference path
if self.ref_doubler:
self.regs[4] |= ADF5356_REG4_R_DOUBLER(1)
if self.ref_divider:
self.regs[4] |= ADF5356_REG4_R_DIVIDER(1)
r = self._compute_reference_counter()
self.regs[4] |= ADF5356_REG4_R_COUNTER(r)
# REG5
# ====
# reserved values
self.regs[5] = int32(0x800025)
# REG6
# ====
# reserved values
self.regs[6] = int32(0x14000006)
# enable negative bleed
self.regs[6] |= ADF5356_REG6_NEGATIVE_BLEED(1)
# charge pump bleed current
self.regs[6] |= ADF5356_REG6_CP_BLEED_CURRENT(
int32(floor(24 * self.f_pfd() / (61.44 * MHz)))
)
# direct feedback from VCO to N counter
self.regs[6] |= ADF5356_REG6_FB_SELECT(1)
# mute until the PLL is locked
self.regs[6] |= ADF5356_REG6_MUTE_TILL_LD(1)
# enable output A
self.regs[6] |= ADF5356_REG6_RF_OUTPUT_A_ENABLE(1)
# set output A power to max power, is adjusted by extra attenuator
self.regs[6] |= ADF5356_REG6_RF_OUTPUT_A_POWER(3) # +5 dBm
# REG7
# ====
# reserved values
self.regs[7] = int32(0x10000007)
# sync load-enable to reference
self.regs[7] |= ADF5356_REG7_LE_SYNC(1)
# frac-N lock-detect precision: 12 ns
self.regs[7] |= ADF5356_REG7_FRAC_N_LD_PRECISION(3)
# REG8
# ====
# reserved values
self.regs[8] = int32(0x102D0428)
# REG9
# ====
# default timeouts (from eval software)
self.regs[9] |= (
ADF5356_REG9_SYNTH_LOCK_TIMEOUT(13)
| ADF5356_REG9_AUTOCAL_TIMEOUT(31)
| ADF5356_REG9_TIMEOUT(0x67)
)
self.regs[9] |= ADF5356_REG9_VCO_BAND_DIVISION(
int32(ceil(self.f_pfd() / 160e3))
)
# REG10
# =====
# reserved values
self.regs[10] = int32(0xC0000A)
# ADC defaults (from eval software)
self.regs[10] |= (
ADF5356_REG10_ADC_ENABLE(1)
| ADF5356_REG10_ADC_CLK_DIV(256)
| ADF5356_REG10_ADC_CONV(1)
)
# REG11
# =====
# reserved values
self.regs[11] = int32(0x61200B)
# REG12
# =====
# reserved values
self.regs[12] = int32(0x15FC)
@portable
def _compute_pfd_frequency(self, r, d, t) -> TInt64:
"""
Calculate the PFD frequency from the given reference path parameters
"""
return int64(self.sysclk * ((1 + d) / (r * (1 + t))))
@portable
def _compute_reference_counter(self) -> TInt32:
"""
Determine the reference counter R that maximizes the PFD frequency
"""
d = ADF5356_REG4_R_DOUBLER_GET(self.regs[4])
t = ADF5356_REG4_R_DIVIDER_GET(self.regs[4])
r = 1
while self._compute_pfd_frequency(r, d, t) > ADF5356_MAX_FREQ_PFD:
r += 1
return int32(r)
@portable
def gcd(a, b):
while b:
a, b = b, a % b
return a
@portable
def split_msb_lsb_28b(v):
return int32((v >> 14) & 0x3FFF), int32(v & 0x3FFF)
@portable
def calculate_pll(f_vco: TInt64, f_pfd: TInt64):
"""
Calculate fractional-N PLL parameters such that
``f_vco`` = ``f_pfd`` * (``n`` + (``frac1`` + ``frac2``/``mod2``) / ``mod1``)
where
``mod1 = 2**24`` and ``mod2 <= 2**28``
:param f_vco: target VCO frequency
:param f_pfd: PFD frequency
:return: ``(n, frac1, (frac2_msb, frac2_lsb), (mod2_msb, mod2_lsb))``
"""
f_pfd = int64(f_pfd)
f_vco = int64(f_vco)
# integral part
n, r = int32(f_vco // f_pfd), f_vco % f_pfd
# main fractional part
r *= ADF5356_MODULUS1
frac1, frac2 = int32(r // f_pfd), r % f_pfd
# auxiliary fractional part
mod2 = f_pfd
while mod2 > ADF5356_MAX_MODULUS2:
mod2 >>= 1
frac2 >>= 1
gcd_div = gcd(frac2, mod2)
mod2 //= gcd_div
frac2 //= gcd_div
return n, frac1, split_msb_lsb_28b(frac2), split_msb_lsb_28b(mod2)

View File

@ -0,0 +1,642 @@
# auto-generated, do not edit
from artiq.language.core import portable
from artiq.language.types import TInt32
from numpy import int32
@portable
def ADF5356_REG0_AUTOCAL_GET(reg: TInt32) -> TInt32:
return int32((reg >> 21) & 0x1)
@portable
def ADF5356_REG0_AUTOCAL(x: TInt32) -> TInt32:
return int32((x & 0x1) << 21)
@portable
def ADF5356_REG0_AUTOCAL_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1 << 21)) | ((x & 0x1) << 21))
@portable
def ADF5356_REG0_INT_VALUE_GET(reg: TInt32) -> TInt32:
return int32((reg >> 4) & 0xffff)
@portable
def ADF5356_REG0_INT_VALUE(x: TInt32) -> TInt32:
return int32((x & 0xffff) << 4)
@portable
def ADF5356_REG0_INT_VALUE_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0xffff << 4)) | ((x & 0xffff) << 4))
@portable
def ADF5356_REG0_PRESCALER_GET(reg: TInt32) -> TInt32:
return int32((reg >> 20) & 0x1)
@portable
def ADF5356_REG0_PRESCALER(x: TInt32) -> TInt32:
return int32((x & 0x1) << 20)
@portable
def ADF5356_REG0_PRESCALER_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1 << 20)) | ((x & 0x1) << 20))
@portable
def ADF5356_REG1_MAIN_FRAC_VALUE_GET(reg: TInt32) -> TInt32:
return int32((reg >> 4) & 0xffffff)
@portable
def ADF5356_REG1_MAIN_FRAC_VALUE(x: TInt32) -> TInt32:
return int32((x & 0xffffff) << 4)
@portable
def ADF5356_REG1_MAIN_FRAC_VALUE_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0xffffff << 4)) | ((x & 0xffffff) << 4))
@portable
def ADF5356_REG2_AUX_FRAC_LSB_VALUE_GET(reg: TInt32) -> TInt32:
return int32((reg >> 18) & 0x3fff)
@portable
def ADF5356_REG2_AUX_FRAC_LSB_VALUE(x: TInt32) -> TInt32:
return int32((x & 0x3fff) << 18)
@portable
def ADF5356_REG2_AUX_FRAC_LSB_VALUE_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x3fff << 18)) | ((x & 0x3fff) << 18))
@portable
def ADF5356_REG2_AUX_MOD_LSB_VALUE_GET(reg: TInt32) -> TInt32:
return int32((reg >> 4) & 0x3fff)
@portable
def ADF5356_REG2_AUX_MOD_LSB_VALUE(x: TInt32) -> TInt32:
return int32((x & 0x3fff) << 4)
@portable
def ADF5356_REG2_AUX_MOD_LSB_VALUE_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x3fff << 4)) | ((x & 0x3fff) << 4))
@portable
def ADF5356_REG3_PHASE_ADJUST_GET(reg: TInt32) -> TInt32:
return int32((reg >> 28) & 0x1)
@portable
def ADF5356_REG3_PHASE_ADJUST(x: TInt32) -> TInt32:
return int32((x & 0x1) << 28)
@portable
def ADF5356_REG3_PHASE_ADJUST_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1 << 28)) | ((x & 0x1) << 28))
@portable
def ADF5356_REG3_PHASE_RESYNC_GET(reg: TInt32) -> TInt32:
return int32((reg >> 29) & 0x1)
@portable
def ADF5356_REG3_PHASE_RESYNC(x: TInt32) -> TInt32:
return int32((x & 0x1) << 29)
@portable
def ADF5356_REG3_PHASE_RESYNC_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1 << 29)) | ((x & 0x1) << 29))
@portable
def ADF5356_REG3_PHASE_VALUE_GET(reg: TInt32) -> TInt32:
return int32((reg >> 4) & 0xffffff)
@portable
def ADF5356_REG3_PHASE_VALUE(x: TInt32) -> TInt32:
return int32((x & 0xffffff) << 4)
@portable
def ADF5356_REG3_PHASE_VALUE_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0xffffff << 4)) | ((x & 0xffffff) << 4))
@portable
def ADF5356_REG3_SD_LOAD_RESET_GET(reg: TInt32) -> TInt32:
return int32((reg >> 30) & 0x1)
@portable
def ADF5356_REG3_SD_LOAD_RESET(x: TInt32) -> TInt32:
return int32((x & 0x1) << 30)
@portable
def ADF5356_REG3_SD_LOAD_RESET_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1 << 30)) | ((x & 0x1) << 30))
@portable
def ADF5356_REG4_COUNTER_RESET_GET(reg: TInt32) -> TInt32:
return int32((reg >> 4) & 0x1)
@portable
def ADF5356_REG4_COUNTER_RESET(x: TInt32) -> TInt32:
return int32((x & 0x1) << 4)
@portable
def ADF5356_REG4_COUNTER_RESET_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1 << 4)) | ((x & 0x1) << 4))
@portable
def ADF5356_REG4_CP_THREE_STATE_GET(reg: TInt32) -> TInt32:
return int32((reg >> 5) & 0x1)
@portable
def ADF5356_REG4_CP_THREE_STATE(x: TInt32) -> TInt32:
return int32((x & 0x1) << 5)
@portable
def ADF5356_REG4_CP_THREE_STATE_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1 << 5)) | ((x & 0x1) << 5))
@portable
def ADF5356_REG4_CURRENT_SETTING_GET(reg: TInt32) -> TInt32:
return int32((reg >> 10) & 0xf)
@portable
def ADF5356_REG4_CURRENT_SETTING(x: TInt32) -> TInt32:
return int32((x & 0xf) << 10)
@portable
def ADF5356_REG4_CURRENT_SETTING_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0xf << 10)) | ((x & 0xf) << 10))
@portable
def ADF5356_REG4_DOUBLE_BUFF_GET(reg: TInt32) -> TInt32:
return int32((reg >> 14) & 0x1)
@portable
def ADF5356_REG4_DOUBLE_BUFF(x: TInt32) -> TInt32:
return int32((x & 0x1) << 14)
@portable
def ADF5356_REG4_DOUBLE_BUFF_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1 << 14)) | ((x & 0x1) << 14))
@portable
def ADF5356_REG4_MUX_LOGIC_GET(reg: TInt32) -> TInt32:
return int32((reg >> 8) & 0x1)
@portable
def ADF5356_REG4_MUX_LOGIC(x: TInt32) -> TInt32:
return int32((x & 0x1) << 8)
@portable
def ADF5356_REG4_MUX_LOGIC_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1 << 8)) | ((x & 0x1) << 8))
@portable
def ADF5356_REG4_MUXOUT_GET(reg: TInt32) -> TInt32:
return int32((reg >> 27) & 0x7)
@portable
def ADF5356_REG4_MUXOUT(x: TInt32) -> TInt32:
return int32((x & 0x7) << 27)
@portable
def ADF5356_REG4_MUXOUT_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x7 << 27)) | ((x & 0x7) << 27))
@portable
def ADF5356_REG4_PD_POLARITY_GET(reg: TInt32) -> TInt32:
return int32((reg >> 7) & 0x1)
@portable
def ADF5356_REG4_PD_POLARITY(x: TInt32) -> TInt32:
return int32((x & 0x1) << 7)
@portable
def ADF5356_REG4_PD_POLARITY_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1 << 7)) | ((x & 0x1) << 7))
@portable
def ADF5356_REG4_POWER_DOWN_GET(reg: TInt32) -> TInt32:
return int32((reg >> 6) & 0x1)
@portable
def ADF5356_REG4_POWER_DOWN(x: TInt32) -> TInt32:
return int32((x & 0x1) << 6)
@portable
def ADF5356_REG4_POWER_DOWN_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1 << 6)) | ((x & 0x1) << 6))
@portable
def ADF5356_REG4_R_COUNTER_GET(reg: TInt32) -> TInt32:
return int32((reg >> 15) & 0x3ff)
@portable
def ADF5356_REG4_R_COUNTER(x: TInt32) -> TInt32:
return int32((x & 0x3ff) << 15)
@portable
def ADF5356_REG4_R_COUNTER_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x3ff << 15)) | ((x & 0x3ff) << 15))
@portable
def ADF5356_REG4_R_DIVIDER_GET(reg: TInt32) -> TInt32:
return int32((reg >> 25) & 0x1)
@portable
def ADF5356_REG4_R_DIVIDER(x: TInt32) -> TInt32:
return int32((x & 0x1) << 25)
@portable
def ADF5356_REG4_R_DIVIDER_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1 << 25)) | ((x & 0x1) << 25))
@portable
def ADF5356_REG4_R_DOUBLER_GET(reg: TInt32) -> TInt32:
return int32((reg >> 26) & 0x1)
@portable
def ADF5356_REG4_R_DOUBLER(x: TInt32) -> TInt32:
return int32((x & 0x1) << 26)
@portable
def ADF5356_REG4_R_DOUBLER_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1 << 26)) | ((x & 0x1) << 26))
@portable
def ADF5356_REG4_REF_MODE_GET(reg: TInt32) -> TInt32:
return int32((reg >> 9) & 0x1)
@portable
def ADF5356_REG4_REF_MODE(x: TInt32) -> TInt32:
return int32((x & 0x1) << 9)
@portable
def ADF5356_REG4_REF_MODE_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1 << 9)) | ((x & 0x1) << 9))
@portable
def ADF5356_REG6_BLEED_POLARITY_GET(reg: TInt32) -> TInt32:
return int32((reg >> 31) & 0x1)
@portable
def ADF5356_REG6_BLEED_POLARITY(x: TInt32) -> TInt32:
return int32((x & 0x1) << 31)
@portable
def ADF5356_REG6_BLEED_POLARITY_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1 << 31)) | ((x & 0x1) << 31))
@portable
def ADF5356_REG6_CP_BLEED_CURRENT_GET(reg: TInt32) -> TInt32:
return int32((reg >> 13) & 0xff)
@portable
def ADF5356_REG6_CP_BLEED_CURRENT(x: TInt32) -> TInt32:
return int32((x & 0xff) << 13)
@portable
def ADF5356_REG6_CP_BLEED_CURRENT_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0xff << 13)) | ((x & 0xff) << 13))
@portable
def ADF5356_REG6_FB_SELECT_GET(reg: TInt32) -> TInt32:
return int32((reg >> 24) & 0x1)
@portable
def ADF5356_REG6_FB_SELECT(x: TInt32) -> TInt32:
return int32((x & 0x1) << 24)
@portable
def ADF5356_REG6_FB_SELECT_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1 << 24)) | ((x & 0x1) << 24))
@portable
def ADF5356_REG6_GATE_BLEED_GET(reg: TInt32) -> TInt32:
return int32((reg >> 30) & 0x1)
@portable
def ADF5356_REG6_GATE_BLEED(x: TInt32) -> TInt32:
return int32((x & 0x1) << 30)
@portable
def ADF5356_REG6_GATE_BLEED_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1 << 30)) | ((x & 0x1) << 30))
@portable
def ADF5356_REG6_MUTE_TILL_LD_GET(reg: TInt32) -> TInt32:
return int32((reg >> 11) & 0x1)
@portable
def ADF5356_REG6_MUTE_TILL_LD(x: TInt32) -> TInt32:
return int32((x & 0x1) << 11)
@portable
def ADF5356_REG6_MUTE_TILL_LD_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1 << 11)) | ((x & 0x1) << 11))
@portable
def ADF5356_REG6_NEGATIVE_BLEED_GET(reg: TInt32) -> TInt32:
return int32((reg >> 29) & 0x1)
@portable
def ADF5356_REG6_NEGATIVE_BLEED(x: TInt32) -> TInt32:
return int32((x & 0x1) << 29)
@portable
def ADF5356_REG6_NEGATIVE_BLEED_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1 << 29)) | ((x & 0x1) << 29))
@portable
def ADF5356_REG6_RF_DIVIDER_SELECT_GET(reg: TInt32) -> TInt32:
return int32((reg >> 21) & 0x7)
@portable
def ADF5356_REG6_RF_DIVIDER_SELECT(x: TInt32) -> TInt32:
return int32((x & 0x7) << 21)
@portable
def ADF5356_REG6_RF_DIVIDER_SELECT_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x7 << 21)) | ((x & 0x7) << 21))
@portable
def ADF5356_REG6_RF_OUTPUT_A_ENABLE_GET(reg: TInt32) -> TInt32:
return int32((reg >> 6) & 0x1)
@portable
def ADF5356_REG6_RF_OUTPUT_A_ENABLE(x: TInt32) -> TInt32:
return int32((x & 0x1) << 6)
@portable
def ADF5356_REG6_RF_OUTPUT_A_ENABLE_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1 << 6)) | ((x & 0x1) << 6))
@portable
def ADF5356_REG6_RF_OUTPUT_A_POWER_GET(reg: TInt32) -> TInt32:
return int32((reg >> 4) & 0x3)
@portable
def ADF5356_REG6_RF_OUTPUT_A_POWER(x: TInt32) -> TInt32:
return int32((x & 0x3) << 4)
@portable
def ADF5356_REG6_RF_OUTPUT_A_POWER_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x3 << 4)) | ((x & 0x3) << 4))
@portable
def ADF5356_REG6_RF_OUTPUT_B_ENABLE_GET(reg: TInt32) -> TInt32:
return int32((reg >> 10) & 0x1)
@portable
def ADF5356_REG6_RF_OUTPUT_B_ENABLE(x: TInt32) -> TInt32:
return int32((x & 0x1) << 10)
@portable
def ADF5356_REG6_RF_OUTPUT_B_ENABLE_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1 << 10)) | ((x & 0x1) << 10))
@portable
def ADF5356_REG7_FRAC_N_LD_PRECISION_GET(reg: TInt32) -> TInt32:
return int32((reg >> 5) & 0x3)
@portable
def ADF5356_REG7_FRAC_N_LD_PRECISION(x: TInt32) -> TInt32:
return int32((x & 0x3) << 5)
@portable
def ADF5356_REG7_FRAC_N_LD_PRECISION_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x3 << 5)) | ((x & 0x3) << 5))
@portable
def ADF5356_REG7_LD_CYCLE_COUNT_GET(reg: TInt32) -> TInt32:
return int32((reg >> 8) & 0x3)
@portable
def ADF5356_REG7_LD_CYCLE_COUNT(x: TInt32) -> TInt32:
return int32((x & 0x3) << 8)
@portable
def ADF5356_REG7_LD_CYCLE_COUNT_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x3 << 8)) | ((x & 0x3) << 8))
@portable
def ADF5356_REG7_LD_MODE_GET(reg: TInt32) -> TInt32:
return int32((reg >> 4) & 0x1)
@portable
def ADF5356_REG7_LD_MODE(x: TInt32) -> TInt32:
return int32((x & 0x1) << 4)
@portable
def ADF5356_REG7_LD_MODE_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1 << 4)) | ((x & 0x1) << 4))
@portable
def ADF5356_REG7_LE_SEL_SYNC_EDGE_GET(reg: TInt32) -> TInt32:
return int32((reg >> 27) & 0x1)
@portable
def ADF5356_REG7_LE_SEL_SYNC_EDGE(x: TInt32) -> TInt32:
return int32((x & 0x1) << 27)
@portable
def ADF5356_REG7_LE_SEL_SYNC_EDGE_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1 << 27)) | ((x & 0x1) << 27))
@portable
def ADF5356_REG7_LE_SYNC_GET(reg: TInt32) -> TInt32:
return int32((reg >> 25) & 0x1)
@portable
def ADF5356_REG7_LE_SYNC(x: TInt32) -> TInt32:
return int32((x & 0x1) << 25)
@portable
def ADF5356_REG7_LE_SYNC_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1 << 25)) | ((x & 0x1) << 25))
@portable
def ADF5356_REG7_LOL_MODE_GET(reg: TInt32) -> TInt32:
return int32((reg >> 7) & 0x1)
@portable
def ADF5356_REG7_LOL_MODE(x: TInt32) -> TInt32:
return int32((x & 0x1) << 7)
@portable
def ADF5356_REG7_LOL_MODE_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1 << 7)) | ((x & 0x1) << 7))
@portable
def ADF5356_REG9_AUTOCAL_TIMEOUT_GET(reg: TInt32) -> TInt32:
return int32((reg >> 9) & 0x1f)
@portable
def ADF5356_REG9_AUTOCAL_TIMEOUT(x: TInt32) -> TInt32:
return int32((x & 0x1f) << 9)
@portable
def ADF5356_REG9_AUTOCAL_TIMEOUT_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1f << 9)) | ((x & 0x1f) << 9))
@portable
def ADF5356_REG9_SYNTH_LOCK_TIMEOUT_GET(reg: TInt32) -> TInt32:
return int32((reg >> 4) & 0x1f)
@portable
def ADF5356_REG9_SYNTH_LOCK_TIMEOUT(x: TInt32) -> TInt32:
return int32((x & 0x1f) << 4)
@portable
def ADF5356_REG9_SYNTH_LOCK_TIMEOUT_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1f << 4)) | ((x & 0x1f) << 4))
@portable
def ADF5356_REG9_TIMEOUT_GET(reg: TInt32) -> TInt32:
return int32((reg >> 14) & 0x3ff)
@portable
def ADF5356_REG9_TIMEOUT(x: TInt32) -> TInt32:
return int32((x & 0x3ff) << 14)
@portable
def ADF5356_REG9_TIMEOUT_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x3ff << 14)) | ((x & 0x3ff) << 14))
@portable
def ADF5356_REG9_VCO_BAND_DIVISION_GET(reg: TInt32) -> TInt32:
return int32((reg >> 24) & 0xff)
@portable
def ADF5356_REG9_VCO_BAND_DIVISION(x: TInt32) -> TInt32:
return int32((x & 0xff) << 24)
@portable
def ADF5356_REG9_VCO_BAND_DIVISION_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0xff << 24)) | ((x & 0xff) << 24))
@portable
def ADF5356_REG10_ADC_CLK_DIV_GET(reg: TInt32) -> TInt32:
return int32((reg >> 6) & 0xff)
@portable
def ADF5356_REG10_ADC_CLK_DIV(x: TInt32) -> TInt32:
return int32((x & 0xff) << 6)
@portable
def ADF5356_REG10_ADC_CLK_DIV_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0xff << 6)) | ((x & 0xff) << 6))
@portable
def ADF5356_REG10_ADC_CONV_GET(reg: TInt32) -> TInt32:
return int32((reg >> 5) & 0x1)
@portable
def ADF5356_REG10_ADC_CONV(x: TInt32) -> TInt32:
return int32((x & 0x1) << 5)
@portable
def ADF5356_REG10_ADC_CONV_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1 << 5)) | ((x & 0x1) << 5))
@portable
def ADF5356_REG10_ADC_ENABLE_GET(reg: TInt32) -> TInt32:
return int32((reg >> 4) & 0x1)
@portable
def ADF5356_REG10_ADC_ENABLE(x: TInt32) -> TInt32:
return int32((x & 0x1) << 4)
@portable
def ADF5356_REG10_ADC_ENABLE_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1 << 4)) | ((x & 0x1) << 4))
@portable
def ADF5356_REG11_VCO_BAND_HOLD_GET(reg: TInt32) -> TInt32:
return int32((reg >> 24) & 0x1)
@portable
def ADF5356_REG11_VCO_BAND_HOLD(x: TInt32) -> TInt32:
return int32((x & 0x1) << 24)
@portable
def ADF5356_REG11_VCO_BAND_HOLD_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x1 << 24)) | ((x & 0x1) << 24))
@portable
def ADF5356_REG12_PHASE_RESYNC_CLK_VALUE_GET(reg: TInt32) -> TInt32:
return int32((reg >> 12) & 0xfffff)
@portable
def ADF5356_REG12_PHASE_RESYNC_CLK_VALUE(x: TInt32) -> TInt32:
return int32((x & 0xfffff) << 12)
@portable
def ADF5356_REG12_PHASE_RESYNC_CLK_VALUE_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0xfffff << 12)) | ((x & 0xfffff) << 12))
@portable
def ADF5356_REG13_AUX_FRAC_MSB_VALUE_GET(reg: TInt32) -> TInt32:
return int32((reg >> 18) & 0x3fff)
@portable
def ADF5356_REG13_AUX_FRAC_MSB_VALUE(x: TInt32) -> TInt32:
return int32((x & 0x3fff) << 18)
@portable
def ADF5356_REG13_AUX_FRAC_MSB_VALUE_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x3fff << 18)) | ((x & 0x3fff) << 18))
@portable
def ADF5356_REG13_AUX_MOD_MSB_VALUE_GET(reg: TInt32) -> TInt32:
return int32((reg >> 4) & 0x3fff)
@portable
def ADF5356_REG13_AUX_MOD_MSB_VALUE(x: TInt32) -> TInt32:
return int32((x & 0x3fff) << 4)
@portable
def ADF5356_REG13_AUX_MOD_MSB_VALUE_UPDATE(reg: TInt32, x: TInt32) -> TInt32:
return int32((reg & ~(0x3fff << 4)) | ((x & 0x3fff) << 4))
ADF5356_NUM_REGS = 14

185
artiq/coredevice/almazny.py Normal file
View File

@ -0,0 +1,185 @@
from artiq.language.core import kernel, portable
from numpy import int32
# almazny-specific data
ALMAZNY_LEGACY_REG_BASE = 0x0C
ALMAZNY_LEGACY_OE_SHIFT = 12
# higher SPI write divider to match almazny shift register timing
# min SER time before SRCLK rise = 125ns
# -> div=32 gives 125ns for data before clock rise
# works at faster dividers too but could be less reliable
ALMAZNY_LEGACY_SPIT_WR = 32
class AlmaznyLegacy:
"""
Almazny (High frequency mezzanine board for Mirny)
This applies to Almazny hardware v1.1 and earlier.
Use :class:`artiq.coredevice.almazny.AlmaznyChannel` for Almazny v1.2 and later.
:param host_mirny: Mirny device Almazny is connected to
"""
def __init__(self, dmgr, host_mirny):
self.mirny_cpld = dmgr.get(host_mirny)
self.att_mu = [0x3f] * 4
self.channel_sw = [0] * 4
self.output_enable = False
@kernel
def init(self):
self.output_toggle(self.output_enable)
@kernel
def att_to_mu(self, att):
"""
Convert an attenuator setting in dB to machine units.
:param att: attenuator setting in dB [0-31.5]
:return: attenuator setting in machine units
"""
mu = round(att * 2.0)
if mu > 63 or mu < 0:
raise ValueError("Invalid Almazny attenuator settings!")
return mu
@kernel
def mu_to_att(self, att_mu):
"""
Convert a digital attenuator setting to dB.
:param att_mu: attenuator setting in machine units
:return: attenuator setting in dB
"""
return att_mu / 2
@kernel
def set_att(self, channel, att, rf_switch=True):
"""
Sets attenuators on chosen shift register (channel).
:param channel: index of the register [0-3]
:param att: attenuation setting in dBm [0-31.5]
:param rf_switch: rf switch (bool)
"""
self.set_att_mu(channel, self.att_to_mu(att), rf_switch)
@kernel
def set_att_mu(self, channel, att_mu, rf_switch=True):
"""
Sets attenuators on chosen shift register (channel).
:param channel: index of the register [0-3]
:param att_mu: attenuation setting in machine units [0-63]
:param rf_switch: rf switch (bool)
"""
self.channel_sw[channel] = 1 if rf_switch else 0
self.att_mu[channel] = att_mu
self._update_register(channel)
@kernel
def output_toggle(self, oe):
"""
Toggles output on all shift registers on or off.
:param oe: toggle output enable (bool)
"""
self.output_enable = oe
cfg_reg = self.mirny_cpld.read_reg(1)
en = 1 if self.output_enable else 0
delay(100 * us)
new_reg = (en << ALMAZNY_LEGACY_OE_SHIFT) | (cfg_reg & 0x3FF)
self.mirny_cpld.write_reg(1, new_reg)
delay(100 * us)
@kernel
def _flip_mu_bits(self, mu):
# in this form MSB is actually 0.5dB attenuator
# unnatural for users, so we flip the six bits
return (((mu & 0x01) << 5)
| ((mu & 0x02) << 3)
| ((mu & 0x04) << 1)
| ((mu & 0x08) >> 1)
| ((mu & 0x10) >> 3)
| ((mu & 0x20) >> 5))
@kernel
def _update_register(self, ch):
self.mirny_cpld.write_ext(
ALMAZNY_LEGACY_REG_BASE + ch,
8,
self._flip_mu_bits(self.att_mu[ch]) | (self.channel_sw[ch] << 6),
ALMAZNY_LEGACY_SPIT_WR
)
delay(100 * us)
@kernel
def _update_all_registers(self):
for i in range(4):
self._update_register(i)
class AlmaznyChannel:
"""
One Almazny channel
Almazny is a mezzanine for the Quad PLL RF source Mirny that exposes and
controls the frequency-doubled outputs.
This driver requires Almazny hardware revision v1.2 or later
and Mirny CPLD gateware v0.3 or later.
Use :class:`artiq.coredevice.almazny.AlmaznyLegacy` for Almazny hardware v1.1 and earlier.
:param host_mirny: Mirny CPLD device name
:param channel: channel index (0-3)
"""
def __init__(self, dmgr, host_mirny, channel):
self.channel = channel
self.mirny_cpld = dmgr.get(host_mirny)
@portable
def to_mu(self, att, enable, led):
"""
Convert an attenuation in dB, RF switch state and LED state to machine
units.
:param att: attenuator setting in dB (0-31.5)
:param enable: RF switch state (bool)
:param led: LED state (bool)
:return: channel setting in machine units
"""
mu = int32(round(att * 2.))
if mu >= 64 or mu < 0:
raise ValueError("Attenuation out of range")
# unfortunate hardware design: bit reverse
mu = ((mu & 0x15) << 1) | ((mu >> 1) & 0x15)
mu = ((mu & 0x03) << 4) | (mu & 0x0c) | ((mu >> 4) & 0x03)
if enable:
mu |= 1 << 6
if led:
mu |= 1 << 7
return mu
@kernel
def set_mu(self, mu):
"""
Set channel state (machine units).
:param mu: channel state in machine units.
"""
self.mirny_cpld.write_ext(
addr=0xc + self.channel, length=8, data=mu, ext_div=32)
@kernel
def set(self, att, enable, led=False):
"""
Set attenuation, RF switch, and LED state (SI units).
:param att: attenuator setting in dB (0-31.5)
:param enable: RF switch state (bool)
:param led: LED state (bool)
"""
self.set_mu(self.to_mu(att, enable, led))

View File

@ -2,11 +2,11 @@ from artiq.language.core import *
from artiq.language.types import *
@syscall(flags={"nounwind", "nowrite"})
@syscall(flags={"nounwind"})
def cache_get(key: TStr) -> TList(TInt32):
raise NotImplementedError("syscall not simulated")
@syscall(flags={"nowrite"})
@syscall
def cache_put(key: TStr, value: TList(TInt32)) -> TNone:
raise NotImplementedError("syscall not simulated")

View File

@ -1,15 +1,53 @@
from operator import itemgetter
from collections import namedtuple
from itertools import count
from contextlib import contextmanager
from enum import Enum
import struct
import logging
from artiq.protocols.analyzer import MessageType, ExceptionType
import socket
logger = logging.getLogger(__name__)
class MessageType(Enum):
output = 0b00
input = 0b01
exception = 0b10
stopped = 0b11
class ExceptionType(Enum):
legacy_reset = 0b000000
legacy_reset_falling = 0b000001
legacy_reset_phy = 0b000010
legacy_reset_phy_falling = 0b000011
legacy_o_underflow_reset = 0b010000
legacy_o_sequence_error_reset = 0b010001
legacy_o_collision_reset = 0b010010
legacy_i_overflow_reset = 0b100000
legacy_o_sequence_error = 0b010101
o_underflow = 0b010100
i_overflow = 0b100001
def get_analyzer_dump(host, port=1382):
sock = socket.create_connection((host, port))
try:
r = bytes()
while True:
buf = sock.recv(8192)
if not buf:
break
r += buf
finally:
sock.close()
return r
OutputMessage = namedtuple(
"OutputMessage", "channel timestamp rtio_counter address data")
@ -52,18 +90,28 @@ DecodedDump = namedtuple(
def decode_dump(data):
parts = struct.unpack(">IQbbb", data[:15])
# extract endian byte
if data[0] == ord('E'):
endian = '>'
elif data[0] == ord('e'):
endian = '<'
else:
raise ValueError
data = data[1:]
# only header is device endian
# messages are big endian
parts = struct.unpack(endian + "IQbbb", data[:15])
(sent_bytes, total_byte_count,
overflow_occured, log_channel, dds_onehot_sel) = parts
error_occurred, log_channel, dds_onehot_sel) = parts
expected_len = sent_bytes + 15
if expected_len != len(data):
raise ValueError("analyzer dump has incorrect length "
"(got {}, expected {})".format(
len(data), expected_len))
if overflow_occured:
logger.warning("analyzer FIFO overflow occured, "
"some messages have been lost")
if error_occurred:
logger.warning("error occurred within the analyzer, "
"data may be corrupted")
if total_byte_count > sent_bytes:
logger.info("analyzer ring buffer has wrapped %d times",
total_byte_count//sent_bytes)
@ -118,6 +166,12 @@ class VCDManager:
.format(name=name, code=code, width=width))
return VCDChannel(self.out, code)
@contextmanager
def scope(self, name):
self.out.write("$scope module {} $end\n".format(name))
yield
self.out.write("$upscope $end\n")
def set_time(self, time):
if time != self.current_time:
self.out.write("#{}\n".format(time))
@ -167,9 +221,8 @@ class TTLClockGenHandler:
class DDSHandler:
def __init__(self, vcd_manager, dds_type, onehot_sel, sysclk):
def __init__(self, vcd_manager, onehot_sel, sysclk):
self.vcd_manager = vcd_manager
self.dds_type = dds_type
self.onehot_sel = onehot_sel
self.sysclk = sysclk
@ -178,16 +231,13 @@ class DDSHandler:
def add_dds_channel(self, name, dds_channel_nr):
dds_channel = dict()
dds_channel["vcd_frequency"] = \
self.vcd_manager.get_channel("dds/" + name + "/frequency", 64)
dds_channel["vcd_phase"] = \
self.vcd_manager.get_channel("dds/" + name + "/phase", 64)
if self.dds_type == "AD9858":
dds_channel["ftw"] = [None, None, None, None]
dds_channel["pow"] = [None, None]
elif self.dds_type == "AD9914":
dds_channel["ftw"] = [None, None]
dds_channel["pow"] = None
with self.vcd_manager.scope("dds/{}".format(name)):
dds_channel["vcd_frequency"] = \
self.vcd_manager.get_channel(name + "/frequency", 64)
dds_channel["vcd_phase"] = \
self.vcd_manager.get_channel(name + "/phase", 64)
dds_channel["ftw"] = [None, None]
dds_channel["pow"] = None
self.dds_channels[dds_channel_nr] = dds_channel
def _gpio_to_channels(self, gpio):
@ -205,34 +255,14 @@ class DDSHandler:
else:
return {gpio}
def _decode_ad9858_write(self, message):
if message.address == 0x41:
self.selected_dds_channels = self._gpio_to_channels(message.data)
for dds_channel_nr in self.selected_dds_channels:
dds_channel = self.dds_channels[dds_channel_nr]
if message.address in range(0x0a, 0x0e):
dds_channel["ftw"][message.address - 0x0a] = message.data
elif message.address in range(0x0e, 0x10):
dds_channel["pow"][message.address - 0x0e] = message.data
elif message.address == 0x40: # FUD
if None not in dds_channel["ftw"]:
ftw = sum(x << i*8
for i, x in enumerate(dds_channel["ftw"]))
frequency = ftw*self.sysclk/2**32
dds_channel["vcd_frequency"].set_value_double(frequency)
if None not in dds_channel["pow"]:
pow = dds_channel["pow"][0] | (dds_channel["pow"][1] & 0x3f) << 8
phase = pow/2**14
dds_channel["vcd_phase"].set_value_double(phase)
def _decode_ad9914_write(self, message):
if message.address == 0x81:
self.selected_dds_channels = self._gpio_to_channels(message.data)
for dds_channel_nr in self.selected_dds_channels:
dds_channel = self.dds_channels[dds_channel_nr]
if message.address == 0x2d:
if message.address == 0x11:
dds_channel["ftw"][0] = message.data
elif message.address == 0x2f:
elif message.address == 0x13:
dds_channel["ftw"][1] = message.data
elif message.address == 0x31:
dds_channel["pow"] = message.data
@ -251,10 +281,124 @@ class DDSHandler:
logger.debug("DDS write @%d 0x%04x to 0x%02x, selected channels: %s",
message.timestamp, message.data, message.address,
self.selected_dds_channels)
if self.dds_type == "AD9858":
self._decode_ad9858_write(message)
elif self.dds_type == "AD9914":
self._decode_ad9914_write(message)
self._decode_ad9914_write(message)
class WishboneHandler:
def __init__(self, vcd_manager, name, read_bit):
self._reads = []
self._read_bit = read_bit
self.stb = vcd_manager.get_channel("{}/{}".format(name, "stb"), 1)
def process_message(self, message):
self.stb.set_value("1")
self.stb.set_value("0")
if isinstance(message, OutputMessage):
logger.debug("Wishbone out @%d adr=0x%02x data=0x%08x",
message.timestamp, message.address, message.data)
if message.address & self._read_bit:
read = self._reads.pop(0)
self.process_read(
message.address & ~self._read_bit,
read.data,
read.rtio_counter - message.timestamp)
else:
self.process_write(message.address,
message.data)
if isinstance(message, InputMessage):
logger.debug("Wishbone in @%d data=0x%08x",
message.rtio_counter, message.data)
self._reads.append(message)
def process_write(self, address, data):
raise NotImplementedError
def process_read(self, address, data, read_slack):
raise NotImplementedError
class SPIMasterHandler(WishboneHandler):
def __init__(self, vcd_manager, name):
self.channels = {}
with vcd_manager.scope("spi/{}".format(name)):
super().__init__(vcd_manager, name, read_bit=0b100)
for reg_name, reg_width in [
("config", 32), ("chip_select", 16),
("write_length", 8), ("read_length", 8),
("write", 32), ("read", 32)]:
self.channels[reg_name] = vcd_manager.get_channel(
"{}/{}".format(name, reg_name), reg_width)
def process_write(self, address, data):
if address == 0:
self.channels["write"].set_value("{:032b}".format(data))
elif address == 1:
self.channels["chip_select"].set_value(
"{:08b}".format(data & 0xffff))
self.channels["write_length"].set_value(
"{:08b}".format(data >> 16 & 0xff))
self.channels["read_length"].set_value(
"{:08b}".format(data >> 24 & 0xff))
elif address == 2:
self.channels["config"].set_value("{:032b}".format(data))
else:
raise ValueError("bad address %d", address)
def process_read(self, address, data, read_slack):
if address == 0:
self.channels["read"].set_value("{:032b}".format(data))
else:
raise ValueError("bad address %d", address)
class SPIMaster2Handler(WishboneHandler):
def __init__(self, vcd_manager, name):
self._reads = []
self.channels = {}
with vcd_manager.scope("spi2/{}".format(name)):
self.stb = vcd_manager.get_channel("{}/{}".format(name, "stb"), 1)
for reg_name, reg_width in [
("flags", 8),
("length", 5),
("div", 8),
("chip_select", 8),
("write", 32),
("read", 32)]:
self.channels[reg_name] = vcd_manager.get_channel(
"{}/{}".format(name, reg_name), reg_width)
def process_message(self, message):
self.stb.set_value("1")
self.stb.set_value("0")
if isinstance(message, OutputMessage):
data = message.data
address = message.address
if address == 1:
logger.debug("SPI config @%d data=0x%08x",
message.timestamp, data)
self.channels["chip_select"].set_value(
"{:08b}".format(data >> 24))
self.channels["div"].set_value(
"{:08b}".format(data >> 16 & 0xff))
self.channels["length"].set_value(
"{:08b}".format(data >> 8 & 0x1f))
self.channels["flags"].set_value(
"{:08b}".format(data & 0xff))
elif address == 0:
logger.debug("SPI write @%d data=0x%08x",
message.timestamp, data)
self.channels["write"].set_value("{:032b}".format(data))
else:
raise ValueError("bad address", address)
# process untimed reads and insert them here
while (self._reads and
self._reads[0].rtio_counter < message.timestamp):
read = self._reads.pop(0)
logger.debug("SPI read @%d data=0x%08x",
read.rtio_counter, read.data)
self.channels["read"].set_value("{:032b}".format(read.data))
elif isinstance(message, InputMessage):
self._reads.append(message)
def _extract_log_chars(data):
@ -263,7 +407,7 @@ def _extract_log_chars(data):
n = data >> 24
data = (data << 8) & 0xffffffff
if not n:
return r
continue
r += chr(n)
return r
@ -308,26 +452,27 @@ def get_vcd_log_channels(log_channel, messages):
def get_single_device_argument(devices, module, cls, argument):
ref_period = None
found = None
for desc in devices.values():
if isinstance(desc, dict) and desc["type"] == "local":
if (desc["module"] == module
and desc["class"] == cls):
if ref_period is None:
ref_period = desc["arguments"][argument]
else:
return None # more than one device found
return ref_period
and desc["class"] in cls):
value = desc["arguments"][argument]
if found is None:
found = value
elif value != found:
return None # more than one value/device found
return found
def get_ref_period(devices):
return get_single_device_argument(devices, "artiq.coredevice.core",
"Core", "ref_period")
("Core",), "ref_period")
def get_dds_sysclk(devices):
return get_single_device_argument(devices, "artiq.coredevice.dds",
"CoreDDS", "sysclk")
return get_single_device_argument(devices, "artiq.coredevice.ad9914",
("AD9914",), "sysclk")
def create_channel_handlers(vcd_manager, devices, ref_period,
@ -343,19 +488,21 @@ def create_channel_handlers(vcd_manager, devices, ref_period,
and desc["class"] == "TTLClockGen"):
channel = desc["arguments"]["channel"]
channel_handlers[channel] = TTLClockGenHandler(vcd_manager, name, ref_period)
if (desc["module"] == "artiq.coredevice.dds"
and desc["class"] in {"AD9858", "AD9914"}):
if (desc["module"] == "artiq.coredevice.ad9914"
and desc["class"] == "AD9914"):
dds_bus_channel = desc["arguments"]["bus_channel"]
dds_channel = desc["arguments"]["channel"]
if dds_bus_channel in channel_handlers:
dds_handler = channel_handlers[dds_bus_channel]
if dds_handler.dds_type != desc["class"]:
raise ValueError("All DDS channels must have the same type")
else:
dds_handler = DDSHandler(vcd_manager, desc["class"],
dds_onehot_sel, dds_sysclk)
dds_handler = DDSHandler(vcd_manager, dds_onehot_sel, dds_sysclk)
channel_handlers[dds_bus_channel] = dds_handler
dds_handler.add_dds_channel(name, dds_channel)
if (desc["module"] == "artiq.coredevice.spi2" and
desc["class"] == "SPIMaster"):
channel = desc["arguments"]["channel"]
channel_handlers[channel] = SPIMaster2Handler(
vcd_manager, name)
return channel_handlers
@ -363,11 +510,13 @@ def get_message_time(message):
return getattr(message, "timestamp", message.rtio_counter)
def decoded_dump_to_vcd(fileobj, devices, dump):
def decoded_dump_to_vcd(fileobj, devices, dump, uniform_interval=False):
vcd_manager = VCDManager(fileobj)
ref_period = get_ref_period(devices)
if ref_period is not None:
vcd_manager.set_timescale_ps(ref_period*1e12)
if not uniform_interval:
vcd_manager.set_timescale_ps(ref_period*1e12)
else:
logger.warning("unable to determine core device ref_period")
ref_period = 1e-9 # guess
@ -389,16 +538,34 @@ def decoded_dump_to_vcd(fileobj, devices, dump):
vcd_log_channels = get_vcd_log_channels(dump.log_channel, messages)
channel_handlers[dump.log_channel] = LogHandler(
vcd_manager, vcd_log_channels)
if uniform_interval:
# RTIO event timestamp in machine units
timestamp = vcd_manager.get_channel("timestamp", 64)
# RTIO time interval between this and the next timed event
# in SI seconds
interval = vcd_manager.get_channel("interval", 64)
slack = vcd_manager.get_channel("rtio_slack", 64)
vcd_manager.set_time(0)
if messages:
start_time = get_message_time(messages[0])
for message in messages:
if message.channel in channel_handlers:
vcd_manager.set_time(
get_message_time(message) - start_time)
channel_handlers[message.channel].process_message(message)
if isinstance(message, OutputMessage):
slack.set_value_double(
(message.timestamp - message.rtio_counter)*ref_period)
start_time = 0
for m in messages:
start_time = get_message_time(m)
if start_time:
break
t0 = 0
for i, message in enumerate(messages):
if message.channel in channel_handlers:
t = get_message_time(message) - start_time
if t >= 0:
if uniform_interval:
interval.set_value_double((t - t0)*ref_period)
vcd_manager.set_time(i)
timestamp.set_value("{:064b}".format(t))
t0 = t
else:
vcd_manager.set_time(t)
channel_handlers[message.channel].process_message(message)
if isinstance(message, OutputMessage):
slack.set_value_double(
(message.timestamp - message.rtio_counter)*ref_period)

View File

@ -1,27 +0,0 @@
from operator import itemgetter
class Comm:
def __init__(self, dmgr):
super().__init__()
def switch_clock(self, external):
pass
def load(self, kernel_library):
pass
def run(self):
pass
def serve(self, embedding_map, symbolizer, demangler):
pass
def check_ident(self):
pass
def get_log(self):
return ""
def clear_log(self):
pass

View File

@ -1,544 +0,0 @@
import struct
import logging
import traceback
import numpy
from enum import Enum
from fractions import Fraction
from collections import namedtuple
from artiq.coredevice import exceptions
from artiq import __version__ as software_version
logger = logging.getLogger(__name__)
class _H2DMsgType(Enum):
LOG_REQUEST = 1
LOG_CLEAR = 2
IDENT_REQUEST = 3
SWITCH_CLOCK = 4
LOAD_LIBRARY = 5
RUN_KERNEL = 6
RPC_REPLY = 7
RPC_EXCEPTION = 8
FLASH_READ_REQUEST = 9
FLASH_WRITE_REQUEST = 10
FLASH_ERASE_REQUEST = 11
FLASH_REMOVE_REQUEST = 12
class _D2HMsgType(Enum):
LOG_REPLY = 1
IDENT_REPLY = 2
CLOCK_SWITCH_COMPLETED = 3
CLOCK_SWITCH_FAILED = 4
LOAD_COMPLETED = 5
LOAD_FAILED = 6
KERNEL_FINISHED = 7
KERNEL_STARTUP_FAILED = 8
KERNEL_EXCEPTION = 9
RPC_REQUEST = 10
FLASH_READ_REPLY = 11
FLASH_OK_REPLY = 12
FLASH_ERROR_REPLY = 13
WATCHDOG_EXPIRED = 14
CLOCK_FAILURE = 15
class UnsupportedDevice(Exception):
pass
class RPCReturnValueError(ValueError):
pass
RPCKeyword = namedtuple('RPCKeyword', ['name', 'value'])
class CommGeneric:
def __init__(self):
self._read_type = self._write_type = None
self._read_length = 0
self._write_buffer = []
def open(self):
"""Opens the communication channel.
Must do nothing if already opened."""
raise NotImplementedError
def close(self):
"""Closes the communication channel.
Must do nothing if already closed."""
raise NotImplementedError
def read(self, length):
"""Reads exactly length bytes from the communication channel.
The channel is assumed to be opened."""
raise NotImplementedError
def write(self, data):
"""Writes exactly length bytes to the communication channel.
The channel is assumed to be opened."""
raise NotImplementedError
#
# Reader interface
#
def _read_header(self):
self.open()
if self._read_length > 0:
raise IOError("Read underrun ({} bytes remaining)".
format(self._read_length))
# Wait for a synchronization sequence, 5a 5a 5a 5a.
sync_count = 0
while sync_count < 4:
(sync_byte, ) = struct.unpack("B", self.read(1))
if sync_byte == 0x5a:
sync_count += 1
else:
sync_count = 0
# Read message header.
(self._read_length, ) = struct.unpack(">l", self.read(4))
if not self._read_length: # inband connection close
raise OSError("Connection closed")
(raw_type, ) = struct.unpack("B", self.read(1))
self._read_type = _D2HMsgType(raw_type)
if self._read_length < 9:
raise IOError("Read overrun in message header ({} remaining)".
format(self._read_length))
self._read_length -= 9
logger.debug("receiving message: type=%r length=%d",
self._read_type, self._read_length)
def _read_expect(self, ty):
if self._read_type != ty:
raise IOError("Incorrect reply from device: {} (expected {})".
format(self._read_type, ty))
def _read_empty(self, ty):
self._read_header()
self._read_expect(ty)
def _read_chunk(self, length):
if self._read_length < length:
raise IOError("Read overrun while trying to read {} bytes ({} remaining)"
" in packet {}".
format(length, self._read_length, self._read_type))
self._read_length -= length
return self.read(length)
def _read_int8(self):
(value, ) = struct.unpack("B", self._read_chunk(1))
return value
def _read_int32(self):
(value, ) = struct.unpack(">l", self._read_chunk(4))
return value
def _read_int64(self):
(value, ) = struct.unpack(">q", self._read_chunk(8))
return value
def _read_float64(self):
(value, ) = struct.unpack(">d", self._read_chunk(8))
return value
def _read_bytes(self):
return self._read_chunk(self._read_int32())
def _read_string(self):
return self._read_bytes()[:-1].decode("utf-8")
#
# Writer interface
#
def _write_header(self, ty):
self.open()
logger.debug("preparing to send message: type=%r", ty)
self._write_type = ty
self._write_buffer = []
def _write_flush(self):
# Calculate message size.
length = sum([len(chunk) for chunk in self._write_buffer])
logger.debug("sending message: type=%r length=%d", self._write_type, length)
# Write synchronization sequence, header and body.
self.write(struct.pack(">llB", 0x5a5a5a5a,
9 + length, self._write_type.value))
for chunk in self._write_buffer:
self.write(chunk)
def _write_empty(self, ty):
self._write_header(ty)
self._write_flush()
def _write_chunk(self, chunk):
self._write_buffer.append(chunk)
def _write_int8(self, value):
self._write_buffer.append(struct.pack("B", value))
def _write_int32(self, value):
self._write_buffer.append(struct.pack(">l", value))
def _write_int64(self, value):
self._write_buffer.append(struct.pack(">q", value))
def _write_float64(self, value):
self._write_buffer.append(struct.pack(">d", value))
def _write_bytes(self, value):
self._write_int32(len(value))
self._write_buffer.append(value)
def _write_string(self, value):
self._write_bytes(value.encode("utf-8") + b"\0")
#
# Exported APIs
#
def reset_session(self):
self.write(struct.pack(">ll", 0x5a5a5a5a, 0))
def check_ident(self):
self._write_empty(_H2DMsgType.IDENT_REQUEST)
self._read_header()
self._read_expect(_D2HMsgType.IDENT_REPLY)
runtime_id = self._read_chunk(4)
if runtime_id != b"AROR":
raise UnsupportedDevice("Unsupported runtime ID: {}"
.format(runtime_id))
gateware_version = self._read_chunk(self._read_length).decode("utf-8")
if gateware_version != software_version and \
gateware_version + ".dirty" != software_version:
logger.warning("Mismatch between gateware (%s) "
"and software (%s) versions",
gateware_version, software_version)
def switch_clock(self, external):
self._write_header(_H2DMsgType.SWITCH_CLOCK)
self._write_int8(external)
self._write_flush()
self._read_empty(_D2HMsgType.CLOCK_SWITCH_COMPLETED)
def get_log(self):
self._write_empty(_H2DMsgType.LOG_REQUEST)
self._read_header()
self._read_expect(_D2HMsgType.LOG_REPLY)
return self._read_chunk(self._read_length).decode("utf-8", "replace")
def clear_log(self):
self._write_empty(_H2DMsgType.LOG_CLEAR)
self._read_empty(_D2HMsgType.LOG_REPLY)
def flash_storage_read(self, key):
self._write_header(_H2DMsgType.FLASH_READ_REQUEST)
self._write_string(key)
self._write_flush()
self._read_header()
self._read_expect(_D2HMsgType.FLASH_READ_REPLY)
return self._read_chunk(self._read_length)
def flash_storage_write(self, key, value):
self._write_header(_H2DMsgType.FLASH_WRITE_REQUEST)
self._write_string(key)
self._write_bytes(value)
self._write_flush()
self._read_header()
if self._read_type == _D2HMsgType.FLASH_ERROR_REPLY:
raise IOError("Flash storage is full")
else:
self._read_expect(_D2HMsgType.FLASH_OK_REPLY)
def flash_storage_erase(self):
self._write_empty(_H2DMsgType.FLASH_ERASE_REQUEST)
self._read_empty(_D2HMsgType.FLASH_OK_REPLY)
def flash_storage_remove(self, key):
self._write_header(_H2DMsgType.FLASH_REMOVE_REQUEST)
self._write_string(key)
self._write_flush()
self._read_empty(_D2HMsgType.FLASH_OK_REPLY)
def load(self, kernel_library):
self._write_header(_H2DMsgType.LOAD_LIBRARY)
self._write_chunk(kernel_library)
self._write_flush()
self._read_empty(_D2HMsgType.LOAD_COMPLETED)
def run(self):
self._write_empty(_H2DMsgType.RUN_KERNEL)
logger.debug("running kernel")
_rpc_sentinel = object()
# See session.c:{send,receive}_rpc_value and llvm_ir_generator.py:_rpc_tag.
def _receive_rpc_value(self, embedding_map):
tag = chr(self._read_int8())
if tag == "\x00":
return self._rpc_sentinel
elif tag == "t":
length = self._read_int8()
return tuple(self._receive_rpc_value(embedding_map) for _ in range(length))
elif tag == "n":
return None
elif tag == "b":
return bool(self._read_int8())
elif tag == "i":
return numpy.int32(self._read_int32())
elif tag == "I":
return numpy.int64(self._read_int64())
elif tag == "f":
return self._read_float64()
elif tag == "F":
numerator = self._read_int64()
denominator = self._read_int64()
return Fraction(numerator, denominator)
elif tag == "s":
return self._read_string()
elif tag == "l":
length = self._read_int32()
return [self._receive_rpc_value(embedding_map) for _ in range(length)]
elif tag == "a":
length = self._read_int32()
return numpy.array([self._receive_rpc_value(embedding_map) for _ in range(length)])
elif tag == "r":
start = self._receive_rpc_value(embedding_map)
stop = self._receive_rpc_value(embedding_map)
step = self._receive_rpc_value(embedding_map)
return range(start, stop, step)
elif tag == "k":
name = self._read_string()
value = self._receive_rpc_value(embedding_map)
return RPCKeyword(name, value)
elif tag == "O":
return embedding_map.retrieve_object(self._read_int32())
else:
raise IOError("Unknown RPC value tag: {}".format(repr(tag)))
def _receive_rpc_args(self, embedding_map):
args, kwargs = [], {}
while True:
value = self._receive_rpc_value(embedding_map)
if value is self._rpc_sentinel:
return args, kwargs
elif isinstance(value, RPCKeyword):
kwargs[value.name] = value.value
else:
args.append(value)
def _skip_rpc_value(self, tags):
tag = tags.pop(0)
if tag == "t":
length = tags.pop(0)
for _ in range(length):
self._skip_rpc_value(tags)
elif tag == "l":
self._skip_rpc_value(tags)
elif tag == "r":
self._skip_rpc_value(tags)
else:
pass
def _send_rpc_value(self, tags, value, root, function):
def check(cond, expected):
if not cond:
raise RPCReturnValueError(
"type mismatch: cannot serialize {value} as {type}"
" ({function} has returned {root})".format(
value=repr(value), type=expected(),
function=function, root=root))
tag = chr(tags.pop(0))
if tag == "t":
length = tags.pop(0)
check(isinstance(value, tuple) and length == len(value),
lambda: "tuple of {}".format(length))
for elt in value:
self._send_rpc_value(tags, elt, root, function)
elif tag == "n":
check(value is None,
lambda: "None")
elif tag == "b":
check(isinstance(value, bool),
lambda: "bool")
self._write_int8(value)
elif tag == "i":
check(isinstance(value, int) and (-2**31 < value < 2**31-1),
lambda: "32-bit int")
self._write_int32(value)
elif tag == "I":
check(isinstance(value, int) and (-2**63 < value < 2**63-1),
lambda: "64-bit int")
self._write_int64(value)
elif tag == "f":
check(isinstance(value, float),
lambda: "float")
self._write_float64(value)
elif tag == "F":
check(isinstance(value, Fraction) and
(-2**63 < value.numerator < 2**63-1) and
(-2**63 < value.denominator < 2**63-1),
lambda: "64-bit Fraction")
self._write_int64(value.numerator)
self._write_int64(value.denominator)
elif tag == "s":
check(isinstance(value, str) and "\x00" not in value,
lambda: "str")
self._write_string(value)
elif tag == "l":
check(isinstance(value, list),
lambda: "list")
self._write_int32(len(value))
for elt in value:
tags_copy = bytearray(tags)
self._send_rpc_value(tags_copy, elt, root, function)
self._skip_rpc_value(tags)
elif tag == "r":
check(isinstance(value, range),
lambda: "range")
tags_copy = bytearray(tags)
self._send_rpc_value(tags_copy, value.start, root, function)
tags_copy = bytearray(tags)
self._send_rpc_value(tags_copy, value.stop, root, function)
tags_copy = bytearray(tags)
self._send_rpc_value(tags_copy, value.step, root, function)
tags = tags_copy
else:
raise IOError("Unknown RPC value tag: {}".format(repr(tag)))
def _serve_rpc(self, embedding_map):
service_id = self._read_int32()
if service_id == 0:
service = lambda obj, attr, value: setattr(obj, attr, value)
else:
service = embedding_map.retrieve_object(service_id)
args, kwargs = self._receive_rpc_args(embedding_map)
return_tags = self._read_bytes()
logger.debug("rpc service: [%d]%r %r %r -> %s", service_id, service, args, kwargs, return_tags)
try:
result = service(*args, **kwargs)
logger.debug("rpc service: %d %r %r == %r", service_id, args, kwargs, result)
if service_id != 0:
self._write_header(_H2DMsgType.RPC_REPLY)
self._write_bytes(return_tags)
self._send_rpc_value(bytearray(return_tags), result, result, service)
self._write_flush()
except Exception as exn:
logger.debug("rpc service: %d %r %r ! %r", service_id, args, kwargs, exn)
self._write_header(_H2DMsgType.RPC_EXCEPTION)
if hasattr(exn, "artiq_core_exception"):
exn = exn.artiq_core_exception
self._write_string(exn.name)
self._write_string(exn.message)
for index in range(3):
self._write_int64(exn.param[index])
filename, line, column, function = exn.traceback[-1]
self._write_string(filename)
self._write_int32(line)
self._write_int32(column)
self._write_string(function)
else:
exn_type = type(exn)
if exn_type in (ZeroDivisionError, ValueError, IndexError) or \
hasattr(exn, "artiq_builtin"):
self._write_string("0:{}".format(exn_type.__name__))
else:
exn_id = embedding_map.store_object(exn_type)
self._write_string("{}:{}.{}".format(exn_id,
exn_type.__module__, exn_type.__qualname__))
self._write_string(str(exn))
for index in range(3):
self._write_int64(0)
tb = traceback.extract_tb(exn.__traceback__, 2)
if len(tb) == 2:
(_, (filename, line, function, _), ) = tb
elif len(tb) == 1:
((filename, line, function, _), ) = tb
else:
assert False
self._write_string(filename)
self._write_int32(line)
self._write_int32(-1) # column not known
self._write_string(function)
self._write_flush()
def _serve_exception(self, embedding_map, symbolizer, demangler):
name = self._read_string()
message = self._read_string()
params = [self._read_int64() for _ in range(3)]
filename = self._read_string()
line = self._read_int32()
column = self._read_int32()
function = self._read_string()
backtrace = [self._read_int32() for _ in range(self._read_int32())]
traceback = list(reversed(symbolizer(backtrace))) + \
[(filename, line, column, *demangler([function]), None)]
core_exn = exceptions.CoreException(name, message, params, traceback)
if core_exn.id == 0:
python_exn_type = getattr(exceptions, core_exn.name.split('.')[-1])
else:
python_exn_type = embedding_map.retrieve_object(core_exn.id)
python_exn = python_exn_type(message.format(*params))
python_exn.artiq_core_exception = core_exn
raise python_exn
def serve(self, embedding_map, symbolizer, demangler):
while True:
self._read_header()
if self._read_type == _D2HMsgType.RPC_REQUEST:
self._serve_rpc(embedding_map)
elif self._read_type == _D2HMsgType.KERNEL_EXCEPTION:
self._serve_exception(embedding_map, symbolizer, demangler)
elif self._read_type == _D2HMsgType.WATCHDOG_EXPIRED:
raise exceptions.WatchdogExpired
elif self._read_type == _D2HMsgType.CLOCK_FAILURE:
raise exceptions.ClockFailure
else:
self._read_expect(_D2HMsgType.KERNEL_FINISHED)
return

View File

@ -0,0 +1,738 @@
import struct
import logging
import traceback
import numpy
import socket
from enum import Enum
from fractions import Fraction
from collections import namedtuple
from artiq.coredevice import exceptions
from artiq import __version__ as software_version
from sipyco.keepalive import create_connection
logger = logging.getLogger(__name__)
class Request(Enum):
SystemInfo = 3
LoadKernel = 5
RunKernel = 6
RPCReply = 7
RPCException = 8
SubkernelUpload = 9
class Reply(Enum):
SystemInfo = 2
LoadCompleted = 5
LoadFailed = 6
KernelFinished = 7
KernelStartupFailed = 8
KernelException = 9
RPCRequest = 10
ClockFailure = 15
class UnsupportedDevice(Exception):
pass
class LoadError(Exception):
pass
class RPCReturnValueError(ValueError):
pass
RPCKeyword = namedtuple('RPCKeyword', ['name', 'value'])
def _receive_fraction(kernel, embedding_map):
numerator = kernel._read_int64()
denominator = kernel._read_int64()
return Fraction(numerator, denominator)
def _receive_list(kernel, embedding_map):
length = kernel._read_int32()
tag = chr(kernel._read_int8())
if tag == "b":
buffer = kernel._read(length)
return list(struct.unpack(kernel.endian + "%s?" % length, buffer))
elif tag == "i":
buffer = kernel._read(4 * length)
return list(struct.unpack(kernel.endian + "%sl" % length, buffer))
elif tag == "I":
buffer = kernel._read(8 * length)
return list(numpy.ndarray((length, ), kernel.endian + 'i8', buffer))
elif tag == "f":
buffer = kernel._read(8 * length)
return list(struct.unpack(kernel.endian + "%sd" % length, buffer))
else:
fn = receivers[tag]
elems = []
for _ in range(length):
# discard tag, as our device would still send the tag for each
# non-primitive elements.
kernel._read_int8()
item = fn(kernel, embedding_map)
elems.append(item)
return elems
def _receive_array(kernel, embedding_map):
num_dims = kernel._read_int8()
shape = tuple(kernel._read_int32() for _ in range(num_dims))
tag = chr(kernel._read_int8())
fn = receivers[tag]
length = numpy.prod(shape)
if tag == "b":
buffer = kernel._read(length)
elems = numpy.ndarray((length, ), '?', buffer)
elif tag == "i":
buffer = kernel._read(4 * length)
elems = numpy.ndarray((length, ), kernel.endian + 'i4', buffer)
elif tag == "I":
buffer = kernel._read(8 * length)
elems = numpy.ndarray((length, ), kernel.endian + 'i8', buffer)
elif tag == "f":
buffer = kernel._read(8 * length)
elems = numpy.ndarray((length, ), kernel.endian + 'd', buffer)
else:
fn = receivers[tag]
elems = []
for _ in range(numpy.prod(shape)):
# discard the tag
kernel._read_int8()
item = fn(kernel, embedding_map)
elems.append(item)
elems = numpy.array(elems)
return elems.reshape(shape)
def _receive_range(kernel, embedding_map):
start = kernel._receive_rpc_value(embedding_map)
stop = kernel._receive_rpc_value(embedding_map)
step = kernel._receive_rpc_value(embedding_map)
return range(start, stop, step)
def _receive_keyword(kernel, embedding_map):
name = kernel._read_string()
value = kernel._receive_rpc_value(embedding_map)
return RPCKeyword(name, value)
receivers = {
"\x00": lambda kernel, embedding_map: kernel._rpc_sentinel,
"t": lambda kernel, embedding_map:
tuple(kernel._receive_rpc_value(embedding_map)
for _ in range(kernel._read_int8())),
"n": lambda kernel, embedding_map: None,
"b": lambda kernel, embedding_map: bool(kernel._read_int8()),
"i": lambda kernel, embedding_map: numpy.int32(kernel._read_int32()),
"I": lambda kernel, embedding_map: numpy.int64(kernel._read_int64()),
"f": lambda kernel, embedding_map: kernel._read_float64(),
"s": lambda kernel, embedding_map: kernel._read_string(),
"B": lambda kernel, embedding_map: kernel._read_bytes(),
"A": lambda kernel, embedding_map: kernel._read_bytes(),
"O": lambda kernel, embedding_map:
embedding_map.retrieve_object(kernel._read_int32()),
"F": _receive_fraction,
"l": _receive_list,
"a": _receive_array,
"r": _receive_range,
"k": _receive_keyword
}
class CommKernelDummy:
def __init__(self):
pass
def load(self, kernel_library):
pass
def run(self):
pass
def serve(self, embedding_map, symbolizer, demangler):
pass
def check_system_info(self):
pass
def incompatible_versions(v1, v2):
if v1.endswith(".beta") or v2.endswith(".beta"):
# Beta branches may introduce breaking changes. Check version strictly.
return v1 != v2
else:
# On stable branches, runtime/software protocol backward compatibility is kept.
# Runtime and software with the same major version number are compatible.
return v1.split(".", maxsplit=1)[0] != v2.split(".", maxsplit=1)[0]
class CommKernel:
warned_of_mismatch = False
def __init__(self, host, port=1381):
self._read_type = None
self.host = host
self.port = port
self.read_buffer = bytearray()
self.write_buffer = bytearray()
def open(self):
if hasattr(self, "socket"):
return
self.socket = create_connection(self.host, self.port)
self.socket.sendall(b"ARTIQ coredev\n")
endian = self._read(1)
if endian == b"e":
self.endian = "<"
elif endian == b"E":
self.endian = ">"
else:
raise IOError("Incorrect reply from device: expected e/E.")
self.unpack_int32 = struct.Struct(self.endian + "l").unpack
self.unpack_int64 = struct.Struct(self.endian + "q").unpack
self.unpack_float64 = struct.Struct(self.endian + "d").unpack
self.pack_header = struct.Struct(self.endian + "lB").pack
self.pack_int8 = struct.Struct(self.endian + "B").pack
self.pack_int32 = struct.Struct(self.endian + "l").pack
self.pack_int64 = struct.Struct(self.endian + "q").pack
self.pack_float64 = struct.Struct(self.endian + "d").pack
def close(self):
if not hasattr(self, "socket"):
return
self.socket.close()
del self.socket
logger.debug("disconnected")
#
# Reader interface
#
def _read(self, length):
# cache the reads to avoid frequent call to recv
while len(self.read_buffer) < length:
# the number is just the maximum amount
# when there is not much data, it would return earlier
diff = length - len(self.read_buffer)
flag = 0
if diff > 8192:
flag |= socket.MSG_WAITALL
new_buffer = self.socket.recv(8192, flag)
if not new_buffer:
raise ConnectionResetError("Core device connection closed unexpectedly")
self.read_buffer += new_buffer
result = self.read_buffer[:length]
self.read_buffer = self.read_buffer[length:]
return result
def _read_header(self):
self.open()
# Wait for a synchronization sequence, 5a 5a 5a 5a.
sync_count = 0
while sync_count < 4:
sync_byte = self._read(1)[0]
if sync_byte == 0x5a:
sync_count += 1
else:
sync_count = 0
# Read message header.
raw_type = self._read(1)[0]
self._read_type = Reply(raw_type)
logger.debug("receiving message: type=%r",
self._read_type)
def _read_expect(self, ty):
if self._read_type != ty:
raise IOError("Incorrect reply from device: {} (expected {})".
format(self._read_type, ty))
def _read_empty(self, ty):
self._read_header()
self._read_expect(ty)
def _read_int8(self):
return self._read(1)[0]
def _read_int32(self):
(value, ) = self.unpack_int32(self._read(4))
return value
def _read_int64(self):
(value, ) = self.unpack_int64(self._read(8))
return value
def _read_float64(self):
(value, ) = self.unpack_float64(self._read(8))
return value
def _read_bool(self):
return True if self._read_int8() else False
def _read_bytes(self):
return self._read(self._read_int32())
def _read_string(self):
return self._read_bytes().decode("utf-8")
#
# Writer interface
#
def _write(self, data):
self.write_buffer += data
# if the buffer is already pretty large, send it
# the block size is arbitrary, tuning it may improve performance
if len(self.write_buffer) > 4096:
self._flush()
def _flush(self):
self.socket.sendall(self.write_buffer)
self.write_buffer.clear()
def _write_header(self, ty):
self.open()
logger.debug("sending message: type=%r", ty)
# Write synchronization sequence and header.
self._write(self.pack_header(0x5a5a5a5a, ty.value))
def _write_empty(self, ty):
self._write_header(ty)
def _write_chunk(self, chunk):
self._write(chunk)
def _write_int8(self, value):
self._write(self.pack_int8(value))
def _write_int32(self, value):
self._write(self.pack_int32(value))
def _write_int64(self, value):
self._write(self.pack_int64(value))
def _write_float64(self, value):
self._write(self.pack_float64(value))
def _write_bool(self, value):
self._write(b'\x01' if value else b'\x00')
def _write_bytes(self, value):
self._write_int32(len(value))
self._write(value)
def _write_string(self, value):
self._write_bytes(value.encode("utf-8"))
#
# Exported APIs
#
def check_system_info(self):
self._write_empty(Request.SystemInfo)
self._flush()
self._read_header()
self._read_expect(Reply.SystemInfo)
runtime_id = self._read(4)
if runtime_id == b"AROR":
gateware_version = self._read_string().split(";")[0]
if not self.warned_of_mismatch and incompatible_versions(gateware_version, software_version):
logger.warning("Mismatch between gateware (%s) "
"and software (%s) versions",
gateware_version, software_version)
CommKernel.warned_of_mismatch = True
finished_cleanly = self._read_bool()
if not finished_cleanly:
logger.warning("Previous kernel did not cleanly finish")
elif runtime_id == b"ARZQ":
pass
else:
raise UnsupportedDevice("Unsupported runtime ID: {}"
.format(runtime_id))
def load(self, kernel_library):
self._write_header(Request.LoadKernel)
self._write_bytes(kernel_library)
self._flush()
self._read_header()
if self._read_type == Reply.LoadFailed:
raise LoadError(self._read_string())
else:
self._read_expect(Reply.LoadCompleted)
def upload_subkernel(self, kernel_library, id, destination):
self._write_header(Request.SubkernelUpload)
self._write_int32(id)
self._write_int8(destination)
self._write_bytes(kernel_library)
self._flush()
self._read_header()
if self._read_type == Reply.LoadFailed:
raise LoadError(self._read_string())
else:
self._read_expect(Reply.LoadCompleted)
def run(self):
self._write_empty(Request.RunKernel)
self._flush()
logger.debug("running kernel")
_rpc_sentinel = object()
# See rpc_proto.rs and compiler/ir.py:rpc_tag.
def _receive_rpc_value(self, embedding_map):
tag = chr(self._read_int8())
if tag in receivers:
return receivers.get(tag)(self, embedding_map)
else:
raise IOError("Unknown RPC value tag: {}".format(repr(tag)))
def _receive_rpc_args(self, embedding_map):
args, kwargs = [], {}
while True:
value = self._receive_rpc_value(embedding_map)
if value is self._rpc_sentinel:
return args, kwargs
elif isinstance(value, RPCKeyword):
kwargs[value.name] = value.value
else:
args.append(value)
def _skip_rpc_value(self, tags):
tag = chr(tags.pop(0))
if tag == "t":
length = tags.pop(0)
for _ in range(length):
self._skip_rpc_value(tags)
elif tag == "l":
self._skip_rpc_value(tags)
elif tag == "r":
self._skip_rpc_value(tags)
elif tag == "a":
_ndims = tags.pop(0)
self._skip_rpc_value(tags)
else:
pass
def _send_rpc_value(self, tags, value, root, function):
def check(cond, expected):
if not cond:
raise RPCReturnValueError(
"type mismatch: cannot serialize {value} as {type}"
" ({function} has returned {root})".format(
value=repr(value), type=expected(),
function=function, root=root))
tag = chr(tags.pop(0))
if tag == "t":
length = tags.pop(0)
check(isinstance(value, tuple) and length == len(value),
lambda: "tuple of {}".format(length))
for elt in value:
self._send_rpc_value(tags, elt, root, function)
elif tag == "n":
check(value is None,
lambda: "None")
elif tag == "b":
check(isinstance(value, bool),
lambda: "bool")
self._write_bool(value)
elif tag == "i":
check(isinstance(value, (int, numpy.int32)) and
(-2**31 <= value < 2**31),
lambda: "32-bit int")
self._write_int32(value)
elif tag == "I":
check(isinstance(value, (int, numpy.int32, numpy.int64)) and
(-2**63 <= value < 2**63),
lambda: "64-bit int")
self._write_int64(value)
elif tag == "f":
check(isinstance(value, float),
lambda: "float")
self._write_float64(value)
elif tag == "F":
check(isinstance(value, Fraction) and
(-2**63 <= value.numerator < 2**63) and
(-2**63 <= value.denominator < 2**63),
lambda: "64-bit Fraction")
self._write_int64(value.numerator)
self._write_int64(value.denominator)
elif tag == "s":
check(isinstance(value, str) and "\x00" not in value,
lambda: "str")
self._write_string(value)
elif tag == "B":
check(isinstance(value, bytes),
lambda: "bytes")
self._write_bytes(value)
elif tag == "A":
check(isinstance(value, bytearray),
lambda: "bytearray")
self._write_bytes(value)
elif tag == "l":
check(isinstance(value, list),
lambda: "list")
self._write_int32(len(value))
tag_element = chr(tags[0])
if tag_element == "b":
self._write(bytes(value))
elif tag_element == "i":
try:
self._write(struct.pack(self.endian + "%sl" % len(value), *value))
except struct.error:
raise RPCReturnValueError(
"type mismatch: cannot serialize {value} as {type}".format(
value=repr(value), type="32-bit integer list"))
elif tag_element == "I":
try:
self._write(struct.pack(self.endian + "%sq" % len(value), *value))
except struct.error:
raise RPCReturnValueError(
"type mismatch: cannot serialize {value} as {type}".format(
value=repr(value), type="64-bit integer list"))
elif tag_element == "f":
self._write(struct.pack(self.endian + "%sd" %
len(value), *value))
else:
for elt in value:
tags_copy = bytearray(tags)
self._send_rpc_value(tags_copy, elt, root, function)
self._skip_rpc_value(tags)
elif tag == "a":
check(isinstance(value, numpy.ndarray),
lambda: "numpy.ndarray")
num_dims = tags.pop(0)
check(num_dims == len(value.shape),
lambda: "{}-dimensional numpy.ndarray".format(num_dims))
for s in value.shape:
self._write_int32(s)
tag_element = chr(tags[0])
if tag_element == "b":
self._write(value.reshape((-1,), order="C").tobytes())
elif tag_element == "i":
array = value.reshape(
(-1,), order="C").astype(self.endian + 'i4')
self._write(array.tobytes())
elif tag_element == "I":
array = value.reshape(
(-1,), order="C").astype(self.endian + 'i8')
self._write(array.tobytes())
elif tag_element == "f":
array = value.reshape(
(-1,), order="C").astype(self.endian + 'd')
self._write(array.tobytes())
else:
for elt in value.reshape((-1,), order="C"):
tags_copy = bytearray(tags)
self._send_rpc_value(tags_copy, elt, root, function)
self._skip_rpc_value(tags)
elif tag == "r":
check(isinstance(value, range),
lambda: "range")
tags_copy = bytearray(tags)
self._send_rpc_value(tags_copy, value.start, root, function)
tags_copy = bytearray(tags)
self._send_rpc_value(tags_copy, value.stop, root, function)
tags_copy = bytearray(tags)
self._send_rpc_value(tags_copy, value.step, root, function)
tags = tags_copy
else:
raise IOError("Unknown RPC value tag: {}".format(repr(tag)))
def _truncate_message(self, msg, limit=4096):
if len(msg) > limit:
return msg[0:limit] + "... (truncated)"
else:
return msg
def _serve_rpc(self, embedding_map):
is_async = self._read_bool()
service_id = self._read_int32()
args, kwargs = self._receive_rpc_args(embedding_map)
return_tags = self._read_bytes()
if service_id == 0:
def service(obj, attr, value): return setattr(obj, attr, value)
else:
service = embedding_map.retrieve_object(service_id)
logger.debug("rpc service: [%d]%r%s %r %r -> %s", service_id, service,
(" (async)" if is_async else ""), args, kwargs, return_tags)
if is_async:
service(*args, **kwargs)
return
try:
result = service(*args, **kwargs)
except RPCReturnValueError as exn:
raise
except Exception as exn:
logger.debug("rpc service: %d %r %r ! %r",
service_id, args, kwargs, exn)
self._write_header(Request.RPCException)
# Note: instead of sending strings, we send object ID
# This is to avoid the need of allocatio on the device side
# This is a special case: this only applies to exceptions
if hasattr(exn, "artiq_core_exception"):
exn = exn.artiq_core_exception
self._write_int32(embedding_map.store_str(exn.name))
self._write_int32(embedding_map.store_str(self._truncate_message(exn.message)))
for index in range(3):
self._write_int64(exn.param[index])
filename, line, column, function = exn.traceback[-1]
self._write_int32(embedding_map.store_str(filename))
self._write_int32(line)
self._write_int32(column)
self._write_int32(embedding_map.store_str(function))
else:
exn_type = type(exn)
if exn_type in (ZeroDivisionError, ValueError, IndexError, RuntimeError) or \
hasattr(exn, "artiq_builtin"):
name = "0:{}".format(exn_type.__name__)
else:
exn_id = embedding_map.store_object(exn_type)
name = "{}:{}.{}".format(exn_id,
exn_type.__module__,
exn_type.__qualname__)
self._write_int32(embedding_map.store_str(name))
self._write_int32(embedding_map.store_str(self._truncate_message(str(exn))))
for index in range(3):
self._write_int64(0)
tb = traceback.extract_tb(exn.__traceback__, 2)
if len(tb) == 2:
(_, (filename, line, function, _), ) = tb
elif len(tb) == 1:
((filename, line, function, _), ) = tb
else:
assert False
self._write_int32(embedding_map.store_str(filename))
self._write_int32(line)
self._write_int32(-1) # column not known
self._write_int32(embedding_map.store_str(function))
self._flush()
else:
logger.debug("rpc service: %d %r %r = %r",
service_id, args, kwargs, result)
self._write_header(Request.RPCReply)
self._write_bytes(return_tags)
self._send_rpc_value(bytearray(return_tags),
result, result, service)
self._flush()
def _serve_exception(self, embedding_map, symbolizer, demangler):
exception_count = self._read_int32()
nested_exceptions = []
def read_exception_string():
# note: if length == -1, the following int32 is the object key
length = self._read_int32()
if length == -1:
return embedding_map.retrieve_str(self._read_int32())
else:
return self._read(length).decode("utf-8")
for _ in range(exception_count):
name = embedding_map.retrieve_str(self._read_int32())
message = read_exception_string()
params = [self._read_int64() for _ in range(3)]
filename = read_exception_string()
line = self._read_int32()
column = self._read_int32()
function = read_exception_string()
nested_exceptions.append([name, message, params,
filename, line, column, function])
demangled_names = demangler([ex[6] for ex in nested_exceptions])
for i in range(exception_count):
nested_exceptions[i][6] = demangled_names[i]
exception_info = []
for _ in range(exception_count):
sp = self._read_int32()
initial_backtrace = self._read_int32()
current_backtrace = self._read_int32()
exception_info.append((sp, initial_backtrace, current_backtrace))
backtrace = []
stack_pointers = []
for _ in range(self._read_int32()):
backtrace.append(self._read_int32())
stack_pointers.append(self._read_int32())
self._process_async_error()
traceback = list(symbolizer(backtrace))
core_exn = exceptions.CoreException(nested_exceptions, exception_info,
traceback, stack_pointers)
if core_exn.id == 0:
python_exn_type = getattr(exceptions, core_exn.name.split('.')[-1])
else:
python_exn_type = embedding_map.retrieve_object(core_exn.id)
try:
python_exn = python_exn_type(
nested_exceptions[-1][1].format(*nested_exceptions[0][2]))
except Exception as ex:
python_exn = RuntimeError(
f"Exception type={python_exn_type}, which couldn't be "
f"reconstructed ({ex})"
)
python_exn.artiq_core_exception = core_exn
raise python_exn
def _process_async_error(self):
errors = self._read_int8()
if errors > 0:
map_name = lambda y, z: [f"{y}(s)"] if z else []
errors = map_name("collision", errors & 2 ** 0) + \
map_name("busy error", errors & 2 ** 1) + \
map_name("sequence error", errors & 2 ** 2)
logger.warning(f"{(', '.join(errors[:-1]) + ' and ') if len(errors) > 1 else ''}{errors[-1]} "
f"reported during kernel execution")
def serve(self, embedding_map, symbolizer, demangler):
while True:
self._read_header()
if self._read_type == Reply.RPCRequest:
self._serve_rpc(embedding_map)
elif self._read_type == Reply.KernelException:
self._serve_exception(embedding_map, symbolizer, demangler)
elif self._read_type == Reply.ClockFailure:
raise exceptions.ClockFailure
else:
self._read_expect(Reply.KernelFinished)
self._process_async_error()
return

View File

@ -0,0 +1,196 @@
from enum import Enum
import logging
import struct
from sipyco.keepalive import create_connection
logger = logging.getLogger(__name__)
class Request(Enum):
GetLog = 1
ClearLog = 2
PullLog = 7
SetLogFilter = 3
SetUartLogFilter = 6
ConfigRead = 12
ConfigWrite = 13
ConfigRemove = 14
ConfigErase = 15
Reboot = 5
DebugAllocator = 8
class Reply(Enum):
Success = 1
Error = 6
Unavailable = 4
LogContent = 2
ConfigData = 7
RebootImminent = 3
class LogLevel(Enum):
OFF = 0
ERROR = 1
WARN = 2
INFO = 3
DEBUG = 4
TRACE = 5
class CommMgmt:
def __init__(self, host, port=1380):
self.host = host
self.port = port
def open(self):
if hasattr(self, "socket"):
return
self.socket = create_connection(self.host, self.port)
self.socket.sendall(b"ARTIQ management\n")
endian = self._read(1)
if endian == b"e":
self.endian = "<"
elif endian == b"E":
self.endian = ">"
else:
raise IOError("Incorrect reply from device: expected e/E.")
def close(self):
if not hasattr(self, "socket"):
return
self.socket.close()
del self.socket
logger.debug("disconnected")
# Protocol elements
def _write(self, data):
self.socket.sendall(data)
def _write_header(self, ty):
self.open()
logger.debug("sending message: type=%r", ty)
self._write(struct.pack("B", ty.value))
def _write_int8(self, value):
self._write(struct.pack("B", value))
def _write_int32(self, value):
self._write(struct.pack(self.endian + "l", value))
def _write_bytes(self, value):
self._write_int32(len(value))
self._write(value)
def _write_string(self, value):
self._write_bytes(value.encode("utf-8"))
def _read(self, length):
r = bytes()
while len(r) < length:
rn = self.socket.recv(min(8192, length - len(r)))
if not rn:
raise ConnectionResetError("Connection closed")
r += rn
return r
def _read_header(self):
ty = Reply(*struct.unpack("B", self._read(1)))
logger.debug("receiving message: type=%r", ty)
return ty
def _read_expect(self, ty):
header = self._read_header()
if header != ty:
raise IOError("Incorrect reply from device: {} (expected {})".
format(header, ty))
def _read_int32(self):
(value, ) = struct.unpack(self.endian + "l", self._read(4))
return value
def _read_bytes(self):
return self._read(self._read_int32())
def _read_string(self):
return self._read_bytes().decode("utf-8")
# External API
def get_log(self):
self._write_header(Request.GetLog)
self._read_expect(Reply.LogContent)
return self._read_string()
def clear_log(self):
self._write_header(Request.ClearLog)
self._read_expect(Reply.Success)
def pull_log(self):
self._write_header(Request.PullLog)
self._read_expect(Reply.LogContent)
return self._read_string()
def set_log_level(self, level):
if level not in LogLevel.__members__:
raise ValueError("invalid log level {}".format(level))
self._write_header(Request.SetLogFilter)
self._write_int8(getattr(LogLevel, level).value)
self._read_expect(Reply.Success)
def set_uart_log_level(self, level):
if level not in LogLevel.__members__:
raise ValueError("invalid log level {}".format(level))
self._write_header(Request.SetUartLogFilter)
self._write_int8(getattr(LogLevel, level).value)
self._read_expect(Reply.Success)
def config_read(self, key):
self._write_header(Request.ConfigRead)
self._write_string(key)
ty = self._read_header()
if ty == Reply.Error:
raise IOError("Device failed to read config. The key may not exist.")
elif ty != Reply.ConfigData:
raise IOError("Incorrect reply from device: {} (expected {})".
format(ty, Reply.ConfigData))
return self._read_string()
def config_write(self, key, value):
self._write_header(Request.ConfigWrite)
self._write_string(key)
self._write_bytes(value)
ty = self._read_header()
if ty == Reply.Error:
raise IOError("Device failed to write config. More information may be available in the log.")
elif ty != Reply.Success:
raise IOError("Incorrect reply from device: {} (expected {})".
format(ty, Reply.Success))
def config_remove(self, key):
self._write_header(Request.ConfigRemove)
self._write_string(key)
self._read_expect(Reply.Success)
def config_erase(self):
self._write_header(Request.ConfigErase)
self._read_expect(Reply.Success)
def reboot(self):
self._write_header(Request.Reboot)
self._read_expect(Reply.RebootImminent)
def debug_allocator(self):
self._write_header(Request.DebugAllocator)

View File

@ -0,0 +1,103 @@
import asyncio
import logging
import struct
from enum import Enum
from sipyco.keepalive import async_open_connection
__all__ = ["TTLProbe", "TTLOverride", "CommMonInj"]
logger = logging.getLogger(__name__)
class TTLProbe(Enum):
level = 0
oe = 1
class TTLOverride(Enum):
en = 0
level = 1
oe = 2
class CommMonInj:
def __init__(self, monitor_cb, injection_status_cb, disconnect_cb=None):
self.monitor_cb = monitor_cb
self.injection_status_cb = injection_status_cb
self.disconnect_cb = disconnect_cb
async def connect(self, host, port=1383):
self._reader, self._writer = await async_open_connection(
host,
port,
after_idle=1,
interval=1,
max_fails=3,
)
try:
self._writer.write(b"ARTIQ moninj\n")
self._receive_task = asyncio.ensure_future(self._receive_cr())
except:
self._writer.close()
del self._reader
del self._writer
raise
def wait_terminate(self):
return self._receive_task
async def close(self):
self.disconnect_cb = None
try:
self._receive_task.cancel()
try:
await asyncio.wait_for(self._receive_task, None)
except asyncio.CancelledError:
pass
finally:
self._writer.close()
del self._reader
del self._writer
def monitor_probe(self, enable, channel, probe):
packet = struct.pack("<bblb", 0, enable, channel, probe)
self._writer.write(packet)
def monitor_injection(self, enable, channel, overrd):
packet = struct.pack("<bblb", 3, enable, channel, overrd)
self._writer.write(packet)
def inject(self, channel, override, value):
packet = struct.pack("<blbb", 1, channel, override, value)
self._writer.write(packet)
def get_injection_status(self, channel, override):
packet = struct.pack("<blb", 2, channel, override)
self._writer.write(packet)
async def _receive_cr(self):
try:
while True:
ty = await self._reader.read(1)
if not ty:
return
if ty == b"\x00":
payload = await self._reader.readexactly(13)
channel, probe, value = struct.unpack("<lbq", payload)
self.monitor_cb(channel, probe, value)
elif ty == b"\x01":
payload = await self._reader.readexactly(6)
channel, override, value = struct.unpack("<lbb", payload)
self.injection_status_cb(channel, override, value)
else:
raise ValueError("Unknown packet type", ty)
except asyncio.CancelledError:
raise
except:
logger.error("Moninj connection terminating with exception", exc_info=True)
finally:
if self.disconnect_cb is not None:
self.disconnect_cb()

View File

@ -1,76 +0,0 @@
import logging
import socket
import sys
from artiq.coredevice.comm_generic import CommGeneric
logger = logging.getLogger(__name__)
def set_keepalive(sock, after_idle, interval, max_fails):
if sys.platform.startswith("linux"):
sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPIDLE, after_idle)
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPINTVL, interval)
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPCNT, max_fails)
elif sys.platform.startswith("win") or sys.platform.startswith("cygwin"):
# setting max_fails is not supported, typically ends up being 5 or 10
# depending on Windows version
sock.ioctl(socket.SIO_KEEPALIVE_VALS,
(1, after_idle*1000, interval*1000))
else:
logger.warning("TCP keepalive not supported on platform '%s', ignored",
sys.platform)
def initialize_connection(host, port):
sock = socket.create_connection((host, port), 5.0)
sock.settimeout(None)
set_keepalive(sock, 3, 2, 3)
logger.debug("connected to host %s on port %d", host, port)
sock.sendall(b"ARTIQ coredev\n")
return sock
class Comm(CommGeneric):
def __init__(self, dmgr, host, port=1381, port_analyzer=1382):
super().__init__()
self.host = host
self.port = port
self.port_analyzer = port_analyzer
def open(self):
if hasattr(self, "socket"):
return
self.socket = initialize_connection(self.host, self.port)
def close(self):
if not hasattr(self, "socket"):
return
self.socket.close()
del self.socket
logger.debug("disconnected")
def read(self, length):
r = bytes()
while len(r) < length:
rn = self.socket.recv(min(8192, length - len(r)))
if not rn:
raise ConnectionResetError("Connection closed")
r += rn
return r
def write(self, data):
self.socket.sendall(data)
def get_analyzer_dump(self):
sock = initialize_connection(self.host, self.port_analyzer)
r = bytes()
while True:
buf = sock.recv(8192)
if not buf:
break
r += buf
sock.close()
return r

View File

@ -1,4 +1,7 @@
import os, sys
import numpy
from inspect import getfullargspec
from functools import wraps
from pythonparser import diagnostic
@ -10,8 +13,9 @@ from artiq.language.units import *
from artiq.compiler.module import Module
from artiq.compiler.embedding import Stitcher
from artiq.compiler.targets import OR1KTarget
from artiq.compiler.targets import RV32IMATarget, RV32GTarget, CortexA9Target
from artiq.coredevice.comm_kernel import CommKernel, CommKernelDummy
# Import for side effects (creating the exception classes).
from artiq.coredevice import exceptions
@ -41,90 +45,245 @@ class CompileError(Exception):
def rtio_init() -> TNone:
raise NotImplementedError("syscall not simulated")
@syscall(flags={"nounwind", "nowrite"})
def rtio_get_destination_status(linkno: TInt32) -> TBool:
raise NotImplementedError("syscall not simulated")
@syscall(flags={"nounwind", "nowrite"})
def rtio_get_counter() -> TInt64:
raise NotImplementedError("syscall not simulated")
def get_target_cls(target):
if target == "rv32g":
return RV32GTarget
elif target == "rv32ima":
return RV32IMATarget
elif target == "cortexa9":
return CortexA9Target
else:
raise ValueError("Unsupported target")
class Core:
"""Core device driver.
:param host: hostname or IP address of the core device.
:param ref_period: period of the reference clock for the RTIO subsystem.
On platforms that use clock multiplication and SERDES-based PHYs,
this is the period after multiplication. For example, with a RTIO core
clocked at 125MHz and a SERDES multiplication factor of 8, the
reference period is 1ns.
The time machine unit is equal to this period.
:param external_clock: whether the core device should switch to its
external RTIO clock input instead of using its internal oscillator.
:param ref_multiplier: ratio between the RTIO fine timestamp frequency
and the RTIO coarse timestamp frequency (e.g. SERDES multiplication
factor).
:param comm_device: name of the device used for communications.
:param analyzer_proxy: name of the core device analyzer proxy to trigger
(optional).
:param analyze_at_run_end: automatically trigger the core device analyzer
proxy after the Experiment's run stage finishes.
"""
kernel_invariants = {
"core", "ref_period", "coarse_ref_period", "ref_multiplier",
"external_clock",
}
def __init__(self, dmgr, ref_period, external_clock=False,
ref_multiplier=8, comm_device="comm"):
def __init__(self, dmgr,
host, ref_period,
analyzer_proxy=None, analyze_at_run_end=False,
ref_multiplier=8,
target="rv32g", satellite_cpu_targets={}):
self.ref_period = ref_period
self.external_clock = external_clock
self.ref_multiplier = ref_multiplier
self.satellite_cpu_targets = satellite_cpu_targets
self.target_cls = get_target_cls(target)
self.coarse_ref_period = ref_period*ref_multiplier
self.comm = dmgr.get(comm_device)
if host is None:
self.comm = CommKernelDummy()
else:
self.comm = CommKernel(host)
self.analyzer_proxy_name = analyzer_proxy
self.analyze_at_run_end = analyze_at_run_end
self.first_run = True
self.dmgr = dmgr
self.core = self
self.comm.core = self
self.analyzer_proxy = None
def compile(self, function, args, kwargs, set_result=None, with_attr_writeback=True):
def notify_run_end(self):
if self.analyze_at_run_end:
self.trigger_analyzer_proxy()
def close(self):
self.comm.close()
def compile(self, function, args, kwargs, set_result=None,
attribute_writeback=True, print_as_rpc=True,
target=None, destination=0, subkernel_arg_types=[]):
try:
engine = _DiagnosticEngine(all_errors_are_fatal=True)
stitcher = Stitcher(engine=engine, core=self, dmgr=self.dmgr)
stitcher = Stitcher(engine=engine, core=self, dmgr=self.dmgr,
print_as_rpc=print_as_rpc,
destination=destination, subkernel_arg_types=subkernel_arg_types)
stitcher.stitch_call(function, args, kwargs, set_result)
stitcher.finalize()
module = Module(stitcher, ref_period=self.ref_period)
target = OR1KTarget()
module = Module(stitcher,
ref_period=self.ref_period,
attribute_writeback=attribute_writeback)
target = target if target is not None else self.target_cls()
library = target.compile_and_link([module])
stripped_library = target.strip(library)
return stitcher.embedding_map, stripped_library, \
lambda addresses: target.symbolize(library, addresses), \
lambda symbols: target.demangle(symbols)
lambda symbols: target.demangle(symbols), \
module.subkernel_arg_types
except diagnostic.Error as error:
raise CompileError(error.diagnostic) from error
def run(self, function, args, kwargs):
result = None
def set_result(new_result):
nonlocal result
result = new_result
embedding_map, kernel_library, symbolizer, demangler = \
self.compile(function, args, kwargs, set_result)
def _run_compiled(self, kernel_library, embedding_map, symbolizer, demangler):
if self.first_run:
self.comm.check_ident()
self.comm.switch_clock(self.external_clock)
self.comm.check_system_info()
self.first_run = False
self.comm.load(kernel_library)
self.comm.run()
self.comm.serve(embedding_map, symbolizer, demangler)
def run(self, function, args, kwargs):
result = None
@rpc(flags={"async"})
def set_result(new_result):
nonlocal result
result = new_result
embedding_map, kernel_library, symbolizer, demangler, subkernel_arg_types = \
self.compile(function, args, kwargs, set_result)
self.compile_and_upload_subkernels(embedding_map, args, subkernel_arg_types)
self._run_compiled(kernel_library, embedding_map, symbolizer, demangler)
return result
def compile_subkernel(self, sid, subkernel_fn, embedding_map, args, subkernel_arg_types):
# pass self to subkernels (if applicable)
# assuming the first argument is self
subkernel_args = getfullargspec(subkernel_fn.artiq_embedded.function)
self_arg = []
if len(subkernel_args[0]) > 0:
if subkernel_args[0][0] == 'self':
self_arg = args[:1]
destination = subkernel_fn.artiq_embedded.destination
destination_tgt = self.satellite_cpu_targets[destination]
target = get_target_cls(destination_tgt)(subkernel_id=sid)
object_map, kernel_library, _, _, _ = \
self.compile(subkernel_fn, self_arg, {}, attribute_writeback=False,
print_as_rpc=False, target=target, destination=destination,
subkernel_arg_types=subkernel_arg_types.get(sid, []))
if object_map.has_rpc_or_subkernel():
raise ValueError("Subkernel must not use RPC or subkernels in other destinations")
return destination, kernel_library
def compile_and_upload_subkernels(self, embedding_map, args, subkernel_arg_types):
for sid, subkernel_fn in embedding_map.subkernels().items():
destination, kernel_library = \
self.compile_subkernel(sid, subkernel_fn, embedding_map,
args, subkernel_arg_types)
self.comm.upload_subkernel(kernel_library, sid, destination)
def precompile(self, function, *args, **kwargs):
"""Precompile a kernel and return a callable that executes it on the core device
at a later time.
Arguments to the kernel are set at compilation time and passed to this function,
as additional positional and keyword arguments.
The returned callable accepts no arguments.
Precompiled kernels may use RPCs and subkernels.
Object attributes at the beginning of a precompiled kernel execution have the
values they had at precompilation time. If up-to-date values are required,
use RPC to read them.
Similarly, modified values are not written back, and explicit RPC should be used
to modify host objects.
Carefully review the source code of drivers calls used in precompiled kernels, as
they may rely on host object attributes being transfered between kernel calls.
Examples include code used to control DDS phase, and Urukul RF switch control
via the CPLD register.
The return value of the callable is the return value of the kernel, if any.
The callable may be called several times.
"""
if not hasattr(function, "artiq_embedded"):
raise ValueError("Argument is not a kernel")
result = None
@rpc(flags={"async"})
def set_result(new_result):
nonlocal result
result = new_result
embedding_map, kernel_library, symbolizer, demangler, subkernel_arg_types = \
self.compile(function, args, kwargs, set_result, attribute_writeback=False)
self.compile_and_upload_subkernels(embedding_map, args, subkernel_arg_types)
@wraps(function)
def run_precompiled():
nonlocal result
self._run_compiled(kernel_library, embedding_map, symbolizer, demangler)
return result
return run_precompiled
@portable
def seconds_to_mu(self, seconds):
"""Convert seconds to the corresponding number of machine units
(RTIO cycles).
:param seconds: time (in seconds) to convert.
"""
return numpy.int64(seconds//self.ref_period)
@portable
def mu_to_seconds(self, mu):
"""Convert machine units (RTIO cycles) to seconds.
:param mu: cycle count to convert.
"""
return mu*self.ref_period
@kernel
def get_rtio_counter_mu(self):
"""Retrieve the current value of the hardware RTIO timeline counter.
As the timing of kernel code executed on the CPU is inherently
non-deterministic, the return value is by necessity only a lower bound
for the actual value of the hardware register at the instant when
execution resumes in the caller.
For a more detailed description of these concepts, see :doc:`/rtio`.
"""
return rtio_get_counter()
@kernel
def wait_until_mu(self, cursor_mu):
"""Block execution until the hardware RTIO counter reaches the given
value (see :meth:`get_rtio_counter_mu`).
If the hardware counter has already passed the given time, the function
returns immediately.
"""
while self.get_rtio_counter_mu() < cursor_mu:
pass
@kernel
def get_rtio_destination_status(self, destination):
"""Returns whether the specified RTIO destination is up.
This is particularly useful in startup kernels to delay
startup until certain DRTIO destinations are up."""
return rtio_get_destination_status(destination)
@kernel
def reset(self):
"""Clear RTIO FIFOs, release RTIO PHY reset, and set the time cursor
@ -143,3 +302,23 @@ class Core:
min_now = rtio_get_counter() + 125000
if now_mu() < min_now:
at_mu(min_now)
def trigger_analyzer_proxy(self):
"""Causes the core analyzer proxy to retrieve a dump from the device,
and distribute it to all connected clients (typically dashboards).
Returns only after the dump has been retrieved from the device.
Raises IOError if no analyzer proxy has been configured, or if the
analyzer proxy fails. In the latter case, more details would be
available in the proxy log.
"""
if self.analyzer_proxy is None:
if self.analyzer_proxy_name is not None:
self.analyzer_proxy = self.dmgr.get(self.analyzer_proxy_name)
if self.analyzer_proxy is None:
raise IOError("No analyzer proxy configured")
else:
success = self.analyzer_proxy.trigger()
if not success:
raise IOError("Analyzer proxy reported failure")

View File

@ -0,0 +1,641 @@
{
"$id": "https://m-labs.hk/kasli_generic.schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Kasli variant description",
"type": "object",
"properties": {
"_description": {
"type": "string",
"description": "Free-form description text"
},
"target": {
"type": "string",
"description": "Target board"
},
"variant": {
"type": "string",
"description": "Target board variant name"
},
"min_artiq_version": {
"type": "string",
"description": "Minimum required ARTIQ version",
"default": "0"
},
"hw_rev": {
"type": "string",
"description": "Hardware revision"
},
"base": {
"type": "string",
"enum": ["use_drtio_role", "standalone", "master", "satellite"],
"description": "Deprecated, use drtio_role instead",
"default": "use_drtio_role"
},
"drtio_role": {
"type": "string",
"enum": ["standalone", "master", "satellite"],
"description": "Role that this device takes in a DRTIO network; 'standalone' means no DRTIO",
"default": "standalone"
},
"ext_ref_frequency": {
"type": "number",
"exclusiveMinimum": 0,
"description": "External reference frequency"
},
"rtio_frequency": {
"type": "number",
"exclusiveMinimum": 0,
"default": 125e6,
"description": "RTIO frequency"
},
"core_addr": {
"type": "string",
"format": "ipv4",
"description": "IPv4 address",
"default": "192.168.1.70"
},
"vendor": {
"type": "string",
"description": "Board vendor"
},
"eui48": {
"type": "array",
"items": {
"type": "string",
"pattern": "^([0-9a-f]{2}-){5}[0-9a-f]{2}$",
"examples": ["80-1f-12-4c-22-7f"]
},
"description": "Ethernet MAC addresses"
},
"enable_sata_drtio": {
"type": "boolean",
"default": false
},
"sed_lanes": {
"type": "number",
"minimum": 1,
"maximum": 32,
"default": 8,
"description": "Number of FIFOs in the SED, must be a power of 2"
},
"peripherals": {
"type": "array",
"items": {
"$ref": "#/definitions/peripheral"
}
}
},
"if": {
"properties": {
"target": { "const": "kasli" },
"hw_rev": {
"not": {
"oneOf": [
{ "const": "v1.0" },
{ "const": "v1.1" }
]
}
}
}
},
"then": {
"properties": {
"enable_sata_drtio": {
"const": false
}
}
},
"required": ["target", "variant", "hw_rev", "base", "peripherals"],
"additionalProperties": false,
"oneOf": [
{
"properties": {
"target": {
"type": "string",
"const": "kasli"
},
"hw_rev": {
"type": "string",
"enum": ["v1.0", "v1.1", "v2.0"]
}
}
},
{
"properties": {
"target": {
"type": "string",
"const": "kasli_soc"
},
"hw_rev": {
"type": "string",
"enum": ["v1.0", "v1.1"]
}
}
}
],
"definitions": {
"peripheral": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": ["dio", "dio_spi", "urukul", "novogorny", "sampler", "suservo", "zotino", "grabber", "mirny", "fastino", "phaser", "hvamp", "shuttler"]
},
"board": {
"type": "string"
},
"hw_rev": {
"type": "string",
"pattern": "^v[0-9]+\\.[0-9]+"
}
},
"required": ["type"],
"allOf": [{
"title": "DIO",
"if": {
"properties": {
"type": {
"const": "dio"
}
}
},
"then": {
"properties": {
"ports": {
"type": "array",
"items": {
"type": "integer"
},
"minItems": 1,
"maxItems": 1
},
"edge_counter": {
"type": "boolean",
"default": false
},
"bank_direction_low": {
"type": "string",
"enum": ["input", "output", "clkgen"]
},
"bank_direction_high": {
"type": "string",
"enum": ["input", "output", "clkgen"]
}
},
"required": ["ports", "bank_direction_low", "bank_direction_high"]
}
}, {
"title": "DIO_SPI",
"if": {
"properties": {
"type": {
"const": "dio_spi"
}
}
},
"then": {
"properties": {
"ports": {
"type": "array",
"items": {
"type": "integer"
},
"minItems": 1,
"maxItems": 1
},
"spi": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"default": "dio_spi"
},
"clk": {
"type": "integer",
"minimum": 0,
"maximum": 7
},
"mosi": {
"type": "integer",
"minimum": 0,
"maximum": 7
},
"miso": {
"type": "integer",
"minimum": 0,
"maximum": 7
},
"cs": {
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 7
}
}
},
"required": ["clk"]
},
"minItems": 1
},
"ttl": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"default": "ttl"
},
"pin": {
"type": "integer",
"minimum": 0,
"maximum": 7
},
"direction": {
"type": "string",
"enum": ["input", "output"]
},
"edge_counter": {
"type": "boolean",
"default": false
}
},
"required": ["pin", "direction"]
},
"default": []
}
},
"required": ["ports", "spi"]
}
}, {
"title": "Urukul",
"if": {
"properties": {
"type": {
"const": "urukul"
}
}
},
"then": {
"properties": {
"ports": {
"type": "array",
"items": {
"type": "integer"
},
"minItems": 1,
"maxItems": 2
},
"synchronization": {
"type": "boolean",
"default": false
},
"refclk": {
"type": "number",
"minimum": 0
},
"clk_sel": {
"type": "integer",
"minimum": 0,
"maximum": 3
},
"clk_div": {
"type": "integer",
"minimum": 0,
"maximum": 3,
"default": 0
},
"pll_n": {
"type": "integer"
},
"pll_en": {
"type": "integer",
"minimum": 0,
"maximum": 1,
"default": 1
},
"pll_vco": {
"type": "integer"
},
"dds": {
"type": "string",
"enum": ["ad9910", "ad9912"],
"default": "ad9910"
}
},
"required": ["ports"]
}
}, {
"title": "Novogorny",
"if": {
"properties": {
"type": {
"const": "novogorny"
}
}
},
"then": {
"properties": {
"ports": {
"type": "array",
"items": {
"type": "integer"
},
"minItems": 1,
"maxItems": 1
}
},
"required": ["ports"]
}
}, {
"title": "Sampler",
"if": {
"properties": {
"type": {
"const": "sampler"
}
}
},
"then": {
"properties": {
"ports": {
"type": "array",
"items": {
"type": "integer"
},
"minItems": 1,
"maxItems": 2
}
},
"required": ["ports"]
}
}, {
"title": "SUServo",
"if": {
"properties": {
"type": {
"const": "suservo"
}
}
},
"then": {
"properties": {
"sampler_ports": {
"type": "array",
"items": {
"type": "integer"
},
"minItems": 2,
"maxItems": 2
},
"sampler_hw_rev": {
"type": "string",
"pattern": "^v[0-9]+\\.[0-9]+",
"default": "v2.2"
},
"urukul0_ports": {
"type": "array",
"items": {
"type": "integer"
},
"minItems": 2,
"maxItems": 2
},
"urukul1_ports": {
"type": "array",
"items": {
"type": "integer"
},
"minItems": 2,
"maxItems": 2
},
"refclk": {
"type": "number",
"minimum": 0
},
"clk_sel": {
"type": "integer",
"minimum": 0,
"maximum": 3
},
"pll_n": {
"type": "integer",
"default": 32
},
"pll_en": {
"type": "integer",
"minimum": 0,
"maximum": 1,
"default": 1
},
"pll_vco": {
"type": "integer"
}
},
"required": ["sampler_ports", "urukul0_ports"]
}
}, {
"title": "Zotino",
"if": {
"properties": {
"type": {
"const": "zotino"
}
}
},
"then": {
"properties": {
"ports": {
"type": "array",
"items": {
"type": "integer"
},
"minItems": 1,
"maxItems": 1
}
},
"required": ["ports"]
}
}, {
"title": "Grabber",
"if": {
"properties": {
"type": {
"const": "grabber"
}
}
},
"then": {
"properties": {
"ports": {
"type": "array",
"items": {
"type": "integer"
},
"minItems": 1,
"maxItems": 3
}
},
"required": ["ports"]
}
}, {
"title": "Mirny",
"if": {
"properties": {
"type": {
"const": "mirny"
}
}
},
"then": {
"properties": {
"ports": {
"type": "array",
"items": {
"type": "integer"
},
"minItems": 1,
"maxItems": 1
},
"refclk": {
"type": "number",
"exclusiveMinimum": 0,
"default": 100e6
},
"clk_sel": {
"oneOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 3
},
{
"type": "string",
"enum": ["xo", "mmcx", "sma"]
}
],
"default": 0
},
"almazny": {
"type": "boolean",
"default": false
},
"almazny_hw_rev": {
"type": "string",
"pattern": "^v[0-9]+\\.[0-9]+",
"default": "v1.2"
}
},
"required": ["ports"]
}
}, {
"title": "Fastino",
"if": {
"properties": {
"type": {
"const": "fastino"
}
}
},
"then": {
"properties": {
"ports": {
"type": "array",
"items": {
"type": "integer"
},
"minItems": 1,
"maxItems": 1
},
"log2_width": {
"type": "integer",
"default": 0,
"description": "Width of DAC channel group (logarithm base 2)"
}
},
"required": ["ports"]
}
}, {
"title": "Phaser",
"if": {
"properties": {
"type": {
"const": "phaser"
}
}
},
"then": {
"properties": {
"ports": {
"type": "array",
"items": {
"type": "integer"
},
"minItems": 1,
"maxItems": 1
},
"mode": {
"type": "string",
"enum": ["base", "miqro"],
"default": "base"
}
},
"required": ["ports"]
}
}, {
"title": "HVAmp",
"if": {
"properties": {
"type": {
"const": "hvamp"
}
}
},
"then": {
"properties": {
"ports": {
"type": "array",
"items": {
"type": "integer"
},
"minItems": 1,
"maxItems": 1
}
},
"required": ["ports"]
}
},{
"title": "Shuttler",
"if": {
"properties": {
"type": {
"const": "shuttler"
}
}
},
"then": {
"properties": {
"ports": {
"type": "array",
"items": {
"type": "integer"
},
"minItems": 1,
"maxItems": 2
},
"drtio_destination": {
"type": "integer"
}
},
"required": ["ports"]
}
}]
}
}
}

View File

@ -0,0 +1,277 @@
class DAC34H84:
"""DAC34H84 settings and register map.
For possible values, documentation, and explanation, see the DAC datasheet
at https://www.ti.com/lit/pdf/slas751
"""
qmc_corr_ena = 0 # msb ab
qmc_offset_ena = 0 # msb ab
invsinc_ena = 0 # msb ab
interpolation = 1 # 2x
fifo_ena = 1
alarm_out_ena = 1
alarm_out_pol = 1
clkdiv_sync_ena = 1
iotest_ena = 0
cnt64_ena = 0
oddeven_parity = 0 # even
single_parity_ena = 1
dual_parity_ena = 0
rev_interface = 0
dac_complement = 0b0000 # msb A
alarm_fifo = 0b111 # msb 2-away
dacclkgone_ena = 1
dataclkgone_ena = 1
collisiongone_ena = 1
sif4_ena = 1
mixer_ena = 0
mixer_gain = 1
nco_ena = 0
revbus = 0
twos = 1
coarse_dac = 9 # 18.75 mA, 0-15
sif_txenable = 0
mask_alarm_from_zerochk = 0
mask_alarm_fifo_collision = 0
mask_alarm_fifo_1away = 0
mask_alarm_fifo_2away = 0
mask_alarm_dacclk_gone = 0
mask_alarm_dataclk_gone = 0
mask_alarm_output_gone = 0
mask_alarm_from_iotest = 0
mask_alarm_from_pll = 0
mask_alarm_parity = 0b0000 # msb a
qmc_offseta = 0 # 12b
fifo_offset = 2 # 0-7
qmc_offsetb = 0 # 12b
qmc_offsetc = 0 # 12b
qmc_offsetd = 0 # 12b
qmc_gaina = 0 # 11b
cmix_fs8 = 0
cmix_fs4 = 0
cmix_fs2 = 0
cmix_nfs4 = 0
qmc_gainb = 0 # 11b
qmc_gainc = 0 # 11b
output_delayab = 0b00
output_delaycd = 0b00
qmc_gaind = 0 # 11b
qmc_phaseab = 0 # 12b
qmc_phasecd = 0 # 12b
phase_offsetab = 0 # 16b
phase_offsetcd = 0 # 16b
phase_addab_lsb = 0 # 16b
phase_addab_msb = 0 # 16b
phase_addcd_lsb = 0 # 16b
phase_addcd_msb = 0 # 16b
pll_reset = 0
pll_ndivsync_ena = 1
pll_ena = 1
pll_cp = 0b01 # single charge pump
pll_p = 0b100 # p=4
pll_m2 = 1 # x2
pll_m = 8 # m = 8
pll_n = 0b0001 # n = 2
pll_vcotune = 0b01
pll_vco = 0x3f # 4 GHz
bias_sleep = 0
tsense_sleep = 0
pll_sleep = 0
clkrecv_sleep = 0
dac_sleep = 0b0000 # msb a
extref_ena = 0
fuse_sleep = 1
atest = 0b00000 # atest mode
syncsel_qmcoffsetab = 0b1001 # sif_sync and register write
syncsel_qmcoffsetcd = 0b1001 # sif_sync and register write
syncsel_qmccorrab = 0b1001 # sif_sync and register write
syncsel_qmccorrcd = 0b1001 # sif_sync and register write
syncsel_mixerab = 0b1001 # sif_sync and register write
syncsel_mixercd = 0b1001 # sif_sync and register write
syncsel_nco = 0b1000 # sif_sync
syncsel_fifo_input = 0b10 # external lvds istr
sif_sync = 0
syncsel_fifoin = 0b0010 # istr
syncsel_fifoout = 0b0100 # ostr
clkdiv_sync_sel = 0 # ostr
path_a_sel = 0
path_b_sel = 1
path_c_sel = 2
path_d_sel = 3
# swap dac pairs (CDAB) for layout
# swap I-Q dacs for spectral inversion
dac_a_sel = 3
dac_b_sel = 2
dac_c_sel = 1
dac_d_sel = 0
dac_sleep_en = 0b1111 # msb a
clkrecv_sleep_en = 1
pll_sleep_en = 1
lvds_data_sleep_en = 1
lvds_control_sleep_en = 1
temp_sense_sleep_en = 1
bias_sleep_en = 1
data_dly = 2
clk_dly = 0
ostrtodig_sel = 0
ramp_ena = 0
sifdac_ena = 0
grp_delaya = 0x00
grp_delayb = 0x00
grp_delayc = 0x00
grp_delayd = 0x00
sifdac = 0
def __init__(self, updates=None):
if updates is None:
return
for key, value in updates.items():
if not hasattr(self, key):
raise KeyError("invalid setting", key)
setattr(self, key, value)
def get_mmap(self):
mmap = []
mmap.append(
(0x00 << 16) |
(self.qmc_offset_ena << 14) | (self.qmc_corr_ena << 12) |
(self.interpolation << 8) | (self.fifo_ena << 7) |
(self.alarm_out_ena << 4) | (self.alarm_out_pol << 3) |
(self.clkdiv_sync_ena << 2) | (self.invsinc_ena << 0))
mmap.append(
(0x01 << 16) |
(self.iotest_ena << 15) | (self.cnt64_ena << 12) |
(self.oddeven_parity << 11) | (self.single_parity_ena << 10) |
(self.dual_parity_ena << 9) | (self.rev_interface << 8) |
(self.dac_complement << 4) | (self.alarm_fifo << 1))
mmap.append(
(0x02 << 16) |
(self.dacclkgone_ena << 14) | (self.dataclkgone_ena << 13) |
(self.collisiongone_ena << 12) | (self.sif4_ena << 7) |
(self.mixer_ena << 6) | (self.mixer_gain << 5) |
(self.nco_ena << 4) | (self.revbus << 3) | (self.twos << 1))
mmap.append((0x03 << 16) | (self.coarse_dac << 12) |
(self.sif_txenable << 0))
mmap.append(
(0x07 << 16) |
(self.mask_alarm_from_zerochk << 15) | (1 << 14) |
(self.mask_alarm_fifo_collision << 13) |
(self.mask_alarm_fifo_1away << 12) |
(self.mask_alarm_fifo_2away << 11) |
(self.mask_alarm_dacclk_gone << 10) |
(self.mask_alarm_dataclk_gone << 9) |
(self.mask_alarm_output_gone << 8) |
(self.mask_alarm_from_iotest << 7) | (1 << 6) |
(self.mask_alarm_from_pll << 5) | (self.mask_alarm_parity << 1))
mmap.append(
(0x08 << 16) | (self.qmc_offseta << 0))
mmap.append(
(0x09 << 16) | (self.fifo_offset << 13) | (self.qmc_offsetb << 0))
mmap.append((0x0a << 16) | (self.qmc_offsetc << 0))
mmap.append((0x0b << 16) | (self.qmc_offsetd << 0))
mmap.append((0x0c << 16) | (self.qmc_gaina << 0))
mmap.append(
(0x0d << 16) |
(self.cmix_fs8 << 15) | (self.cmix_fs4 << 14) |
(self.cmix_fs2 << 13) | (self.cmix_nfs4 << 12) |
(self.qmc_gainb << 0))
mmap.append((0x0e << 16) | (self.qmc_gainc << 0))
mmap.append(
(0x0f << 16) |
(self.output_delayab << 14) | (self.output_delaycd << 12) |
(self.qmc_gaind << 0))
mmap.append((0x10 << 16) | (self.qmc_phaseab << 0))
mmap.append((0x11 << 16) | (self.qmc_phasecd << 0))
mmap.append((0x12 << 16) | (self.phase_offsetab << 0))
mmap.append((0x13 << 16) | (self.phase_offsetcd << 0))
mmap.append((0x14 << 16) | (self.phase_addab_lsb << 0))
mmap.append((0x15 << 16) | (self.phase_addab_msb << 0))
mmap.append((0x16 << 16) | (self.phase_addcd_lsb << 0))
mmap.append((0x17 << 16) | (self.phase_addcd_msb << 0))
mmap.append(
(0x18 << 16) |
(0b001 << 13) | (self.pll_reset << 12) |
(self.pll_ndivsync_ena << 11) | (self.pll_ena << 10) |
(self.pll_cp << 6) | (self.pll_p << 3))
mmap.append(
(0x19 << 16) |
(self.pll_m2 << 15) | (self.pll_m << 8) | (self.pll_n << 4) |
(self.pll_vcotune << 2))
mmap.append(
(0x1a << 16) |
(self.pll_vco << 10) | (self.bias_sleep << 7) |
(self.tsense_sleep << 6) |
(self.pll_sleep << 5) | (self.clkrecv_sleep << 4) |
(self.dac_sleep << 0))
mmap.append(
(0x1b << 16) |
(self.extref_ena << 15) | (self.fuse_sleep << 11) |
(self.atest << 0))
mmap.append(
(0x1e << 16) |
(self.syncsel_qmcoffsetab << 12) |
(self.syncsel_qmcoffsetcd << 8) |
(self.syncsel_qmccorrab << 4) |
(self.syncsel_qmccorrcd << 0))
mmap.append(
(0x1f << 16) |
(self.syncsel_mixerab << 12) | (self.syncsel_mixercd << 8) |
(self.syncsel_nco << 4) | (self.syncsel_fifo_input << 2) |
(self.sif_sync << 1))
mmap.append(
(0x20 << 16) |
(self.syncsel_fifoin << 12) | (self.syncsel_fifoout << 8) |
(self.clkdiv_sync_sel << 0))
mmap.append(
(0x22 << 16) |
(self.path_a_sel << 14) | (self.path_b_sel << 12) |
(self.path_c_sel << 10) | (self.path_d_sel << 8) |
(self.dac_a_sel << 6) | (self.dac_b_sel << 4) |
(self.dac_c_sel << 2) | (self.dac_d_sel << 0))
mmap.append(
(0x23 << 16) |
(self.dac_sleep_en << 12) | (self.clkrecv_sleep_en << 11) |
(self.pll_sleep_en << 10) | (self.lvds_data_sleep_en << 9) |
(self.lvds_control_sleep_en << 8) |
(self.temp_sense_sleep_en << 7) | (1 << 6) |
(self.bias_sleep_en << 5) | (0x1f << 0))
mmap.append(
(0x24 << 16) | (self.data_dly << 13) | (self.clk_dly << 10))
mmap.append(
(0x2d << 16) |
(self.ostrtodig_sel << 14) | (self.ramp_ena << 13) |
(0x002 << 1) | (self.sifdac_ena << 0))
mmap.append(
(0x2e << 16) | (self.grp_delaya << 8) | (self.grp_delayb << 0))
mmap.append(
(0x2f << 16) | (self.grp_delayc << 8) | (self.grp_delayd << 0))
mmap.append((0x30 << 16) | self.sifdac)
return mmap

View File

@ -1,239 +0,0 @@
from artiq.language.core import *
from artiq.language.types import *
from artiq.language.units import *
_PHASE_MODE_DEFAULT = -1
# keep in sync with dds.h
PHASE_MODE_CONTINUOUS = 0
PHASE_MODE_ABSOLUTE = 1
PHASE_MODE_TRACKING = 2
@syscall(flags={"nowrite"})
def dds_init(time_mu: TInt64, bus_channel: TInt32, channel: TInt32) -> TNone:
raise NotImplementedError("syscall not simulated")
@syscall(flags={"nowrite"})
def dds_init_sync(time_mu: TInt64, bus_channel: TInt32,
channel: TInt32, sync_delay: TInt32) -> TNone:
raise NotImplementedError("syscall not simulated")
@syscall(flags={"nowrite"})
def dds_set(time_mu: TInt64, bus_channel: TInt32, channel: TInt32, ftw: TInt32,
pow: TInt32, phase_mode: TInt32, amplitude: TInt32) -> TNone:
raise NotImplementedError("syscall not simulated")
@syscall(flags={"nowrite"})
def dds_batch_enter(time_mu: TInt64) -> TNone:
raise NotImplementedError("syscall not simulated")
@syscall(flags={"nowrite"})
def dds_batch_exit() -> TNone:
raise NotImplementedError("syscall not simulated")
class _BatchContextManager:
kernel_invariants = {"core", "core_dds"}
def __init__(self, core_dds):
self.core_dds = core_dds
self.core = self.core_dds.core
@kernel
def __enter__(self):
self.core_dds.dds_batch_enter()
@kernel
def __exit__(self, type, value, traceback):
self.core_dds.dds_batch_exit()
class CoreDDS:
"""Core device Direct Digital Synthesis (DDS) driver.
Gives access to the DDS functionality of the core device.
:param sysclk: DDS system frequency. The DDS system clock must be a
phase-locked multiple of the RTIO clock.
"""
kernel_invariants = {"core", "sysclk", "batch"}
def __init__(self, dmgr, sysclk, core_device="core"):
self.core = dmgr.get(core_device)
self.sysclk = sysclk
self.batch = _BatchContextManager(self)
@kernel
def dds_batch_enter(self):
"""Starts a DDS command batch. All DDS commands are buffered
after this call, until ``batch_exit`` is called.
The time of execution of the DDS commands is the time cursor position
when the batch is entered."""
dds_batch_enter(now_mu())
@kernel
def dds_batch_exit(self):
"""Ends a DDS command batch. All buffered DDS commands are issued
on the bus."""
dds_batch_exit()
class _DDSGeneric:
"""Core device Direct Digital Synthesis (DDS) channel driver.
Controls one DDS channel managed directly by the core device's runtime.
This class should not be used directly, instead, use the chip-specific
drivers such as ``AD9858`` and ``AD9914``.
The time cursor is not modified by any function in this class.
:param bus: name of the DDS bus device that this DDS is connected to.
:param channel: channel number of the DDS device to control.
"""
kernel_invariants = {
"core", "core_dds", "bus_channel", "channel", "pow_width"
}
def __init__(self, dmgr, bus_channel, channel, core_dds_device="core_dds"):
self.core_dds = dmgr.get(core_dds_device)
self.core = self.core_dds.core
self.bus_channel = bus_channel
self.channel = channel
self.phase_mode = PHASE_MODE_CONTINUOUS
@portable(flags=["fast-math"])
def frequency_to_ftw(self, frequency):
"""Returns the frequency tuning word corresponding to the given
frequency.
"""
return round(int(2, width=64)**32*frequency/self.core_dds.sysclk)
@portable(flags=["fast-math"])
def ftw_to_frequency(self, ftw):
"""Returns the frequency corresponding to the given frequency tuning
word.
"""
return ftw*self.core_dds.sysclk/int(2, width=64)**32
@portable(flags=["fast-math"])
def turns_to_pow(self, turns):
"""Returns the phase offset word corresponding to the given phase
in turns."""
return round(turns*2**self.pow_width)
@portable(flags=["fast-math"])
def pow_to_turns(self, pow):
"""Returns the phase in turns corresponding to the given phase offset
word."""
return pow/2**self.pow_width
@portable(flags=["fast-math"])
def amplitude_to_asf(self, amplitude):
"""Returns amplitude scale factor corresponding to given amplitude."""
return round(amplitude*0x0fff)
@portable(flags=["fast-math"])
def asf_to_amplitude(self, asf):
"""Returns the amplitude corresponding to the given amplitude scale
factor."""
return asf/0x0fff
@kernel
def init(self):
"""Resets and initializes the DDS channel.
This needs to be done for each DDS channel before it can be used, and
it is recommended to use the startup kernel for this.
This function cannot be used in a batch; the correct way of
initializing multiple DDS channels is to call this function
sequentially with a delay between the calls. 2ms provides a good
timing margin."""
dds_init(now_mu(), self.bus_channel, self.channel)
@kernel
def set_phase_mode(self, phase_mode):
"""Sets the phase mode of the DDS channel. Supported phase modes are:
* ``PHASE_MODE_CONTINUOUS``: the phase accumulator is unchanged when
switching frequencies. The DDS phase is the sum of the phase
accumulator and the phase offset. The only discrete jumps in the
DDS output phase come from changes to the phase offset.
* ``PHASE_MODE_ABSOLUTE``: the phase accumulator is reset when
switching frequencies. Thus, the phase of the DDS at the time of
the frequency change is equal to the phase offset.
* ``PHASE_MODE_TRACKING``: when switching frequencies, the phase
accumulator is set to the value it would have if the DDS had been
running at the specified frequency since the start of the
experiment.
"""
self.phase_mode = phase_mode
@kernel
def set_mu(self, frequency, phase=0, phase_mode=_PHASE_MODE_DEFAULT,
amplitude=0x0fff):
"""Sets the DDS channel to the specified frequency and phase.
This uses machine units (FTW and POW). The frequency tuning word width
is 32, whereas the phase offset word width depends on the type of DDS
chip and can be retrieved via the ``pow_width`` attribute. The amplitude
width is 12.
The "frequency update" pulse is sent to the DDS with a fixed latency
with respect to the current position of the time cursor.
:param frequency: frequency to generate.
:param phase: adds an offset, in turns, to the phase.
:param phase_mode: if specified, overrides the default phase mode set
by ``set_phase_mode`` for this call.
"""
if phase_mode == _PHASE_MODE_DEFAULT:
phase_mode = self.phase_mode
dds_set(now_mu(), self.bus_channel, self.channel,
frequency, phase, phase_mode, amplitude)
@kernel
def set(self, frequency, phase=0.0, phase_mode=_PHASE_MODE_DEFAULT,
amplitude=1.0):
"""Like ``set_mu``, but uses Hz and turns."""
self.set_mu(self.frequency_to_ftw(frequency),
self.turns_to_pow(phase), phase_mode,
self.amplitude_to_asf(amplitude))
class AD9858(_DDSGeneric):
"""Driver for AD9858 DDS chips. See ``_DDSGeneric`` for a description
of the functionality."""
pow_width = 14
class AD9914(_DDSGeneric):
"""Driver for AD9914 DDS chips. See ``_DDSGeneric`` for a description
of the functionality."""
pow_width = 16
@kernel
def init_sync(self, sync_delay=0):
"""Resets and initializes the DDS channel as well as configures
the AD9914 DDS for synchronisation. The synchronisation procedure
follows the steps outlined in the AN-1254 application note.
This needs to be done for each DDS channel before it can be used, and
it is recommended to use the startup kernel for this.
This function cannot be used in a batch; the correct way of
initializing multiple DDS channels is to call this function
sequentially with a delay between the calls. 10ms provides a good
timing margin.
:param sync_delay: integer from 0 to 0x3f that sets the value of
SYNC_OUT (bits 3-5) and SYNC_IN (bits 0-2) delay ADJ bits.
"""
dds_init_sync(now_mu(), self.bus_channel, self.channel, sync_delay)

124
artiq/coredevice/dma.py Normal file
View File

@ -0,0 +1,124 @@
"""Direct Memory Access (DMA) extension.
This feature allows storing pre-defined sequences of output RTIO events into
the core device's SDRAM, and playing them back at higher speeds than the CPU
alone could achieve.
"""
from artiq.language.core import syscall, kernel
from artiq.language.types import TInt32, TInt64, TStr, TNone, TTuple, TBool
from artiq.coredevice.exceptions import DMAError
from numpy import int64
@syscall
def dma_record_start(name: TStr) -> TNone:
raise NotImplementedError("syscall not simulated")
@syscall
def dma_record_stop(duration: TInt64, enable_ddma: TBool) -> TNone:
raise NotImplementedError("syscall not simulated")
@syscall
def dma_erase(name: TStr) -> TNone:
raise NotImplementedError("syscall not simulated")
@syscall
def dma_retrieve(name: TStr) -> TTuple([TInt64, TInt32, TBool]):
raise NotImplementedError("syscall not simulated")
@syscall
def dma_playback(timestamp: TInt64, ptr: TInt32, enable_ddma: TBool) -> TNone:
raise NotImplementedError("syscall not simulated")
class DMARecordContextManager:
"""Context manager returned by :meth:`CoreDMA.record()`.
Upon entering, starts recording a DMA trace. All RTIO operations are
redirected to a newly created DMA buffer after this call, and ``now``
is reset to zero.
Upon leaving, stops recording a DMA trace. All recorded RTIO operations
are stored in a newly created trace, and ``now`` is restored to the value
it had before the context manager was entered.
"""
def __init__(self):
self.name = ""
self.saved_now_mu = int64(0)
self.enable_ddma = False
@kernel
def __enter__(self):
dma_record_start(self.name) # this may raise, so do it before altering now
self.saved_now_mu = now_mu()
at_mu(0)
@kernel
def __exit__(self, type, value, traceback):
dma_record_stop(now_mu(), self.enable_ddma) # see above
at_mu(self.saved_now_mu)
class CoreDMA:
"""Core device Direct Memory Access (DMA) driver.
Gives access to the DMA functionality of the core device.
"""
kernel_invariants = {"core", "recorder"}
def __init__(self, dmgr, core_device="core"):
self.core = dmgr.get(core_device)
self.recorder = DMARecordContextManager()
self.epoch = 0
@kernel
def record(self, name, enable_ddma=False):
"""Returns a context manager that will record a DMA trace called ``name``.
Any previously recorded trace with the same name is overwritten.
The trace will persist across kernel switches.
In DRTIO context, distributed DMA can be toggled with ``enable_ddma``.
Enabling it allows running DMA on satellites, rather than sending all
events from the master.
Keeping it disabled it may improve performance in some scenarios,
e.g. when there are many small satellite buffers."""
self.epoch += 1
self.recorder.name = name
self.recorder.enable_ddma = enable_ddma
return self.recorder
@kernel
def erase(self, name):
"""Removes the DMA trace with the given name from storage."""
self.epoch += 1
dma_erase(name)
@kernel
def playback(self, name):
"""Replays a previously recorded DMA trace. This function blocks until
the entire trace is submitted to the RTIO FIFOs."""
(advance_mu, ptr, uses_ddma) = dma_retrieve(name)
dma_playback(now_mu(), ptr, uses_ddma)
delay_mu(advance_mu)
@kernel
def get_handle(self, name):
"""Returns a handle to a previously recorded DMA trace. The returned handle
is only valid until the next call to :meth:`record` or :meth:`erase`."""
(advance_mu, ptr, uses_ddma) = dma_retrieve(name)
return (self.epoch, advance_mu, ptr, uses_ddma)
@kernel
def playback_handle(self, handle):
"""Replays a handle obtained with :meth:`get_handle`. Using this function
is much faster than :meth:`playback` for replaying a set of traces repeatedly,
but incurs the overhead of managing the handles onto the programmer."""
(epoch, advance_mu, ptr, uses_ddma) = handle
if self.epoch != epoch:
raise DMAError("Invalid handle")
dma_playback(now_mu(), ptr, uses_ddma)
delay_mu(advance_mu)

View File

@ -0,0 +1,240 @@
"""Driver for RTIO-enabled TTL edge counter.
Like for the TTL input PHYs, sensitivity can be configured over RTIO
(``gate_rising()``, etc.). In contrast to the former, however, the count is
accumulated in gateware, and only a single input event is generated at the end
of each gate period::
with parallel:
doppler_cool()
self.pmt_counter.gate_rising(1 * ms)
with parallel:
readout()
self.pmt_counter.gate_rising(100 * us)
print("Doppler cooling counts:", self.pmt_counter.fetch_count())
print("Readout counts:", self.pmt_counter.fetch_count())
For applications where the timestamps of the individual input events are not
required, this has two advantages over ``TTLInOut.count()`` beyond raw
throughput. First, it is easy to count events during multiple separate periods
without blocking to read back counts in between, as illustrated in the above
example. Secondly, as each count total only takes up a single input event, it
is much easier to acquire counts on several channels in parallel without
risking input FIFO overflows::
# Using the TTLInOut driver, pmt_1 input events are only processed
# after pmt_0 is done counting. To avoid RTIOOverflows, a round-robin
# scheme would have to be implemented manually.
with parallel:
self.pmt_0.gate_rising(10 * ms)
self.pmt_1.gate_rising(10 * ms)
counts_0 = self.pmt_0.count(now_mu()) # blocks
counts_1 = self.pmt_1.count(now_mu())
#
# Using gateware counters, only a single input event each is
# generated, greatly reducing the load on the input FIFOs:
with parallel:
self.pmt_0_counter.gate_rising(10 * ms)
self.pmt_1_counter.gate_rising(10 * ms)
counts_0 = self.pmt_0_counter.fetch_count() # blocks
counts_1 = self.pmt_1_counter.fetch_count()
See :mod:`artiq.gateware.rtio.phy.edge_counter` and
:meth:`artiq.gateware.eem.DIO.add_std` for the gateware components.
"""
from artiq.language.core import *
from artiq.language.types import *
from artiq.coredevice.rtio import (rtio_output, rtio_input_data,
rtio_input_timestamped_data)
from numpy import int32, int64
CONFIG_COUNT_RISING = 0b0001
CONFIG_COUNT_FALLING = 0b0010
CONFIG_SEND_COUNT_EVENT = 0b0100
CONFIG_RESET_TO_ZERO = 0b1000
class CounterOverflow(Exception):
"""Raised when an edge counter value is read which indicates that the
counter might have overflowed."""
pass
class EdgeCounter:
"""RTIO TTL edge counter driver driver.
Like for regular TTL inputs, timeline periods where the counter is
sensitive to a chosen set of input transitions can be specified. Unlike the
former, however, the specified edges do not create individual input events;
rather, the total count can be requested as a single input event from the
core (typically at the end of the gate window).
:param channel: The RTIO channel of the gateware phy.
:param gateware_width: The width of the gateware counter register, in
bits. This is only used for overflow handling; to change the size,
the gateware needs to be rebuilt.
"""
kernel_invariants = {"core", "channel", "counter_max"}
def __init__(self, dmgr, channel, gateware_width=31, core_device="core"):
self.core = dmgr.get(core_device)
self.channel = channel
self.counter_max = (1 << (gateware_width - 1)) - 1
@staticmethod
def get_rtio_channels(channel, **kwargs):
return [(channel, None)]
@kernel
def gate_rising(self, duration):
"""Count rising edges for the given duration and request the total at
the end.
The counter is reset at the beginning of the gate period. Use
:meth:`set_config` directly for more detailed control.
:param duration: The duration for which the gate is to stay open.
:return: The timestamp at the end of the gate period, in machine units.
"""
return self.gate_rising_mu(self.core.seconds_to_mu(duration))
@kernel
def gate_falling(self, duration):
"""Count falling edges for the given duration and request the total at
the end.
The counter is reset at the beginning of the gate period. Use
:meth:`set_config` directly for more detailed control.
:param duration: The duration for which the gate is to stay open.
:return: The timestamp at the end of the gate period, in machine units.
"""
return self.gate_falling_mu(self.core.seconds_to_mu(duration))
@kernel
def gate_both(self, duration):
"""Count both rising and falling edges for the given duration, and
request the total at the end.
The counter is reset at the beginning of the gate period. Use
:meth:`set_config` directly for more detailed control.
:param duration: The duration for which the gate is to stay open.
:return: The timestamp at the end of the gate period, in machine units.
"""
return self.gate_both_mu(self.core.seconds_to_mu(duration))
@kernel
def gate_rising_mu(self, duration_mu):
"""See :meth:`gate_rising`."""
return self._gate_mu(
duration_mu, count_rising=True, count_falling=False)
@kernel
def gate_falling_mu(self, duration_mu):
"""See :meth:`gate_falling`."""
return self._gate_mu(
duration_mu, count_rising=False, count_falling=True)
@kernel
def gate_both_mu(self, duration_mu):
"""See :meth:`gate_both_mu`."""
return self._gate_mu(
duration_mu, count_rising=True, count_falling=True)
@kernel
def _gate_mu(self, duration_mu, count_rising, count_falling):
self.set_config(
count_rising=count_rising,
count_falling=count_falling,
send_count_event=False,
reset_to_zero=True)
delay_mu(duration_mu)
self.set_config(
count_rising=False,
count_falling=False,
send_count_event=True,
reset_to_zero=False)
return now_mu()
@kernel
def set_config(self, count_rising: TBool, count_falling: TBool,
send_count_event: TBool, reset_to_zero: TBool):
"""Emit an RTIO event at the current timeline position to set the
gateware configuration.
For most use cases, the `gate_*` wrappers will be more convenient.
:param count_rising: Whether to count rising signal edges.
:param count_falling: Whether to count falling signal edges.
:param send_count_event: If `True`, an input event with the current
counter value is generated on the next clock cycle (once).
:param reset_to_zero: If `True`, the counter value is reset to zero on
the next clock cycle (once).
"""
config = int32(0)
if count_rising:
config |= CONFIG_COUNT_RISING
if count_falling:
config |= CONFIG_COUNT_FALLING
if send_count_event:
config |= CONFIG_SEND_COUNT_EVENT
if reset_to_zero:
config |= CONFIG_RESET_TO_ZERO
rtio_output(self.channel << 8, config)
@kernel
def fetch_count(self) -> TInt32:
"""Wait for and return count total from previously requested input
event.
It is valid to trigger multiple gate periods without immediately
reading back the count total; the results will be returned in order on
subsequent fetch calls.
This function blocks until a result becomes available.
"""
count = rtio_input_data(self.channel)
if count == self.counter_max:
raise CounterOverflow(
"Input edge counter overflow on RTIO channel {0}",
int64(self.channel))
return count
@kernel
def fetch_timestamped_count(
self, timeout_mu=int64(-1)) -> TTuple([TInt64, TInt32]):
"""Wait for and return the timestamp and count total of a previously
requested input event.
It is valid to trigger multiple gate periods without immediately
reading back the count total; the results will be returned in order on
subsequent fetch calls.
This function blocks until a result becomes available or the given
timeout elapses.
:return: A tuple of timestamp (-1 if timeout elapsed) and counter
value. (The timestamp is that of the requested input event
typically the gate closing time and not that of any input edges.)
"""
timestamp, count = rtio_input_timestamped_data(timeout_mu,
self.channel)
if count == self.counter_max:
raise CounterOverflow(
"Input edge counter overflow on RTIO channel {0}",
int64(self.channel))
return timestamp, count

View File

@ -10,54 +10,100 @@ from artiq.coredevice.runtime import source_loader
ZeroDivisionError = builtins.ZeroDivisionError
ValueError = builtins.ValueError
IndexError = builtins.IndexError
RuntimeError = builtins.RuntimeError
AssertionError = builtins.AssertionError
class CoreException:
"""Information about an exception raised or passed through the core device."""
def __init__(self, exceptions, exception_info, traceback, stack_pointers):
self.exceptions = exceptions
self.exception_info = exception_info
self.traceback = list(traceback)
self.stack_pointers = stack_pointers
def __init__(self, name, message, params, traceback):
first_exception = exceptions[0]
name = first_exception[0]
if ':' in name:
exn_id, self.name = name.split(':', 2)
self.id = int(exn_id)
else:
self.id, self.name = 0, name
self.message, self.params = message, params
self.traceback = list(traceback)
self.message = first_exception[1]
self.params = first_exception[2]
def append_backtrace(self, record, inlined=False):
filename, line, column, function, address = record
stub_globals = {"__name__": filename, "__loader__": source_loader}
source_line = linecache.getline(filename, line, stub_globals)
indentation = re.search(r"^\s*", source_line).end()
if address is None:
formatted_address = ""
elif inlined:
formatted_address = " (inlined)"
else:
formatted_address = " (RA=+0x{:x})".format(address)
filename = filename.replace(artiq_dir, "<artiq>")
lines = []
if column == -1:
lines.append(" {}".format(source_line.strip() if source_line else "<unknown>"))
lines.append(" File \"{file}\", line {line}, in {function}{address}".
format(file=filename, line=line, function=function,
address=formatted_address))
else:
lines.append(" {}^".format(" " * (column - indentation)))
lines.append(" {}".format(source_line.strip() if source_line else "<unknown>"))
lines.append(" File \"{file}\", line {line}, column {column},"
" in {function}{address}".
format(file=filename, line=line, column=column + 1,
function=function, address=formatted_address))
return lines
def single_traceback(self, exception_index):
# note that we insert in reversed order
lines = []
last_sp = 0
start_backtrace_index = self.exception_info[exception_index][1]
zipped = list(zip(self.traceback[start_backtrace_index:],
self.stack_pointers[start_backtrace_index:]))
exception = self.exceptions[exception_index]
name = exception[0]
message = exception[1]
params = exception[2]
if ':' in name:
exn_id, name = name.split(':', 2)
exn_id = int(exn_id)
else:
exn_id = 0
lines.append("{}({}): {}".format(name, exn_id, message.format(*params)))
zipped.append(((exception[3], exception[4], exception[5], exception[6],
None, []), None))
for ((filename, line, column, function, address, inlined), sp) in zipped:
# backtrace of nested exceptions may be discontinuous
# but the stack pointer must increase monotonically
if sp is not None and sp <= last_sp:
continue
last_sp = sp
for record in reversed(inlined):
lines += self.append_backtrace(record, True)
lines += self.append_backtrace((filename, line, column, function,
address))
lines.append("Traceback (most recent call first):")
return "\n".join(reversed(lines))
def __str__(self):
lines = []
lines.append("Core Device Traceback (most recent call last):")
last_address = 0
for (filename, line, column, function, address) in self.traceback:
stub_globals = {"__name__": filename, "__loader__": source_loader}
source_line = linecache.getline(filename, line, stub_globals)
indentation = re.search(r"^\s*", source_line).end()
if address is None:
formatted_address = ""
elif address == last_address:
formatted_address = " (inlined)"
else:
formatted_address = " (RA=+0x{:x})".format(address)
last_address = address
filename = filename.replace(artiq_dir, "<artiq>")
if column == -1:
lines.append(" File \"{file}\", line {line}, in {function}{address}".
format(file=filename, line=line, function=function,
address=formatted_address))
lines.append(" {}".format(source_line.strip() if source_line else "<unknown>"))
else:
lines.append(" File \"{file}\", line {line}, column {column},"
" in {function}{address}".
format(file=filename, line=line, column=column + 1,
function=function, address=formatted_address))
lines.append(" {}".format(source_line.strip() if source_line else "<unknown>"))
lines.append(" {}^".format(" " * (column - indentation)))
lines.append("{}({}): {}".format(self.name, self.id,
self.message.format(*self.params)))
return "\n".join(lines)
tracebacks = [self.single_traceback(i) for i in range(len(self.exceptions))]
traceback_str = ('\n\nDuring handling of the above exception, ' +
'another exception occurred:\n\n').join(tracebacks)
return 'Core Device Traceback:\n' +\
traceback_str +\
'\n\nEnd of Core Device Traceback\n'
class InternalError(Exception):
@ -71,44 +117,13 @@ class CacheError(Exception):
class RTIOUnderflow(Exception):
"""Raised when the CPU fails to submit a RTIO event early enough
(with respect to the event's timestamp).
"""Raised when the CPU or DMA core fails to submit a RTIO event early
enough (with respect to the event's timestamp).
The offending event is discarded and the RTIO core keeps operating.
"""
artiq_builtin = True
class RTIOSequenceError(Exception):
"""Raised when an event is submitted on a given channel with a timestamp
not larger than the previous one.
The offending event is discarded and the RTIO core keeps operating.
"""
artiq_builtin = True
class RTIOCollision(Exception):
"""Raised when an event is submitted on a given channel with the same
coarse timestamp as the previous one but with a different fine timestamp.
Coarse timestamps correspond to the RTIO system clock (typically around
125MHz) whereas fine timestamps correspond to the RTIO SERDES clock
(typically around 1GHz).
The offending event is discarded and the RTIO core keeps operating.
"""
artiq_builtin = True
class RTIOBusy(Exception):
"""Raised when at least one output event could not be executed because
the given channel was already busy executing a previous event.
This exception is raised late: after the error condition occurred. More
specifically it is raised on submitting an event on the same channel after
the execution of the faulty event was attempted.
The offending event was discarded.
"""
artiq_builtin = True
class RTIOOverflow(Exception):
"""Raised when at least one event could not be registered into the RTIO
@ -120,19 +135,35 @@ class RTIOOverflow(Exception):
"""
artiq_builtin = True
class DDSError(Exception):
"""Raised when attempting to start a DDS batch while already in a batch,
when too many commands are batched, and when DDS channel settings are
incorrect.
class RTIODestinationUnreachable(Exception):
"""Raised with a RTIO operation could not be completed due to a DRTIO link
being down.
"""
artiq_builtin = True
class I2CError(Exception):
"""Raised with a I2C transaction fails."""
class DMAError(Exception):
"""Raised when performing an invalid DMA operation."""
artiq_builtin = True
class SubkernelError(Exception):
"""Raised when an operation regarding a subkernel is invalid
or cannot be completed.
"""
artiq_builtin = True
class WatchdogExpired(Exception):
"""Raised when a watchdog expires."""
class ClockFailure(Exception):
"""Raised when RTIO PLL has lost lock."""
class I2CError(Exception):
"""Raised when a I2C transaction fails."""
pass
class SPIError(Exception):
"""Raised when a SPI transaction fails."""
pass

304
artiq/coredevice/fastino.py Normal file
View File

@ -0,0 +1,304 @@
"""RTIO driver for the Fastino 32channel, 16 bit, 2.5 MS/s per channel,
streaming DAC.
"""
from numpy import int32, int64
from artiq.language.core import kernel, portable, delay, delay_mu
from artiq.coredevice.rtio import (rtio_output, rtio_output_wide,
rtio_input_data)
from artiq.language.units import ns
from artiq.language.types import TInt32, TList
class Fastino:
"""Fastino 32-channel, 16-bit, 2.5 MS/s per channel streaming DAC
The RTIO PHY supports staging DAC data before transmitting them by writing
to the DAC RTIO addresses, if a channel is not "held" by setting its bit
using :meth:`set_hold`, the next frame will contain the update. For the
DACs held, the update is triggered explicitly by setting the corresponding
bit using :meth:`set_update`. Update is self-clearing. This enables atomic
DAC updates synchronized to a frame edge.
The `log2_width=0` RTIO layout uses one DAC channel per RTIO address and a
dense RTIO address space. The RTIO words are narrow (32 bit) and
few-channel updates are efficient. There is the least amount of DAC state
tracking in kernels, at the cost of more DMA and RTIO data.
The setting here and in the RTIO PHY (gateware) must match.
Other `log2_width` (up to `log2_width=5`) settings pack multiple
(in powers of two) DAC channels into one group and into one RTIO write.
The RTIO data width increases accordingly. The `log2_width`
LSBs of the RTIO address for a DAC channel write must be zero and the
address space is sparse. For `log2_width=5` the RTIO data is 512 bit wide.
If `log2_width` is zero, the :meth:`set_dac`/:meth:`set_dac_mu` interface
must be used. If non-zero, the :meth:`set_group`/:meth:`set_group_mu`
interface must be used.
:param channel: RTIO channel number
:param core_device: Core device name (default: "core")
:param log2_width: Width of DAC channel group (logarithm base 2).
Value must match the corresponding value in the RTIO PHY (gateware).
"""
kernel_invariants = {"core", "channel", "width", "t_frame"}
def __init__(self, dmgr, channel, core_device="core", log2_width=0):
self.channel = channel << 8
self.core = dmgr.get(core_device)
self.width = 1 << log2_width
# frame duration in mu (14 words each 7 clock cycles each 4 ns)
# self.core.seconds_to_mu(14*7*4*ns) # unfortunately this may round wrong
assert self.core.ref_period == 1*ns
self.t_frame = int64(14*7*4)
@staticmethod
def get_rtio_channels(channel, **kwargs):
return [(channel, None)]
@kernel
def init(self):
"""Initialize the device.
* disables RESET, DAC_CLR, enables AFE_PWR
* clears error counters, enables error counting
* turns LEDs off
* clears `hold` and `continuous` on all channels
* clear and resets interpolators to unit rate change on all
channels
It does not change set channel voltages and does not reset the PLLs or clock
domains.
Note: On Fastino gateware before v0.2 this may lead to 0 voltage being emitted
transiently.
"""
self.set_cfg(reset=0, afe_power_down=0, dac_clr=0, clr_err=1)
delay_mu(self.t_frame)
self.set_cfg(reset=0, afe_power_down=0, dac_clr=0, clr_err=0)
delay_mu(self.t_frame)
self.set_continuous(0)
delay_mu(self.t_frame)
self.stage_cic(1)
delay_mu(self.t_frame)
self.apply_cic(0xffffffff)
delay_mu(self.t_frame)
self.set_leds(0)
delay_mu(self.t_frame)
self.set_hold(0)
delay_mu(self.t_frame)
@kernel
def write(self, addr, data):
"""Write data to a Fastino register.
:param addr: Address to write to.
:param data: Data to write.
"""
rtio_output(self.channel | addr, data)
@kernel
def read(self, addr):
"""Read from Fastino register.
TODO: untested
:param addr: Address to read from.
:return: The data read.
"""
raise NotImplementedError
# rtio_output(self.channel | addr | 0x80)
# return rtio_input_data(self.channel >> 8)
@kernel
def set_dac_mu(self, dac, data):
"""Write DAC data in machine units.
:param dac: DAC channel to write to (0-31).
:param data: DAC word to write, 16 bit unsigned integer, in machine
units.
"""
self.write(dac, data)
@kernel
def set_group_mu(self, dac: TInt32, data: TList(TInt32)):
"""Write a group of DAC channels in machine units.
:param dac: First channel in DAC channel group (0-31). The `log2_width`
LSBs must be zero.
:param data: List of DAC data pairs (2x16 bit unsigned) to write,
in machine units. Data exceeding group size is ignored.
If the list length is less than group size, the remaining
DAC channels within the group are cleared to 0 (machine units).
"""
if dac & (self.width - 1):
raise ValueError("Group index LSBs must be zero")
rtio_output_wide(self.channel | dac, data)
@portable
def voltage_to_mu(self, voltage):
"""Convert SI Volts to DAC machine units.
:param voltage: Voltage in SI Volts.
:return: DAC data word in machine units, 16 bit integer.
"""
data = int32(round((0x8000/10.)*voltage)) + int32(0x8000)
if data < 0 or data > 0xffff:
raise ValueError("DAC voltage out of bounds")
return data
@portable
def voltage_group_to_mu(self, voltage, data):
"""Convert SI Volts to packed DAC channel group machine units.
:param voltage: List of SI Volt voltages.
:param data: List of DAC channel data pairs to write to.
Half the length of `voltage`.
"""
for i in range(len(voltage)):
v = self.voltage_to_mu(voltage[i])
if i & 1:
v = data[i // 2] | (v << 16)
data[i // 2] = int32(v)
@kernel
def set_dac(self, dac, voltage):
"""Set DAC data to given voltage.
:param dac: DAC channel (0-31).
:param voltage: Desired output voltage.
"""
self.write(dac, self.voltage_to_mu(voltage))
@kernel
def set_group(self, dac, voltage):
"""Set DAC group data to given voltage.
:param dac: DAC channel (0-31).
:param voltage: Desired output voltage.
"""
data = [int32(0)] * (len(voltage) // 2)
self.voltage_group_to_mu(voltage, data)
self.set_group_mu(dac, data)
@kernel
def update(self, update):
"""Schedule channels for update.
:param update: Bit mask of channels to update (32 bit).
"""
self.write(0x20, update)
@kernel
def set_hold(self, hold):
"""Set channels to manual update.
:param hold: Bit mask of channels to hold (32 bit).
"""
self.write(0x21, hold)
@kernel
def set_cfg(self, reset=0, afe_power_down=0, dac_clr=0, clr_err=0):
"""Set configuration bits.
:param reset: Reset SPI PLL and SPI clock domain.
:param afe_power_down: Disable AFE power.
:param dac_clr: Assert all 32 DAC_CLR signals setting all DACs to
mid-scale (0 V).
:param clr_err: Clear error counters and PLL reset indicator.
This clears the sticky red error LED. Must be cleared to enable
error counting.
"""
self.write(0x22, (reset << 0) | (afe_power_down << 1) |
(dac_clr << 2) | (clr_err << 3))
@kernel
def set_leds(self, leds):
"""Set the green user-defined LEDs
:param leds: LED status, 8 bit integer each bit corresponding to one
green LED.
"""
self.write(0x23, leds)
@kernel
def set_continuous(self, channel_mask):
"""Enable continuous DAC updates on channels regardless of new data
being submitted.
"""
self.write(0x25, channel_mask)
@kernel
def stage_cic_mu(self, rate_mantissa, rate_exponent, gain_exponent):
"""Stage machine unit CIC interpolator configuration.
"""
if rate_mantissa < 0 or rate_mantissa >= 1 << 6:
raise ValueError("rate_mantissa out of bounds")
if rate_exponent < 0 or rate_exponent >= 1 << 4:
raise ValueError("rate_exponent out of bounds")
if gain_exponent < 0 or gain_exponent >= 1 << 6:
raise ValueError("gain_exponent out of bounds")
config = rate_mantissa | (rate_exponent << 6) | (gain_exponent << 10)
self.write(0x26, config)
@kernel
def stage_cic(self, rate) -> TInt32:
"""Compute and stage interpolator configuration.
This method approximates the desired interpolation rate using a 10 bit
floating point representation (6 bit mantissa, 4 bit exponent) and
then determines an optimal interpolation gain compensation exponent
to avoid clipping. Gains for rates that are powers of two are accurately
compensated. Other rates lead to overall less than unity gain (but more
than 0.5 gain).
The overall gain including gain compensation is
`actual_rate**order/2**ceil(log2(actual_rate**order))`
where `order = 3`.
Returns the actual interpolation rate.
"""
if rate <= 0 or rate > 1 << 16:
raise ValueError("rate out of bounds")
rate_mantissa = rate
rate_exponent = 0
while rate_mantissa > 1 << 6:
rate_exponent += 1
rate_mantissa >>= 1
order = 3
gain = 1
for i in range(order):
gain *= rate_mantissa
gain_exponent = 0
while gain > 1 << gain_exponent:
gain_exponent += 1
gain_exponent += order*rate_exponent
assert gain_exponent <= order*16
self.stage_cic_mu(rate_mantissa - 1, rate_exponent, gain_exponent)
return rate_mantissa << rate_exponent
@kernel
def apply_cic(self, channel_mask):
"""Apply the staged interpolator configuration on the specified channels.
Each Fastino channel starting with gateware v0.2 includes a fourth order
(cubic) CIC interpolator with variable rate change and variable output
gain compensation (see :meth:`stage_cic`).
Fastino gateware before v0.2 does not include the interpolators and the
methods affecting the CICs should not be used.
Channels using non-unity interpolation rate should have
continous DAC updates enabled (see :meth:`set_continuous`) unless
their output is supposed to be constant.
This method resets and settles the affected interpolators. There will be
no output updates for the next `order = 3` input samples.
Affected channels will only accept one input sample per input sample
period. This method synchronizes the input sample period to the current
frame on the affected channels.
If application of new interpolator settings results in a change of the
overall gain, there will be a corresponding output step.
"""
self.write(0x27, channel_mask)

View File

@ -0,0 +1,51 @@
# Definitions for using the "FMC DIO 32ch LVDS a" card with the VHDCI-EEM breakout v1.1
eem_fmc_connections = {
0: [0, 8, 2, 3, 4, 5, 6, 7],
1: [1, 9, 10, 11, 12, 13, 14, 15],
2: [17, 16, 24, 19, 20, 21, 22, 23],
3: [18, 25, 26, 27, 28, 29, 30, 31],
}
def shiftreg_bits(eem, out_pins):
"""
Returns the bits that have to be set in the FMC card direction
shift register for the given EEM.
Takes a set of pin numbers (0-7) at the EEM. Return values
of this function for different EEMs should be ORed together.
"""
r = 0
for i in range(8):
if i not in out_pins:
lvds_line = eem_fmc_connections[eem][i]
# lines are swapped in pairs to ease PCB routing
# at the shift register
shift = lvds_line ^ 1
r |= 1 << shift
return r
dio_bank0_out_pins = set(range(4))
dio_bank1_out_pins = set(range(4, 8))
urukul_out_pins = {
0, # clk
1, # mosi
3, 4, 5, # cs_n
6, # io_update
7, # dds_reset
}
urukul_aux_out_pins = {
4, # sw0
5, # sw1
6, # sw2
7, # sw3
}
zotino_out_pins = {
0, # clk
1, # mosi
3, 4, # cs_n
5, # ldac_n
7, # clr_n
}

109
artiq/coredevice/grabber.py Normal file
View File

@ -0,0 +1,109 @@
from numpy import int32, int64
from artiq.language.core import *
from artiq.language.types import *
from artiq.coredevice.rtio import rtio_output, rtio_input_data
class OutOfSyncException(Exception):
"""Raised when an incorrect number of ROI engine outputs has been
retrieved from the RTIO input FIFO."""
pass
class Grabber:
"""Driver for the Grabber camera interface."""
kernel_invariants = {"core", "channel_base", "sentinel"}
def __init__(self, dmgr, channel_base, res_width=12, count_shift=0,
core_device="core"):
self.core = dmgr.get(core_device)
self.channel_base = channel_base
count_width = min(31, 2*res_width + 16 - count_shift)
# This value is inserted by the gateware to mark the start of a series of
# ROI engine outputs for one video frame.
self.sentinel = int32(int64(2**count_width))
@staticmethod
def get_rtio_channels(channel_base, **kwargs):
return [(channel_base, "ROI coordinates"), (channel_base + 1, "ROI mask")]
@kernel
def setup_roi(self, n, x0, y0, x1, y1):
"""
Defines the coordinates of a ROI.
The coordinates are set around the current position of the RTIO time
cursor.
The user must keep the ROI engine disabled for the duration of more
than one video frame after calling this function, as the output
generated for that video frame is undefined.
Advances the timeline by 4 coarse RTIO cycles.
"""
c = int64(self.core.ref_multiplier)
rtio_output((self.channel_base << 8) | (4*n+0), x0)
delay_mu(c)
rtio_output((self.channel_base << 8) | (4*n+1), y0)
delay_mu(c)
rtio_output((self.channel_base << 8) | (4*n+2), x1)
delay_mu(c)
rtio_output((self.channel_base << 8) | (4*n+3), y1)
delay_mu(c)
@kernel
def gate_roi(self, mask):
"""
Defines which ROI engines produce input events.
At the end of each video frame, the output from each ROI engine that
has been enabled by the mask is enqueued into the RTIO input FIFO.
This function sets the mask at the current position of the RTIO time
cursor.
Setting the mask using this function is atomic; in other words,
if the system is in the middle of processing a frame and the mask
is changed, the processing will complete using the value of the mask
that it started with.
:param mask: bitmask enabling or disabling each ROI engine.
"""
rtio_output((self.channel_base + 1) << 8, mask)
@kernel
def gate_roi_pulse(self, mask, dt):
"""Sets a temporary mask for the specified duration (in seconds), before
disabling all ROI engines."""
self.gate_roi(mask)
delay(dt)
self.gate_roi(0)
@kernel
def input_mu(self, data):
"""
Retrieves the accumulated values for one frame from the ROI engines.
Blocks until values are available.
The input list must be a list of integers of the same length as there
are enabled ROI engines. This method replaces the elements of the
input list with the outputs of the enabled ROI engines, sorted by
number.
If the number of elements in the list does not match the number of
ROI engines that produced output, an exception will be raised during
this call or the next.
"""
channel = self.channel_base + 1
sentinel = rtio_input_data(channel)
if sentinel != self.sentinel:
raise OutOfSyncException
for i in range(len(data)):
roi_output = rtio_input_data(channel)
if roi_output == self.sentinel:
raise OutOfSyncException
data[i] = roi_output

View File

@ -1,15 +1,20 @@
"""
Non-realtime drivers for I2C chips on the core device.
"""
from artiq.language.core import syscall, kernel
from artiq.language.types import TBool, TInt32, TNone
from artiq.coredevice.exceptions import I2CError
@syscall(flags={"nowrite"})
def i2c_init(busno: TInt32) -> TNone:
@syscall(flags={"nounwind", "nowrite"})
def i2c_start(busno: TInt32) -> TNone:
raise NotImplementedError("syscall not simulated")
@syscall(flags={"nounwind", "nowrite"})
def i2c_start(busno: TInt32) -> TNone:
def i2c_restart(busno: TInt32) -> TNone:
raise NotImplementedError("syscall not simulated")
@ -28,8 +33,122 @@ def i2c_read(busno: TInt32, ack: TBool) -> TInt32:
raise NotImplementedError("syscall not simulated")
class PCA9548:
"""Driver for the PCA9548 I2C bus switch.
@syscall(flags={"nounwind", "nowrite"})
def i2c_switch_select(busno: TInt32, address: TInt32, mask: TInt32) -> TNone:
raise NotImplementedError("syscall not simulated")
@kernel
def i2c_poll(busno, busaddr):
"""Poll I2C device at address.
:param busno: I2C bus number
:param busaddr: 8 bit I2C device address (LSB=0)
:returns: True if the poll was ACKed
"""
i2c_start(busno)
ack = i2c_write(busno, busaddr)
i2c_stop(busno)
return ack
@kernel
def i2c_write_byte(busno, busaddr, data, ack=True):
"""Write one byte to a device.
:param busno: I2C bus number
:param busaddr: 8 bit I2C device address (LSB=0)
:param data: Data byte to be written
:param nack: Allow NACK
"""
i2c_start(busno)
try:
if not i2c_write(busno, busaddr):
raise I2CError("failed to ack bus address")
if not i2c_write(busno, data) and ack:
raise I2CError("failed to ack write data")
finally:
i2c_stop(busno)
@kernel
def i2c_read_byte(busno, busaddr):
"""Read one byte from a device.
:param busno: I2C bus number
:param busaddr: 8 bit I2C device address (LSB=0)
:returns: Byte read
"""
i2c_start(busno)
data = 0
try:
if not i2c_write(busno, busaddr | 1):
raise I2CError("failed to ack bus read address")
data = i2c_read(busno, ack=False)
finally:
i2c_stop(busno)
return data
@kernel
def i2c_write_many(busno, busaddr, addr, data, ack_last=True):
"""Transfer multiple bytes to a device.
:param busno: I2c bus number
:param busaddr: 8 bit I2C device address (LSB=0)
:param addr: 8 bit data address
:param data: Data bytes to be written
:param ack_last: Expect I2C ACK of the last byte written. If `False`,
the last byte may be NACKed (e.g. EEPROM full page writes).
"""
n = len(data)
i2c_start(busno)
try:
if not i2c_write(busno, busaddr):
raise I2CError("failed to ack bus address")
if not i2c_write(busno, addr):
raise I2CError("failed to ack data address")
for i in range(n):
if not i2c_write(busno, data[i]) and (
i < n - 1 or ack_last):
raise I2CError("failed to ack write data")
finally:
i2c_stop(busno)
@kernel
def i2c_read_many(busno, busaddr, addr, data):
"""Transfer multiple bytes from a device.
:param busno: I2c bus number
:param busaddr: 8 bit I2C device address (LSB=0)
:param addr: 8 bit data address
:param data: List of integers to be filled with the data read.
One entry ber byte.
"""
m = len(data)
i2c_start(busno)
try:
if not i2c_write(busno, busaddr):
raise I2CError("failed to ack bus address")
if not i2c_write(busno, addr):
raise I2CError("failed to ack data address")
i2c_restart(busno)
if not i2c_write(busno, busaddr | 1):
raise I2CError("failed to ack bus read address")
for i in range(m):
data[i] = i2c_read(busno, ack=i < m - 1)
finally:
i2c_stop(busno)
class I2CSwitch:
"""Driver for the I2C bus switch.
PCA954X (or other) type detection is done by the CPU during I2C init.
I2C transactions not real-time, and are performed by the CPU without
involving RTIO.
On the KC705, this chip is used for selecting the I2C buses on the two FMC
connectors. HPC=1, LPC=2.
@ -41,40 +160,25 @@ class PCA9548:
@kernel
def set(self, channel):
"""Select one channel.
Selecting multiple channels at the same time is not supported by this
driver.
"""Enable one channel.
:param channel: channel number (0-7)
"""
i2c_init(self.busno)
i2c_start(self.busno)
try:
if not i2c_write(self.busno, self.address):
raise I2CError("PCA9548 failed to ack address")
if not i2c_write(self.busno, 1 << channel):
raise I2CError("PCA9548 failed to ack control word")
finally:
i2c_stop(self.busno)
i2c_switch_select(self.busno, self.address >> 1, 1 << channel)
@kernel
def readback(self):
i2c_init(self.busno)
i2c_start(self.busno)
r = 0
try:
if not i2c_write(self.busno, self.address | 1):
raise I2CError("PCA9548 failed to ack address")
r = i2c_read(self.busno, False)
finally:
i2c_stop(self.busno)
return r
def unset(self):
"""Disable output of the I2C switch.
"""
i2c_switch_select(self.busno, self.address >> 1, 0)
class TCA6424A:
"""Driver for the TCA6424A I2C I/O expander.
I2C transactions not real-time, and are performed by the CPU without
involving RTIO.
On the NIST QC2 hardware, this chip is used for switching the directions
of TTL buffers."""
def __init__(self, dmgr, busno=0, address=0x44, core_device="core"):
@ -83,20 +187,9 @@ class TCA6424A:
self.address = address
@kernel
def _write24(self, command, value):
i2c_init(self.busno)
i2c_start(self.busno)
try:
if not i2c_write(self.busno, self.address):
raise I2CError("TCA6424A failed to ack address")
if not i2c_write(self.busno, command):
raise I2CError("TCA6424A failed to ack command")
for i in range(3):
if not i2c_write(self.busno, value >> 16):
raise I2CError("TCA6424A failed to ack data")
value <<= 8
finally:
i2c_stop(self.busno)
def _write24(self, addr, value):
i2c_write_many(self.busno, self.address, addr,
[value >> 16, value >> 8, value])
@kernel
def set(self, outputs):
@ -115,3 +208,46 @@ class TCA6424A:
self._write24(0x8c, 0) # set all directions to output
self._write24(0x84, outputs_le) # set levels
class PCF8574A:
"""Driver for the PCF8574 I2C remote 8-bit I/O expander.
I2C transactions not real-time, and are performed by the CPU without
involving RTIO.
"""
def __init__(self, dmgr, busno=0, address=0x7c, core_device="core"):
self.core = dmgr.get(core_device)
self.busno = busno
self.address = address
@kernel
def set(self, data):
"""Drive data on the quasi-bidirectional pins.
:param data: Pin data. High bits are weakly driven high
(and thus inputs), low bits are strongly driven low.
"""
i2c_start(self.busno)
try:
if not i2c_write(self.busno, self.address):
raise I2CError("PCF8574A failed to ack address")
if not i2c_write(self.busno, data):
raise I2CError("PCF8574A failed to ack data")
finally:
i2c_stop(self.busno)
@kernel
def get(self):
"""Retrieve quasi-bidirectional pin input data.
:return: Pin data
"""
i2c_start(self.busno)
ret = 0
try:
if not i2c_write(self.busno, self.address | 1):
raise I2CError("PCF8574A failed to ack address")
ret = i2c_read(self.busno, False)
finally:
i2c_stop(self.busno)
return ret

View File

@ -0,0 +1,38 @@
from os import path
import json
from jsonschema import Draft7Validator, validators
def extend_with_default(validator_class):
validate_properties = validator_class.VALIDATORS["properties"]
def set_defaults(validator, properties, instance, schema):
for property, subschema in properties.items():
if "default" in subschema:
instance.setdefault(property, subschema["default"])
for error in validate_properties(
validator, properties, instance, schema,
):
yield error
return validators.extend(
validator_class, {"properties" : set_defaults},
)
schema_path = path.join(path.dirname(__file__), "coredevice_generic.schema.json")
with open(schema_path, "r") as f:
schema = json.load(f)
validator = extend_with_default(Draft7Validator)(schema)
def load(description_path):
with open(description_path, "r") as f:
result = json.load(f)
global validator
validator.validate(result)
if result["base"] != "use_drtio_role":
result["drtio_role"] = result["base"]
return result

View File

@ -0,0 +1,77 @@
from numpy import int32
from artiq.experiment import *
from artiq.coredevice.i2c import i2c_write_many, i2c_read_many, i2c_poll
port_mapping = {
"EEM0": 7,
"EEM1": 5,
"EEM2": 4,
"EEM3": 3,
"EEM4": 2,
"EEM5": 1,
"EEM6": 0,
"EEM7": 6,
"EEM8": 12,
"EEM9": 13,
"EEM10": 15,
"EEM11": 14,
"SFP0": 8,
"SFP1": 9,
"SFP2": 10,
"LOC0": 11,
}
class KasliEEPROM:
def __init__(self, dmgr, port, busno=0,
core_device="core", sw0_device="i2c_switch0", sw1_device="i2c_switch1"):
self.core = dmgr.get(core_device)
self.sw0 = dmgr.get(sw0_device)
self.sw1 = dmgr.get(sw1_device)
self.busno = busno
self.port = port_mapping[port]
self.address = 0xa0 # i2c 8 bit
@kernel
def select(self):
mask = 1 << self.port
if self.port < 8:
self.sw0.set(self.port)
self.sw1.unset()
else:
self.sw0.unset()
self.sw1.set(self.port - 8)
@kernel
def deselect(self):
self.sw0.unset()
self.sw1.unset()
@kernel
def write_i32(self, addr, value):
self.select()
try:
data = [0]*4
for i in range(4):
data[i] = (value >> 24) & 0xff
value <<= 8
i2c_write_many(self.busno, self.address, addr, data)
i2c_poll(self.busno, self.address)
finally:
self.deselect()
@kernel
def read_i32(self, addr):
self.select()
try:
data = [0]*4
i2c_read_many(self.busno, self.address, addr, data)
value = int32(0)
for i in range(4):
value <<= 8
value |= data[i]
finally:
self.deselect()
return value

169
artiq/coredevice/mirny.py Normal file
View File

@ -0,0 +1,169 @@
"""RTIO driver for Mirny (4 channel GHz PLLs)
"""
from artiq.language.core import kernel, delay, portable
from artiq.language.units import us
from numpy import int32
from artiq.coredevice import spi2 as spi
SPI_CONFIG = (
0 * spi.SPI_OFFLINE
| 0 * spi.SPI_END
| 0 * spi.SPI_INPUT
| 1 * spi.SPI_CS_POLARITY
| 0 * spi.SPI_CLK_POLARITY
| 0 * spi.SPI_CLK_PHASE
| 0 * spi.SPI_LSB_FIRST
| 0 * spi.SPI_HALF_DUPLEX
)
# SPI clock write and read dividers
SPIT_WR = 4
SPIT_RD = 16
SPI_CS = 1
WE = 1 << 24
# supported CPLD code version
PROTO_REV_MATCH = 0x0
class Mirny:
"""
Mirny PLL-based RF generator.
:param spi_device: SPI bus device
:param refclk: Reference clock (SMA, MMCX or on-board 100 MHz oscillator)
frequency in Hz
:param clk_sel: Reference clock selection.
Valid options are: "XO" - onboard crystal oscillator;
"SMA" - front-panel SMA connector; "MMCX" - internal MMCX connector.
Passing an integer writes it as ``clk_sel`` in the CPLD's register 1.
The effect depends on the hardware revision.
:param core_device: Core device name (default: "core")
"""
kernel_invariants = {"bus", "core", "refclk", "clk_sel_hw_rev"}
def __init__(self, dmgr, spi_device, refclk=100e6, clk_sel="XO", core_device="core"):
self.core = dmgr.get(core_device)
self.bus = dmgr.get(spi_device)
# reference clock frequency
self.refclk = refclk
if not (10 <= self.refclk / 1e6 <= 600):
raise ValueError("Invalid refclk")
# reference clock selection
try:
self.clk_sel_hw_rev = {
# clk source: [reserved, reserved, v1.1, v1.0]
"xo": [-1, -1, 0, 0],
"mmcx": [-1, -1, 3, 2],
"sma": [-1, -1, 2, 3],
}[clk_sel.lower()]
except AttributeError: # not a string, fallback to int
if clk_sel & 0x3 != clk_sel:
raise ValueError("Invalid clk_sel") from None
self.clk_sel_hw_rev = [clk_sel] * 4
except KeyError:
raise ValueError("Invalid clk_sel") from None
self.clk_sel = -1
# board hardware revision
self.hw_rev = 0 # v1.0: 3, v1.1: 2
# TODO: support clk_div on v1.0 boards
@kernel
def read_reg(self, addr):
"""Read a register"""
self.bus.set_config_mu(
SPI_CONFIG | spi.SPI_INPUT | spi.SPI_END, 24, SPIT_RD, SPI_CS
)
self.bus.write((addr << 25))
return self.bus.read() & int32(0xFFFF)
@kernel
def write_reg(self, addr, data):
"""Write a register"""
self.bus.set_config_mu(SPI_CONFIG | spi.SPI_END, 24, SPIT_WR, SPI_CS)
self.bus.write((addr << 25) | WE | ((data & 0xFFFF) << 8))
@kernel
def init(self, blind=False):
"""
Initialize and detect Mirny.
Select the clock source based the board's hardware revision.
Raise ValueError if the board's hardware revision is not supported.
:param blind: Verify presence and protocol compatibility. Raise ValueError on failure.
"""
reg0 = self.read_reg(0)
self.hw_rev = reg0 & 0x3
if not blind:
if (reg0 >> 2) & 0x3 != PROTO_REV_MATCH:
raise ValueError("Mirny PROTO_REV mismatch")
delay(100 * us) # slack
# select clock source
self.clk_sel = self.clk_sel_hw_rev[self.hw_rev]
if self.clk_sel < 0:
raise ValueError("Hardware revision not supported")
self.write_reg(1, (self.clk_sel << 4))
delay(1000 * us)
@portable(flags={"fast-math"})
def att_to_mu(self, att):
"""Convert an attenuation setting in dB to machine units.
:param att: Attenuation setting in dB.
:return: Digital attenuation setting.
"""
code = int32(255) - int32(round(att * 8))
if code < 0 or code > 255:
raise ValueError("Invalid Mirny attenuation!")
return code
@kernel
def set_att_mu(self, channel, att):
"""Set digital step attenuator in machine units.
:param att: Attenuation setting, 8 bit digital.
"""
self.bus.set_config_mu(SPI_CONFIG | spi.SPI_END, 16, SPIT_WR, SPI_CS)
self.bus.write(((channel | 8) << 25) | (att << 16))
@kernel
def set_att(self, channel, att):
"""Set digital step attenuator in SI units.
This method will write the attenuator settings of the selected channel.
.. seealso:: :meth:`set_att_mu`
:param channel: Attenuator channel (0-3).
:param att: Attenuation setting in dB. Higher value is more
attenuation. Minimum attenuation is 0*dB, maximum attenuation is
31.5*dB.
"""
self.set_att_mu(channel, self.att_to_mu(att))
@kernel
def write_ext(self, addr, length, data, ext_div=SPIT_WR):
"""Perform SPI write to a prefixed address"""
self.bus.set_config_mu(SPI_CONFIG, 8, SPIT_WR, SPI_CS)
self.bus.write(addr << 25)
self.bus.set_config_mu(SPI_CONFIG | spi.SPI_END, length, ext_div, SPI_CS)
if length < 32:
data <<= 32 - length
self.bus.write(data)

View File

@ -0,0 +1,174 @@
from artiq.language.core import kernel, delay, portable
from artiq.language.units import ns
from artiq.coredevice import spi2 as spi
SPI_CONFIG = (0*spi.SPI_OFFLINE | 0*spi.SPI_END |
0*spi.SPI_INPUT | 0*spi.SPI_CS_POLARITY |
0*spi.SPI_CLK_POLARITY | 0*spi.SPI_CLK_PHASE |
0*spi.SPI_LSB_FIRST | 0*spi.SPI_HALF_DUPLEX)
SPI_CS_ADC = 1
SPI_CS_SR = 2
@portable
def adc_ctrl(channel=1, softspan=0b111, valid=1):
"""Build a LTC2335-16 control word"""
return (valid << 7) | (channel << 3) | softspan
@portable
def adc_softspan(data):
"""Return the softspan configuration index from a result packet"""
return data & 0x7
@portable
def adc_channel(data):
"""Return the channel index from a result packet"""
return (data >> 3) & 0x7
@portable
def adc_data(data):
"""Return the ADC value from a result packet"""
return (data >> 8) & 0xffff
@portable
def adc_value(data, v_ref=5.):
"""Convert a ADC result packet to SI units (Volt)"""
softspan = adc_softspan(data)
data = adc_data(data)
g = 625
if softspan & 4:
g *= 2
if softspan & 2:
h = 1 << 15
else:
h = 1 << 16
data = -(data & h) + (data & ~h)
if softspan & 1:
h *= 500
else:
h *= 512
v_per_lsb = v_ref*g/h
return data*v_per_lsb
class Novogorny:
"""Novogorny ADC.
Controls the LTC2335-16 8 channel ADC with SPI interface and
the switchable gain instrumentation amplifiers using a shift
register.
:param spi_device: SPI bus device name
:param cnv_device: CNV RTIO TTLOut channel name
:param div: SPI clock divider (default: 8)
:param gains: Initial value for PGIA gains shift register
(default: 0x0000). Knowledge of this state is not transferred
between experiments.
:param core_device: Core device name
"""
kernel_invariants = {"bus", "core", "cnv", "div", "v_ref"}
def __init__(self, dmgr, spi_device, cnv_device, div=8, gains=0x0000,
core_device="core"):
self.bus = dmgr.get(spi_device)
self.core = dmgr.get(core_device)
self.cnv = dmgr.get(cnv_device)
self.div = div
self.gains = gains
self.v_ref = 5. # 5 Volt reference
@kernel
def set_gain_mu(self, channel, gain):
"""Set instrumentation amplifier gain of a channel.
The four gain settings (0, 1, 2, 3) corresponds to gains of
(1, 10, 100, 1000) respectively.
:param channel: Channel index
:param gain: Gain setting
"""
gains = self.gains
gains &= ~(0b11 << (channel*2))
gains |= gain << (channel*2)
self.bus.set_config_mu(SPI_CONFIG | spi.SPI_END,
16, self.div, SPI_CS_SR)
self.bus.write(gains << 16)
self.gains = gains
@kernel
def configure(self, data):
"""Set up the ADC sequencer.
:param data: List of 8 bit control words to write into the sequencer
table.
"""
if len(data) > 1:
self.bus.set_config_mu(SPI_CONFIG,
8, self.div, SPI_CS_ADC)
for i in range(len(data) - 1):
self.bus.write(data[i] << 24)
self.bus.set_config_mu(SPI_CONFIG | spi.SPI_END,
8, self.div, SPI_CS_ADC)
self.bus.write(data[len(data) - 1] << 24)
@kernel
def sample_mu(self, next_ctrl=0):
"""Acquire a sample:
Perform a conversion and transfer the sample.
:param next_ctrl: ADC control word for the next sample
:return: The ADC result packet (machine units)
"""
self.cnv.pulse(40*ns) # t_CNVH
delay(560*ns) # t_CONV max
self.bus.set_config_mu(SPI_CONFIG | spi.SPI_INPUT | spi.SPI_END,
24, self.div, SPI_CS_ADC)
self.bus.write(next_ctrl << 24)
return self.bus.read()
@kernel
def sample(self, next_ctrl=0):
"""Acquire a sample
.. seealso:: :meth:`sample_mu`
:param next_ctrl: ADC control word for the next sample
:return: The ADC result packet (Volt)
"""
return adc_value(self.sample_mu(), self.v_ref)
@kernel
def burst_mu(self, data, dt_mu, ctrl=0):
"""Acquire a burst of samples.
If the burst is too long and the sample rate too high, there will be
RTIO input overflows.
High sample rates lead to gain errors since the impedance between the
instrumentation amplifier and the ADC is high.
:param data: List of data values to write result packets into.
In machine units.
:param dt: Sample interval in machine units.
:param ctrl: ADC control word to write during each result packet
transfer.
"""
self.bus.set_config_mu(SPI_CONFIG | spi.SPI_INPUT | spi.SPI_END,
24, self.div, SPI_CS_ADC)
for i in range(len(data)):
t0 = now_mu()
self.cnv.pulse(40*ns) # t_CNVH
delay(560*ns) # t_CONV max
self.bus.write(ctrl << 24)
at_mu(t0 + dt_mu)
for i in range(len(data)):
data[i] = self.bus.read()

1638
artiq/coredevice/phaser.py Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,14 @@
from artiq.language.core import syscall
from artiq.language.types import TInt64, TInt32, TNone
from artiq.language.types import TInt32, TInt64, TList, TNone, TTuple
@syscall(flags={"nowrite"})
def rtio_output(time_mu: TInt64, channel: TInt32, addr: TInt32, data: TInt32
) -> TNone:
def rtio_output(target: TInt32, data: TInt32) -> TNone:
raise NotImplementedError("syscall not simulated")
@syscall(flags={"nowrite"})
def rtio_output_wide(target: TInt32, data: TList(TInt32)) -> TNone:
raise NotImplementedError("syscall not simulated")
@ -16,3 +20,12 @@ def rtio_input_timestamp(timeout_mu: TInt64, channel: TInt32) -> TInt64:
@syscall(flags={"nowrite"})
def rtio_input_data(channel: TInt32) -> TInt32:
raise NotImplementedError("syscall not simulated")
@syscall(flags={"nowrite"})
def rtio_input_timestamped_data(timeout_mu: TInt64,
channel: TInt32) -> TTuple([TInt64, TInt32]):
"""Wait for an input event up to timeout_mu on the given channel, and
return a tuple of timestamp and attached data, or (-1, 0) if the timeout is
reached."""
raise NotImplementedError("syscall not simulated")

Some files were not shown because too many files have changed in this diff Show More