Implementing a nios ii custom instruction in qsys, Design example: cyclic redundancy check, Implementing custom instruction hardware in qsys – Altera Nios II Custom User Manual

Page 31

Advertising
background image

January 2011

Altera Corporation

Nios II Custom Instruction User Guide

4. Implementing a Nios II Custom

Instruction in Qsys

This chapter describes the process of implementing a Nios II custom instruction with
the Qsys component editor. The component editor enables you to create new Qsys
components, including Nios II custom instructions. This chapter also describes the
process of accessing Nios II custom instructions from software.

f

For detailed information about the Qsys component editor, refer to

Creating Qsys

Components

in volume 1 of the Quartus II Handbook.

Design Example: Cyclic Redundancy Check

The cyclic redundancy check (CRC) algorithm detects the corruption of data during
transmission. It detects a higher percentage of errors than a simple checksum. The
CRC calculation consists of an iterative algorithm involving XOR and shift operations.
These operations are carried out concurrently in hardware and iteratively in software.
Because the operations are carried out concurrently, the execution is much faster in
hardware.

The CRC design files demonstrate the steps to implement an extended multicycle
Nios II custom instruction. These design files are available for you to download from
the

Nios II Custom Instruction Design Example web page

.

Implementing Custom Instruction Hardware in Qsys

This section describes the custom instruction tool-flow, and walks you through the
process of implementing a Nios II custom instruction. Implementing a Nios II custom
instruction hardware entails the following tasks:

“Opening the Component Editor”

“Adding the HDL Files”

“Configuring the Custom Instruction Signal Type” on page 4–3

“Setting Up the Custom Instruction Interfaces” on page 4–3

“Setting the Details” on page 4–4

“Saving and Adding the Custom Instruction” on page 4–5

“Generating the System and Compiling in the Quartus II Software” on page 4–5

The following sections detail the steps required to set up the design example
environment and to perform the list of tasks.

Advertising