Compiler Options
The logic engineer can control the verbosity of the LogicGem Compiler by using the settings in the Options sub-menu of the Compiler menu. A checkmark in the Options sub-menu indicates which options are in effect during the compilation process. Any number of options may be in effect at a time.
This function allows the logic engineer to select the level and type of verbiage to be included in the Compiler output. Figure 24 shows the opened Options menu with the options: Rule Numbers, Statistic Code, Table, and Rule Descriptions.
Rule Numbers - With this option the rule numbers are included as comments in the Compiler output code. Cross reference can then be made with the source table or the comment-form table version outputted with the generated code to alleviate the task of trouble-shooting and understanding the code logic.
Statistic Code - This interesting and useful feature endows the Compiler generated source code with the ability to record the actual rule frequencies (when the code is executed and a particular rule is encountered its frequency is stepped up by one) and costs (a rule's cost is stepped up by a user-determined functional value). This is accomplished by readily identifiable internal registers introduced in code. The user-programmer is required to interface with these registers to collect the data. If nothing else, these data serve as useful feedback to periodically refresh the source code either through modifying the logic table Frequency and Cost inputs or through updating the user-provided cost function.
For example, generated compiled code output might include the following statements for Rule 9 of a given decision table (since index values start at zero, the index value of 8 indicates Rule 9):
Frequency(8) = Frequency(8) + 1
Cost(8) = Cost(8) + C(8)
Here, you will have to declare the register arrays Frequency() and Cost() since the LogicGem compiler doesn't provide such code. You'll also have to write your own cost function C(). In addition, you must write your own code to utilize the final frequency and cost values after the code has executed. For example, you may wish to record the values in a log file or database.
Table - A comment-form version of the actual source logic table is appended to the Compiler output code. This permanent attachment of the table to the code is very useful documenting tool since the actual source table can be readily recreated from its comment-form version.
Rule Names - With this option the user-defined rule-names are included as comments in the Compiler output code. As with the case of the “Rule Number” option this allows quick cross-reference with other documented source, the English documentation for example, for easier trouble-shooting and logic-tracing the code.
You may select the desired options using the following method:
Click on the Compiler menu function.
Click on the Options sub-menu to display the list of available options.
Click on the desired option. The Compiler menu disappears after a selection is made. The next time you select the Options sub-menu, the option you selected will have a check mark. The checkmark(s) indicates which compiler option(s) to include with the compiled output.
Repeat the above process for each additional option.