IPT-C2H-NIOS Altera, IPT-C2H-NIOS Datasheet - Page 27

no-image

IPT-C2H-NIOS

Manufacturer Part Number
IPT-C2H-NIOS
Description
C2H COMPILER FOR NIOS II
Manufacturer
Altera
Series
Nios®IIr
Type
Nios IIr
Datasheet

Specifications of IPT-C2H-NIOS

Function
C to Hardware Compiler
License
Initial License
Software Application
IP CORE, NIOS Processor And Functions
Core Architecture
FPGA
Core Sub-architecture
Cyclone
Rohs Compliant
NA
Lead Free Status / RoHS Status
Not applicable / Not applicable
Altera Corporation
November 2009
f
You can download dma_c2h_tutorial.c from the Nios II literature page.
The file is located next to this document (Nios II C2H Compiler User
Guide) on the Altera Nios II literature page at
literature/lit-nio2.jsp.
The file dma_c2h_tutorial.c includes two functions:
main() performs the following actions:
1.
2.
3.
4.
5.
6.
To measure the time it takes for the copy operations to complete, there are
timer routines around the loop that calls the do_dma() function. After
the application runs, the number of milliseconds that were spent
performing the copy operations is displayed to the Console view in the
Nios II IDE.
Set up the Hardware for the Project
To set up the hardware for the tutorial, perform the following steps:
1.
do_dma() – This is the function you accelerate. It performs a block
memory copy. do_dma() takes a source address pointer, a
destination address pointer, and an integer number of bytes to copy.
When implemented in hardware, do_dma() resembles DMA copy
logic. The prototype for do_dma() is as follows:
int do_dma( int * __restrict__ dest_ptr,
The _ _ restrict__ qualifier informs the compiler that the
pointers dest_ptr and source_ptr point to mutually exclusive
address ranges. For further information about the __restrict__
qualifier, see
Hardware Mapping
main() – main() calls do_dma() and measures the amount of time
taken, so that you can compare the software implementation with the
hardware accelerator.
Allocates two 1 MB buffers in main memory
Fills the source buffer with incrementing values
Fills destination buffer with all 0x0.
Calls the do_dma() function 100 times
Checks the copied data to ensure there were no errors
Frees the two allocated buffers
Connect your Nios development board to power, and connect the
board to your host computer with an Altera download cable.
int * __restrict__ source_ptr, int length )
“Pointer Aliasing” on page 3–32
9.1
Reference.
Nios II C2H Compiler User Guide
http://www.altera.com/
Getting Started Tutorial
of
Chapter 3, C-to-
2–5

Related parts for IPT-C2H-NIOS