其他验证选项
还有一些与命令行执行相关的附加选项。
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.
--tty 参数的选项
到目前为止,在我们的示例中,我们始终使用
--tty table
来指示应显示输出值表。 您可以通过列出一个或多个选项(以逗号分隔)以其他方式自定义行为。 例如,您可以编写
--tty table,halt,speed
,程序将执行下面列出的所有三种行为。 (它们列出的顺序并不重要。)
- halt
-
模拟结束后,会显示一行消息,解释模拟结束的原因。 任何情况下都会显示错误情况(例如检测到的振荡)。
- speed
-
如果将 speed 与 --tty 结合使用,则在完成仿真后 Logisim 将显示电路仿真速度的摘要,例如:
714 Hz (509 ticks in 712 milliseconds) < /blockquote>
请注意,在模拟过程中显示信息会使模拟速度变慢。 作为一项比较,相同的电路和图像在仅使用 speed 选项时以 714 Hz 以上运行,但在使用 table 选项时也以 490 Hz 运行。
- stats
-
显示一个制表符分隔的表,其中包含有关项目中顶级“主”电路使用的组件的统计信息。 该表包括四列:
- 唯一:该组件出现在电路层次结构中的次数,其中层次结构中的每个子电路仅计算一次。
- 递归:组件在电路层次结构中出现的次数,其中我们对每个子电路在层次结构中出现的次数进行计数。
- 组件:组件的名称。
- 库:组件所在库的名称。
项目菜单
部分进一步解释了“唯一”和“递归”之间的区别。 如果文件使用已加载 Logisim 库中的电路,则这些组件将被视为“黑匣子”:库电路的内容不包含在唯一和递归计数中。(此功能对于分配学生使用 Logisim 库的子集构建项目的教师非常有用。)
- table
-
(正如已经讨论过的)
- tty
-
任何 TTY 组件都会将其输出发送到显示器(标准输出),并且在键盘上键入的任何信息都会发送到电路中的所有键盘组件。 即使这些组件深深嵌套在子电路层次结构中,它们也会被包含在内。
下一步: 测试多个文件 。