Mudasir
03/25/2023, 7:46 PMStefan Schippers
03/25/2023, 10:14 PMlet n=1
tran 50n 1m
write result{$&n}.raw
--> binary raw file "result1.raw"Calvin Yan
05/20/2024, 9:30 PMStefan Schippers
05/21/2024, 8:49 PMxschem get current_name
so if you do this in a code block:
value="tcleval(
...
...
.control
save all
tran 10n 10u
remzerovec
write [file rootname [xschem get current_name]].raw
.endc
)"
You will be writing the raw file to circuit.raw
if circuit
is the name of current schematic. The tcleval( .... ) wrapper passes the inner string to TCL for substitution, so the commands inside brackets ([ ... ]) are evaluated and result is substituted.
Since ngspice has problems getting environment variables xschem does all the substitutions and presents to ngspice a netlist with no variables left to be expanded.
I would be glad to avoid this if ngspice one day gets the ability to expand env vars, like $PDK_ROOT and $PDK and so on.