• flywiththewind > accelerating functions with the c2h compiler: scatter ...
  • accelerating functions with the c2h compiler: scatter ...

    免费下载 下载该文档 文档格式:PDF   更新时间:2006-07-02   下载次数:0   点击次数:1
    文档基本属性
    文档语言:Simplified Chinese
    文档格式:pdf
    文档作者:ISOYES
    关键词:
    主题:
    备注:
    点击这里显示更多文档属性
    Hardware & Software Requirements
    To use the design files provided with this application note, you must have the following software and hardware:
    ■ ■ ■ ■
    Altera Corporation AN417-1.1
    Quartus II development software version 6.0 or later, installed on a Windows or Linux computer Nios II Embedded Design Suite (EDS) version 6.0 or later Nios development board provided by Altera, such as the Nios Development Board, Cyclone II Edition JTAG download cable compatible with your target hardware, such as a USB-Blaster cable 1
    Background: Scatter-Gather DMA
    Background: Scatter-Gather DMA
    Embedded systems frequently employ DMA engines to increase data throughput and offload memory copy operations from the processor. In many cases the memory locations being accessed are dispersed throughout the address space. A scatter-gather DMA engine can manage multiple DMA transfers to noncontiguous memory locations, instead of having the processor issue separate DMA transfers for each region of memory. A scattergather DMA creates a table of address and length pairs called a descriptor table, which prepares the engine for all of the transfers. The DMA engine incurs very little overhead when switching between buffer locations, because no software intervention is necessary.
    Software-Only Implementation
    Example 1 shows the software implementation of the checksum algorithm, which is based on the Braden, Borman and Partridge's implementation of RFC 1071. This implementation is typical for execution on a processor. It is not optimal for the C2H Compiler and does not exploit knowledge of the underlying hardware to create higher performance results. Example 1: Software Implementation of Internet Checksum
    /****************************************************************************** * Portable C implementation of the Internet checksum, derived * * from Braden, Borman, and Partridge's example implementation * * in RFC 1071. * * * * Inputs: unsigned short *: base address of the buffer to be summed * * int: length of the buffer to be summed * * Outputs: unsigned short: calculated 16 bit checksum * *******************************************************************************/ unsigned short sw_checksum(unsigned short * addr, int count) { /* Compute Internet Checksum for "count" bytes * beginning at location "addr". */ register long sum = 0; while( count > 1 ) { /* This is the inner loop */ sum += *addr++; count -= 2; } /* Add left-over byte, if any */ if( count > 0 ) sum += * (unsigned char *)addr; /* Fold 32-bit sum to 16 bits */ while (sum>>16) sum = (sum & 0xffff) + (sum >> 16); return (~sum); }

    上一页下一页

  • 下载地址 (推荐使用迅雷下载地址,速度快,支持断点续传)
  • 免费下载 PDF格式下载
  • 您可能感兴趣的
  • flywiththewind  flyinthewind  gonewiththewind  runwiththewind  rollwiththewind  gongwiththewind  conewiththewind  comewiththewind  gownwiththewind  gunwiththewind