edma3_log.h
来自「vicp做为dm6446上的硬件加速器」· C头文件 代码 · 共 234 行
H
234 行
/*******************************************************************************
**+--------------------------------------------------------------------------+**
**| **** |**
**| **** |**
**| ******o*** |**
**| ********_///_**** |**
**| ***** /_//_/ **** |**
**| ** ** (__/ **** |**
**| ********* |**
**| **** |**
**| *** |**
**| |**
**| Copyright (c) 1998-2006 Texas Instruments Incorporated |**
**| ALL RIGHTS RESERVED |**
**| |**
**| Permission is hereby granted to licensees of Texas Instruments |**
**| Incorporated (TI) products to use this computer program for the sole |**
**| purpose of implementing a licensee product based on TI products. |**
**| No other rights to reproduce, use, or disseminate this computer |**
**| program, whether in part or in whole, are granted. |**
**| |**
**| TI makes no representation or warranties with respect to the |**
**| performance of this computer program, and specifically disclaims |**
**| any responsibility for any damages, special or consequential, |**
**| connected with the use of this program. |**
**| |**
**+--------------------------------------------------------------------------+**
*******************************************************************************/
/** \file edma3_log.h
\brief EDMA3 logging/tracing service
This file contains interface for EDMA3 error/event/message logging and
tracing service.
(C) Copyright 2006, Texas Instruments, Inc
\author EDMA3 Architecture Team
\version 1.0 Anant Gole Created
*/
#ifndef _EDMA3_LOG_H_
#define _EDMA3_LOG_H_
#include <std.h>
#include <log.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* \defgroup EDMA3 Log Service
*
* EDMA3 error/event/message logging/tracing service
*/
/*@{*/
/*
Note : This header file is used to BIOS logs only. For porting purposes this
file need to replace EDMA3_LOG_EVENT macro.
This header file uses log format as defined by Socrates Instrumentation.
Any change in the file will result in incorrect interpretation by Socrates Tool.
BIOS Log Format
-------------------------------------------------------------------------------
| TimeStamp | Sequence # | Event # | Event Descriptor | Data1 | Data2 | Data3 |
| (2 words) | by BIOS | by BIOS | | | | |
-------------------------------------------------------------------------------
LogBuffer: A single log buffer called DVTEvent_Log will be used for all event logs
TimeStamp: Automatically inserted by BIOS Log_Printf4.
Sequence #: Automatically inserted by BIOS Log_Printf4. This is used to detect data loss.
Event: Name to uniquely identify event. This is the name that will be used in the visualization.
(Limitation: RTA requires the name to be a static global)
Event Descriptor: The Event Descriptor is created using the EDMA3_DVT_DESC Macro.
This Macro is of the following format (see tables below for EventType and ArgType):
EDMA3_DVT_DESC(EventType, Arg1Type, Arg2Type, Arg3Type)
Note: Event # is generated by BIOS based on unique String provided as input to "Log_Printf4".
This string is extracted by Sorcates via the map file.
Note:
1. Only three pieces of data can be included in any log
2. Data needs to be included in the same order as in table.
i.e. if logging INITIATOR, SIZE and CORR then INITIATOR
must be in arg1, CORR in arg2 and SIZE in arg3
Example:
ISRx()
{
Log_Printf4(&DVTEvent_Log, "ISR1", EDMA3_DVT_DESC(EDMA3_DVT_INT_eSTART, EDMA3_DVT_dNONE, EDMA3_DVT_dNONE,
EDMA3_DVT_dNONE))
:
:
Log_Printf4(&DVTEvent_Log, "ISR1", EDMA3_DVT_DESC(EDMA3_DVT_INT_eEND, EDMA3_DVT_dSIZE, EDMA3_DVT_dNONE,
EDMA3_DVT_dNONE), sizeof(Buffer))
}
*/
extern far LOG_Obj DVTEvent_Log;
typedef enum
{
EDMA3_DVT_eINT , /* Interrupt Event. Use this only is logging
that the interrupt occurred. Use INT_START/END
if tracking the entry and exit of interrupt */
EDMA3_DVT_eINT_START, /* Enter Interrupt service routine */
EDMA3_DVT_eINT_END, /* Exit Interrupt service routine */
EDMA3_DVT_eFUNC, /* Interrupt Event. Use this only is logging that
the function was called. Use FUNC_START/END if
tracking the entry and exit of function */
EDMA3_DVT_eFUNC_START, /* Enter function service routine */
EDMA3_DVT_eFUNC_END, /* Exit function service routine */
EDMA3_DVT_ePACKET_START, /* Start of a Packet */
EDMA3_DVT_ePACKET_END, /* End of a Packet */
EDMA3_DVT_eDATA_SND, /* An event that has a free running counter value
associated with it */
EDMA3_DVT_eDATA_SND_START, /* A COUNTER Event that has a corresponding
ENDCOUNTER event */
EDMA3_DVT_eDATA_SND_END, /* End of a STARTCOUNTER event */
EDMA3_DVT_eDATA_RCV, /* An Event that has a value associated with it */
EDMA3_DVT_eRCV_START, /* A VALUE event that has a corresponding ENDVALUE
event */
EDMA3_DVT_eRCV_END, /* End of a STARTVALUE event */
EDMA3_DVT_eSMPL_COUNTER, /* Sample some free running counter */
EDMA3_DVT_eEVENT, /* Events not explicitly defined above */
EDMA3_DVT_eEVENT_START, /* Start of an Event not mentioned in the above list */
EDMA3_DVT_eEVENT_END /* End of an Event not mentioned in the above list */
} EDMA3_logEventType;
typedef enum
{
EDMA3_DVT_dNONE , /* No Data */
EDMA3_DVT_dINST, /* ID for this instance of the driver. This is necessary
if separate analysis is required for different instances
of a multiple instance driver. */
EDMA3_DVT_dINITIATOR, /* ID of the component that initiated this driver request */
EDMA3_DVT_dMSG_ID, /* Use to correlate START and END events. This is not
necessary if events are sequenced, i.e. no more than
1 START is pending at any given time. */
EDMA3_DVT_dCOUNTER, /* Value of a free running counter */
EDMA3_DVT_dSIZE_BYTES, /* Size in number of bytes */
EDMA3_DVT_dSIZE_WORDS, /* Size in number of words */
EDMA3_DVT_dPADD, /* Program Address */
EDMA3_DVT_dDADD, /* Data address */
EDMA3_DVT_dDATA, /* Some Data */
EDMA3_DVT_dPACKET_ID, /* Packet ID */
EDMA3_DVT_dCHANNEL_ID /* Channel ID */
} EDMA3_logDataDesc;
#define ARG1(arg1) (arg1 << 8)
#define ARG2(arg2) (arg2 << 16)
#define ARG3(arg3) (arg3 << 24)
#define EDMA3_DVT_DESC(event, arg1, arg2, arg3) (event | ARG1(arg1) | ARG2(arg2) | ARG3(arg3))
/*
* EDMA3 Event Log Macro
*
* Macro to log the event
*/
#define EDMA3_LOG_EVENT LOG_printf4
/* Examples : For instrumenting a driver which is working in interrupt mode.
Driver Write Function:
Drv_Write(...)
{
EDMA3_LOG_EVENT(hLog, "DRV", EDMA3_DVT_DESC(EDMA3_DVT_eFUNC_START, EDMA3_DVT_dNONE, EDMA3_DVT_dNONE, EDMA3_DVT_dNONE));
EDMA3_LOG_EVENT(hLog, "DRV", EDMA3_DVT_DESC(EDMA3_DVT_ePACKET_START, EDMA3_DVT_dPACKET_ID, EDMA3_DVT_dNONE, EDMA3_DVT_dNONE), packetId);
.
.
EDMA3_LOG_EVENT(hLog, "DRV", EDMA3_DVT_DESC(EDMA3_DVT_eDATA_SND_START, EDMA3_DVT_dNONE, EDMA3_DVT_dNONE, EDMA3_DVT_dNONE));
.
.
.
EDMA3_LOG_EVENT(hLog, "DRV", EDMA3_DVT_DESC(EDMA3_DVT_eFUNC_END, EDMA3_DVT_dSIZE_BYTES, EDMA3_DVT_dNONE, EDMA3_DVT_dNONE), Data Transferred);
}
Note: In case the driver is asychronous, then the FUNC_END event will be placed before calling
the completion call back.
DRV_ISR(...)
{
Case: Intermediate Transfer complete
EDMA3_LOG_EVENT(hLog, "DRV", EDMA3_DVT_DESC(EDMA3_DVT_eDATA_SND_END, EDMA3_DVT_dSIZE_BYTES, EDMA3_DVT_dNONE, EDMA3_DVT_dNONE), Data written to Hardware);
case: More Data Pending
EDMA3_LOG_EVENT(hLog, "DRV", EDMA3_DVT_DESC(EDMA3_DVT_eDATA_SND_START, EDMA3_DVT_dNONE, EDMA3_DVT_dNONE, EDMA3_DVT_dNONE));
}
*/
/*@}*/
#ifdef __cplusplus
}
#endif /* extern "C" */
#endif /* _EDMA3_LOG_H_ */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?