Copy one circuit into another file
| Method | Copies or links | Where it is | Tested |
|---|---|---|---|
| File, Merge… | Copies the circuits you choose | File menu, Ctrl+M | yes |
| Export Circuit | Writes one circuit to a new file | Right-click the circuit in the explorer | yes |
| Load as a library | Links, no copy | Project, Load Library | yes |
| Copy and paste between windows | Copies selected parts | Edit menu, Ctrl+C and Ctrl+V | yes, plain parts |
Merge
Open the project that should receive the circuit
Open your own file. Nothing is added until you confirm the dialog.
Choose File, Merge…
A file chooser opens with the current file name filled in. Pick the other .circ file.
Tick the circuits
The dialog says Select circuit(s) to merge into the project and lists the circuits of that file. Include dependencies is ticked by default, and a line below counts the selected circuits. Press OK.
The Merge dialog: a list with one circuit named fadd, a ticked box Include dependencies and the line Total to merge: 1 selected circuit(s).
An error dialog saying circuit fadd cannot be merged because the project already has a circuit of the same name in the loaded library components.
Export Circuit
Right-click a circuit in the explorer and choose Export Circuit. The menu entry is not in the Project menu. A save chooser opens with the circuit name as the file name, and a message confirms Circuit successfully exported to the file.
In our test the exported file had the exported circuit as its main circuit and nothing else. A circuit with no dependencies showed no dependency dialog; we did not export one with dependencies, so we do not describe that dialog.
Copy and paste
Two windows of the same Logisim session share a clipboard for parts. After File, Extract and open project bundle… we had two windows open; Ctrl+A and Ctrl+C in one, then Ctrl+V in the other, attached the pasted pins to the pointer and marked that project modified.
Two Logisim windows open; in the front window a pasted selection of two pins (Pin x 2) is attached to the pointer and the project name is marked modified.
Load a .circ file as a library
Open Project, Load Library
The submenu has three items: Built-in Library…, Logisim-evolution Library… and JAR Library….
Pick the .circ file
Choose Logisim-evolution Library… and select the file. A folder named after the file appears in the explorer with its circuits inside.
Save
The project is marked modified. Saving writes the link.
The Project menu of Logisim-evolution 5.0.0 with its Load Library submenu open, showing Built-in Library, Logisim-evolution Library and JAR Library.
The link is stored as a relative path next to the library file, for example file#components.circ. No circuit is copied, so the library file must travel with yours. See the .circ file for where the line sits in the file.
Describe this circuit
Components: Input pin X; Input pin Y.
- Input pin X connects to Input pin Y (net X, Y).
Download circ-libraries-components.circ (the library, one circuit named fadd) and circ-libraries-uses-library.circ. Keep them in the same folder. Both were saved by 5.0.0 and do not open in 2.7.1.
If the library file moves
When the library file is missing, Logisim shows The required library file is missing and a file chooser follows so you can point to the new place (more on files that will not open).
An information dialog: the required library file components.circ is missing, please select the file from the following dialog.
Built-in libraries
A new file loads Wiring, Gates, Plexers, Arithmetic, Floating Point Arithmetic, Memory and Input/Output. Other built-in libraries are added from Project, Load Library, Built-in Library…. The counts below are components per library in our component data for 5.0.0 and 2.7.1; see all components.
| Wiring | 14 |
|---|---|
| HDL-IP | 2 |
| Arithmetic | 13 |
| Floating Point Arithmetic | 18 |
| TTL | 65 |
| Gates | 13 |
| BFH mega functions | 2 |
| Plexers | 5 |
| Base | 1 |
| Input/Output | 17 |
| Input/Output Extra | 7 |
| TCL | 2 |
| Memory | 11 |
| System On a Chip | 8 |
No libraries match.
TTL and IC libraries
Logisim-evolution 5.0.0 has 65 TTL chips built in, including the 74181, so you do not need to download a TTL library. The TTL page lists them. Classic 2.7.1 has none.
JAR libraries
Project, Load Library, JAR Library… opens a chooser for .jar files.
We built a tiny library of our own (a Java class that extends the Library class, one tool, and the manifest line Library-Class: DemoLib). It loaded and showed up as a folder.
- Saved form. Saving wrote
jar#demolib.jar#DemoLib: a path relative to the project, then the class name. - Name clash. A first version whose tool was the built-in Constant was refused: Library contains following tool present in the workspace.
- No manifest line. A JAR without Library-Class made Logisim ask for the class name. We could not enter a valid name with our key driver, so we do not know what happens after a correct name.
Send the whole project as one bundle
File, Export project bundle… (Ctrl+Shift+E) asks for a file name ending in .lsebdl, then a form for the project name, authors, keywords and description.
This is the easy way to hand in a project that depends on a library file.
Substitute a library from the command line
The 5.0.0 help lists --substitute lib1 lib2, which substitutes one library for another. It works in a headless run (F135), with two conditions: write lib1 exactly as the library name is stored in the circuit file (for a library saved next to the file, just libA.circ), and keep the original library present, because a missing library stops the run at a prompt before any substitution.
We used a main file that loads libA.circ, whose circuit adder inverts its input, and a replacement libB.circ whose adder passes the input through. The input was a constant 1.
java -jar logisim-evolution-5.0.0-all.jar --tty table user.circ
Y
0
java -jar logisim-evolution-5.0.0-all.jar --tty table --substitute libA.circ libB.circ user.circ
Y
1
-s is the short form, the option can also come after the file name, and the second name can be a path. An absolute path as the first name did nothing in our run. The replacement needs a circuit with the same name and pins as the one it replaces. The command line page covers the other options.
Not tested
We did not test loading libraries automatically at startup, more than one substitution pair, the Add main circuit prefix option, an export of a circuit with dependencies, or pasting circuits that contain subcircuits.
See also subcircuits, the usual way to reuse a circuit inside one file.
For VHDL entities and HDL export, see VHDL and Verilog.