Swap library cells or module instances in a Verilog netlist for another cell or module, remapping ports by name -- for library migration and ECO.
Surgically replaces cell (module) instances in Verilog/SystemVerilog source with other cells, remapping their pins, from cell-map CSV files. Each swapped instance is, by default, wrapped as `ifndef EDAUTILS_CELLSWAP <original> `else <new> `endif, so the new cell is selected by defining the macro; -disable_define swaps in place instead. Only files that change are written, into an output directory (default outputdir/), with the rest of the text kept as written.
Usage
swapcells -in <file.v> | -f <filelist> -csvfiles <a.csv:b.csv> | -csvdir <dir>
[-outdir <dir>] [-disable_define | -ifndef_macro_name <macro>] [options]
Every option is listed by swapcells -help, and the complete reference is in the capability file that ships with the tool's AGENTS.md.
Exit status
- 0 when the run finished with no error. 1 = the run reported any error (parse errors, license feature missing ...) or caught an internal exception,
EDAUTILS_ROOTmissing, or out of memory (Fatal Error 53092). 255 = unknown option or missing input (error 54024). 10 = no valid license file. - Message format:
swapcells: <Severity>: <id>: <text>; the printed id is 50000 + the source number, and-suppresstakes the printed id. The banner is always printed. - The run ends with
swapcells: Note: 53250: Found N error(s) and M warning(s) ...(also on the missing-input exit, not on "Unknown option").
Requirements
Java 11 or newer on PATH (Java 21 recommended), Linux or Windows. Unpack the bundle, run source setup_env.sh and call swapcells. Install in one command with curl -fsSL https://edautils.com/install.sh | sh -s -- swapcells.