forked from M-Labs/artiq
1
0
Fork 0

artiq_ddb_template: kasli-soc support

This commit is contained in:
Sebastien Bourdeauducq 2021-05-30 19:40:03 +08:00
parent 93e1bd9ba0
commit a80c35a606
1 changed files with 14 additions and 6 deletions

View File

@ -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: