JHDL 0.2
| JHDL Doc Home Page | Getting Started Home Page | << | < | > | >>
As we have seen, JHDL is a useful text based tool for designing and creating circuits. JHDL can be used to describe circuits hierarchically and simulate their function, printing out results. Unfortunately, text based design entry tools lack the ability to provide a visualization of the circuit for purposes of verification and validation. JAB (Just Another Browser) is a tool that uses a hierarchical tree view and schematics to interactively browse the hierarchy of a JHDL circuit. The tree view and corresponding automatically generated schematic help the user simulate the circuit and verify structural correctness of its design. We will continue with the n bit adder example from above to better illustrate the use of JAB.
With a testbench created for your adder, you're ready to run JAB and see what it looks like. To start JAB, simply type "java jab" at the command line. This will bring up a window that looks like figure 1, with blank left and right panes. JAB only works on classes that implement the testbench interface, so you must have a testbench for any circuit you wish to simulate in the JAB environment. To load a design for testing, click in the 'Load Class' window and type in the name of the testbench class you want to test. You can also load a class from the command line by adding a third argument, e.g. "java jab NBitAdderTB". JAB keeps track of classes that have been successfully loaded, so the next time you start JAB you can elect to load a previously loaded circuit from the list under the File menu. Load NBitAdder for testing now, if you have not already.
Once you have loaded a testbench, you will see a tree appear in the left hand pane of the JAB window. You can use this tree to traverse the hierarchy of the circuit. As you select cells, you will notice that the wire names, widths, type, and current value of their ports are displayed in the right hand pane of the JAB window.
Figure 1: JAB Window |

Now that we have explored some of the basic tree features of JAB, we are ready to set up our simulation. JAB provides a facility for tracing the values of wires and displaying those values in a separate window. To begin to set up our simulation, first select cell 'NBitAdder'.
As a default, JAB only displays information for wires that are connected to ports of the selected cell. To view all wires in the cell, open the View menu and click on View Child Wires.
Wire values can be watched in JAB by clicking on the checkbox next to the wire information. When you click on a wire's trace checkbox, JAB will bring up a waves window and watch the wire that you have selected. Multiple wires in any level of hierarchy can be watched. Trace all the wires for our FullAdder by clicking on all the checkboxes in the right pane of the JAB window.
Now that we have applied watches to wires of interest, it is time to execute the circuit. To execute a circuit, simply click on the Step button. This will step the circuit one cycle. To step multiple cycles simply enter the number of cycles you wish to run in the text field next to the step button and press enter. Cycle the FullAdder for 10 clock cycles and take a look at the Waves window. All the simulation values are displayed in hexadecimal. Change them to decimal by selecting each wire and changing the Radix from the pull down menu. The Waves window should look like figure 2.
Figure 2: Waves Window |

As you can see, the names of all the wires we watched are currently displayed in the left pane of the Waves window. The wire names are displayed prefixed with the name of the cell in which they reside. Wires have a complete hierarchical name which can be seen by unchecking the "short name" box at the top of the window.
A marker is provided to help in using the waves window. You can click anywhere in the Waves panel to grab the marker. As you move the marker, values in the middle panel will update to reflect the state of the wires at the marker. The Cycle box in the tool bar will tell you which cycle you are currently in. This is particularly handy when the window is zoomed so far out that cycle values disappear. The "go to cycle" box will center the waves window on a desired cycle and place the marker on it. Centering will only occur if it makes sense, e.g, negative clock cycles do not make sense. You can also zoom the Waves window using the provided Zoom In and Zoom Out buttons. As you zoom, the left most cycle will stay in position.
JAB provides an automatic schematic generator to take your textual circuit descriptions and convert them into a graphical circuit view. This is particularly useful in verifying the structural correctness of a design. To invoke the schematic viewer simply click on the cell of interest in the tree and select View Cell Schematic under the the Tools menu (this can also be done by using the keyboard shortcut ctrl-v). Open up the tree view of the NBitAdder by clicking on the '+' symbol next to it and then select a FullAdder cell. Hit ctrl-v to bring up a schematic. A window will appear that should look like figure 3.
Figure 3: Schematic Window |

You might have noticed some of the wires crossing over on themselves. This may make it difficult to track the path of the wire. To help with this problem, you may simply click on any wire to highlight it. Cells can also be selected by clicking on them. To select multiple wires or cells, simply hold down the ctrl key while selecting.
Notice the red numbers on the schematic view. These numbers represent the current values of the ports they are next to. The schematic view provides another method of verifying circuit operation. If you step the circuit you will see the port values change in the schematic view.
In hierarchical designs, you can view schematics of cells in the current view by simply double clicking on the cell of interest. You can zoom the circuit view by using the provided buttons or by holding the shift key and drawing a rectangle on the schematic. The schematic will then zoom in on that box.
JAB also provides a text-based command console. There is a command corresponding to most of the functions that can be done in the gui. If you click on the Console tab in the JAB window you should see a history of all the commands you have performed during this session. By selecting the 'Save log' option under the File menu, a file with this command history will be saved to the working directory. A dialog box appears that will prompt you to enter the name of the file to save. During a later session, this file can be sourced at the console by typing "source <filename>". A listing of all available console commands can be found by typing "help" in the console. You can also type "help <command>" where command is the name of the command you're interested in to find out more details about a specific operation.
Figure 4: Console Window |

| JHDL Doc Home Page | Getting Started Home Page | << | < | > | >>
Copyright (c) 1998-1999 Brigham Young University. All
rights reserved.
Reproduction in whole or in part in any form or
medium without express permission of Brigham Young University is
prohibited.