2 /*
3 Copyright (c) 2016, Texas Instruments Incorporated - http://www.ti.com/
4 All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the
16 * distribution.
17 *
18 * Neither the name of Texas Instruments Incorporated nor the names of
19 * its contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 */
36 /*
37 * ======== fwkSim.h ========
38 */
40 #ifndef _FWK_SIM_H_
41 #define _FWK_SIM_H_
43 #include <xdc/std.h>
44 #include <ti/xdais/xdas.h>
46 // Min, max number of system clock ticks (default tick = 1 msec.)
47 #define RX_ALPHA_MIN_TICKS ( 50 ) // min setting =0
48 #define RX_ALPHA_MAX_TICKS ( 10000 ) // max setting =RAND_MAX
49 #define RX_ALPHA_DELTA_TICKS ( RX_ALPHA_MAX_TICKS - RX_ALPHA_MIN_TICKS)
51 // Number of system clock ticks between start of Rx, Tx audio timers
52 #define RX_TX_AUDIO_DELTA_TICKS ( 1 )
54 // Simulated load time in system clock ticks
55 #define DEC_CONTROL_LOAD ( 1 )
56 #define DEC_ACTIVATE_LOAD ( 1 )
57 #define DEC_RESET_LOAD ( 1 )
58 #define DEC_INFO_LOAD ( 1 )
59 #define DEC_DECODE_LOAD ( 2 )
60 #define DEC_DEACTIVATE_LOAD ( 1 )
62 // Global debug counters */
63 extern Uint32 gTimerRxCnt; // debug counter for timerRxAudio
64 extern Uint32 gTimerTxCnt; // debug counter for timerTxAudio
65 extern Uint32 gClockRxAlphaCnt; // debug counter for clockRxAlpha
67 /* ======== timerRxFxn ======== */
68 // Simulate Rx audio frame clock.
69 Void timerRxFxn(UArg a0);
71 /* ======== timerTxFxn ======== */
72 // Simulate Tx audio frame clock.
73 Void timerTxFxn(UArg a0);
75 /* ======== clockRxAlphaFxn ======== */
76 // Simulate timing of Rx alpha command reception.
77 // Commands are received at randomly computed time.
78 // Commands executed are contained in command list in DSP build.
79 Void clockRxAlphaFxn(UArg a0);
81 // Simulation stop
82 Void simStop(Void);
84 // Simulation initialization
85 Void simInit(Void);
87 // Simulation start
88 Void simStart(Void);
90 // Simulate load
91 Void simLoad(Uint32 loadTime);
93 #endif /* _FWK_SIM_H_ */