| Andrew Caldwell, Andrew B. Kahng, Igor Markov, Mike Oliver and Dirk Stroobandt |
| I. | Introduction |
| II. | Parameters |
| II.a. Parameter specification | |
| III. | Rules |
| IV. | Rule Chains |
The model developer manual explains certan concepts that are not fully treated in the user manual, as regards the basic concepts of parameters, rules, and rule chains, and how to create or edit them through the GTX GUI. This manual is not a substitute for the user manual; it assumes that you know about the major concepts of GTX and that you are familiar with how you can use existing models in GTX. If this is not the case, please read the user manual first.
The parameters view is the primary location for information about
parameters. You can get to the parameters view either by clicking on the
"Pars" button at the bottom of the list window, or from the "View"
menu.
II.a. Parameter specification In GTX,
parameters represent variables and system specifications such as supply
voltage, Rent Parameter, size of the die, etc. A parameter is specified
by the following attributes:
Loading parameters from file
From the "File" menu, select "Load Supplied" or "Load User" then "Parameter File". (The first option will load a parameter file from the directory where parameters shipped with the program will commonly be found; the second loads from the directory where you save the parameters you yourself create in a GTX session.) Parameter files typically have a ".prm" extension. Select the file name, and select "OK". If the file parses successfully, the parameters will be added to the list of all parameters.
When in the parameters view, the list window displays the name, current value and units of each parameter. "DIMLESS" appearing in the Units column means the parameter is dimensionless (as separate from "not specified", which appears as a blank).
Editing parameters
Clicking on a parameter in the list selects the parameter and displays all its information in the detail window. From the detail window, users can edit the parameter's attributes. When you are done editing the parameter, click on "OK" to keep the changes, or "Cancel" to discard them. Note that a parameter's name cannot be changed. Editing the "Parameter Name" field will create a new parameter with the edited name. Also, types must agree between rules and parameters. This means that the type of a parameter cannot be changed if GTX has a rule loaded which uses the parameter.
To edit a parameter's current value, first select the parameter in the list window. The current value is displayed in the top frame of the detail window. Enter the new value in the white edit-box. Commit will make the new value the parameter's current value (the new value is displayed in the list window). Restore Default will restore the parameter's original value if one was specified.
If you wish to enter multiple values, separate them by commas. For numeric parameters only (i.e. doubles and ints), you may also enter ranges of values in the format lower ; upper ; step, where lower is the (inclusive) lower bound, upper is the (exclusive) upper bound, and step is the step size (must be positive). You can use multiple ranges, or mix and match ranges with single values, by separating them with commas. The "Commit" button enters the values. Multiple values are used for sweeping when evaluating a rule chain (see Executing a Study).
Creating a new parameter
Create a new parameter by selecting New then Parameter from the File menu. The Create New Parameter dialog box is identical to the parameter attributes display in the detail window. Specify the new parameters name, data type and other values and then click on "OK" to create it. The new parameter will appear in the list window.
Saving parameters
From the File menu, select "Save All" or "Save Delta" then Parameters. There are two options for saving:
The rules view displays a list of all rules loaded into the system and detailed information about each of them. To get to the parameters view click on the "Rules" button at the bottom of the list window, or select "Rules" from the "View" menu.
Rules represent relationships between parameters. As the building
blocks of Rule Chains, they are the fundamental calculation units of the
GTX engine. Rules can be used to express anything from fundamental laws
of nature (Ohm's Law, for example) to empirically observed design relationships
(say, computing expected total wirelength from Rent's Parameter). There
are three types of rules:
As with parameters, a good way to begin exploring rules is to load a collection of them from a file.
Loading rules from file
If you have a file containing a collection of rule definitions, choose "Load Supplied" or "Load User" under the "File" menu, then "Rule File". This will bring up a file-find dialog box. Double-click on the file you want.("Load Supplied" will select rule files from the directory where rules shipped with the program are usually stored; "Load User" will use the directory where you save rules you create during a GTX session.)
If the file parses successfully, the rules will appear (along with all previously loaded rules) in the list window. Clicking on one of the rules will cause its definition to appear in detail window. You can view the rule's name, output parameter, input parameters (in the "Selected" box at the lower right), a text description of the rule, any literature reference, and the body of the rule (i.e. how it calculates its output).
If the selected rule is a code rule, the "Body" in the detail window will say just "---CODE NODE--". Code rules cannot be edited. Unless you are editing the rule, you may ignore the "Avail outputs" box and the "Available" box in the "Inputs" section. Their function is explained below, in "Creating new rules".
You may see a "Warning(s)" dialog box indicating that one or more rules had caused implicit creation of a parameter. This is being used primarily by the rules development group; users may ignore it.
Creating new rules
To create a new rule, choose "New" under the "File" menu, then "Rule". A dialog box will appear with the same fields as in the rule-definition view described above in "Loading rules from file".
You must give the rule a name in the "Rule Name" box (it will not parse without it); this name should contain no whitespace or special characters (underscore is fine).
You must select the output parameter. The available loaded parameters are listed in "Avail outputs"; double-click on the one you want and it will appear in the "Output" box. If you want an output which is not an existing parameter, double-click on "---NEW PARAMETER---" in "Avail outputs". The "New Parameter" dialog box will appear; when you have completed it and chosen "OK", your new parameter will appear in the "Output" box.
You must specify the body of the rule. The syntax for this is described in the grammar document.
Any parameters referenced in the body of the rule must be selected as inputs in the "Inputs" section on the right side of the dialog box. All available parameters (except for the selected output and all currently-selected inputs) appear in the "Avail" box at the top. To add one to the "Selected" box, double-click it, or highlight it and choose "Add". To remove one from the "Selected" box, double-click it, or highlight it and choose "Remove".
In addition to the above mandatory fields, you may also give a description of the rule in the "Description" box and/or a literature reference in the "Reference" box.
Editing rules
To edit an ASCII rule, first select it from the list window. As with parameters, changing the rule's name results in a new rule of that name. You may edit the rule's output parameter, input parameters, description, reference and body. Currently only the body of the rules may be edited. The system will not allow changing the inputs or outputs of existing rules
Saving rules
From the File menu, select "Save All" or "Save Delta" then Rules. There are two options for saving:
Rule chains are sequences of rules used to compute values for parameters. A rule chain is completely described by the set of rules included in it. Parameters which are inputs to a rule in the rule chain and are not computed by a rule in the chain are primary inputs. Parameters computed by a rule in the chain are the chain's outputs .
The rule chain view allows viewing and editing the rules in the current rule chain, as well as creating a new one. Either click on the "Chain" button at the bottom of the list window or select Rule Chain from the View menu.
Loading rule chain from file
If you have a file containing a rule chain, you may load it by choosing "Load Supplied" or "Load User" under the "File" menu, then "Rule Chain File". This will bring up a file-find dialog box. Double-click on the file you want.
If the file loads successfully, the list window will display all rules in the chain. The detail window is used for editing the rule chain when in the rule chain view.
Editing a rule chain (or creating one from scratch)
Rule chains are created from the "top down". First you decide what you want to compute, then you select a rule that computes it. If the current rule chain is empty, then in the rule-chain view, all available parameters will be listed in the column in the middle of the screen (under "Uncomputed input"). If the rule chain is not empty, then by selecting one of the rules, you will see in the middle column a list of all inputs to the rule that are not currently computed by the chain.
If you select one of these parameters, you will see in the right-hand column (under "Rules computing selected param") a list of all available rules that compute that parameter. By selecting one of these and choosing "Add" (or by double-clicking the rule), the rule will be added to the chain in topological order.
The rule chain can be extended in a more general way. To compute some parameter which is not an input to the current rule chain, choose the "Show All" button at the bottom of the middle column. This will show all parameters which are not computed by the current rule chain; you can then select one and add a rule computing it.
To remove a rule from the chain, double-click on the rule in the list window (left-most list).
If you select a rule in the list window, and then change to the rules view (via the "Rules" button), the highlighted rule will remain selected. The detail window now provides all available information on that rule.
Adding constraints
A constraint is a special kind of rule. Its output parameter must always be the built-in boolean parameter CONSTRAINT, and its body must be a bool expression. It is used in a special way--whenever its output evaluates to false, the computation with the current set of input values is terminated and its outputs are not added to the values of the output parameters.
To add a constraint rule to the available rules, follow the instructions above for "Creating new rules", making sure that the output is CONSTRAINT (for convenience, CONSTRAINT is the first output parameter listed).
To add a constraint to the chain, choose the "Show All" button at the bottom of the middle column in the rule-chain view (obtained by clicking on "Chain" or choosing "Rule Chain" under the "View" menu) and highlight "CONSTRAINT" at the top of the middle column. All constraint rules (except any already present in your rule chain) will appear in the right-hand column; you may select one and double-click it to add it to the chain. CONSTRAINT is a special exception to the rule that only one rule in a given rule chain may compute a given output; you may have as many constraint rules as you like in the chain (for this reason CONSTRAINT will always be available when you choose the "Show All" button; an ordinary parameter would not show up if the rule chain already computed it).
Editing Values
To see the input and output parameters of the chain, click on the "Vals" button at the lower left, or choose "Values in Chain" under the "View" menu.
Most often you will be editing values of parameters that are inputs to the current rule chain. To do this, click on the "Vals" button or choose "Values in Chain" under the "View" menu. Some inputs may already have values, either because they have default values in their parameter definitions or because they have previously been edited; these will show up in the "Values" column in the box at the top left (the one headed by "Input Name | Value | Units ").
To change a value or values, select the parameter whose values you wish to edit. The value(s), if any, will appear in the top portion of the right half of the screen. If there are multiple values, they will be separated by commas.
Enter the new values in the top right (to the left of the "Commit" button). If you wish to enter multiple values, separate them by commas. For numeric parameters only (i.e. doubles and ints), you may also enter ranges of values in the format lower ; upper ; step, where lower is the (inclusive) lower bound, upper is the (exclusive) upper bound, and step is the step size (must be positive). You can use multiple ranges, or mix and match ranges with single values, by separating them with commas. When you are finished, choose the "Commit" button to enter the values (on the Windows version you may simply hit the "Enter" key instead; this is not working yet on the Unix version).
Although inputs to the current chain are the most useful values
to edit, you may edit the values of any other parameter by going to the
"Parameters" view (click the "Pars" button at the lower left or choose
"Parameters" from the "View" menu). You may choose any parameter
and follow the procedure above to edit its value(s).