package require spice spice_init_gui example.cir
Once the Control GUI is loaded the simulation can be run and halted via the GUI's Run and Halt buttons, by the hot keys 'control-r' and 'control-h', or via the command line with spicewish::run and spicewish::halt.
Selecting Plot from the Control GUI menu will load the Node Selection Dialog listing all the available spice nodes. Clicking button 1 on the required node will highlight its text. Once all the required nodes are highlighted selecting Plot on the dialog will create a new viewer plotting all the nodes.
Selecting 'Trace -> Add/Remove traces' from the viewers menu loads the Node Selection Dialog with the viewers nodes highlighted. Additional nodes can be selected and current nodes can be deselected by clicking button 1. Select Update to refresh the viewers traces.
When the simulation is running the current viewers traces can be updated through the viewers menu 'Traces -> Update', alternatively the 'control-u' hot key can be used.
The simulation can be resumed via the Control GUI or by hot keys 'contol-r' and 'contorl-h'. When a simulation halts all the viewers traces are automatically updated.
To zoom with the mouse, position the mouse cursor to the left side of the desired zoom interval, clicking button 1 will create a zoom box, drag the zoom box to the right hand side of the desired zoom interval and click button 1.
To zoom out back to level 0, or cancel the zoom box click button 3.
Each viewer has a measurement bar displaying six values x1, x2, y1, y2, dx and dy. The measurement values work on the dimensions of the zoom box as described above.
Clicking button 1 over a measurements label will print the value to the console.
The frequency value of dx is printed to the console by clicking button 2 over the dx measurement label.
SpiceWish has a sophisticated trace placement grid, in which the viewer is split up into 16 regions(slots). Traces can be grouped together in slot.
The TracePlace grid can be activated from the viewers menu 'Options -> TracePlace' or the 'control-t' hot key.
With the TracePlace grid activated, traces can be added to slots by holding button 2 over the desired trace in the viewer or legend, a drag drop packet tied to the cursor will be created, drag the packet and release button 2 over the desired slot. A marker at the right of each slot displays the colours of the traces associated with the slot.
Holding button 2 over a slot will create a drag and drop packet of all the traces held in the slot. The packet can then be dragged and dropped into any of the other slots.
With the cursor over the desired slot the mouse wheel can be used to increase and decrease the slots height. All the slots traces will be rescaled to reflect the new heights of the slots.
The Control GUI has a built in spice file editor widget which can be toggled on and off by selecting Editor from the GUI or the 'contorl-e' hot key. The Editor also generates a seperate tab for any .include files.
Devices are highlighted in different colours for easy recognition.
Clicking Button 3 in the editor window will load the menu from which the modified spice file can be saved
Additional traces can be added to viewers via the editor. Highlight a spice node in the text with button 1, if the node is valid then selecting button 3 will create a drag and drop packet instead of the menu. The Packet can be dragged and dropped into any viewer.
For ease of use the most commonly used commands have been given a keyboard shortcut.
Key |
Widget |
Command |
---|---|---|
control-r |
Control GUI / Viewers |
Run/Resumes the simulation |
control-h |
Control GUI / Viewers |
Halts the simulation and updates all the viewers traces |
control-u |
Control GUI / Viewers |
Updates all the viewers traces |
control-p |
Control GUI |
Loads the Node Selection Dialog |
control-e |
Control GUI |
Toggles the Editor widget on and off |
control-t |
Viewers |
Toggles the viewers TracePlace grid on and off |
control-m |
Viewers |
Toggles viewers menu and measurments bar on and off |
control-c |
Viewers |
Raises the Control GUI |
All SpiceWish's main procedures are exported with the namespace spicewish:: A detailed list with descriptions and usage's can be found here.
Tcl scripts can easily be generated to automate the process of running the simulation and selecting nodes. (example.cir )
Example 1:
package require spice spice_init_gui example.cir spice::stop when time >1n spice::run spicewish::plot a1_x1_y0 b1_x1_y0 spicewish::plot la1_x1_y0\#branch
Example 2:
package require spice spice_init_gui example.cir spice::stop when time >1n spice::run # viewer1 set viewer1 [ spicewish::plot a1_x1_y0 b1_x1_y0 ] spicewish::tp $viewer1 1 ;#- turns viewers traceplace grid on spicewish::tp_add $viewer1 1 a1_x1_y0 ;#- moves trace 'a1_x1_y0' into slot 1 spicewish::tp_add $viewer1 2 b1_x1_y0 ;#- moves trace 'b1_x1_y0' into slot 2