I have created a symbol with an underlying delay.lib file (see below)
The x_process calls a shell command that in turn calls the python interpreter and script.
It seems ngspice can only find the pytest executable when kicad is started from the command line in the project folder (make it the work directory). Is there a way around to make it work when started from the menu?
I use kicad 8.08 on Ubuntu 24.04.2 LTS
*** delay line
.subckt delayline clock datain dataout
.param delayclocks=10
.param vlogic=3.3
* no calculation possible inline so we creat param constants
.param vlogicfloat=vlogic/2
.param vlogiclow =vlogic*0.3
.param vlogichigh =vlogic*0.7
* Digital outputs are on b2 b1 b0.
* inputs clock reset output (all digital)
a0 [dataind] clk null [dataoutd] delay1
* interface to pyton via shellscript
.model delay1 d_process(process_file = "pytest" process_params=["delay", "-vvv", "--log_file", "delay.log", "--arg1", "{delayclocks}"])
* Convert the digital outputs to analog
a3 [dataoutd] [dataout] dac1
.model dac1 dac_bridge(out_low = 0 out_high = {vlogic} out_undef = {vlogicfloat})
* Convert the analog inputs to digital
a6 [clock] [clk] adc1
a7 [datain] [dataind] adc1
.model adc1 adc_bridge(in_low={vlogiclow} in_high={vlogichigh})
.ends
*** end delay