The JSON files describing crates are validated using the JSON schema at artiq/coredevice/coredevice_generic.schema.json. The schema is the most complete documentation for the format at the moment.
The device_db
is usually a superset of what can be described in the JSON file. That is, you can generate a device_db
from the JSON file (artiq_ddb_template crate.json > device_db.py
- this utility uses the schema linked above the validate the input before starting the device_db
generation) but in general not all the information contained in a device_db
can be mapped back to a JSON file (for example information about non-realtime controllers).
Of course, you can reconstruct the JSON file by hand from the device_db
but this is tedious (because you'll need to know which devices correspond to which boards, and how to map RTIO (base) addresses back to EEM port numbers). The JSON file is easier to write directly by looking at the connections inside the crate and adding the hardware options you have (e.g. Urukul AD9910 vs AD9912, clock sources, potential SUServos, etc.).