# genconnectiondb

> Extract a Verilog/SystemVerilog design's connectivity -- instances, parameter maps, port-to-port and constant connections -- into a Baya connection database (XML and JSON) for querying, diffing or replaying as Baya Tcl.

- Catalog id: `Genconnectiondb`; bundle: `genconnectiondb`; latest version 20261018
- Documentation page: https://edautils.com/Baya.html
- Keywords: connectivity database, netlist connectivity, Baya connection DB
- Terms: as stated on edautils.com, EDAUtils tools are free for commercial and academic use, with no license server. The bundle's own metadata says: "Free to evaluate with the bundled licence; commercial licences from help@edautils.com". Licence prerequisites per tool are under "How an agent runs it".
- This file: https://edautils.com/capabilities/genconnectiondb.md

## Downloads

- EDAUtils download site: https://edautils.ai/download/Genconnectiondb (latest file `genconnectiondb-20261018.tar.gz`)
- SourceForge: https://sourceforge.net/projects/baya-soc-integration-platform/files/genconnectiondb/
- SourceForge: https://sourceforge.net/projects/edautils-free-utilities/files/genconnectiondb/
- GitHub Releases: https://github.com/edautils/releases/releases/download/RELEASE_20261018/genconnectiondb-20261018.tar.gz (release `RELEASE_20261018`; all releases: https://github.com/edautils/releases/releases)

## How an agent runs it

The following is the AGENTS.md shipped at the root of the bundle.

Reads a Verilog/SystemVerilog design and writes a Baya connection database for the `-top`
module (and, with `-recursive`, every sub-module below it): its instances, parameter maps and
connections (port-to-port and constant), as an XML file and a JSON file of the same stem
(default `BayaConnectionDB.xml` / `BayaConnectionDB.json`). The XML feeds
`compareconnectiondb` and `bayadb2bayatcl`. Main class:
`com.eu.miscedautils.shell.Verilog2BayaDB` (jar `lib/designplayer.jar`).

### Where it ships

Its own bundle, `genconnectiondb.tar.gz` (flow `genconnectiondb`; release tree
`release_scripts/genconnectiondb/1.0`), and as a point tool in the **baya-shell** and
**designplayer-shell** bundles (`bin/genconnectiondb` running the shell's jar; this guide as
`tools/genconnectiondb/AGENTS.md`, examples under `tools/genconnectiondb/examples/`).

### Prerequisites

- Java on `PATH` (the launcher runs plain `java`). Use Java 11 or newer (Java 21 recommended: the
  release is built and regression-tested with OpenJDK 21); the bundled JAXB and Eclipse libraries
  are class-file version 55, so a Java 8 runtime fails with `UnsupportedClassVersionError`.
- `EDAUTILS_ROOT` = the unpacked bundle directory (must contain `bin/` and `lib/`). The
  launcher exits 1 with "Environment variable EDAUTILS_ROOT is not set" otherwise.
  `source setup_env.sh` (or `setup_env.csh`) from the bundle root sets `EDAUTILS_ROOT`,
  `EDAUTILS_LICENSE_FILE=$EDAUTILS_ROOT/edautils.lic`, `CLASSPATH` and prepends `bin/` to `PATH`.
- Licence feature `VERILOG2BAYACONNDB`. The licence file is searched in this order:
  `$EDAUTILS_LICENSE_FILE`, `./edautils.lic` (run directory), `$HOME/edautils.lic`,
  `$EDAUTILS_ROOT/edautils.lic`. No licence for the feature: exit status 10.
- Optional environment: `JAVA_FLAGS` (passed to the JVM, e.g. `-Xmx8g`; with no heap option in it the launcher adds `-Xmx` sized to the machine (`bin/eu_heap.sh`: the largest of 64/32/16/12/8/4 GB within 3/4 of physical or cgroup memory, else 2 GB; `EDAUTILS_MAX_HEAP_GB` caps it)),
  `EDAUTILS_LOG_FILE` / `EDAUTILS_APPEND_LOG_FILE` (log file name; the second appends),
  `EDAUTILS_DISABLE_USAGE_TRACKING=true`, `EDAUTILS_PRINT_STACK_TRACE` (stack traces on
  internal exceptions), `EDAUTILS_ENABLE_DEBUG_ENVIRONMENT=1` (debug messages),
  `EDAUTILS_LIBRARY_MAP_FILE` (default for `-mapfile`, else `libmap.ini`),
  `EDAUTILS_VERILOG_MERGE_CONCAT=true` (same effect as `-noconcatmerge`, see below).
- No external tools needed.

### Invocation

```
genconnectiondb -in <file.v> | -f <filelist>  -top <module>  [-out <db.xml>]  [options]
```

Tool-specific options:

| Option | Meaning |
|---|---|
| `-top <module>` | Module to convert (mandatory; without it the usage is printed) |
| `-out <file>` | Database name (default `BayaConnectionDB.xml`); see Outputs for the XML/JSON pair |
| `-recursive` | Also convert every sub-module instantiated below `-top` |
| `-noelaborate` | Do not elaborate the top module (nor parameter-map values) |
| `-nomergeassgn` | Skip bit-splitting and assignment/port-map merging before conversion |
| `-noconcatmerge` | Despite the name, this **enables** concat merging (`FVPDescription.setMergeConcat(true)`; default off) |
| `-nouniquify` | Accepted and recorded, but the flag is not read anywhere in the conversion code |
| `-in_xml <file>` | Accepted and recorded, but the value is never used |
| `-help`, `-h` | Print usage and exit |

Common Verilog-reader options (shared parser, `FVPProcessCmdLineArgs`): `-in <file>`,
`-f <filelist>` (wildcards in names are expanded unless `-nowildcard`),
`-excludefilelist <file>`, `+incdir+<p1>+<p2>`, `+define+A+B=1`, `-v95`
(no SystemVerilog keywords), `-nowildcard`, `-nokeywords a:b`, `-blackbox` (blackbox
undefined modules), `-declare_wires_for_undefined_obects`, `-dump`, `-restore <units>`,
`-work <lib>`, `-mapfile <ini>`, `-l <log>` / `-la <log>` (log file / append),
`-quiet`, `-nobanner`, `-dbg`, `-suppress <id1:id2>`, `-user <email>`, `-encryption_key`,
`-encryption_algorithm`, `-private_key_file`, `-public_key_file`.
An unrecognised option is an error ("Unrecognized option : <opt>") followed by the usage.
The usage text spells the define option `+dine+MACRO=vale`; the real option is `+define+`.

### Inputs / Outputs

- Reads: the Verilog files from `-in` / `-f` and their `` `include`` files.
- Writes: `<stem>.xml` and `<stem>.json`, where `<stem>` is the `-out` name without its
  `.xml`/`.json` extension (`-out conn.json` gives `conn.xml` + `conn.json`). Open (unconnected)
  pins are not stored. An actual narrower or wider than its formal is aligned to the formal's
  LSB, as Verilog connects it: `.a({in1,in2})` on `a[3:0]` records `in1 -> a(1)`,
  `in2 -> a(0)` and leaves `a[3:2]` open; a scalar on a vector port connects bit 0 only.
  A concatenation wider than its port warns (message 57036) and records only the bits that
  reach the port. Also creates `myEdaUtilsWork/` (parser work library) in the current
  directory. Nothing is written when the `-top` module is not found.
- Log: `genconnectiondb.log` in the current directory (override with `-l`/`-la` or
  `EDAUTILS_LOG_FILE`). Every console line is also written to the log.

### Exit status and messages

- 0 on a normal finish, **including runs that reported errors** (missing `-top`, top module
  not found, parse errors all return 0). 10 = licence checkout failed.
  1 = `EDAUTILS_ROOT` missing/invalid.
- Message format: `genconnectiondb: <Severity>: <id>: <text>`, severity one of `Error`,
  `Fatal Error`, `Warning`, `Note`; `<id>` is a 5-digit message number. Usage lines have
  no severity or id. Per module: `Generating connection DB corresponding to the  module <m>`
  and `Completed conversion of the module <m>`.
- The run ends with `genconnectiondb: Note: <id>: Found N error(s) and M warning(s) ...`;
  N is the number of Error/Fatal messages. This summary is printed **even with `-nobanner`**.

### Examples

Shipped: `examples/multiple_connection_3/` (`runme.csh`, `infile.list`, `src/mod1.v`,
`src/mod2.v`, `src/soc.v`; `infile.list` uses the wildcard `src/mod*.v`):

```
cd $EDAUTILS_ROOT/examples/multiple_connection_3
genconnectiondb -f infile.list -top MySoC -out example.xml -recursive
```

From the regression suite (reference:
`tests.edautilscommandline/tests/genconnectiondb/multiple_connection_3/runme.csh` via
`../runme_common.csh`, which then round-trips the database through `bayadb2bayatcl` and
`baya-shell`):

```
genconnectiondb -f infile.list -top MySoC -out example.xml -recursive
bayadb2bayatcl -in example.xml -out example.tcl
```

### Integration notes

- Non-interactive; does not read stdin. Run with `</dev/null`.
- Writes the log, both database files and `myEdaUtilsWork/` into the current directory: give
  each parallel run its own working directory (or distinct `-out` and `-l`).
- Set `EDAUTILS_DISABLE_USAGE_TRACKING=true` to stop usage registration.
- Success test: exit status 0 **and** the log contains `Found 0 error(s)` **and** both
  `<stem>.xml` and `<stem>.json` exist.
- Without `-recursive` only the `-top` module is converted.

### See also

compareconnectiondb (bundle compareconnectivitydatabase), bayadb2bayatcl, verilog2baya,
baya-shell, parseverilog.
