Opening the component editor, Adding the hdl files – Altera Nios II Custom User Manual

Page 32

Advertising
background image

4–2

Chapter 4: Implementing a Nios II Custom Instruction in Qsys

Implementing Custom Instruction Hardware in Qsys

Nios II Custom Instruction User Guide

January 2011

Altera Corporation

Setting up the Design Environment for the Design Example

Before you start the design example, you must set up the design environment to
accommodate the processes described in the following sections. To set up the design
example environment, follow these steps:

1. Open the ug_custom_instruction_files.zip file from the

Nios II Custom

Instruction Design Example web page

and extract all the files to a new directory.

2. Follow the instructions in the Quartus II Project Setup section in the

readme_qsys.txt

file in the extracted design files. The instructions direct you to

determine a <project_dir> working directory for the project and to open the design
example project in the Quartus II software.

Opening the Component Editor

After you follow the steps in the Quartus II Project Setup section of the
readme_qsys.txt

file, you have an Quartus II project located in the <project_dir>

directory and open in the Quartus II software.

To open the component editor, follow these steps:

1. To open Qsys, on the Tools menu, click Qsys.

2. In Qsys, on the File menu, click Open.

3. Browse to the <project_dir> directory if necessary, select the .qsys file, and click

Open

.

4. On the Qsys Component Library tab, click New. The component editor appears,

displaying the Introduction tab.

Adding the HDL Files

To specify the synthesis HDL files for your custom instruction, follow these steps:

1. Click Next to display the HDL Files tab.

2. Click Add.

3. Browse to <project_dir>/crc_hw, the location of the HDL files for this design

example.

4. Select the CRC_Custom_Instruction.v and CRC_Component.v files and click

Open

.

1

The Quartus II Analysis and Synthesis program checks the design for errors
when you add the files. Confirm that no error message appears.

5. Ensure the Synth setting is turned on for both files. This setting directs the

component editor to generate models for synthesis..

6. Turn on the Top parameter for the CRC_Custom_Instruction.v file, to indicate it is

the top-level HDL file for this custom instruction.

1

The Quartus II Analysis and Synthesis program checks the design for errors
when you change the Top setting. Confirm that no error message appears.

Advertising