From ea1dd2da43e5d5288f0ad5925a5973a749108e25 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 30 May 2021 19:40:03 +0800 Subject: [PATCH] artiq_ddb_template: kasli-soc support --- artiq/frontend/artiq_ddb_template.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/artiq/frontend/artiq_ddb_template.py b/artiq/frontend/artiq_ddb_template.py index 3a3c3d55e..03425f215 100755 --- a/artiq/frontend/artiq_ddb_template.py +++ b/artiq/frontend/artiq_ddb_template.py @@ -11,9 +11,14 @@ from artiq.coredevice import jsondesc def process_header(output, description): - if description["target"] != "kasli": + if description["target"] not in ("kasli", "kasli_soc"): raise NotImplementedError + cpu_target = { + "kasli": "or1k", + "kasli_soc": "cortexa9" + }[description["target"]] + print(textwrap.dedent(""" # Autogenerated for the {variant} variant core_addr = "{core_addr}" @@ -23,7 +28,7 @@ def process_header(output, description): "type": "local", "module": "artiq.coredevice.core", "class": "Core", - "arguments": {{"host": core_addr, "ref_period": {ref_period}}} + "arguments": {{"host": core_addr, "ref_period": {ref_period}, "target": "{cpu_target}"}}, }}, "core_log": {{ "type": "controller", @@ -58,7 +63,8 @@ def process_header(output, description): """).format( variant=description["variant"], core_addr=description["core_addr"], - ref_period=1/(8*description["rtio_frequency"])), + ref_period=1/(8*description["rtio_frequency"]), + cpu_target=cpu_target), file=output) @@ -513,7 +519,7 @@ class PeripheralManager: processor = getattr(self, "process_"+str(peripheral["type"])) return processor(rtio_offset, peripheral) - def add_sfp_leds(self, rtio_offset): + def add_board_leds(self, rtio_offset): for i in range(2): self.gen(""" device_db["{name}"] = {{ @@ -544,8 +550,10 @@ def process(output, master_description, satellites): for peripheral in master_description["peripherals"]: n_channels = pm.process(rtio_offset, peripheral) rtio_offset += n_channels - if base == "standalone" and master_description["hw_rev"] in ("v1.0", "v1.1"): - n_channels = pm.add_sfp_leds(rtio_offset) + kasli_with_leds = (master_description["target"] == "kasli" and master_description["hw_rev"] in ("v1.0", "v1.1")) + kasli_soc = master_description["target"] == "kasli_soc" + if base == "standalone" and kasli_with_leds or kasli_soc: + n_channels = pm.add_board_leds(rtio_offset) rtio_offset += n_channels for destination, description in satellites: