You can create pin assignments in the LeonardoSpectrum software and import them into the Quartus II software. Pin assignments can be made in LeonardoSpectrum software through the GUI, using the Command Line, or in attributes coded into the VHDL or Verilog HDL design files. Use a tool command language (Tcl) file to export the assignments to the Quartus II software.
For more information on making constraints in the LeonardoSpectrum software, refer to the Reference Manual provided in the LeonardoSpectrum software Open Manuals Bookcase (Help Menu).
Making Pin Assignments with the LeonardoSpectrum GUI
To make pin assignments using the LeonardoSpectrum software graphical user interface (GUI), perform the following steps:
- Choose FlowTabs (Tools Menu) or click on the Advanced Flow Tabs icon.
- Click the Constraints Flowtab.
- At the bottom of the Constraints tab, click one of the following:
- Input PowerTab to specify input pin assignments
- Output PowerTab to specify output pin assignments
- Clock PowerTab to specify clock pin assignments
- Select the desired pin name.
- Type the desired pin location in the Pin Location: text box.
- Click Apply.
Making Pin Assignments from the LeonardoSpectrum Command Line
The Command Line syntax for this attribute is:set_attribute pin_number
<port name> "
<pin number>";
The LeonardoSpectrum-Altera (Level 1) version of the software does not support command-line operation. You can enter commands such as pin assignments into a Tcl script file. Source the script in the GUI by selecting Run Script (File menu).
Making Pin Assignments Using HDL Attributes
To make pin assignments, use the following HDL attributes:
- Use ATTRIBUTE PIN_NUMBER to make pin assignments to individual signals.
- Use ATTRIBUTE ARRAY_PIN_NUMBER to make pin assignments to buses (VHDL only).
The following example shows how to make pin assignments in Verilog HDL:
module pin_assignment (clk, data_in, data_out); //exemplar attribute clk pin_number 5; input clk,
The following example shows how to make pin assignments in VHDL:
(in VHDL you must also declare the attribute types by calling the exemplar package)
LIBRARY exemplar; USE exemplar.exemplar.ALL; ENTITY pin_assignment IS PORT ( ATTRIBUTE PIN_NUMBER OF clk : SIGNAL IS "5"; ATTRIBUTE ARRAY_PIN_NUMBER OF data_in : SIGNAL IS ("10", "11", "12, "13"); END pin_assignment;
In this example, the pin numbers are assigned left to right. Pin 10 is assigned to data_in(3), pin 11 is assigned to data_in(2), and so on.
clk : IN STD_LOGIC; data_in : IN STD_LOGIC_VECTOR(3 DOWNTO 0); data_out : OUT STD_LOGIC_VECTOR (3 DOWNTO 0));
Exporting Assignments to Quartus II using the TCL File
The LeonardoSpectrum software generates a Tcl file containing assignments along with the EDIF Input File (.edf). This Tcl file contains other LeonardoSpectrum-generated constraints along with the pin assignments. Source this Tcl file in the Quartus II software to pass the assignments to the Quartus II software by typing following command in the Quartus II software Tcl Console window:source
<filename>.tcl