⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hpi_readwrite_test.c

📁 dsp tms320c6486的csl例程
💻 C
字号:
/*****************************************************************************\
*           TEXAS INSTRUMENTS INCORPORATED PROPRIETARY INFORMATION           
*                                                                            
*  Property of Texas Instruments 
*  For  Unrestricted  Internal  Use  Only 
*  Unauthorized reproduction and/or distribution is strictly prohibited.  
*  This product is protected under copyright law and trade secret law 
*  as an unpublished work.  
*  Created 2004, (C) Copyright 2003 Texas Instruments.  All rights reserved.
*------------------------------------------------------------------------------
*  Filename       : hpi_test.c
*  Date Created   : Nov 27, 2004
*  Last Modified  : Feb 15, 2004
*  Description    : UHPI Throughput test for perforimg burst accesses with 
*                   varying data payload sizes [4, 16, 64, 1K and 4K (32-bit)
*                   words]. Runs each payload size back-to-back 16 times.
*
*  History        :
*  Project        : Himalaya
*  Author         : Raja
\*****************************************************************************/

#include <csl.h>
#include "hpi_const.h"    /* Device specific file */
#include "test_init.h"    /* Testcase specific initialization file */
#include "tomahawk.h"
#include "cslr_gpio.h"
#include <csl_types.h>

#define GEM_ID 		0

void setup_gpio();
void init_gpio();

Uint32 DoHpiTest(void)
{
    Uint32 i, j;
	Uint32 result = 0;
    Uint32 *dsp_src_buff_g , *dsp_dst_buff_g;

    init_gpio();

   	if (GEM_ID == 0) {
   	    dsp_src_buff_g= dsp_src_buff + GEM_ID*0x1000000/4 + 0x10000000/4;
        dsp_dst_buff_g= dsp_dst_buff + GEM_ID*0x1000000/4 + 0x10000000/4;

   	    for (i = 0 ; i < payLoad[0] ; i++) { 
            dsp_src_buff_g[i] = i;
     		dsp_dst_buff_g[i] = 0;
    	}

        /* Clearing HPI_RST in HPIC */
        DSP_HPIC = 0x00000000;
		setup_gpio();

        /* Perform UHPI Transfers for various Payloads                      */
   		for (i = 0; i < NO_OF_PAYLOADS; i++) {
            /* Perform UHPI Transfers for various iterations */
            setup_gpio();    // 1  For Sync
            for (j = 0; j < NO_OF_ITERATIONS; j++) {
                while((DSP_HPIC & 0x02) != 0x02)    //  Wait For Normal mode Init       
                    DSP_HPIC = 0x02 ;
			        setup_gpio();    // 2 Sync  Before FAST MODE

          			setup_gpio();   // 3  Sync After FAST MODE READ

        			setup_gpio();     //4  Sync AFter Fast Mode Write
       			} /* loop for NO_OF_ITERATIONS */

                /* Compare DSP reference and dst buffers for each payload  */
     		    result = Data_Compare_HPI(dsp_src_buff_g, dsp_dst_buff_g, 256);

        		if (result != PASS) {
    				break;
	     		}
    		} /* loop for NO_OF_PAYLOADS */
   		}
//	}
    return (result);
}



void main(void)
{
  /*------------------------------------------------------------------*/
  /* Function call to perform the actual test                         */
  /*------------------------------------------------------------------*/    
    DoHpiTest();

}


/*****************************************************************************\
* End of hpi_test.c
\*****************************************************************************/


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -