Stefan Schippers
08/27/2022, 11:34 AMset xschem_listen_port 2021
into your xschemrc file, this will make xschem listen to the specified tcp port.
You can send commands (and get responses) to/from xschem using this tcp connection.
Some commands may cause xschem to display a dialog box, so it will block command processing until user clicks the dialog box.
If there are situations like this let me know, i will add flags for interactive/non interactive use.
Assuming there is a running xschem instance and the tcp listen is enabled you can try this from another terminal:
schippes@mazinga:~$ nc localhost 2021
xschem load sky130_tests/test_nmos.sch
/home/schippes/.xschem/xschem_library/xschem_sky130/sky130_tests/test_nmos.sch
xschem get instances
103
xschem netlist
^C
The above commands will load a schematic, query the number of instances and generate a netlist for it.