/***************************************************************************** ** ** ProgramMNCodeCov ** ** Description: ** set TMAN to code coverage config ** Parameters: ** input: ** coderange : point to structure shown as follows ** coderange->use : this range is used or not ** coderange->addr : set code coverage address ** coderange->status : set code coverage status ******************************************************************************/ RETCODE ProgramMNCodeCov(SPA_CC_RANGE_NODE *coderange) ; /***************************************************************************** ** ** ListCodeCov ** ** Description: ** List code coverage data from trace memory ** ** Parameters: ** input: ** adder : read data from this addr ** len : ** *data : a pointer to code coverage data ** ******************************************************************************/ RETCODE ListCodeCov(U32 adder,U16 len,U8 *data) ; /****************************************************************************** ** ** SetRangeAddr ** ** Description: ** Set upper or lower bound of range addr of one event ** ** Parameters: ** input: ** addrlo : lower addr of one event ** addrhi : upper addr of one event ** eventID : event ID ** output: ** ** *******************************************************************************/ RETCODE SetRangeAddr(U32 addrlo,U32 addrhi,U8 eventID) ; /****************************************************************************** ** ** SetSingleMask ** ** Description: ** Set addr, data or status field of one event to a single value or ** a value with mask. ** For a single value, set the input parameter "mask" to be 0xFFFFFFFF. ** ** Parameters: ** input: ** field: ADDR_FIELD, DATA_FIELD or STATUS_FIELD ** value: setting value ** mask: setting mask ** eventID : event ID ** output: ** ** *******************************************************************************/ RETCODE SetSingleMask(EVENT_FIELD field,U32 value, U32 mask, U8 eventID) ; /****************************************************************************** ** ** WrBCOneAddr ** ** Description: ** Write data to Bus Compare SSRAM at singal addr. ** ** Parameters: ** input: ** port: set port to write ** addr: addr value ** bit: which bit is mask ** data: data value ** eventID : event ID ** output: ** ** *******************************************************************************/ VOID WrBCOneAddr(U8 port,U16 addr,U16 bit,U16 data,U8 eventID) ; /****************************************************************************** ** ** SetBCData ** ** Description: ** Set Bus Compare SSRAM data ** ** Parameters: ** input: ** port: set port to write ** mask: data mask value ** set: set data value ** output: ** ** *******************************************************************************/ VOID SetBCData(U8 port,U16 mask,U16 set) ; /****************************************************************************** ** ** WrBCMaskAddr ** ** Description: ** Write data to Bus compare SSRAM at maskable addr. ** ** Parameters: ** input: ** port: set which port to write ** addrmask: addr mask value ** addrset: set addr value ** datamask: data mask value ** dataset: set data value ** fcnt : counter value ** output: ** ** *******************************************************************************/ VOID WrBCMaskAddr(U8 port,U16 addrmask,U16 addrset,U16 datamask,U16 dataset, U16 fcnt) ; /****************************************************************************** ** ** SetAllBusEvent ** ** Description: ** Set all bus events to MTAT-II ** ** Parameters: ** input: ** events: pointer to event 0 structure and the following should ** contain bus event 1, 2, 3, ... structure ** output: ** ** *******************************************************************************/ RETCODE SetAllBusEvent(BUS_EVENT *events); /****************************************************************************** ** ** WriteSeqRAMs ** ** Description: ** Write state machine data to Sequential RAM ** ** Parameters: ** input: ** *buffer: pointer to the data read from Sequential RAM ** *data: pointer to the data written into Sequential RAM ** output: ** if data != buffer ,return error. ** *******************************************************************************/ RETCODE WriteSeqRAMs(U8 _far *data,U8 _far *buffer); /****************************************************************************** ** ** ConfigTrace ** ** Description: ** Set the trace memory to 1, 2, 4.. trace buffers (MTAT-II is 1). ** Set the trigger location to PRE_TRIG, CENTER_TRIG, or POST_TRIG ** Set EP to break (or not break) when the trace memory are full ** This function only changes the global variables "traceBufferNumber", ** "triggerLocation" ,"ToffOnFull" and "breakOnFull", ** ** Parameters: ** input: ** traceBufNum: number of trace buffers ** trigLoc: trigger location ** breakFull: break on trace memory full ** ToffFull: Trace off on trace memory full ** output: ** none ** *******************************************************************************/ RETCODE ConfigTrace(U16 traceBufNum, TRIG_LOC trigLoc, BOOLEAN breakFull, BOOLEAN ToffFull); /****************************************************************************** ** ** InitialTraceMachine ** ** Description: ** Check MTAT-II exist ? If yes ,config FPGA to P4PIPE,PIO AND SMAIN. ** ** Parameters: ** input: ** none ** output: ** none ** *******************************************************************************/ RETCODE InitialTraceMachine(VOID); /****************************************************************************** ** ** ListTraceBuffer ** ** Description: ** List trace data from trace buffer "trcBufLogID" frame "logFrameNum" ** ** Parameters: ** input: ** log: point to structure shown as follows ** log->traceBufId: trace buffer logical ID ** log->traceform: list form (CLOCK_LIST or CYCLE_LIST) ** log->startFrame: logical frame number from which the list starts ** qualify: point to structure which includes the qualify-list information ** frameContents: pointer to list data ** output: ** none ** *******************************************************************************/ RETCODE ListTraceBuffer(TRACE_HEAD *log, QUALIFY_LIST *qualify, VOID *frameContents); /***************************************************************************** ** ** ReadTimerCounter ** ** Description: ** Read timer/counter value ** ** Parameters: ** input: ** *cnt0AfterTraceHalt : 32-bit pointer save timer0/counter0 value ** *cnt1AfterTraceHalt : 32-bit pointer save timer1/counter1 value ** ** output: ** none ******************************************************************************/ RETCODE ReadTimerCounter (U32 *cnt0AfterTraceHalt,U32 *cnt1AfterTraceHalt) ; /***************************************************************************** ** ** ReadHaltTimeStamp ** ** Description: ** Read timestamp value at EP halt frame. ** ** Parameters: ** input: ** *timeStamp : 8-bit pointer save timestamp value ** ** output: ** none ******************************************************************************/ VOID ReadHaltTimeStamp(U8 *timeStamp) ; /***************************************************************************** ** ** ReadTimeStamp ** ** Description: ** Read timestamp value ** ** Parameters: ** input: ** trcBufLogID : trace buffer logical ID ** LogID : current trace buffer logical ID ** *timeStamp : 8-bit pointer save timestamp value ** ** output: ** none ******************************************************************************/ VOID ReadTimeStamp(U16 trcBufLogID,S32 LogID,U8 *timeStamp) ; /***************************************************************************** ** ** SPAListTrace ** ** Description: ** Provide special list trace buffer for SPA.In SPA function,trace buffer ** only collect one trace frame. ** ** Parameters: ** input: ** *event : 8-bit pointer to save event value ** *timeStamp : 8-bit pointer save timestamp value ** ** output: ** none ** ******************************************************************************/ RETCODE SPAListTrace(U8 *timeStamp,U8 *event) ; /****************************************************************************** ** ** ProgramTMANTrace ** ** Description: ** Program TMAN to TRACE configuration ** EP bus can be traced into trace memory, if TMAN is under TRACE ** configuration ** ** Parameters: ** input: ** trcSel : Set EP to break (or not break) when the trace buffer are full ** output: ** none ** *******************************************************************************/ RETCODE ProgramTMANTrace(U8 trcSel); /****************************************************************************** ** ** TraceStop ** ** Description: ** Set MTAT-II to stop trace when TRACE-ON-FLY. ** ** Parameters: ** input: ** none ** output: ** none *******************************************************************************/ RETCODE TraceStop(VOID) ; /****************************************************************************** ** ** TraceStart ** ** Description: ** Set MTAT-II to start trace when TRACE-ON-FLY. ** ** Parameters: ** input: ** none ** output: ** none ******************************************************************************/ RETCODE TraceStart(VOID) ; /****************************************************************************** ** ** GetTrigInfoOfTrcBuf ** ** Description: ** Get global variables "startLogFrameOfTrcBuf","endLogFrameOfTrcBuf", ** "trigPhyFrameOfTrcBuf" ** ** Parameters: ** input: ** trcBufLogID : trace buffer logic ID. ** output: ** none *******************************************************************************/ RETCODE GetTrigInfoOfTrcBuf(U16 trcBufLogID) ; /****************************************************************************** ** ** IsTMANBreak ** ** Description: ** Check MTAT-II break or not ? ** ** Parameters: ** input: ** none ** output: ** none *******************************************************************************/ BOOLEAN IsTMANBreak(VOID) ; /***************************************************************************** ** ** CheckTrigEvent ** ** Description: ** Read event,timer/counter at trigger point ** ** Parameters: ** input: ** none ** output: ** 01 : event0 match ** 02 : event1 match ** 03 : event2 match ** 04 : event3 match ** 05 : event4 match ** 06 : event5 match ** 07 : event6 match ** 08 : event7 match ** 09 : counter0/timer0 match ** 10 : counter0/timer0 match ******************************************************************************/ RETCODE CheckTrigEvent(VOID) ; /***************************************************************************** ** ** CheckTrcFull ** ** Description: ** Check MTAT-II stop trace or not ? ** ** Parameters: ** input: ** none ** output: ** 0 : MTAT-II is tracing ** 1 : MTAT-II is not tracing ********************************************************************************/ BOOLEAN CheckTrcFull(VOID) ; /***************************************************************************** ** ** WriteSerialEEPROM ** ** Description: ** Write data to serial EEPROM ** ** Parameters: ** input: ** *ptr : a pointer point to data buffer ** output: ** none ********************************************************************************/ VOID WriteSerialEEPROM(U8 *ptr) ; /***************************************************************************** ** ** ReadSerialEEPROM ** ** Description: ** Read data from serial EEPROM ** ** Parameters: ** input: ** *ptr : a pointer point to data buffer ** output: ** none ********************************************************************************/ VOID ReadSerialEEPROM(U8 *ptr) ; /*************************************************************************** ** ** SetTAddr ** ** Description: ** Set trcae buffer address ** ** Parameters: ** input: ** addr : address value ** output: ** none ****************************************************************************/ VOID SetTAddr(U32 addr); /********************************* EOF *************************************/