17.11.2012 Views

Managing Quartus II Projects, Quartus II Handbook version ... - Altera

Managing Quartus II Projects, Quartus II Handbook version ... - Altera

Managing Quartus II Projects, Quartus II Handbook version ... - Altera

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

June2012<br />

Q<strong>II</strong>52012-12.0.0<br />

Q<strong>II</strong>52012-12.0.0<br />

© 2012 <strong>Altera</strong> Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, HARDCOPY, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos<br />

are trademarks of <strong>Altera</strong> Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as<br />

trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. <strong>Altera</strong> warrants performance of its<br />

semiconductor products to current specifications in accordance with <strong>Altera</strong>'s standard warranty, but reserves the right to make changes to any products and<br />

services at any time without notice. <strong>Altera</strong> assumes no responsibility or liability arising out of the application or use of any information, product, or service<br />

described herein except as expressly agreed to in writing by <strong>Altera</strong>. <strong>Altera</strong> customers are advised to obtain the latest <strong>version</strong> of device specifications before relying<br />

on any published information and before placing orders for products or services.<br />

<strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong> Version 12.0<br />

Volume 2: Design Implementation and Optimization<br />

June 2012<br />

4. <strong>Managing</strong> <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong><br />

This chapter discusses how to create and manage projects, and how to migrate them<br />

from one computing platform to another.<br />

Today’s larger and more sophisticated FPGA designs are often developed by several<br />

engineers and are constantly changing throughout the project lifecycle. Designers<br />

must track their project changes to ensure efficient design coordination.<br />

This chapter discusses the following topics:<br />

■ “<strong>Managing</strong> Your <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong>” on page 4–1<br />

■ “Exporting and Importing Version-Compatible Database Files” on page 4–6<br />

■ “<strong>Managing</strong> <strong>Projects</strong> in a Team-Based Design Environment” on page 4–15<br />

■ “Scripting Support” on page 4–16<br />

<strong>Managing</strong> Your <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong><br />

To help you manage your FPGA designs, the <strong>Quartus</strong> ® <strong>II</strong> software provides tools that<br />

assist you with your design tasks, including creating a project, creating assignments,<br />

managing revisions, and archiving projects.<br />

A <strong>Quartus</strong> <strong>II</strong> project contains all your design files, setting files, and other files<br />

necessary for the successful compilation of your design.<br />

h For more information about creating and opening a project, adding files to and<br />

removing files from a project, modifying project settings, saving project changes, and<br />

specifying the top-level entity, refer to <strong>Managing</strong> Files in a Project in <strong>Quartus</strong> <strong>II</strong> Help.<br />

For more information about libraries, refer to “Specifying Libraries” on page 4–10.<br />

1 On the General page of the Options dialog box, you can also specify a default<br />

directory that automatically stores all project files.<br />

After you create a new project, the <strong>Quartus</strong> <strong>II</strong> software automatically generates<br />

various project files necessary for successful compilation, including the <strong>Quartus</strong> <strong>II</strong><br />

Project File (.qpf) and <strong>Quartus</strong> <strong>II</strong> Settings File (.qsf).<br />

h For more information about the .qpf and .qsf, refer to <strong>Quartus</strong> <strong>II</strong> Project File (.qpf) and<br />

<strong>Quartus</strong> <strong>II</strong> Setting File (.qsf) in <strong>Quartus</strong> <strong>II</strong> Help.<br />

f For a list of supported <strong>Quartus</strong> <strong>II</strong> project files and design file types, refer to<br />

Introduction to the <strong>Quartus</strong> <strong>II</strong> Software manual.<br />

Twitter<br />

ISO<br />

9001:2008<br />

Registered<br />

Feedback Subscribe


4–2 Chapter 4: <strong>Managing</strong> <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong><br />

<strong>Managing</strong> Your <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong><br />

File Association<br />

<strong>Quartus</strong> <strong>II</strong> project files are files associated with a <strong>Quartus</strong> <strong>II</strong> project, but are not design<br />

files in the project hierarchy. Most project files do not contain design logic. The<br />

<strong>Quartus</strong> <strong>II</strong> software supports project files such as .qpf, <strong>Quartus</strong> <strong>II</strong> IP File (.qip), and<br />

.qsf, among others.<br />

Design files are files that contain logic for a <strong>Quartus</strong> <strong>II</strong> project. The Compiler compiles<br />

the <strong>Quartus</strong> <strong>II</strong> design files. The <strong>Quartus</strong> <strong>II</strong> software also supports designs created<br />

from EDIF Input Files (.edf) or Verilog <strong>Quartus</strong> Mapping Files (.vqm) generated by<br />

EDA design entry and synthesis tools. You can also create Verilog HDL or VHDL<br />

designs in the <strong>Quartus</strong> <strong>II</strong> software and EDA design entry tools and either generate<br />

EDIF Input Files (.edf) and Verilog <strong>Quartus</strong> Mapping File (.vqm), or use the Verilog<br />

HDL or VHDL design files directly in <strong>Quartus</strong> <strong>II</strong> projects. The <strong>Quartus</strong> <strong>II</strong> software also<br />

supports use of <strong>Quartus</strong> <strong>II</strong> Exported Partition Files (.qxp) as source files containing<br />

entities you can add to your design.<br />

The <strong>Quartus</strong> <strong>II</strong> software sets file type association when you run the <strong>Quartus</strong> <strong>II</strong><br />

software <strong>version</strong> 9.1 or earlier; however, in the <strong>Quartus</strong> <strong>II</strong> software <strong>version</strong>s 10.0 and<br />

later, the <strong>Quartus</strong> <strong>II</strong> software sets file type association after installation, which can be<br />

overwritten if you run prior <strong>version</strong>s of the <strong>Quartus</strong> <strong>II</strong> software after installing<br />

<strong>Quartus</strong> <strong>II</strong> software <strong>version</strong>s 10.0 and later. If your files are associated with a different<br />

<strong>version</strong> of the <strong>Quartus</strong> <strong>II</strong> software, and you want to associate the files with the<br />

<strong>Quartus</strong> <strong>II</strong> software <strong>version</strong> 10.0, you can manually associate the files to the <strong>Quartus</strong> <strong>II</strong><br />

software <strong>version</strong> 10.0.<br />

Example 4–1 shows how to associate files with the current <strong>version</strong> of the <strong>Quartus</strong> <strong>II</strong><br />

software manually:<br />

Example 4–1. Command to Associate Files<br />

\quartus\bin\qreg.exe --file_assoc r<br />

Editing Text-Based Designs with the <strong>Quartus</strong> <strong>II</strong> Text Editor<br />

You can use any text editor with the <strong>Quartus</strong> <strong>II</strong> software; however, the <strong>Quartus</strong> <strong>II</strong> Text<br />

Editor allows you to take advantage of features available only in the <strong>Quartus</strong> <strong>II</strong><br />

software, error location, and predefined templates to help you with coding.<br />

The <strong>Quartus</strong> <strong>II</strong> software provides templates that allow you to insert predefined code<br />

directly into your design file; you can choose from several design languages, and you<br />

can directly add TimeQuest analyzer design constraints and megafunction<br />

information. You can also create and save your own templates.<br />

h For more information about editing <strong>Quartus</strong> <strong>II</strong> Text Editor files, refer to Editing<br />

<strong>Quartus</strong> <strong>II</strong> Text Editor Files in <strong>Quartus</strong> <strong>II</strong> Help. For more information about text editors,<br />

refer to About the <strong>Quartus</strong> <strong>II</strong> Text Editor in <strong>Quartus</strong> <strong>II</strong> Help. For more information about<br />

the <strong>Quartus</strong> <strong>II</strong> Text Editor options and setting a preferred text editor, refer to Setting<br />

<strong>Quartus</strong> <strong>II</strong> Text Editor Options in <strong>Quartus</strong> <strong>II</strong> Help.<br />

f For more information about the <strong>Quartus</strong> <strong>II</strong> language template feature, refer to the<br />

“<strong>Quartus</strong> <strong>II</strong> Language Templates” section in the Recommended HDL Coding Styles<br />

chapter in volume 1 of the <strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong>.<br />

<strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong> Version 12.0 June 2012 <strong>Altera</strong> Corporation<br />

Volume 2: Design Implementation and Optimization


Chapter 4: <strong>Managing</strong> <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong> 4–3<br />

<strong>Managing</strong> Your <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong><br />

Creating Assignments<br />

Assignments control a variety of different functions of the <strong>Quartus</strong> <strong>II</strong> software and are<br />

an important part of an efficient and effective design. When used in conjunction with<br />

a good design practices, assignments can help you successfully compile your design.<br />

You can create assignments with different editors and dialog boxes in the <strong>Quartus</strong> <strong>II</strong><br />

software or with Tcl scripts. Assignments are logic functions you assign to a physical<br />

resource on the device, or compilation resources you assign to logic functions.<br />

<strong>Quartus</strong> <strong>II</strong> Settings File<br />

As you create assignments in the <strong>Quartus</strong> <strong>II</strong> software, you can choose either to store<br />

the assignments in memory temporarily or write the assignment out to the .qsf with<br />

the Update assignments to disk during design processing only option located on the<br />

Processing page of the Options dialog box. You can open the Options dialog box by<br />

clicking Options on the Tools menu. If you turn on the Update assignments to disk<br />

during design processing only option, the <strong>Quartus</strong> <strong>II</strong> software stores all assignments<br />

in memory and writes to the .qsf when a compilation starts or when you save or close<br />

the project. The performance of the software improves when you save assignments in<br />

memory. You can view this performance improvement when the <strong>Quartus</strong> <strong>II</strong> software<br />

stores the project files on a remote data disk.<br />

f For more information about the .qsf, refer to the <strong>Quartus</strong> <strong>II</strong> Settings File Manual.<br />

Preserving QSF Format<br />

When you create new assignments, the <strong>Quartus</strong> <strong>II</strong> software appends the assignments<br />

to the end of the .qsf. If you modify an assignment, the corresponding line in the .qsf<br />

changes to maintain the order of assignments in the .qsf, unless you add and remove<br />

project source files, or when you add, remove, and exclude members from an<br />

assignment group. In these cases, the <strong>Quartus</strong> <strong>II</strong> software appends all assignments to<br />

the end of the .qsf. For example, if you add a new design file to the project, the<br />

<strong>Quartus</strong> <strong>II</strong> software appends the list of all your design files to the end of the .qsf.<br />

The <strong>Quartus</strong> <strong>II</strong> software preserves all spaces and tabs for all unmodified assignments<br />

and comments. When you create a new assignment or modify an existing assignment<br />

in the GUI, the <strong>Quartus</strong> <strong>II</strong> software writes the assignment with the default formatting.<br />

<strong>Quartus</strong> <strong>II</strong> Default Settings File<br />

You can ensure consistent results when defaults change between <strong>version</strong>s of the<br />

<strong>Quartus</strong> <strong>II</strong> software with the assignment_defaults.qdf, located in the bin or bin64<br />

directory of the <strong>Quartus</strong> <strong>II</strong> installation path.<br />

The <strong>Quartus</strong> <strong>II</strong> software reads assignments from various files and stores the<br />

assignments in memory. The <strong>Quartus</strong> <strong>II</strong> software reads settings files in the following<br />

order and assignments in subsequent files take precedence over earlier ones:<br />

1. assignment_defaults.qdf from /bin or bin64<br />

2. assignment_defaults.qdf from the project directory<br />

3. _assignment_defaults.qdf from the project directory<br />

4. .qsf from the project directory<br />

June 2012 <strong>Altera</strong> Corporation <strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong> Version 12.0<br />

Volume 2: Design Implementation and Optimization


4–4 Chapter 4: <strong>Managing</strong> <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong><br />

<strong>Managing</strong> Your <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong><br />

As the <strong>Quartus</strong> <strong>II</strong> software reads each new file, if an existing assignment from an<br />

existing project file matches, following rules of case sensitivity, multivalued fields,<br />

and other rules, the <strong>Quartus</strong> <strong>II</strong> software replaces the old value with a new value. For<br />

example, if the first file has an assignment A=1, and the second file has A=2, the<br />

software replaces assignment A=1 with assignment A=2.<br />

Creating Timing Assignments<br />

If you create timing assignments with the TimeQuest Timing Analyzer, the <strong>Quartus</strong> <strong>II</strong><br />

software creates a Synopsys Design Constraints File (.sdc) that contains your SDC<br />

commands.<br />

f For more information about TimeQuest analyzer and SDC constraints, refer to the<br />

<strong>Quartus</strong> <strong>II</strong> TimeQuest Timing Analyzer chapter in volume 3 of the <strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong>.<br />

Creating Revisions<br />

In the <strong>Quartus</strong> <strong>II</strong> software, a revision is a set of assignments and settings. A project<br />

may have multiple revisions, and each revision has its own set of assignments and<br />

settings. You can create multiple revisions in a project, and you can create a unique<br />

revision based on an existing revision. Creating a unique revision allows you to<br />

optimize a design for different results; creating a revision based on an existing<br />

revision allows you to try new settings and assignments and then compare the<br />

revisions.<br />

Creating a revision of your design allows you to create a new set of assignments and<br />

settings for a set of design files without losing your previous assignments and<br />

settings. You can perform the following tasks with revisions:<br />

■ Create a revision not based on a previous revision. Creating a unique revision<br />

allows you to optimize a design for different fundamental reasons, such as to<br />

optimize by area in one revision and then optimize for f MAX in another revision.<br />

When you create a unique revision, the <strong>Quartus</strong> <strong>II</strong> software uses all default<br />

settings.<br />

■ Create a revision based on an existing revision, but try new settings and<br />

assignments in the new revision. A new revision includes all the assignments and<br />

settings in the existing revision.You can revert from the new revision to the<br />

original revision. You can compare revisions manually, or with features in the<br />

<strong>Quartus</strong> <strong>II</strong> software.<br />

<strong>Managing</strong> Project Revisions<br />

The Revisions dialog box manages your revisions by allowing you to create and<br />

delete a revision, specify the current revision, and compare revisions.<br />

Each time you create a new revision of a project, the <strong>Quartus</strong> <strong>II</strong> software creates a new<br />

.qsf and adds the name of the new revision to the list of revisions in the .qsf. The<br />

name of a new .qsf matches the revision name.<br />

<strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong> Version 12.0 June 2012 <strong>Altera</strong> Corporation<br />

Volume 2: Design Implementation and Optimization


Chapter 4: <strong>Managing</strong> <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong> 4–5<br />

<strong>Managing</strong> Your <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong><br />

You can compare the compilation results of multiple revisions side by side with the<br />

Compare Revisions dialog box. The Compare Revisions dialog box compares the<br />

compilation results of each revision in three categories:<br />

■ Analysis & Synthesis<br />

■ Fitter<br />

■ TimeQuest Timing Analyzer<br />

In addition to viewing the compilation results of each revision, you can also compare<br />

the assignments for each revision. Comparing the compilation results and<br />

assignments for each revision allows you to gain a better understanding of how<br />

different optimization options affect your design.<br />

h For more information about creating, deleting, specifying, and comparing revisions,<br />

refer to <strong>Managing</strong> Project Revisions in <strong>Quartus</strong> <strong>II</strong> Help.<br />

Creating New Copies of Your Design<br />

If your design requires that you have two separate copies of your project, rather than<br />

just a separate revision, you can create a second copy of your project with the Copy<br />

Project command. For example, if you have a design that is compatible with a 32-bit<br />

data bus and you require a new copy of your design to interface with a 64-bit data<br />

bus, you may want a separate copy of the project.<br />

The <strong>Quartus</strong> <strong>II</strong> software provides utilities to copy and save different copies of your<br />

project. Creating a copy of your project with the Copy Project command directs the<br />

<strong>Quartus</strong> <strong>II</strong> software to copy all your design files, your .qsf, and all your associated<br />

revisions.<br />

If you are creating a new copy of a project that contains an .edf or a .vqm from a<br />

third-party EDA synthesis tool, first create a copy of your project and then replace any<br />

.edf or .vqm files with the newly generated .edf or .vqm.<br />

h For more information about the Copy Project command, refer to Copy Project Dialog<br />

Box in <strong>Quartus</strong> <strong>II</strong> Help.<br />

Archiving and Restoring <strong>Projects</strong><br />

To share large projects between engineers or to transfer your project to a new <strong>version</strong><br />

of the <strong>Quartus</strong> <strong>II</strong> software, you can archive your project. Archiving your project<br />

creates a single compressed <strong>Quartus</strong> <strong>II</strong> Archive File (.qar) that contains all your<br />

design, project, and settings files. The .qar contains all the .qdf files required to<br />

compile your design and restore the original compilation results. When you restore<br />

the archive in a different <strong>version</strong> of the <strong>Quartus</strong> <strong>II</strong> software, you must include the .qdf<br />

in the archive to preserve previous compilation results. For more information about<br />

the .qdf, refer to “<strong>Quartus</strong> <strong>II</strong> Default Settings File” on page 4–3.<br />

1 You can copy files listed in the Source Control file set for the Archiver with the Copy<br />

Project command. If you cannot find your source file in the Source Control file set,<br />

add the source file to your project before copying.<br />

June 2012 <strong>Altera</strong> Corporation <strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong> Version 12.0<br />

Volume 2: Design Implementation and Optimization


4–6 Chapter 4: <strong>Managing</strong> <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong><br />

Exporting and Importing Version-Compatible Database Files<br />

h For more information about archiving a project and restoring an archived project,<br />

refer to About Archiving <strong>Projects</strong> and Archiving <strong>Projects</strong> in <strong>Quartus</strong> <strong>II</strong> Help.<br />

Exporting and Importing Version-Compatible Database Files<br />

The <strong>Quartus</strong> <strong>II</strong> software generates <strong>version</strong>-compatible database files that are a<br />

representation of the internal database files. The <strong>Quartus</strong> <strong>II</strong> software allows you to<br />

export and import <strong>version</strong>-compatible database files for a project to use compilation<br />

databases in different <strong>version</strong>s of the <strong>Quartus</strong> <strong>II</strong> software. If you export<br />

<strong>version</strong>-compatible database files for a project, you can import these files in a future<br />

<strong>version</strong> of the <strong>Quartus</strong> <strong>II</strong> software. By importing <strong>version</strong>-compatible database files<br />

and rerunning timing analysis, you can check a project's fitting and timing results in<br />

newer <strong>version</strong>s of the <strong>Quartus</strong> <strong>II</strong> software.<br />

Version-compatible databases allows you to use the same project database when you<br />

upgrade to a newer <strong>version</strong> of the <strong>Quartus</strong> <strong>II</strong> software, eliminating the need to<br />

recompile your project, which saves design time.<br />

Figure 4–1 shows the <strong>Quartus</strong> <strong>II</strong> software <strong>version</strong>-compatible database structure.<br />

Figure 4–1. <strong>Quartus</strong> <strong>II</strong> Version-Compatible Database Structure<br />

<strong>Quartus</strong> <strong>II</strong> Project<br />

<strong>Quartus</strong> <strong>II</strong> Project (Version 1)<br />

<strong>Quartus</strong> <strong>II</strong> Project (Revision A) Settings A<br />

<strong>Quartus</strong> <strong>II</strong> Project (Revision B) Settings B<br />

<strong>Quartus</strong> <strong>II</strong> Project (Version 2)<br />

filtref.v<br />

filtref_2.vwf<br />

filtref_2.qsf<br />

<strong>Quartus</strong> <strong>II</strong> Project (Revision A) Settings C<br />

<strong>Quartus</strong> <strong>II</strong> Project (Revision B) Settings D<br />

h For more information about exporting and importing <strong>version</strong>-compatible database<br />

files, including device support, refer to Exporting and Importing Version-Compatible<br />

Database Files in <strong>Quartus</strong> <strong>II</strong> Help.<br />

If you require the database files to reproduce the compilation results in the same<br />

<strong>Quartus</strong> <strong>II</strong> software <strong>version</strong>, you can use the command-line option to archive a full<br />

compilation database. For more information, refer to “Archiving and Restoring<br />

<strong>Projects</strong>” on page 4–5.<br />

<strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong> Version 12.0 June 2012 <strong>Altera</strong> Corporation<br />

Volume 2: Design Implementation and Optimization<br />

filtref.v<br />

filtref.vwf<br />

filtref.asf


Chapter 4: <strong>Managing</strong> <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong> 4–7<br />

Exporting and Importing Version-Compatible Database Files<br />

Migrating to a New Version of the <strong>Quartus</strong> <strong>II</strong> Software<br />

To migrate your design to a newer <strong>version</strong> of the <strong>Quartus</strong> <strong>II</strong> software, follow these<br />

steps:<br />

1. On the File menu, click Open Project and browse to select the <strong>Quartus</strong> <strong>II</strong> project<br />

file to open the older <strong>version</strong> of the <strong>Quartus</strong> <strong>II</strong> software project.<br />

2. On the Project menu, click Copy Project to create a new copy of the project. The<br />

older <strong>version</strong> closes and the copied project opens.<br />

3. Before exporting the database, you must run Analysis and Synthesis for the new<br />

<strong>version</strong>. On the Project menu, click Export Database. By default, the <strong>Quartus</strong> <strong>II</strong><br />

software exports the database to the export_db directory of the copied project. You<br />

can also create a new directory.<br />

4. Open the copied project from the new <strong>version</strong> of the <strong>Quartus</strong> <strong>II</strong> software. The<br />

<strong>Quartus</strong> <strong>II</strong> software deletes the existing database but not the exported database.<br />

5. On the Project menu, click Import Database. By default, the <strong>Quartus</strong> <strong>II</strong> software<br />

selects the directory that contains the exported database you just created. Select<br />

the exported database and the <strong>Quartus</strong> <strong>II</strong> software imports the <strong>version</strong>-compatible<br />

database files.<br />

Saving the Database in a Version-Compatible Format<br />

To save the database in a <strong>version</strong>-compatible format during a full compilation, follow<br />

these steps:<br />

1. On the Assignments menu, click Settings. The Settings dialog box appears.<br />

2. In the Category list, select Compilation Process Settings. The Compilation<br />

Process Settings page appears.<br />

3. Turn on the Export <strong>version</strong> compatible database option.<br />

4. Browse to the directory in which you want to save the database.<br />

5. Click OK.<br />

You can also export a project database as <strong>version</strong>-compatible database files during a<br />

full compilation.<br />

h For more information about importing and exporting <strong>version</strong>-compatible databases,<br />

refer to Exporting and Importing Version-Compatible Database Files in <strong>Quartus</strong> <strong>II</strong> Help.<br />

June 2012 <strong>Altera</strong> Corporation <strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong> Version 12.0<br />

Volume 2: Design Implementation and Optimization


4–8 Chapter 4: <strong>Managing</strong> <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong><br />

Exporting and Importing Version-Compatible Database Files<br />

<strong>Quartus</strong> <strong>II</strong> Project Platform Migration<br />

When moving your project from one computing platform to another, you must<br />

consider the following cross-platform issues:<br />

■ “File Names and Hierarchies”<br />

■ “Specifying Libraries”<br />

■ “<strong>Quartus</strong> <strong>II</strong> Search Path Precedence Rules”<br />

■ “<strong>Quartus</strong> <strong>II</strong>-Generated Files for Third-Party EDA Tools”<br />

■ “Migrating Database Files Between Platforms”<br />

File Names and Hierarchies<br />

To ensure a successful migration across platforms, consider the following differences<br />

between operating systems when naming source files, especially when interacting<br />

with the operating systems from the command prompt or a Tcl script:<br />

■ Some operating system file systems are case sensitive. When writing scripts,<br />

ensure that you specify paths exactly, even if the current operating system is not<br />

case sensitive. Use lowercase letters when naming files.<br />

■ Use a character set common to all the used platforms.<br />

■ Do not change the forward-slash (/) and back-slash (\) path separators in the .qsf<br />

because the <strong>Quartus</strong> <strong>II</strong> software changes all back-slash (\) path separators to<br />

forward-slashes (/).<br />

■ Observe the shortest file name length limit of the different operating systems you<br />

are using.<br />

1 <strong>Altera</strong> recommends that you avoid using spaces in the name of the project<br />

directory. You can rename the directory with a symbol such as the<br />

underscore (_) as a place holder instead of spaces (for example,<br />

“my_design” instead of “my design”).<br />

<strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong> Version 12.0 June 2012 <strong>Altera</strong> Corporation<br />

Volume 2: Design Implementation and Optimization


Chapter 4: <strong>Managing</strong> <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong> 4–9<br />

Exporting and Importing Version-Compatible Database Files<br />

You can specify files and directories inside a <strong>Quartus</strong> <strong>II</strong> project as paths relative to the<br />

project directory. For example, for a project titled foo_design with a directory<br />

structure shown in Figure 4–2, specify the source files as: top.v, foo_folder/foo1.v,<br />

foo_folder/foo2.v, and foo_folder/bar_folder/bar1.vhdl.<br />

Figure 4–2. All Inclusive Project Directory Structure<br />

foo_design<br />

foo_design.qsf<br />

If the .qsf is in a directory that is separate from the source files, you can specify paths<br />

using the relative and absolute paths and libraries options.<br />

Relative Paths<br />

If the source files are very near to the <strong>Quartus</strong> <strong>II</strong> project directory, you can express<br />

relative paths using the .. notation. For example, in the directory structure shown in<br />

Figure 4–3, you can specify top.v as ../source/top.v and foo1.v as<br />

../source/foo_folder/foo1.v.<br />

Figure 4–3. <strong>Quartus</strong> <strong>II</strong> Project Directory Separate from Design Files<br />

June 2012 <strong>Altera</strong> Corporation <strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong> Version 12.0<br />

Volume 2: Design Implementation and Optimization<br />

top.v<br />

foo_design<br />

foo_folder<br />

quartus<br />

source<br />

foo1.v<br />

foo2.v<br />

bar_folder<br />

bar1.vhdl<br />

foo_design.qsf<br />

top.v<br />

foo_folder<br />

foo1.v<br />

foo2.v<br />

bar_folder<br />

bar1.vhdl


4–10 Chapter 4: <strong>Managing</strong> <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong><br />

Exporting and Importing Version-Compatible Database Files<br />

1 When you copy a directory structure to a different platform, ensure that all the<br />

subdirectories are in the same hierarchical structure and relative path as in the<br />

original platform.<br />

Specifying Libraries<br />

You can specify the directory containing source files as a library that the <strong>Quartus</strong> <strong>II</strong><br />

software searches when you compile your project. A <strong>Quartus</strong> <strong>II</strong> library is a directory<br />

containing your <strong>Quartus</strong> <strong>II</strong> project design files. You can specify the following libraries<br />

in the <strong>Quartus</strong> <strong>II</strong> software:<br />

■ Project libraries—Apply to a specific project<br />

■ Global libraries—Apply to all projects<br />

1 The project directory takes precedence over the project libraries.<br />

All files in your libraries are relative to the libraries. For example, if you specify the<br />

user_lib1 directory as a project library and you want to add the /user_lib1/foo1.v file<br />

to the library, you can specify the foo1.v file in the .qsf as foo1.v. The <strong>Quartus</strong> <strong>II</strong><br />

software searches the file in directories that the <strong>Quartus</strong> <strong>II</strong> software specifies as<br />

libraries.<br />

h For more information about libraries , refer to Libraries Page (Settings Dialog Box) in<br />

<strong>Quartus</strong> Help.<br />

Specifying Project Libraries<br />

To specify project libraries from the GUI, on the Assignments menu, click Settings<br />

and select Libraries. Type the name of the directory in the Project Library name box,<br />

or browse to the name of the directory. The .qsf of the current revision stores project<br />

libraries.<br />

You can also specify project libraries in the Libraries page in the General category in<br />

the Options dialog box.<br />

Specifying Global Libraries<br />

To specify global libraries from the GUI, on the Tools menu, click Options and select<br />

Libraries. Type the name of the directory in the Global Library name box, or browse<br />

to the name of the directory. The quartus2.ini file stores global libraries.<br />

To specify libraries from the GUI, on the Assignments menu, click Settings and select<br />

Libraries.<br />

For Windows, the <strong>Quartus</strong> <strong>II</strong> software searches for the quartus2.ini file in the<br />

following directories and order:<br />

1. USERPROFILE, for example, C:\Documents and Settings\<br />

2. Directory specified by the TMP environmental variable<br />

3. Directory specified by the TEMP environmental variable<br />

4. Root directory, for example, C:\<br />

For Linux, the <strong>Quartus</strong> <strong>II</strong> software creates the file in the altera.quartus directory<br />

under the directory.<br />

<strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong> Version 12.0 June 2012 <strong>Altera</strong> Corporation<br />

Volume 2: Design Implementation and Optimization


Chapter 4: <strong>Managing</strong> <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong> 4–11<br />

Exporting and Importing Version-Compatible Database Files<br />

1 If the altera.quartus directory does not exist, the <strong>Quartus</strong> <strong>II</strong> software creates the file in<br />

the directory.<br />

1 Whenever you specify a directory name in the GUI or in Tcl, the <strong>Quartus</strong> <strong>II</strong> software<br />

maintains the directory name you use in the .qsf rather than resolved to an absolute<br />

path.<br />

If the directory is outside of the project directory, the path returned in the dialog box is<br />

an absolute path. You can use the Browse button in either the Settings dialog box or<br />

the Options dialog box to select a directory. You can change the absolute path to a<br />

relative path by editing the absolute path displayed in the library name field to create<br />

a relative path before you click Add to put the directory in the Libraries list.<br />

Alternatively, you can also select from the Libraries list and double-click to edit the<br />

path.<br />

When copying projects that specify project libraries, you must either copy your<br />

project library files along with the project directory or ensure that your project library<br />

files exist in the target platform.<br />

<strong>Quartus</strong> <strong>II</strong> Search Path Precedence Rules<br />

If two files have the same file name, the <strong>Quartus</strong> <strong>II</strong> software’s search path precedence<br />

rules determine the found file. The <strong>Quartus</strong> <strong>II</strong> software resolves relative paths by<br />

searching for the file in the following directories and order:<br />

1. The project directory.<br />

2. The project’s database (db) directory.<br />

3. Project libraries are searched in the order specified by the SEARCH_PATH setting<br />

of the .qsf for the current revision.<br />

1 <strong>Altera</strong> recommends that you use the SEARCH_PATH assignment to define<br />

the project libraries. You can have multiple SEARCH_PATH assignments.<br />

However, you can specify only one source directory for each<br />

SEARCH_PATH assignment. For more information about SEARCH_PATH<br />

assignments, refer to Example 4–18 on page 4–19.<br />

4. Global user libraries are searched in the order specified by the SEARCH_PATH<br />

setting on the Global User Libraries page in the Options dialog box.<br />

5. The <strong>Quartus</strong> <strong>II</strong> software libraries directory, for example,<br />

\libraries. For more information about<br />

libraries, refer to “Specifying Libraries Using Scripts” on page 4–19.<br />

June 2012 <strong>Altera</strong> Corporation <strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong> Version 12.0<br />

Volume 2: Design Implementation and Optimization


4–12 Chapter 4: <strong>Managing</strong> <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong><br />

Exporting and Importing Version-Compatible Database Files<br />

<strong>Quartus</strong> <strong>II</strong>-Generated Files for Third-Party EDA Tools<br />

The project archive and copy features in the <strong>Quartus</strong> <strong>II</strong> software do not include<br />

<strong>Quartus</strong> <strong>II</strong> generated files for third-party EDA tools such as:<br />

■ Verilog Output Files (.vo)<br />

■ VHDL Output Files (.vho)<br />

■ Standard Delay Format Output Files (.sdo) output netlist files<br />

■ Stamp model files<br />

■ PartMiner XML-Format Files (.xml)<br />

■ IBIS Output Files (.ibs)<br />

When you archive your design project, you can save the database in a<br />

<strong>version</strong>-compatible format during a full compilation and include the<br />

<strong>version</strong>-compatible database files in your project archive.<br />

1 Version-compatible databases may not be available for all device families because the<br />

archive does not include the compilation database. If you require the database files to<br />

reproduce the compilation results in the same <strong>Quartus</strong> <strong>II</strong> software <strong>version</strong>, you can<br />

use the command-line option to archive a full database. For more information, refer to<br />

“Archiving and Restoring <strong>Projects</strong>” on page 4–5.<br />

For more information about saving the database in a <strong>version</strong>-compatible format and<br />

archiving projects, refer to “Saving the Database in a Version-Compatible Format” on<br />

page 4–7 and “Archiving <strong>Projects</strong>” on page 4–17.<br />

To copy your project to another platform, you can regenerate the output netlist or<br />

output files by following these steps:<br />

1. Import the <strong>version</strong>-compatible database. For more information, refer to<br />

“Migrating to a New Version of the <strong>Quartus</strong> <strong>II</strong> Software” on page 4–7.<br />

2. From the Tools menu, run the TimeQuest analyzer.<br />

3. Run the EDA Netlist Writer.<br />

To restore your project, you can regenerate the output netlist or output files by<br />

performing the following steps:<br />

1. Restore your design project. For more information about restoring an archived<br />

project, refer to “Archiving and Restoring <strong>Projects</strong>” on page 4–5.<br />

2. Import the <strong>version</strong>-compatible database. For more information about migrating to<br />

a new <strong>version</strong>, refer to “Migrating to a New Version of the <strong>Quartus</strong> <strong>II</strong> Software” on<br />

page 4–7.<br />

3. From the Processing menu, run the TimeQuest analyzer.<br />

4. Run the EDA Netlist Writer.<br />

1 When you create <strong>version</strong>-compatible databases, you do not need to<br />

recompile your design as you move across platforms.<br />

<strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong> Version 12.0 June 2012 <strong>Altera</strong> Corporation<br />

Volume 2: Design Implementation and Optimization


Chapter 4: <strong>Managing</strong> <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong> 4–13<br />

Exporting and Importing Version-Compatible Database Files<br />

Migrating Database Files Between Platforms<br />

There is nothing inherent in the file format and syntax of the exported<br />

<strong>version</strong>-compatible database files that might cause problems when migrating the files<br />

to other platforms. However, the contents of the database can cause problems for<br />

platform migration. For example, using the absolute paths in <strong>version</strong>-compatible<br />

database files generated by the <strong>Quartus</strong> <strong>II</strong> software can cause problems for migration.<br />

<strong>Altera</strong> recommends that you change the absolute paths to relative paths before<br />

migrating files whenever possible.<br />

Working with Messages<br />

The <strong>Quartus</strong> <strong>II</strong> software generates various types of messages, including Information,<br />

Warning, Extra Info, Critical Warning, and Error messages. Some messages include<br />

information about software status during a compilation and alert you to possible<br />

problems with your design. The Messages box in the <strong>Quartus</strong> <strong>II</strong> GUI displays<br />

messages, and these messages are written to stdout when you use command-line<br />

executables. In both cases, <strong>Quartus</strong> <strong>II</strong> report files write messages.<br />

You can right-click a message in the Message window to get help for the message,<br />

locate the source of the message of your design, and manage messages.<br />

Messages provide useful information if you take time to review them after each<br />

compilation. The following sections describe the <strong>Quartus</strong> <strong>II</strong> software features to help<br />

you manage messages.<br />

Messages Window<br />

The Messages window displays nine message tabs, enabling you to review all<br />

messages of a certain type. The Info, Extra Info, Warning, Critical Warning, and<br />

Error tabs display messages by type.<br />

h For more information about the Messages window and message tabs, refer to About<br />

the Messages Window in <strong>Quartus</strong> <strong>II</strong> Help. For more information about managing<br />

messages in the Messages window, refer to <strong>Managing</strong> Messages in the Messages Window<br />

in <strong>Quartus</strong> <strong>II</strong> Help.<br />

Message Suppression<br />

You can use message suppression to reduce the number of messages after a<br />

compilation by preventing individual messages and entire categories of messages<br />

from displaying. For example, if you review a particular message and determine that<br />

your design is not the cause of the message, you can suppress the message for<br />

subsequent compilations. Message suppression saves time because you see only new<br />

messages during subsequent compilations.<br />

Adding a suppressed message creates a suppression rule. Suppressing exact selected<br />

messages adds patterns that are exact strings to the suppression rules. Suppressing all<br />

similar messages adds patterns with wildcards to the suppression rules.<br />

Furthermore, you can suppress all messages of a particular type in a particular stage<br />

of the compilation flow. On the Tools menu, click Options. In the Category list, select<br />

Suppression in the Messages section.<br />

June 2012 <strong>Altera</strong> Corporation <strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong> Version 12.0<br />

Volume 2: Design Implementation and Optimization


4–14 Chapter 4: <strong>Managing</strong> <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong><br />

Exporting and Importing Version-Compatible Database Files<br />

Suppressing individual messages is controlled in two locations in the <strong>Quartus</strong> <strong>II</strong> GUI.<br />

You can right-click on a message in the Messages window and choose commands in<br />

the Suppress sub-menu entry. To open the Message Suppression Manager, right-click<br />

in the Messages window. From the Suppress sub-menu, click Message Suppression<br />

Manager. For more information about the Message Suppression Manager, refer to<br />

“Message Suppression Manager” on page 4–15.<br />

Message Suppression Methods<br />

You can use the following methods to create suppression rules:<br />

■ Suppress Exact Selected Messages<br />

■ Suppress All Similar Messages<br />

■ Suppress All Flagged Messages<br />

If you suppress a message with the Suppress Exact Selected Messages option, the<br />

<strong>Quartus</strong> <strong>II</strong> software suppresses only messages that match the exact text during<br />

subsequent compilations. The Suppress All Similar Messages option behaves like a<br />

wildcard pattern on variable fields in messages and the Suppress All Flagged<br />

Messages option only suppresses flagged messages.<br />

Example 4–2 shows an example of suppressing common Info type of messages:<br />

Example 4–2. Example of Suppressing Common Info Type Message<br />

Info: Found 1 design units, including 1 entities, in source file mult.v.<br />

This Info type of message is common during synthesis. The <strong>Quartus</strong> <strong>II</strong> software<br />

displays the message for each processed source file with varying information about<br />

the number of design units, entities, and source file name.<br />

Example 4–3 shows an example of this message in Help:<br />

Example 4–3. Example of Suppressing Common Info Type Message<br />

Found design units, including entities, in source file .<br />

Choosing to suppress all similar messages effectively replaces the variable parts of<br />

that message (, , and ) with wildcards.<br />

Example 4–4 shows the suppression rule to suppress common Info type of messages:<br />

Example 4–4. Suppression Rule to Suppress Common Info Type of Messages<br />

Info: Found * design units, including * entities, in source file *.<br />

The <strong>Quartus</strong> <strong>II</strong> software suppresses all messages that match the pattern.<br />

<strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong> Version 12.0 June 2012 <strong>Altera</strong> Corporation<br />

Volume 2: Design Implementation and Optimization


Chapter 4: <strong>Managing</strong> <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong> 4–15<br />

<strong>Managing</strong> <strong>Projects</strong> in a Team-Based Design Environment<br />

Message Suppression Details and Limitations<br />

The following rules describe which messages that you can suppress and how to<br />

suppress them:<br />

■ You cannot suppress error messages or messages with information about <strong>Altera</strong><br />

legal agreements.<br />

■ Suppressing a message also suppresses all its submessages, if any.<br />

■ Suppressing a submessage causes the <strong>Quartus</strong> <strong>II</strong> software to suppress matching<br />

submessages only if the parent messages are the same.<br />

■ You cannot create your own custom wildcards to suppress messages.<br />

■ You must use the <strong>Quartus</strong> <strong>II</strong> GUI to manage message suppression, including<br />

choosing messages to suppress. The <strong>Quartus</strong> <strong>II</strong> software surpresses these<br />

messages during compilation in the GUI and when using command-line<br />

executables.<br />

■ The <strong>Quartus</strong> <strong>II</strong> software surpresses the messages on a per-revision basis, not for an<br />

entire project. The <strong>Quartus</strong> <strong>II</strong> software stores information about which messages to<br />

suppress in a file called .srf. If you create a revision based on a<br />

suppressed messages revision, the <strong>Quartus</strong> <strong>II</strong> software copies the suppression<br />

rules file to the new revision. You cannot make all revisions in one project using<br />

the same suppression rules file.<br />

■ You cannot remove messages or modify message suppression rules while a<br />

compilation is running.<br />

Message Suppression Manager<br />

You can use the Message Suppression Manager to view and suppress messages, view<br />

and delete suppression rules, and view suppressed messages. The Message<br />

Suppression Manager has three tabs labeled Suppressible Messages, Suppression<br />

Rules, and Suppressed Messages.<br />

h For more information about the Message Suppression Manager, refer to About Message<br />

Suppression in <strong>Quartus</strong> <strong>II</strong> Help.<br />

<strong>Managing</strong> <strong>Projects</strong> in a Team-Based Design Environment<br />

The <strong>Quartus</strong> <strong>II</strong> software provides several methods to help you manage efficient<br />

design coordination across multiple designers and design iterations. You can use the<br />

following features to preserve and track project changes:<br />

■ Creating Revisions<br />

■ <strong>Managing</strong> Different Design Versions<br />

■ Creating Version-Compatible Databases<br />

■ Archiving <strong>Projects</strong><br />

h For more information about creating revisions, managing different design <strong>version</strong>s,<br />

creating <strong>version</strong>-compatible databases, and archiving projects in a team-based design<br />

environment, refer to About Project Management in <strong>Quartus</strong> <strong>II</strong> Help.<br />

June 2012 <strong>Altera</strong> Corporation <strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong> Version 12.0<br />

Volume 2: Design Implementation and Optimization


4–16 Chapter 4: <strong>Managing</strong> <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong><br />

Scripting Support<br />

The <strong>Quartus</strong> <strong>II</strong> software supports top-down incremental compilation flows. With<br />

top-down compilation, one designer or project lead compiles the entire design in the<br />

software. Different designers or IP providers can design and verify different parts of<br />

the design, and the project lead can add design entities to the project as they are<br />

completed. However, the project lead compiles and optimizes the top-level project as<br />

a whole. Completed parts of the design can have fitting results and performance fixed<br />

as other parts of the design change.<br />

f For more information about incremental compilation for team-based design, refer to<br />

the <strong>Quartus</strong> <strong>II</strong> Incremental Compilation for Hierarchical and Team-Based Design chapter in<br />

volume 1 of the <strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong>. For more information about best practices for<br />

incremental compilation partitions and floorplan assignments, refer to Best Practices<br />

for Incremental Compilation Partitions and Floorplan Assignments chapter in volume 1 of<br />

the <strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong>.<br />

Scripting Support<br />

You can run procedures and create settings described in this chapter in a Tcl script.<br />

You can also run some procedures at a command prompt. For more information about<br />

scripting command options, refer to the <strong>Quartus</strong> <strong>II</strong> Command-Line and Tcl API Help<br />

browser.<br />

Example 4–5 shows the command to run the Help browser:<br />

Example 4–5. Command to Run the Help Browser<br />

quartus_sh --qhelp r<br />

<strong>Managing</strong> Revisions<br />

You can use the following commands to create and manage revisions. For more<br />

information about managing revisions, including creating and deleting revisions,<br />

setting the current revision, and getting a list of revisions, refer to “Creating<br />

Revisions” on page 4–4.<br />

Creating Revisions<br />

The -based_on and -set_current options are optional. You can also use<br />

-copy_results option to copy results from the “based_on” revision.<br />

Example 4–6 shows a Tcl command to create a new revision called speed_ch, based on<br />

a revision called chiptrip, and sets the new revision as the current revision:<br />

Example 4–6. Creating Revisions Command<br />

create_revision speed_ch -based_on chiptrip -set_current<br />

Setting the Current Revision<br />

The -force option enables you to open the revision that you specify under revision<br />

name and overwrite the compilation database if the database <strong>version</strong> is incompatible.<br />

<strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong> Version 12.0 June 2012 <strong>Altera</strong> Corporation<br />

Volume 2: Design Implementation and Optimization


Chapter 4: <strong>Managing</strong> <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong> 4–17<br />

Scripting Support<br />

Example 4–7 shows the Tcl command to specify the current revision:<br />

Example 4–7. Specifying the Current Revision Command<br />

set_current_revision -force <br />

Getting a List of Revisions<br />

Example 4–8 shows the Tcl command to get a list of revisions in the opened project:<br />

Example 4–8. Getting a List of Revisions in an Opened Project Command<br />

get_project_revisions <br />

Deleting Revisions<br />

Example 4–9 shows the Tcl command to delete a revision:<br />

Example 4–9. Deleting a Revision Command<br />

delete_revision <br />

Archiving <strong>Projects</strong><br />

You can archive projects with a Tcl command or a command run at the system<br />

command prompt.<br />

Example 4–10 shows the Tcl command to create a project archive with the default<br />

settings, overwriting the existing specified archived file:<br />

Example 4–10. Creating a Project Archive with the Default Settings Command<br />

project_archive archive.qar -overwrite r<br />

You can change default settings with the project_archive command with options<br />

such as:<br />

■ -all_revisions<br />

■ -include_libraries<br />

■ -include_outputs<br />

■ -use_file_set <br />

■ -<strong>version</strong>_compatible_database<br />

1 For new device families, a <strong>version</strong>-compatible database might not be available<br />

because the archive does not include the compilation database. If you require the<br />

database files to reproduce the compilation results in the same <strong>Quartus</strong> <strong>II</strong> software<br />

<strong>version</strong>, you can use the -use_file_set full_db command-line option to archive a<br />

full database. For more information, refer to “Archiving and Restoring <strong>Projects</strong>” on<br />

page 4–5.<br />

June 2012 <strong>Altera</strong> Corporation <strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong> Version 12.0<br />

Volume 2: Design Implementation and Optimization


4–18 Chapter 4: <strong>Managing</strong> <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong><br />

Scripting Support<br />

Example 4–11 shows the command to create a project archive called top:<br />

Example 4–11. Creating a Project Archive Command<br />

quartus_sh --archive top r<br />

You can overwrite the existing archive file with the -overwrite option.<br />

The VERILOG_INCLUDE_FILE assignment allows you to add a file into your project;<br />

however, the VERILOG_INCLUDE_FILE assignment adds the file for archiving<br />

purposes only and has no impact on compilation. The VERILOG_INCLUDE_FILE and<br />

VERILOG_FILE are two different assignments. A syntax error occurs if you use the<br />

VERILOG_FILE assignment to add a file.<br />

f For more information, refer to the <strong>Quartus</strong> <strong>II</strong> Integrated Synthesis chapter in volume 1<br />

of the <strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong>.<br />

Restoring Archived <strong>Projects</strong><br />

You can restore archived projects with a Tcl command or with a command run at a<br />

command prompt. For more information about restoring archived projects, refer to<br />

“Archiving and Restoring <strong>Projects</strong>” on page 4–5.<br />

Example 4–12 shows the Tcl command to restore the project archive named<br />

archive.qar in the restored subdirectory and overwrite existing files:<br />

Example 4–12. Restoring a Project Archive Command<br />

project_restore archive.qar -destination restored -overwrite r<br />

Example 4–13 shows the command to restore a project archive:<br />

Example 4–13. Restoring a Project Archive Command<br />

quartus_sh --restore archive.qar r<br />

Importing and Exporting Version-Compatible Databases<br />

You can import and export <strong>version</strong>-compatible databases with either a Tcl command<br />

or a command run at a command prompt. For more information about importing and<br />

exporting <strong>version</strong>-compatible databases, refer to “Exporting and Importing<br />

Version-Compatible Database Files” on page 4–6.<br />

1 The flow and database_manager packages contain commands to manage<br />

<strong>version</strong>-compatible databases.<br />

Example 4–14 shows the Tcl command to import or export <strong>version</strong>-compatible<br />

databases from the database_manager package.<br />

Example 4–14. Importing and Exporting Version-Compatible Databases Command<br />

export_database r<br />

import_database r<br />

<strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong> Version 12.0 June 2012 <strong>Altera</strong> Corporation<br />

Volume 2: Design Implementation and Optimization


Chapter 4: <strong>Managing</strong> <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong> 4–19<br />

Scripting Support<br />

Example 4–15 shows the Tcl commands from the flow package to import or export<br />

<strong>version</strong>-compatible databases. If you use the flow package, you must specify the<br />

database directory variable name.<br />

Example 4–15. Importing and Exporting Version-Compatible Databases from the flow Package<br />

Command<br />

set_global_assignment -name VER_COMPATIBLE_DB_DIR <br />

execute_flow –flow export_database<br />

execute_flow –flow import_database<br />

Example 4–16 shows the Tcl commands to generate <strong>version</strong>-compatible databases<br />

after every compilation.<br />

Example 4–16. Generating Version-Compatible Databases After Every Compilation Command<br />

set_global_assignment -name AUTO_EXPORT_VER_COMPATIBLE_DB ON<br />

set_global_assignment-name VER_COMPATIBLE_DB_DIR <br />

Example 4–17 shows the quartus_cdb and the quartus_sh executables to manage<br />

<strong>version</strong>-compatible databases:<br />

Example 4–17. quartus_cdb and quartus_sh Executable<br />

quartus_cdb -c --export_database= r<br />

quartus_cdb -c --import_database=r<br />

quartus_sh –flow export_database -c \ r<br />

quartus_sh –flow import_database -c \ r<br />

Specifying Libraries Using Scripts<br />

In Tcl, use commands in the ::quartus::project package to specify project libraries.<br />

To specify project libraries, use the set_global_assignment command.<br />

Example 4–18 shows the typical usage of the set_global_assignment command:<br />

Example 4–18. Commands to Specify Project Libraries Using the SEARCH_PATH Assignment<br />

set_global_assignment -name SEARCH_PATH "../other_dir/library1"<br />

set_global_assignment -name SEARCH_PATH "../other_dir/library2"<br />

set_global_assignment -name SEARCH_PATH "../other_dir/library3"<br />

To report any project libraries specified for a project and any global libraries specified<br />

for the current installation of the <strong>Quartus</strong> <strong>II</strong> software, use the get_global_assignment<br />

and get_user_option Tcl commands.<br />

Example 4–19 shows that the Tcl script outputs the user paths and global libraries for<br />

an open <strong>Quartus</strong> <strong>II</strong> project:<br />

Example 4–19. Commands to Report Specified Project Libraries<br />

get_global_assignment -name SEARCH_PATH<br />

get_user_option -name SEARCH_PATH<br />

June 2012 <strong>Altera</strong> Corporation <strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong> Version 12.0<br />

Volume 2: Design Implementation and Optimization


4–20 Chapter 4: <strong>Managing</strong> <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong><br />

Conclusion<br />

Conclusion<br />

f For more information about Tcl scripting, refer to the Tcl Scripting chapter in volume 2<br />

of the <strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong>. For more information about all settings and constraints in<br />

the <strong>Quartus</strong> <strong>II</strong> software, refer to the <strong>Quartus</strong> <strong>II</strong> Settings File Manual. For more<br />

information about command-line scripting, refer to the Command-Line Scripting<br />

chapter in volume 2 of the <strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong>.<br />

h For more information about Tcl scripting, refer to the API Functions for Tcl in<br />

<strong>Quartus</strong> <strong>II</strong> Help.<br />

Designers often try different settings and <strong>version</strong>s of their designs throughout the<br />

development process. The <strong>Quartus</strong> <strong>II</strong> project revisions facilitate the creation and<br />

management of different assignments and settings. Project archives are useful to save<br />

your results, or pass designs between different members of a team. In addition,<br />

understanding how to migrate your projects from one computing platform to another,<br />

controlling messages, and reducing compilation time are important as well. The<br />

<strong>Quartus</strong> <strong>II</strong> software facilitates efficient management of your design to accommodate<br />

today’s sophisticated FPGA designs.<br />

Document Revision History<br />

Table 4–1 shows the revision history for this chapter.<br />

Table 4–1. Document Revision History (Part 1 of 2)<br />

Date Version Changes<br />

■ Removed survey link.<br />

June 2012 12.0.0 ■ Updated the “Scripting Support” on page 4–16 to add information about<br />

VERILOG_INCLUDE_FILE.<br />

November 2011 10.1.1 Template update.<br />

December 2010 10.1.0<br />

July 2010 10.0.0<br />

■ Changed to new document template.<br />

■ Removed Figure 4–1, Figure 4–6, Table 4–2.<br />

■ Moved “Hiding Messages” to Help. Moved information in “Message Suppression<br />

Manager” on page 4–15 to Help.<br />

■ Removed references about the set_user_option command in “Specifying Libraries<br />

Using Scripts” on page 4–19.<br />

■ Removed Classic Timing Analyzer references.<br />

■ Major reorganization done to this chapter.<br />

■ Updated “Working with Messages” on page 4–17. Added a link to Help. Removed<br />

Figure 4–2 on page 4–7, Figure 4–11 on page 23, and Figure 4–12 on page.<br />

■ Updated “Specifying Libraries” on page 4–14 section. Changed “User Libraries” to<br />

“Libraries”. Removed “Reducing Compilation Time” on page 4–26.<br />

■ Added “<strong>Managing</strong> <strong>Projects</strong> in a Team-Based Design Environment” on page 4–22 and “File<br />

Association” on page 4–2.<br />

■ Updated Figure 4–1 on page 4–6, Figure 4–2 on page 4–8, Figure 4–6 on page 4–18,<br />

Figure 4–6 on page 4–19, and Figure 4–7 on page 4–21.<br />

<strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong> Version 12.0 June 2012 <strong>Altera</strong> Corporation<br />

Volume 2: Design Implementation and Optimization


Chapter 4: <strong>Managing</strong> <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong> 4–21<br />

Document Revision History<br />

Table 4–1. Document Revision History (Part 2 of 2)<br />

Date Version Changes<br />

■ Updated “Creating a New Project” on page 4–4, “Archiving a Project” on page 4–9,<br />

“Restoring an Archived Project” on page 4–11.<br />

November 2009 9.1.0 ■ Added “<strong>Quartus</strong> <strong>II</strong> Text Editor” on page 4–2, “Reducing Compilation Time” on page 4–32.<br />

■ Updated Table 4–1 on page 4–10, Table 4–2 on page 4–20.<br />

■ Updated Figure 4–4 on page 4–9, Figure 4–7 on page 4–19.<br />

April 2009 9.0.0 Updated to fix “Document Revision History” for <strong>version</strong> 9.0.0.<br />

March 2009 9.0.0<br />

■ Updated “<strong>Managing</strong> <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong>” on page 4–1, “Creating a New Project” on<br />

page 4–2, “Using Revisions with Your Design” on page 4–3, “Creating and Deleting<br />

Revisions” on page 4–4, “Creating New Copies of Your Design” on page 4–6, “Version-<br />

Compatible Databases” on page 4–11, “<strong>Quartus</strong> <strong>II</strong> Project Platform Migration” on<br />

page 4–12, “Filenames and Hierarchies” on page 4–12, “<strong>Quartus</strong> <strong>II</strong> Search Path<br />

Precedence Rules” on page 4–15, “<strong>Quartus</strong> <strong>II</strong>-Generated Files for Third-Party EDA Tools”<br />

on page 4–15, “Migrating Database Files between Platforms” on page 4–16, “Message<br />

Suppression” on page 4–20, “<strong>Quartus</strong> <strong>II</strong> Settings File” on page 4–24, “<strong>Quartus</strong> <strong>II</strong> Default<br />

Settings File” on page 4–25, “<strong>Managing</strong> Revisions” on page 4–26, “Archiving <strong>Projects</strong>”<br />

on page 4–26 and “Archiving <strong>Projects</strong> with the <strong>Quartus</strong> <strong>II</strong> Archive Project Feature” on<br />

page 4–7, “Importing and Exporting Version-Compatible Databases” on page 4–27,<br />

“Specifying Libraries Using Scripts” on page 4–28, “Conclusion” on page 4–30.<br />

■ Updated Figure 4–1, Figure 4–7, Figure 4–8, and Figure 4–11.<br />

■ Updated Table 4–1 and Table 4–2.<br />

■ Updated Example 4–3, Example 4–4, Example 4–5, and Example 4–6.<br />

f For previous <strong>version</strong>s of the <strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong>, refer to the <strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong><br />

Archive.<br />

June 2012 <strong>Altera</strong> Corporation <strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong> Version 12.0<br />

Volume 2: Design Implementation and Optimization


4–22 Chapter 4: <strong>Managing</strong> <strong>Quartus</strong> <strong>II</strong> <strong>Projects</strong><br />

Document Revision History<br />

<strong>Quartus</strong> <strong>II</strong> <strong>Handbook</strong> Version 12.0 June 2012 <strong>Altera</strong> Corporation<br />

Volume 2: Design Implementation and Optimization

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!