<@U01819B63HP> Is there a way to include an extern...
# xschem
h
@Stefan Schippers Is there a way to include an external file into the netlist by xschem? Not with a
.include
(this I know how to do), but a mechanism that xschem puts the file contents directly into the resulting netlist?
s
@Harald Pretl The following image shows an instance of an opamp in a schematic (above) and the symbol (in another xschem window) with its attributes. The following attribute in the symbol:
spice_sym_def="tcleval([read_data_nonewline [abs_sym_path comp_65nm_read.cir]])"
will read the file
comp_65nm_read.cir
looking in the xschem search paths. the
read_data_nonewline
will read the file into the netlist (with no additional newline added 🙂 ), the
abs_sym_path
builds the absolute path of the given file name looking for a match (the 1st found) in the search paths, This is more portable than specifying the absolute path of the file. You can also use environment vars, like
spice_sym_def="tcleval([read_data_nonewline $env(HOME)/comp_65nm_read.cir])"
The
comp_65nm_read.cir
file is the description of the subcircuit:
Copy code
* comp_65nm_read.cir

.subckt comp_65nm_read PLUS OUT MINUS
v1 x 0 1.1
e1 out x plus minus 0.5
.ends
h
Super, exactly what I need… will try that.