StefanSchippers / xschem

A schematic editor for VLSI/Asic/Analog custom designs, netlist backends for VHDL, Spice and Verilog. The tool is focused on hierarchy and parametric designs, to maximize circuit reuse.
Other
297 stars 21 forks source link

Preview .tcl symbol with preview_window #195

Closed georgtree closed 2 months ago

georgtree commented 2 months ago

Hello! Question - is it possible to preview generator symbol with command preview_window with default input for generator? It should be possible somehow, but I need your advice, thank you.

StefanSchippers commented 2 months ago

it is possible, to render a generator, you must call its name with parenthesis, perhaps with arguments. Since in a preview window you are not usually giving any parameters the generator script should be usually architected to accept no arguments and do a "default" action.

To preview a generator tier.tcl: xschem preview_window draw .p {xschem-repo/trunk/xschem_library/generators/tier.tcl()}

1

The tier.tcl is a generator that display either a VDD tier symbol or a GND tier symbol depending on the node name given as parameter, like tier.tcl(VDD) or tier.tcl(GND). when no arguments are given it displays as a GND symbol. 1

georgtree commented 2 months ago

Great, thank you, I have many components that use scripts not for changing the symbol but it's properties in device_model attribute. I will try it today's evening.

georgtree commented 2 months ago

All works, thank you! Additional question - is it possible to show hidden by default text in preview window? Thank you in advance!

StefanSchippers commented 2 months ago

I think you can temporarily enable the global variable show_hidden_texts:

set save $show_hidden_texts
set show_hidden_texts 1
xschem preview_window draw .path /path/to/symbol.sym
set show_hidden_texts $save
georgtree commented 2 months ago

Ah, right, thank you!