/*                                                                          */
/* File Name   : mbdr_dsp_debug_prob.h                                      */
/*                                                                          */
/* Written By  : 79556                                                      */
/*                                                                          */
/* versions    :                                                            */
/*+--------+-----------+---------------------------------------------------+*/
/*| Version| Date      | Change content                                    |*/
/*+--------+-----------+---------------------------------------------------+*/
/*|        |       2006| Creation                                          |*/
/*+--------+-----------+---------------------------------------------------+*/
/*|        |23/Sep/2006| mbdr_dsp_dbg_read_and_split_prob_dw_buf           |*/
/*+--------+-----------+---------------------------------------------------+*/
/*| 0.02.65|24/Jan/2011|- mbdr_dsp_debug_prob_read_dw_buffer_repeated_times|*/
/*+--------+-----------+---------------------------------------------------+*/
/*| 0.02.94|20/Dec/2011|- replace programmer name by code                  |*/
/*+--------+-----------+---------------------------------------------------+*/
/*|        |20/Feb/2014|- mbdr_dsp_dbg_print_prob_dw_buf_nop               |*/
/*+--------+-----------+---------------------------------------------------+*/
/*                                                                          */
/* Function    : decalre prob/read write utilities                          */
/*                                                                          */
#include "windef.h"

#ifndef _MBDR_DSP_DEBUG_PROB_H
#define _MBDR_DSP_DEBUG_PROB_H

/* reads DW buffer, first DW in input file is DW count */
extern void mbdr_dsp_debug_prob_read_dw_buffer_repeated_times(
                         SHORT           pi_repeat_count,
                         volatile LONG  *pi_source_prob_p,
                         LONG           *po_destination_buf_p);

extern void mbdr_dsp_dbg_print_prob_dw_buf(const void     *pi_buf_p,
                                           int             pi_buf_byte_size,
                                           volatile LONG  *po_prob_fp);

/* dummy routine to save run time cycles */
extern void mbdr_dsp_dbg_print_prob_dw_buf_nop(const void     *pi_buf_p,
                                               int             pi_buf_byte_size,
                                               volatile LONG  *po_prob_fp);

extern void mbdr_dsp_dbg_read_prob_dw_buf(
                        volatile LONG  *pi_prob_read_fp,
                        int             pi_buf_byte_size,
                        void           *po_dw_buf_p);

/* routines splits reading input to 2 different DW buffers */
/* pi_buf_byte_size legal values: 8K                       */
extern void mbdr_dsp_dbg_read_and_split_prob_dw_buf(
                        volatile LONG  *pi_prob_read_fp,
                        int             pi_buf_byte_size,
                        void           *po_dw_buf_0_p,
                        void           *po_dw_buf_1_p);

extern void mbdr_dsp_dbg_print_prob_char_buf(char *pi_char_buf_p,
                                      int   pi_buf_byte_size,
                                      volatile char  *po_prob_fp);


extern void mbdr_dsp_dbg_general_end(void);
extern void mbdr_dsp_dbg_end_sim_with_dummy_probs(ULONG pi_read_lines);

typedef struct
{
  void (*stream_open_proc_p)        (void *pio_stream_manage_p) ;
  void (*stream_print_string_proc_p)(void *pio_stream_manage_p,
                                     char string) ;
  void (*stream_close_proc_p)       (void *pio_stream_manage_p) ;
}mbdr_dsp_dbg_print_stream_procs_t;



extern void mbdr_dsp_dbg_print_uf(const char *pi_char_buf_p,
                                  int   pi_buf_byte_size,
                                  volatile char  *po_prob_fp);

extern void mbdr_dsp_dbg_print_prob_word_buf(const SHORT *pi_word_buf_p,
                                             int   pi_buf_byte_size,
                                             volatile SHORT  *po_prob_fp);

extern void mbdr_dsp_dbg_read_prob_word_buf(
                       volatile SHORT  *pi_prob_read_fp,
                       int              pi_buf_byte_size,
                       void            *po_buf_p);

extern void mbdr_dsp_debug_terminate_bp(void);
extern void mbdr_dsp_debug_wait_and_terminate(LONG pi_nop_wait);


#endif
