Import / export bridge between DUH and IP-XACT / SPIRIT.
- DUH is a compact JSON5 description of an IP component — ports, bus interfaces, register maps, and model info. It is the native format used by the
duh-coretooling. - IP-XACT (IEEE 1685) and its predecessor SPIRIT are verbose XML standards for describing the same IP metadata, consumed by many EDA tools.
duh-ipxact converts in both directions:
DUH (.json5) ⇄ IP-XACT / SPIRIT (.xml)
| Direction | Command | Source | Target |
|---|---|---|---|
| Export | duh2spirit, duh2spirit14 |
DUH JSON5 | SPIRIT XML |
| Import | ipxact2duh |
IP-XACT XML | DUH JSON5 |
Run without installing:
npx duh-ipxact <command>
Or install globally / as a dependency:
npm install -g duh-ipxact
duh-ipxact <command>
Commands:
duh-ipxact duh2spirit14 duh [spirit] convert DUH file to Spirit 1.4 file
duh-ipxact duh2spirit duh [spirit] convert DUH file to Spirit 2009 file
duh-ipxact ipxact2duh ipxact [duh] convert IPXACT file to DUH file
duh-ipxact fetch download IPXACT, SPIRIT schemas
Options:
--version Show version number [boolean]
--verbose, -v [default: false]
--help Show help [boolean]
If the output file argument is omitted, the result is printed to stdout.
SPIRIT 2009 (IEEE 1685-2009):
npx duh-ipxact duh2spirit <myDuh>.json5 <mySpirit>.xml
SPIRIT 1.4:
npx duh-ipxact duh2spirit14 <myDuh>.json5 <mySpirit>.xml
npx duh-ipxact ipxact2duh <myIpxact>.xml <myDuh>.json5
Download the IP-XACT and SPIRIT XSD schemas (into accellera.org/...) for local validation:
npx duh-ipxact fetch
Validate a generated SPIRIT file:
xmllint --schema accellera.org/XMLSchema/SPIRIT/1685-2009/index.xsd <mySpirit>.xml
Validate an IP-XACT file:
xmllint --schema accellera.org/XMLSchema/IPXACT/1685-2014/index.xsd <myIpxact>.xml
Two extra binaries read from stdin and write to stdout, for use in shell pipelines:
cat <myDuh>.json5 | node bin/duh2spirit.js > <mySpirit>.xml
cat <myIpxact>.xml | node bin/ipxact2duh.js > <myDuh>.json5
bin/import.js walks a directory tree, converting every *.xml IP-XACT file it
finds into a matching *.json5 DUH file, mirroring the directory layout:
import/**/*.xml → specs/**/*.json5
Run it from a directory that contains an import/ folder:
node bin/import.js
Outputs land under specs/, preserving sub-paths.
- Export (
duh2spirit.js) walks the DUH object and emits a SPIRIT XML tree viaonml, wrapping tags in thespirit:namespace and attaching the schema URIs for the requested version. - Import (
ml2on.js) parses IP-XACT XML withonmland folds the verbose node tree into compact DUH. Ports collapse to signed widths (in→+width,out→-width); Verilog-style literals ('h,'b,'d) are parsed to numbers.
Apache 2.0 — see LICENSE.