Synopsis Configuration File Examples Download Author |
This page describes the use of the program 'decodify'. decodify -f config_file [-s] [-b|-o|-h] number_string decodify is a simple string parsing program that takes a numerical string as a command line argument and prints out its various parts. The string is supposed to represent concatenated values of several variables. decodify prints out the value of these variables. The order of concatenation of the variables, from lower to higher order bits, as well as their names are specified in a configuration file. The name of this file is also specified as a command line argument. Although it can be used in various cases, the main reason behind the creation of decodify is to extract the sub-parts of control bus in digital logic simulation. A control bus usually consists of a number of independent control signals and/or sub-busses. When displaying the values of the individual signals or sub-buses is possible, it is not desirable as it will clutter the screen or the logfile. The full description of the command line arguments are:
-f config_file:
-s:
-b, -o, -h:
number_string:
The configuration (or, 'config') file specifies the names, the order and the widths of the variables whose concatenated value is represented by the input numerical string. It can be specified in one of the two formats. The first format of the config file is given below: FIELD NAME\tWIDTH The second format is of the form: FIELD NAME[\tMSB\tLSB] The second format is valid only if '-s' command line option has been specified. Tabs are used as delimeters for the fields. 'FIELD NAME' is the name of the field and may contain blank(s), but not tabs. A field name of 'Reserved' or 'reserved' are counted, but not printed. 'WIDTH' refers to the width of the variable. 'MSB' is the Most Significant bit of a bus. For a wire, no MSB is specified. 'LSB' is the Least Significant bit of a bus. For a wire, no LSB is specified. The value of LSB does not need to be smaller than the value of MSB. In the following examples, '\t' is a tab character. All these examples can be found in the ./examples directory. Example 1: % cat c1 first field\t3 second Field\t1 Third Field 5 % decodify -f c1 f53 first field: 0x3. second Field: 0x0. Third Field : 0x15. Example 2: % cat c2 first field\t3 reserved\t1 Third Field\t5 % decodify -f c2 f53 first field: 0x3. Third Field : 0x15. Example 3: % cat c3 First Field\t3 Second Field\t1 Third Field\t4 Fourth Field\t10 %decodify -f c3 f53 First Field: 0x3. Second Field: 0x0. Third Field : 0x5. Fourth Field : 0xf. Example 4: % cat c4 First Field 9 7 Second Field Third Field 12 16 % decodify -f c4 -s f53 First Field: 0x3. Second Field: 0x0. Third Field : 0x15. Example 5: % decodify -f c4 -s -b 111101010011 First Field: 0x3. Second Field: 0x0. Third Field : 0x15. Click here to get the latest gzipped-tar version of the release. decodify is designed, implemented and maintained by Swapnajit Mittra, Principal, Project VeriPage. It is distributed under Lesser GNU Public License (LGPL) Agreement. The website for this project is located at the SourceForge Network. |
Last updated Apr 26, 2003.