AWE Core 8.D.6 Documentation
AWEInstance.h
Go to the documentation of this file.
1/*******************************************************************************
2*
3* Audio Framework
4* ---------------
5*
6********************************************************************************
7* AWEInstance.h
8********************************************************************************
9*
10* Description: Public API AWEInstance structure and functions
11*
12* Copyright: (c) 2007-2021 DSP Concepts, Inc. All rights reserved.
13* 3235 Kifer Road
14* Santa Clara, CA 95054
15*
16*******************************************************************************/
17
23#ifndef _AWECOREINSTANCE_H
24#define _AWECOREINSTANCE_H
25
26#include <stdlib.h>
27#include <string.h>
28#include <stddef.h>
29
30#include "TargetProcessor.h" //Include the TargetProcessor header that includes another processor specific header file.
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
44typedef struct _AWEInstance
45{
50 UINT32 instanceId;
51
52 /*------------------HEAPS------------------*/
54 UINT32 *pFastHeapA;
55
57 UINT32 *pFastHeapB;
58
60 UINT32 *pSlowHeap;
61
66
69
72
73 /*------------------AUDIO CALLBACKS------------------*/
74
79 INT32 (*cbAudioStart)(struct _AWEInstance *PAWE);
80
85 INT32 (*cbAudioStop)(struct _AWEInstance *pAWE);
86
87 /*------------------CACHE COHERENCE CALLBACK------------------*/
88
94 INT32 (*cbCacheInvalidate)(struct _AWEInstance *pAWE, void *nStartingAddress, UINT32 lengthInWords);
95
96
97 /*------------------IO PINS------------------*/
98
103 IOPinDescriptor *pInputPin;
104
109 IOPinDescriptor *pOutputPin;
110
111 /*------------------MODULES------------------*/
112
120
127 const ModClassModule **pModuleDescriptorTable;
128
129 /*------------------PACKET BUFFERS------------------*/
130
138
147
154
159
162
165
166/*The name of the AWE Instance that will be displayed in Server. Can be any 8 character string*/
167#ifdef __ADSP21000__
169 const UINT32 *pName;
170#else
172 const char *pName;
173#endif
174
177
180
184
189
190 /*------------------MULTI-INSTANCE SUPPORT------------------*/
194 volatile UINT32 *pSharedHeap;
195
198
201
202#ifdef AWEINSTANCE_FRAMEWORK
203 AWEINSTANCE_FRAMEWORK
204#else
206 #ifdef BUILD64
207 UINT32 _Reserved[571];
208 #else
209 UINT32 _Reserved[300];
210 #endif
211#endif
212
214
215
216/*------------------------------------------Initialization----------------------------------------------------*/
227
228
237INT32 awe_initPin(IOPinDescriptor *pPin, UINT32 channels, const char *name);
238
239
245void awe_initFlashFS(AWEInstance * pAWE, AWEFlashFSInstance * pAWEFlashFSInstance);
246
247typedef INT32 packetProcessFunction(AWEInstance * pAWE);
248
249
250/*------------------------------------------Packet----------------------------------------------------*/
258
269INT32 awe_packetProcessMulti(AWEInstance * pAWE, BOOL isTuningInstance);
270
271/*------------------------------------------Audio----------------------------------------------------*/
282INT32 awe_audioPump(AWEInstance *pAWE, UINT32 layoutIndex);
283
305INT32 awe_audioImportSamples(const AWEInstance *pAWE, const void *inSamples, INT32 inStride, INT32 channel, SampleType inType);
306
329INT32 awe_audioExportSamples(const AWEInstance *pAWE, void *outSamples, INT32 outStride, INT32 channel, SampleType outType);
330
338
357
374INT32 awe_audioIsReadyToPumpMulti(AWEInstance* pAWE, UINT32 instanceID);
375
376/*------------------------------------------Deferred Functions----------------------------------------------------*/
384
385
386/*------------------------------------------Loader Functions----------------------------------------------------*/
400INT32 awe_loadAWBfromArray(AWEInstance *pAWE, const UINT32 *pCommands, UINT32 arraySize, UINT32 *pPos);
401
415INT32 awe_loadAWBfromFile(AWEInstance *pAWE, const char *binaryFile, UINT32 *pPos);
416
430INT32 awe_loadAWBfromFlash(AWEInstance *pAWE, const char *binaryFile, UINT32 *pPos);
431
432
433/*------------------------------------------Layout Functions----------------------------------------------------*/
441void awe_layoutGetChannelCount(const AWEInstance *pAWE, UINT32 pinIdx, UINT32 *inCount, UINT32 *outCount);
442
451INT32 awe_layoutGetInputBlockSize(const AWEInstance *pAWE, UINT32 pinIdx, UINT32 *blockSize);
452
461INT32 awe_layoutGetInputSampleRate(const AWEInstance *pAWE, UINT32 pinIdx, FLOAT32 *sampleRate);
462
469
470
471/*------------------------------------------Control Interface Functions----------------------------------------------------*/
472
483INT32 awe_ctrlSetValue(const AWEInstance *pAWE, UINT32 handle, const void *value, INT32 arrayOffset, UINT32 length);
484
495INT32 awe_ctrlGetValue(const AWEInstance *pAWE, UINT32 handle, void *value, INT32 arrayOffset, UINT32 length);
496
505INT32 awe_ctrlSetStatus(const AWEInstance *pAWE, UINT32 handle, UINT32 status);
506
515INT32 awe_ctrlGetStatus(const AWEInstance *pAWE, UINT32 handle, UINT32 *status);
516
529INT32 awe_ctrlSetValueMask(const AWEInstance *pAWE, UINT32 handle, const void *value, INT32 arrayOffset, UINT32 length, UINT32 mask);
530
543INT32 awe_ctrlGetValueMask(const AWEInstance *pAWE, UINT32 handle, void *value, INT32 arrayOffset, UINT32 length, UINT32 mask);
544
552INT32 awe_ctrlGetModuleClass(const AWEInstance *pAWE, UINT32 handle, UINT32 *pClassID);
553
562INT32 awe_setProfilingStatus(AWEInstance *pAWE, UINT32 status);
563
574INT32 awe_getAverageLayoutCycles(AWEInstance *pAWE, UINT32 layoutIdx, UINT32 * averageCycles);
575
584void awe_setInstancesInfo(AWEInstance **pInstances, INT32 numAweInstancesOnCore);
585
595INT32 awe_fwSetLayoutCoreAffinity(AWEInstance* pAWE, INT32 layoutNumber, INT32 coreAffinity);
596
604INT32 awe_fwGetLayoutCoreAffinity(AWEInstance* pAWE, INT32 layoutNumber);
605
606
607
608#ifdef __cplusplus
609}
610#endif
611
612#endif // _AWECOREINSTANCE_H
INT32 awe_layoutGetInputSampleRate(const AWEInstance *pAWE, UINT32 pinIdx, FLOAT32 *sampleRate)
Returns the sample rate of an input pin.
INT32 awe_loadAWBfromFlash(AWEInstance *pAWE, const char *binaryFile, UINT32 *pPos)
Load an AWB file from the flash.
INT32 awe_fwSetLayoutCoreAffinity(AWEInstance *pAWE, INT32 layoutNumber, INT32 coreAffinity)
Set the core affinity of the layout in layoutNumber.
INT32 awe_initPin(IOPinDescriptor *pPin, UINT32 channels, const char *name)
Initialize an input or output pin.
INT32 awe_ctrlGetStatus(const AWEInstance *pAWE, UINT32 handle, UINT32 *status)
Get the runtime status of a module.
INT32 awe_ctrlSetValue(const AWEInstance *pAWE, UINT32 handle, const void *value, INT32 arrayOffset, UINT32 length)
Set a scalar or array value of a module variable by handle.
INT32 awe_packetProcessMulti(AWEInstance *pAWE, BOOL isTuningInstance)
Multi-instance Wrapper for tuning packet processing.
INT32 awe_deferredSetCall(AWEInstance *pAWE)
Perform deferred awe set on a module.
INT32 awe_audioPump(AWEInstance *pAWE, UINT32 layoutIndex)
Audio pump function.
void awe_setInstancesInfo(AWEInstance **pInstances, INT32 numAweInstancesOnCore)
Setup function only intended for systems with multiple AWE Instances in a single core.
void awe_layoutGetChannelCount(const AWEInstance *pAWE, UINT32 pinIdx, UINT32 *inCount, UINT32 *outCount)
Returns the number of channels in the Layout's input and output pins.
INT32 awe_getAverageLayoutCycles(AWEInstance *pAWE, UINT32 layoutIdx, UINT32 *averageCycles)
Get the average cycles of a running layout, in units of cycles at profileSpeed.
void awe_initFlashFS(AWEInstance *pAWE, AWEFlashFSInstance *pAWEFlashFSInstance)
Initialize the file system.
INT32 awe_audioImportSamples(const AWEInstance *pAWE, const void *inSamples, INT32 inStride, INT32 channel, SampleType inType)
Import samples from a user buffer to a channel.
INT32 awe_layoutIsValid(const AWEInstance *pAWE)
Determines if a layout is loaded and valid.
INT32 awe_ctrlSetStatus(const AWEInstance *pAWE, UINT32 handle, UINT32 status)
Set the runtime status of a module.
INT32 awe_ctrlGetValue(const AWEInstance *pAWE, UINT32 handle, void *value, INT32 arrayOffset, UINT32 length)
Get a scalar or array value of a module variable by handle.
INT32 awe_loadAWBfromArray(AWEInstance *pAWE, const UINT32 *pCommands, UINT32 arraySize, UINT32 *pPos)
Executes packet commands from an in-memory array.
INT32 awe_audioExportSamples(const AWEInstance *pAWE, void *outSamples, INT32 outStride, INT32 channel, SampleType outType)
Export samples to a user buffer from a channel.
INT32 awe_audioGetPumpMask(AWEInstance *pAWE)
Test if AWE is ready to run.
INT32 awe_fwGetLayoutCoreAffinity(AWEInstance *pAWE, INT32 layoutNumber)
Get the core affinity of the layout in layoutNumber, initializes to 0 and can be set with awe_fwSetLa...
INT32 awe_setProfilingStatus(AWEInstance *pAWE, UINT32 status)
Enable or disable the profiling ability of the AWE Core.
INT32 awe_audioIsReadyToPumpMulti(AWEInstance *pAWE, UINT32 instanceID)
Test if AWE is ready to run on secondary instances (ID > 0).
INT32 awe_packetProcess(AWEInstance *pAWE)
Process an AWEInstance's newly received tuning packet.
INT32 awe_loadAWBfromFile(AWEInstance *pAWE, const char *binaryFile, UINT32 *pPos)
Load an AWB file from stdio.
INT32 awe_ctrlGetValueMask(const AWEInstance *pAWE, UINT32 handle, void *value, INT32 arrayOffset, UINT32 length, UINT32 mask)
Get a scalar or array value of a module variable by handle with mask.
INT32 awe_init(AWEInstance *pAWE)
Initialize the instance.
INT32 awe_layoutGetInputBlockSize(const AWEInstance *pAWE, UINT32 pinIdx, UINT32 *blockSize)
Returns the block size of a pin.
INT32 awe_ctrlSetValueMask(const AWEInstance *pAWE, UINT32 handle, const void *value, INT32 arrayOffset, UINT32 length, UINT32 mask)
Set a scalar or array value of a module variable by handle with mask.
INT32 awe_ctrlGetModuleClass(const AWEInstance *pAWE, UINT32 handle, UINT32 *pClassID)
Get an object class from its handle.
struct _AWEInstance AWEInstance
The AWE instance.
INT32 awe_audioIsStarted(const AWEInstance *pAWE)
Check if this instance is running.
enum _SampleType SampleType
Type of data for I/O.
The AWE instance.
Definition: AWEInstance.h:45
IOPinDescriptor * pInputPin
A BSP author must define/allocate an input pin in their BSP and assign it to this member NOTE: AudioW...
Definition: AWEInstance.h:103
INT32(* cbCacheInvalidate)(struct _AWEInstance *pAWE, void *nStartingAddress, UINT32 lengthInWords)
OPTIONAL This callback is invoked wherever cache flush or invalidation is required,...
Definition: AWEInstance.h:94
const char * pName
Name of this instance as a string
Definition: AWEInstance.h:172
float profileSpeed
Profiling clock speed in Hz.
Definition: AWEInstance.h:164
UINT32 * pReplyBuffer
Reply buffer pointer.
Definition: AWEInstance.h:146
UINT32 * pFastHeapB
The second fast heap, B .
Definition: AWEInstance.h:57
UINT32 numThreads
Number of threads supported for multithreaded systems(1-4).
Definition: AWEInstance.h:176
IOPinDescriptor * pOutputPin
A BSP author must define/allocate an output pin in their BSP and assign it to this member NOTE: Audio...
Definition: AWEInstance.h:109
UINT32 * pPacketBuffer
The Packet buffer pointer.
Definition: AWEInstance.h:137
INT32(* cbAudioStart)(struct _AWEInstance *PAWE)
OPTIONAL This callback is invoked when a layout is run or when a StartAudio command is sent.
Definition: AWEInstance.h:79
INT32(* cbAudioStop)(struct _AWEInstance *pAWE)
OPTIONAL.
Definition: AWEInstance.h:85
UINT32 _Reserved[300]
Internal members.
Definition: AWEInstance.h:209
UINT32 slowHeapSize
The slow heap size.
Definition: AWEInstance.h:71
UINT32 fundamentalBlockSize
Base frame size of this instance.
Definition: AWEInstance.h:183
UINT32 * pSlowHeap
The slow heap.
Definition: AWEInstance.h:60
UINT32 userVersion
User Version word.
Definition: AWEInstance.h:158
float sampleRate
Default sample rate of this instance.
Definition: AWEInstance.h:179
UINT32 packetBufferSize
Packet buffer size.
Definition: AWEInstance.h:153
volatile UINT32 * pSharedHeap
AWE Core shared memory definitions.
Definition: AWEInstance.h:194
UINT32 fastHeapBSize
The fast heap B size.
Definition: AWEInstance.h:68
UINT32 numProcessingInstances
The number of audio processing instances of AWE Core configured on a single target.
Definition: AWEInstance.h:200
UINT32 sharedHeapSize
The shared heap size.
Definition: AWEInstance.h:197
AWEFlashFSInstance * pFlashFileSystem
DSPC Flash file system instance.
Definition: AWEInstance.h:188
float coreSpeed
A BSP author will set this to the speed of the CPU they are integrating into.
Definition: AWEInstance.h:161
UINT32 instanceId
The ID of this instance.
Definition: AWEInstance.h:50
UINT32 numModules
Number of modules in module table.
Definition: AWEInstance.h:119
const ModClassModule ** pModuleDescriptorTable
Pointer to module table.
Definition: AWEInstance.h:127
UINT32 fastHeapASize
The fast heap A size.
Definition: AWEInstance.h:65
UINT32 * pFastHeapA
Fast heap A.
Definition: AWEInstance.h:54
The DSPC Flash File System Instance.
Definition: FlashFSInstance.h:40