I'm having some trouble with something I think should be trivial. I create a symbol from a schemati...
j
I'm having some trouble with something I think should be trivial. I create a symbol from a schematic consisting of just a VCVS - see attached. I create a symbol from this using "Make symbol from schematic". When I place the symbol and netlist in another schematic I can't descend into the new symbol's schematic and it gets highlighted red upon netlisting and there is no sign of it in the netlist. I've successfully created symbols from schematics in the past but can't work out what's going wrong here. Can anyone suggest some places to look to debug what is going on here...?
s
try to descend into the symbol, by selecting and pressing the 'i' key, then press 'q' and see if there is at least the following text:
Copy code
type=subcircuit
format="@name @pinlist @symname"
template="name=x1"
j
'i' key takes me to the symbol view then 'q' displays an empty dialogue for global schematic property.
s
Next thing is to check: • If you do a '`q`' on the symbol placed in another schematic what is shown in the 'Symbol' textbox? just the name or a full path? • where is the
.sym
file ? • where is the (vcvs)
.sch
file? • are they in the same directory and is the directory listed in the XSCHEM_LIBRARY_PATH list of directories as specified in your
xschemrc
file?
Place the above 3 lines in the global properties
then save, return to top and see if you can descend to schematic
j
yes, works... I wonder how it ended up incomplete...
s
If you have a time to redo the make symbol from schematic (delete the .sym file first just to be sure) let me know if it is generated incomplete, I will check.
j
"delete the .sym file first just to be sure" - I wondered about this... creating the symbol from scratch works. Some changes are being preserved from the existing symbol.
s
yes if a symbol already exists regenerating the symbol preserves existing attributes of the old one , to avoid deleting stuff a user created on the old symbol. Will see what happens if the existing symbol is incomplete... Thanks
@Jeremy Reeve the problem has been fixed. Thank you for pointing this out! If an existing symbol has empty (or white space only) attributes the make symbol function will not try to preserve these empty attributes and force the default set of attributes:
Copy code
type=subcircuit
format="@name @pinlist @symname"
template="name=x1"
if a symbol does not have a
type=subcircuit
xschem does assume it is not a subcircuit and will not even try to descend into it.
j
great stuff. I suppose I was naive not to try removing the existing symbol but the warning message about overwriting threw me. Thanks for your assistance.
s
the goal was to preserve existing attributes: if the old symbol has this:
Copy code
type=subcircuit
format="@name @pinlist @symname OFFSET=@OFFSET AMPLITUDE=@AMPLITUDE GAIN=@GAIN ROUT=@ROUT COUT=@COUT"
template="name=x1 OFFSET=0 AMPLITUDE=5 GAIN=100 ROUT=1000 COUT=1p"
and the designer adds one pin to the sub schematic and wants to update the symbol with '`make symbol from schematic`' it would be irritating if the long list of attributes gets thrown away and replaced with the bare minimum defaults. However in your case of a symbol with '_no attributes at all_' these should definitely not be preserved 😀