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

Page 24

Advertising
background image

3–2

Chapter 3: Implementing a Nios II Custom Instruction in SOPC Builder

Implementing Custom Instruction Hardware in SOPC Builder

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_sopcb.txt

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

determine a <project_dir> working directory for the project, to download an
appropriate Quartus II project for your development board, 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_sopcb.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 the SOPC Builder system, on the Tools menu, click SOPC Builder.

2. On the SOPC Builder System Contents tab, double-click cpu. The Nios II

Processor parameter editor appears.

3. On the Parameter Settings page, on the Custom Instructions tab, click Import.

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