What works in 5.0.0
| Feature | 2.7.1 | 5.0.0 |
|---|---|---|
| Export a circuit as VHDL | 2.7.1: nonot tested | 5.0.0: yestested (F112) |
| Export a circuit as Verilog | 2.7.1: nonot tested | 5.0.0: yestested (F112) |
| VHDL Entity component | 2.7.1: nonot tested | 5.0.0: partialplaced and saved; not simulated (F119) |
| Simulate a VHDL entity | 2.7.1: nonot tested | 5.0.0: partialneeds a simulator we did not have |
| Compile the exported files | 2.7.1: nonot tested | 5.0.0: partialVerilog elaborated and evaluated, VHDL analysed; not simulated (F128) |
Export a circuit as VHDL or Verilog
You do not need a board or vendor software, but you do need to pick a board and map every pin, because the export is part of the FPGA flow.
Open FPGA, Synthesize & Download…
Choose a target board and leave the action at Generate HDL only. File, Preferences, FPGA Commander Settings holds the language setting (VHDL by default, or Verilog).
Press Execute and map the pins
A mapping window lists Unmapped Components. Select one and double-click a highlighted spot on the board picture; it moves to Mapped Components. Do this for every input and output, then press Done. The window is taller than many screens; our lab needed a very large virtual display to reach Done.
Save the project
Saving writes the map into the file as a boardmap element, so the next export can run from the command line.
The command-line form is covered on the command line page and the board list in the FPGA guide.
Where the files go and what they contain
Files are written to logisim_evolution_workspace/<project name>/<circuit name>/ in your home folder. For the full adder (VHDL):
- ▸ vhdl/
- ▸ circuit/
- main_entity.vhd← ports A, B, Cin in; Cout, S out
- main_behavior.vhd← signals and the gate instances
- gates/← AND_GATE, OR_GATE, XOR_GATE_ONEHOT, each as entity and behavior
- toplevel/← logisimTopLevelShell wrapper for the board
- ▸ circuit/
- ucf/XilinxConstraints.ucf← pin constraints (a Xilinx board)
- scripts/← XilinxScript.cmd, XilinxVHDLList.prj, XilinxDownload
With Verilog selected the same run writes one .v file per module under verilog/circuit, verilog/gates and verilog/toplevel. A counter driven by a Clock component adds support files for the clock and the counter.
An excerpt of the entity our full adder produced:
ENTITY main IS
PORT ( A : IN std_logic;
B : IN std_logic;
Cin : IN std_logic;
Cout : OUT std_logic;
S : OUT std_logic );
END ENTITY main;
Download the top-level files our export wrote for the full adder: main_entity.vhd, main_behavior.vhd and the Verilog main.v. They need the gate files from the same run, and we did not compile any of them.
Add a VHDL entity to a circuit
Choose Project, Add VHDL Entity…
A prompt titled VHDL Entity Name appears. Type a name. The menu also has Import VHDL Entity….
Write or import the code
The editor opens with a template. Its ports (clock, val, max, cpt) are examples; replace the whole text. The first button above the editor opens a chooser for .vhd or .vhdl files, which is how we loaded ours.
Place the entity and save
Select the entity in the explorer and click the canvas. Save the project.
The VHDL editor in Logisim-evolution 5.0.0 showing a 2-input XOR entity with ports a, b and y, and the explorer with the entity xor2.
Our entity is a 2-input XOR; download the source as xor2.vhd.
Simulation needs an external program
The Simulate menu has VHDL Simulation Enabled and Restart VHDL simulator.
Ticking the first item opened a folder chooser. We had no simulator, so we cancelled it.
Afterwards the canvas showed a red message that VHDL simulation is not running and asks you to enable it and check the simulator setup (the rest of the text is cut off in the pane). A VHDL simulator log panel appeared and stayed empty, and the entity’s output stayed undefined.
We did not point the chooser at Questa or ModelSim, so we do not know how a working simulator behaves.
Using the exported HDL elsewhere
We checked the exported files with two free tools (F128). The Verilog of the full adder was elaborated in Yosys and all eight input rows gave the expected sum and carry; the 4-bit counter synthesised without errors. The VHDL of the full adder, the counter and an XOR gate was analysed with vhdl_lang and gave no errors; the counter reported four warnings for signals that are declared and never used. This is static analysis, not simulation, and we did not run Vivado, Quartus, GHDL or Icarus, so we make no claim about them.
A “Logisim to Verilog converter”
No separate converter is needed. The export above is the way, after you map the pins.
Verilog import
We found no Verilog import in 5.0.0. Upstream describes one on its development branch; we will test it when it is released. See what is new in 5.0 and releases.
Related
The FPGA guide covers boards and the mapping window; the .circ file page shows where the map and the VHDL are stored; and the error messages list has the mapping stop.