Back to Logisim Evolution

Other verification options

src/main/resources/doc/en/html/guide/verify/other.html

4.1.04.0 KB
Original Source

Other verification options

There are some additional options related to command-line execution.

The --load command-line parameter

A more complex circuit might include RAM or ROM components that need to be loaded with a program or data in order for the circuit to have anything to do. You can specify a memory image file at the command line, which will be loaded into any RAM or ROM components in the circuit before simulation begins. (This does not work when loading the GUI - it is only for command-line execution.)

java -jar logisim-filename.jar cpu.circ --tty table --load ram-image.txt --load rom-image.txt myRom

The --tty parameters (see below) must be immediately after --tty, and the memory image's filename must be immediately after --load). The filename may be followed by the label of the memory component that should be loaded. There may be as many --load options as you need. The memory image file should be in Logisim's memory image format.

Logisim searches for memory recursively, so this will still work if the memory is nested within a subcircuit. Logisim will attempt to load the same file into every RAM or ROM that it can find with a matching label. If no label is provided, the same file is loaded into every RAM or ROM component other than those with labels matching other --load options. In the example above, the ram-image.txt is loaded into every RAM and ROM component in the simulation tree other than those that have the label myRom. All RAM and ROM components that have the label myRom will be loaded from the rom-image.txt file. The order of the --load options does not matter.

Options for the --tty parameter

In our examples thus far, we've always used --tty table to indicate that a table of output values should be displayed. You can customize the behavior in other ways by listing one or more options, separated by commas. For instance, you might write --tty table,halt,speed, and the program will perform all three behaviors listed below. (The order in which they are listed does not matter.)

halt

After the simulation ends, a one-line message is displayed explaining why the simulation ended. Error conditions - such as a detected oscillation - are displayed in any case.

speed

If you use speed in conjunction with --tty, then after completing the simulation Logisim will display a summary of how quickly the circuit was simulated, such as:

714 Hz (509 ticks in 712 milliseconds)< /blockquote>

Note that displaying information during the simulation makes the simulation go much slower. As just one comparison, the same circuit and image ran at 714 Hz above with just the speed option but 490 Hz with the table option as well.

stats

Shows a tab-delimited table containing statistics about components used by the top-level "main" circuit in the project. The table includes four columns:

  • Unique: The number of times that component appears in the circuit's hierarchy, where each subcircuit within the hierarchy is counted only once.
  • Recursive: The number of times that component appears in the circuit's hierarchy, where we count each subcircuit as many times as it appears in the hierarchy.
  • Component: The name of the component.
  • Library: The name of the library from which the component came.

The distinction between "Unique" and "Recursive" is explained further under Project menu section. If the file uses circuits from a loaded Logisim library, those components are considered to be "black boxes": The contents of the library's circuits are not included in the unique and recursive counts.

(This feature can be useful for instructors who assign students to build projects using a subset of Logisim's libraries.)

table

(as already discussed)

tty

Any TTY components send their output to the display (standard output), and any information typed at the keyboard is sent to all Keyboard components in the circuit. These components are included even if they are nested deeply in the subcircuit hierarchy.

Next: Testing multiple files.