<@U01819B63HP> is there a way I can select differe...
# xschem
y
@User is there a way I can select different schematic to be netlisted using TCL variables? I was trying to use different variations of the following syntax:
schematic="cell_name_${mode}"
But nothing was really working. The use case I'm facing right now is that I have inductors in my design. For simulation I want the model to be used in the netlist, for LVS i want a short between input and output as that's what the extraction tool sees. So I am trying to default a TCL
mode
variable to
sim
and then override the variable when doing the LVS netlist generation. I really want to do this with flags applied at a global level rather than having to descend the heirarchy and change the
schematic=
expression for multiple cells. Do you have any tips on how I can achieve this?
s
Hi, Just to know the context, do you have multiple inductor symbols? if your design contains multiple instances of the same inductor symbol you need to change the
schematic=...
attribute only once in the inductor symbol. Anyway if you think it is useful to add a tcl variable evaluation when parsing the schematic attribute i can add this feature. Currently the schematic attrribute is used as is, without variable expansion.
y
Yeah, I have multiple different inductors. The other place I'd also like to use it is I have digital created with openlane. I create an xschem cell and in the schematic I just put the netlist in a code section. That makes things all get netliselted correctly for LVS. But it would be useful to use a different schematic for simulation coz ngspice will get swamped with the digital netlist, so a different schematic maybe using xspice primitives or simplified routing or something I can easily simulate to know things are hooked up correctly
s
Thank you for the explanation. The format you suggested can be implemented (
schematic="cell_name_${mode}"
) however filenames with '$' must have $ escaped to avoid confusion. Will work on that.
@yrrapt after too long delay i have implemented a way to do what you suggest: Use following syntax for the
schematic
attribute in a symbol:
schematic=tcleval(cell_name_${::mode}.sch)
the tcleval(...) construct instructs xschem to pass down the argument to tcl for evaluation. This way you can use tcl variables (use the ${::var} notation to specify global scope) to build the final schematic name. Ensure the TCL variable (set mode .....) is defined before traversing/netlisting: