Understand the Input JSON Schema
masternetlistsvg consumes a JSON (or JSON5) object representing a netlist. The structure is organized by modules. Each module contains:
ports: A dictionary of port names. Each port defines itsdirection(inputoroutput) and abitsarray representing the wire indices.cells: A dictionary of components (e.g., logic gates, resistors, transistors). Each cell includes:type: A string matching an alias in a skin file.port_directions(optional): Defines the direction of ports for that specific cell type.connections: A mapping of port names to arrays of wire indices (e.g.,"A": [16, 17, 18]).attributes(optional): Arbitrary metadata (e.g., resistor values like"value": "10k").
You can generate this JSON automatically using tools like Yosys or write it manually using JSON5 syntax.
{
"modules": {
"module_name": {
"ports": {
"port_name": {
"direction": "input",
"bits": [ 0, 1, 2 ]
}
},
"cells": {
"cell_id": {
"type": "component_type",
"connections": {
"port_a": [ 0, 1, 2 ],
"port_b": [ 3 ]
}
}
}
}
}
}