next up previous contents
Next: Miscellaneous Modules Up: GUI Implementation Previous: Multibox Modules

Signal Display Modules

The signal display modules are responsible for creating and manipulating the waveforms which are presented in the signal display window. Each labelled netlist of the circuit is represented by exactly one waveform in this window. The modules responsible for its implementation are outlined in Table 3.12.

 

 
Module Name Purpose
sigdisp.tcl Contains procedures to create and manipulate the signal display window. This module also contains several utility procedures related to the signal display window which can be invoked by other modules.
simulate.tcl This module is responsible for transmitting the signal inputs and circuit description to the simulator engine for simulation. The resultant output signals are then read and displayed in the signal display window.
Table 3.12: Signal Display Modules

The Tk canvas widget was used to implement the signal labels, signal times and signal waveforms subwindows of the signal display window. By using canvases, the implementation was able to take advantage of the flexibility and accuracy of the placement of the contents of these windows, thereby achieving ideal alignment and synchronization. The implementation of the sigdisp.tcl module is too lengthy to describe in detail in this chapter; therefore, for brevity, only the procedural interface of this module will be discussed.

The sig_draw_signal procedure is responsible for displaying a signal and takes, as parameters, the signal name and a list containing time/value pairs; the latter parameter is optional. If the procedure is invoked with only the signal name then the duration of the signal and its values will be set according to pre-defined defaults, as established in the resource option database. If the calling procedure supplies a list of time/value pairs, then a waveform that corresponds with the elements of the list will be displayed. Each element in this list consists of two items, the signal value and the time at which the signal occurred. It is only necessary for the list to contain signal transitions; the intervening gaps will be filled in accordingly. For example, a signal which is initially unknown, but then falls low after three time units, and then rises high after four more time units is represented by the list {\0 X} {3 0} {7 1}\. If the specified signal is already present on the signal display, then its waveform will be modified according to the signals in the list.

The sigdisp.tcl module also contains two procedures which can be used by client code to delete signals in the signal display window -- sig_delete, which accepts the name of the signal to delete and sig_delete_all which has no parameters. The implementation calls sig_delete whenever the user deletes a netlist label or a wire point which had a netlist label attached to it. The signal representing the netlist is removed from the display and the window is resized if necessary. The sig_delete_all procedure is invoked when the user wishes to delete the current circuit and start a new one. All the signals in the display will be removed, thereby restoring the signal display to its original state.

Two other procedures, sig_rename and sig_type affect the labelling of the signals. The sig_rename procedure accepts the original signal name and its new name and will change the name of the signal in the signal display. This procedure is called when the user changes the name of a netlist label via the Netlist Label dialog box. The sig_type procedure accepts the name of a signal and an optional parameter indicating the new type of the signal -- either input, output or unknown. If the latter parameter is not supplied, then the procedure simply returns the current type of the specified signal. Otherwise, the type of the signal is changed to the specified type. This procedure is called when the user makes an adjustment to a netlist which results in a change to the existing netlist/port association. For example, if the user solders an output port to a labelled netlist, then the type of the signal representing the netlist must be changed to output in the signal display window. By doing this, signal types are automatically updated in the signal display as the netlist connectivity changes.

The simulate.tcl module is more closely related to the integration of the simulator engine with the GUI. As a result, the description of this module will be deferred until Chapter 5.


next up previous contents
Next: Miscellaneous Modules Up: GUI Implementation Previous: Multibox Modules

Donald Craig
Mon Jul 8 12:05:35 NDT 1996