A TkGate circuit is divided into one or more modules, with one of the modules being designated the "top-level" or "root" module. A module is composed of zero or more "gates" and wires to connect the gates. We use the term "gate" loosely to refer to any circuit element. Special "comment" gates can be used to place text in the circuit.
Creating a gate in TkGate is simply a matter of clicking the cursor to set a position, and selecting a gate type from the menu. Since most gate types have a one or two character shortcut, once you learn the shortcuts you can perform most of your editing with one hand on the keyboard and the other hand on the mouse. Moving gates is almost as easy as creating them, simply select a gate (or gates) and drag them to a new position, any wires connected to the gates will be moved along with them and adjusted to ensure that they contain only horizontal and vertical segments.
% tkgate [options] [files ...]The following command-line options are supported:
Option | Description |
---|---|
-v | Be verbose about start-up error messages and warnings. |
-V | Read the TkGate files specified on the command-line and check them for internal errors, but do not start TkGate. |
-h | Print the list of options. |
-d | Turn on debugging. |
-x | Automatically starts the simulator on start-up. |
-q | Suppresses start-up messages. |
-s | Executes with a synchronous X server connection. This option is primarily for debugging. |
-n | Do not display the splash screen on start-up. |
-l lib | Loads the specified library on start-up. Can be specified multiple times. |
-L lang | Specifies the language to use. TkGate must have been built with multi-lingual support in order to use this option. |
-O opts | Specifies a list of printer options. |
-P printer | Print the specified circuit to a printer without starting up the GUI. |
-p file | Print the specified circuit to a file without starting up the GUI. |
-X script | Starts the simulator and executes the specified simulation script. |
Option | Description |
---|---|
epsf=bool | Use encapsulated Postscript format |
duplex=bool | Use duplex printing |
index=bool | Include index |
hier=bool | Include module hierarchy graph |
paper=type | Use the specified paper size |
4up=bool | Do 4-up printing of small modules |
modules=list | Comma separated list of modules to print |
After laying dormant for several years, it was resurrected in 1991 and ported to run under X11 with the Xlib API. A screenshot of this version, which was called "xgate", is shown in Figure 1.1. In this incarnation it was used several times by students in the introductory digital logic course, but after the author graduated and left CMU, it went into hibernation again.
Work on the first Tcl/Tk incarnation begun in 1998 as an exercise in learning Tcl/Tk. It was also the first version to use a Verilog-like save file format. Previous versions of gate/xgate used a Lisp-like save file format.
The current version, TkGate 2.0, represents a substantial effort over the previous 1.8 version. Whereas TkGate 1.8 was comprised of approximately 73,000 lines of C and Tcl, TkGate 2.0 nearly doubles that line count with over 130,000 lines of C and Tcl. Major improvements added to TkGate 2.0 include an improved user interface, true Verilog format save files, Verilog-based simulation, a module interface editor, symbolic module interfaces and virtual peripheral devices.