From a792bc5456d944f2a54eec551a8844daccf1ad5d Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 16 Jun 2023 16:32:42 +0800 Subject: [PATCH] json: factor handling of deprecated 'base' --- artiq/coredevice/jsondesc.py | 3 +++ artiq/frontend/artiq_ddb_template.py | 4 ---- artiq/gateware/targets/kasli_generic.py | 2 -- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/artiq/coredevice/jsondesc.py b/artiq/coredevice/jsondesc.py index 58f14d8b0..f59fbf886 100644 --- a/artiq/coredevice/jsondesc.py +++ b/artiq/coredevice/jsondesc.py @@ -32,4 +32,7 @@ def load(description_path): global validator validator.validate(result) + if result["base"] != "use_drtio_role": + result["drtio_role"] = result["base"] + return result diff --git a/artiq/frontend/artiq_ddb_template.py b/artiq/frontend/artiq_ddb_template.py index 9e5ea1364..b0000e839 100755 --- a/artiq/frontend/artiq_ddb_template.py +++ b/artiq/frontend/artiq_ddb_template.py @@ -687,14 +687,10 @@ def main(): args = parser.parse_args() primary_description = jsondesc.load(args.primary_description) - if primary_description["base"] != "use_drtio_role": - primary_description["drtio_role"] = primary_description["base"] satellites = [] for destination, description_path in args.satellite: satellite_description = jsondesc.load(description_path) - if satellite_description["base"] != "use_drtio_role": - satellite_description["drtio_role"] = satellite_description["base"] satellites.append((int(destination, 0), satellite_description)) if args.output is not None: diff --git a/artiq/gateware/targets/kasli_generic.py b/artiq/gateware/targets/kasli_generic.py index 62a56b9dd..310cc1039 100755 --- a/artiq/gateware/targets/kasli_generic.py +++ b/artiq/gateware/targets/kasli_generic.py @@ -150,8 +150,6 @@ def main(): help="Override ROM identifier") args = parser.parse_args() description = jsondesc.load(args.description) - if description["base"] != "use_drtio_role": - description["drtio_role"] = description["base"] min_artiq_version = description.get("min_artiq_version", "0") if Version(artiq_version) < Version(min_artiq_version):