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:
gives the location of the configuration file that decodify
use for decoding. More on the format of the configuration
file is given in Section II.

-s:
tells decodify that the configuration file is in 'MSB LSB'
format rather than the 'Width' format. 'Width' is the
default. More on this in Section II.

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.