clean up example DDBs

This commit is contained in:
2026-01-23 19:04:58 +08:00
parent 9614c48e9d
commit 3c70203709
4 changed files with 20 additions and 86 deletions

View File

@@ -1,76 +0,0 @@
# For NIST_QC2
device_db = {
"core": {
"type": "local",
"module": "artiq.coredevice.core",
"class": "Core",
"arguments": {
"host": "192.168.1.52",
"ref_period": 1e-9,
"ref_multiplier": 8,
"target": "cortexa9"
}
},
"core_cache": {
"type": "local",
"module": "artiq.coredevice.cache",
"class": "CoreCache"
},
"core_dma": {
"type": "local",
"module": "artiq.coredevice.dma",
"class": "CoreDMA"
},
"i2c_switch": {
"type": "local",
"module": "artiq.coredevice.i2c",
"class": "PCA9548"
},
"led0": {
"type": "local",
"module": "artiq.coredevice.ttl",
"class": "TTLOut",
"arguments": {"channel": 41},
},
}
# TTLs on QC2 backplane
for i in range(40):
device_db["ttl" + str(i)] = {
"type": "local",
"module": "artiq.coredevice.ttl",
"class": "TTLInOut",
"arguments": {"channel": i}
}
device_db["ad9914dds0"] = {
"type": "local",
"module": "artiq.coredevice.ad9914",
"class": "AD9914",
"arguments": {"sysclk": 3e9, "bus_channel": 50, "channel": 0},
}
device_db["ad9914dds1"] = {
"type": "local",
"module": "artiq.coredevice.ad9914",
"class": "AD9914",
"arguments": {"sysclk": 3e9, "bus_channel": 50, "channel": 1},
}
for i in range(4):
device_db["ttl"+str(i)+"_counter"] = {
"type": "local",
"module": "artiq.coredevice.edge_counter",
"class": "EdgeCounter",
"arguments": {"channel": 52+i}
}
# for ARTIQ test suite
device_db.update(
loop_out="ttl0",
loop_in="ttl1",
ttl_out="ttl2",
ttl_out_serdes="ttl2",
)

1
examples/device_db.py Symbolic link
View File

@@ -0,0 +1 @@
device_db_zc706.py

View File

@@ -1,5 +1,7 @@
# For NIST_QC2
import os
device_db = {
"core": {
"type": "local",
@@ -75,8 +77,10 @@ device_db.update(
ttl_out_serdes="ttl2",
)
device_db["core_batch"] = {
"type": "local",
"module": "artiq.coredevice.rtio",
"class": "RTIOBatch"
}
if os.environ.get("ENABLE_ACPKI"):
device_db["core_batch"] = {
"type": "local",
"module": "artiq.coredevice.rtio",
"class": "RTIOBatch"
}

View File

@@ -322,7 +322,7 @@
target = "zc706";
variant = "acpki_nist_qc2";
};
make-zc706-hitl-tests = { name, board-package, ddb_folder ? "examples" }: pkgs.stdenv.mkDerivation {
make-zc706-hitl-tests = { name, board-package, setup-commands ? ""}: pkgs.stdenv.mkDerivation {
name = "zc706-hitl-tests-${name}";
__networked = true; # compatibility with old patched Nix
@@ -340,6 +340,8 @@
phases = ["buildPhase"];
buildPhase = ''
${setup-commands}
export NIX_SSHOPTS="-F /dev/null -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR -i /opt/hydra_id_ed25519"
LOCKCTL=$(mktemp -d)
mkfifo $LOCKCTL/lockctl
@@ -371,10 +373,10 @@
sleep 15
echo Running test kernel...
artiq_run --device-db ${self}/${ddb_folder}/device_db.py ${self}/examples/mandelbrot.py
artiq_run --device-db ${self}/examples/device_db.py ${self}/examples/mandelbrot.py
echo Running ARTIQ unit tests...
export ARTIQ_ROOT=${self}/${ddb_folder}
export ARTIQ_ROOT=${self}/examples
export ARTIQ_LOW_LATENCY=1
python -m unittest discover artiq.test.coredevice -v
@@ -387,11 +389,14 @@
)
'';
};
zc706-hitl-tests = make-zc706-hitl-tests { name = "nist_qc2"; board-package = zc706-nist_qc2.zc706-nist_qc2-jtag; };
zc706-hitl-tests = make-zc706-hitl-tests {
name = "nist_qc2";
board-package = zc706-nist_qc2.zc706-nist_qc2-jtag;
};
zc706-acpki-hitl-tests = make-zc706-hitl-tests {
name = "acpki_nist_qc2";
board-package = zc706-acpki_nist_qc2.zc706-acpki_nist_qc2-jtag;
ddb_folder = "examples/acpki";
setup-commands = "export ENABLE_ACPKI=1";
};
in rec {