The File tab

The File tab allows you to specify a file into which the log should be placed.

At the top are buttons for enabling and disabling logging to file. (Note that you cannot enable logging until a file is selected below.) These buttons allow you to pause and restart file logging. When you switch in the project window to viewing another simulation, the file logging is automatically paused; if you return to the original one, logging will resume, but some data may have been lost in the meantime.

In the middle is an indicator of what file is being logged to. To change it, use the Select... button. On selecting a file, file logging will automatically start. If you select a pre-existing file, Logisim will ask whether you want to overwrite the file or append the new entries onto the end.

At bottom you can control whether a header line should be placed into the file. The header includes the name of the project and circuit, a timestamp, and column headers. If header lines are added, then a new header line will be placed into the file whenever the selection changes. You an also control whether the file is continously updated as new data appears in the table, or just written once with the current table data.

The Reset button turns off file logging, and resets the check boxes to their default state.

File format

Entries are placed into the file in tab-delimited format corresponding roughly to what appears under the Table tab. If all of the columns represent pins of a circuit, and you do not add new selections part way through a logging session, then the file format is identical to that used for the Test Vector feature. The format is intentionally simple so that you can feed it into another program for processing, such as a Python/Perl script or a spreadsheet program.

An example logging file might look as follows:

# Logisim: Log add32 of myproject
# Tue Dec 22 13:44:54 EST 2009
A[32]   B[32]   C[32]   Cin     Cout
00000000000000000000000000000000        00000000000000000000000000000000        00000000000000000000000000000000        0       0
00000000000000000000000000000011        00000000000000000000000000000001        00000000000000000000000000000100        0       0
-2       00000005h     3       0       0
0       0003o          3       0       0

Blank lines are ignored. Anything following a '#' character is a comment. The first non-blank, non-comment line lists the name of each selection (and its path, if it is in a sub-circuit), and its width (if > 1), separated by tabs. New header lines will be output each time the selection is changed.

The remaining lines list each value separated by tabs. The values are in whatever radix was being displayed for that selection at the time the file data was written. Thus, the values can be in hex, octal, binary, or signed decimal. Hex values have a 'h' suffix. Octal values have a 'o' suffix. Binary and decimal can be distinguished by looking at the number of digits: binary will always have enough digits for the entire width of the column, and never have a negative sign. Decimal values will always have fewer digits, and can have a negative sign.

So that a script can process the file at the same time as Logisim is running, Logisim will flush the new records onto the disk every 500 ms. Note that Logisim may also intermittently close and later re-open the file during the simulation, particularly if several seconds have elapsed without any new records being added.

Next: Test Vectors.