From 93c9d8bcdfa4eb75817f77a1dc307ac803c1687f Mon Sep 17 00:00:00 2001 From: linuswck Date: Thu, 12 Oct 2023 10:33:06 +0800 Subject: [PATCH] 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" --- artiq/coredevice/coredevice_generic.schema.json | 3 +-- artiq/frontend/artiq_ddb_template.py | 12 +++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/artiq/coredevice/coredevice_generic.schema.json b/artiq/coredevice/coredevice_generic.schema.json index f12f1d9b0..bf79bb976 100644 --- a/artiq/coredevice/coredevice_generic.schema.json +++ b/artiq/coredevice/coredevice_generic.schema.json @@ -630,8 +630,7 @@ "maxItems": 2 }, "drtio_destination": { - "type": "integer", - "default": 4 + "type": "integer" } }, "required": ["ports"] diff --git a/artiq/frontend/artiq_ddb_template.py b/artiq/frontend/artiq_ddb_template.py index 394252911..5038563d6 100755 --- a/artiq/frontend/artiq_ddb_template.py +++ b/artiq/frontend/artiq_ddb_template.py @@ -767,7 +767,17 @@ def process(output, primary_description, satellites): n_channels = pm.process(rtio_offset, peripheral) rtio_offset += n_channels - for peripheral in drtio_peripherals: + for i, peripheral in enumerate(drtio_peripherals): + if not("drtio_destination" in peripheral): + if primary_description["target"] == "kasli": + if primary_description["hw_rev"] in ("v1.0", "v1.1"): + peripheral["drtio_destination"] = 3 + i + else: + peripheral["drtio_destination"] = 4 + i + elif primary_description["target"] == "kasli_soc": + peripheral["drtio_destination"] = 5 + i + else: + raise NotImplementedError print(textwrap.dedent(""" # DEST#{dest} peripherals