vicp_support.h

来自「vicp做为dm6446上的硬件加速器」· C头文件 代码 · 共 196 行

H
196
字号
/* ======================================================================== *//*  TEXAS INSTRUMENTS, INC.                                                 *//*                                                                          *//*  VICP Signal Processing Library                                          *//*                                                                          *//*  This library contains proprietary intellectual property of Texas        *//*  Instruments, Inc.  The library and its source code are protected by     *//*  various copyrights, and portions may also be protected by patents or    *//*  other legal protections.                                                *//*                                                                          *//*  This software is licensed for use with Texas Instruments TMS320         *//*  family DSPs.  This license was provided to you prior to installing      *//*  the software.  You may review this license by consulting the file       *//*  TI_license.PDF which accompanies the files in this library.             *//*                                                                          *//* ------------------------------------------------------------------------ *//*                                                                          *//* NAME                                                                     *//*   vicp_support.h -- vicp support header file                             *//*                                                                          *//* DESCRIPTION                                                              *//*   This  file includes symbols definitions and function's interfaces      *//*   that the application needs to use in order to access the VICP memories */
/*                                                                          *//* REV                                                                      */
/*                                                                          *//*   version 0.0.1:  3rd Feb                                                */
/*   Initial version                                                        */
/*                                                                          *//* ------------------------------------------------------------------------ *//*            Copyright (c) 2008 Texas Instruments, Incorporated.           *//*                           All Rights Reserved.                           *//* ======================================================================== */


#ifndef __VICP_SUPPORT_H__
#define __VICP_SUPPORT_H__

#include "tistdtypes.h"

/* 
    Define this symbol in the build project's option if target is DM648/7
    or uncomment line below
*/
/* #define _DM648 1 */

/*
    Define addressing symbols that are device dependent
*/
#ifndef _DM648

#define IMCOP_UMAP1_BASE          0x11100000
#define GLOBVIEW_BASE             0x11000000
#define IMCOP_CFG_BASE            0x01CC0000   

#else

#define IMCOP_UMAP1_BASE          0x00100000
#define GLOBVIEW_BASE             0x00000000
#define IMCOP_CFG_BASE            0x02080000   

#endif

/*
    Define image buffers, coefficient and command memories base addresses
*/

/* Byte addresses */
#define IMGBUF_BASE         (IMCOP_UMAP1_BASE + 0x00000)   /* Image buffer A&B ping-pong view */
#define IMGBUF_A_BASE       IMGBUF_BASE
#define IMGBUF_B_BASE       IMGBUF_BASE
#define IMGBUF_A_FULL_BASE  (IMCOP_UMAP1_BASE + 0x04000)   /* Image buffer A in full view */
#define IMGBUF_B_FULL_BASE  (IMCOP_UMAP1_BASE + 0x06000)   /* image buffer B in full view */
#define COEFFBUF_BASE    (IMCOP_UMAP1_BASE + 0x08000)   /* coefficient memory */
#define CMDBUF_BASE      (IMCOP_UMAP1_BASE + 0x14000)   /* command memory */

/*
    Define size symbols
*/
/* Below symbols are used to express size in number of 16-bits words */
#define IMGBUF_SIZE         0x2000   /* 8 kW in full view */
#define IMGBUF_A_SIZE       0x1000   /* Each image buffer is 4 kW */
#define IMGBUF_B_SIZE       0x1000
#define COEFFBUF_SIZE    0x4000   /* Coefficient memory is 16 kW */  
#define CMDBUF_SIZE      0x1000   /* Command memory is 4 kW */ 

/* Below symbols are used to express size in number bytes */
#define IMGBUF_SIZE_BYTES   0x4000   /* 8 kW in full view */
#define IMGBUF_A_SIZE_BYTES 0x2000   /* Each image buffer is 4 kW */
#define IMGBUF_B_SIZE_BYTES 0x2000
#define COEFFBUF_SIZE_BYTES    0x8000   /* Coefficient memory is 16 kW */  
#define CMDBUF_SIZE_BYTES      0x2000   /* Command memory is 4 kW */

/*
    Define symbols used as input parameters to IMGBUF_switch() function
*/
/* Symbols used to select which memory to switch */
#define    SELIMGBUFA       0x00000003
#define    SELIMGBUFB       0x00000003
#define    SELCOEFBUF       0x0000000C
#define    SELCMDBUF        0x00000030
#define    SELALLBUF        0x00003FFF

/* Symbols used to qualify the switch */
#define    IMGBUFADSP       0x00000000 /* Grant image buffer A access to DSP */
#define    IMGBUFADMA       IMGBUFADSP /* Grant image buffer A access to DMA */
#define    IMGBUFAVICP      0x00000001 /* Grant image buffer A access to VICP*/

#define    IMGBUFBDSP       0x00000001 /* Grant image buffer B access to DSP */
#define    IMGBUFBDMA       IMGBUFBDSP /* Grant image buffer B access to DMA */
#define    IMGBUFBVICP       0x00000000 /* Grant image buffer B access to VICP */

#define    COEFFBUFDSP      0x00000000 /* Grant coefficient memory access to DSP */
#define    COEFFBUFDMA      COEFFBUFDSP /* Grant coefficient memory access to DMA */
#define    COEFFBUFVICP     0x00000004 /* Grant coefficient memory access to VICP  */
#define    COEFFBUFAUTO     0x00000008 /* Switch is automatically handled (preferred mode) */

#define    CMDBUFDSP        0x00000000 /* Grant command memory access to DSP */
#define    CMDBUFDMA        CMDBUFDSP  /* Grant command memory access to DMA */
#define    CMDBUFVICP       0x00000010 /* Grant command memory access to VICP */    
#define    CMDBUFAUTO       0x00000020 /* Switch is automatically handled (preferred mode) */

#define    ALLBUFDSP        0x00000000 /* Grant all memory access to DSP */

/* Symbol passed to IP_run DmaTferStruct structure's dmaChNo member */
#define    DMAC_CHAN_ANY    37

/*
    Type definitions
*/

/* These types are used by CACHE_<..> function */
typedef unsigned long   CACHE_Addr_t ;
typedef unsigned long   CACHE_Size_t ;
typedef void (*CACHE_Cb)(CACHE_Addr_t addr, CACHE_Size_t size, unsigned short wait);

typedef struct {

  CACHE_Cb wbCb;     /* Callback for D-cache write back API */
  CACHE_Cb invCb;    /* Callback for D-cache invalidate API */
  CACHE_Cb wbInvCb;  /* Callback for D-cache write back and invalidate API */

} CACHE_InitPrm_t;


/*
Function prototypes
*/

/*
 Start the VICP computation unit
 The command sequence pointed by cmdPtr is executed
 until a sleep command (single word 0x8000) is encountered
*/
void IMX_start(Uint16 *cmdPtr);

/* Wait for completion of the VICP computation unit */
void IMX_wait();

/* This function is used to switch VICP's memories access between (DSP+EDMA3) and VICP */
Uint32 IMGBUF_switch(Uint32 buffers, Uint32 connections);

/* Initialize callbacks to write back invalidate D-cache */
void CACHE_init(CACHE_InitPrm_t *pPrm);

/*
  Write back data from cache 

  addr    buffer address
  size    size of buffer
*/
void CACHE_writeBack(CACHE_Addr_t addr, CACHE_Size_t size, unsigned short wait);

/*
  Invalidate data from cache 

  addr    buffer address
  size    size of buffer
*/
void CACHE_invalidate(CACHE_Addr_t addr, CACHE_Size_t size, unsigned short wait);

/*
  Write back and invalidate data from cache 

  addr    buffer address
  size    size of buffer
*/
void CACHE_wbInv(CACHE_Addr_t addr, CACHE_Size_t size, unsigned short wait);

#endif /*  __VICP_SUPPORT_H__  */





⌨️ 快捷键说明

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