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
300 stars 22 forks source link

[RFC] ctrl-click spice code to run it #169

Closed qpwo closed 5 months ago

qpwo commented 5 months ago

Problem: I want to quickly try different sims. I don't think the editor has a shortcut for commenting(?). No keyboard shortcut for toggle-spice-ignore either I think.

Solution: ctrl-click code symbol to generate netlist and execute it.

Editor shortcut for commenting or keyboard shortcut for toggle-spice-ignore could also solve this.

qpwo commented 5 months ago

(Ok that's my last RFC for now!)

StefanSchippers commented 5 months ago

There is such command, it is Properties -> Toggle *_ignore attribute on selected instances.

You can select multiple instances and after doing the menu command all selected elements will be toggled (ignored / not ignored) Will look for a free bind key to associate (there is currently no keybind for that). --> Added bind key Shift-T for that.

StefanSchippers commented 5 months ago

You can ctrl-click the code symbol to trigger netlist and simulation: Add this: tclcommand="xschem netlist; simulate" or tclcommand="xschem netlist; simulate {xschem annotate_op}" to schedule a Operating point annotation after simulation completes.

StefanSchippers commented 5 months ago

So if I understood your request the sequence is:

If a command block is disabled (spice_ignore=1) you can enable it automatically before generatng a netlist: xschem setprop instance COMMANDS spice_ignore 0 you can then create a netlist: xschem netlist and finally disable the code block again: xschem setprop instance COMMANDS spice_ignore 1

StefanSchippers commented 5 months ago

3

qpwo commented 5 months ago

Shift-T is perfect! Much appreciated. That tcl recipe is handy too.

qpwo commented 5 months ago

TIL that you can put tclcommand= on a code_shown.sym

StefanSchippers commented 5 months ago

You can put that on any symbol to execute the relevant command. You can also set a url=.... attribute to open a web page or local document when ctrl-clicking the instance. Xschem will figure out what application to call (browser for http addresses, pdf viewer for pdf files. In cases you need to tell xschem what to use to open the provided url you can add a program=... to specify the application.

Do not set both tclcommand and url/program on the same symbol