]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/blob - processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/systemStream.c
Add Decoder Output Circular Buffer reset function
[processor-sdk/performance-audio-sr.git] / processor_audio_sdk_1_00_00_00 / pasdk / test_dsp / framework / systemStream.c
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 //
38 // Framework -- System Stream Function Definitions
39 //
40 //     System Stream Functions Main and 1-5.
41 //
42 //
44 //
45 // See: pa/f/s3/ss0.c
46 //
48 // Specific ASP usage requires inter-file symbol definitions ...
49 #include "noasp.h"
50 // ... end of specific usage definitions.
52 #include <xdc/std.h>
53 //#include <std.h>
54 //#include  <std.h>
55 //#include <xdas.h>
57 #include <xdc/runtime/Log.h>
58 #include <ti/sysbios/knl/Task.h>
59 #include <ti/sysbios/utils/Load.h>
61 #include <paftyp.h>
62 #include <pafsys_a.h>
63 #include <pafcc.h>
64 //#include "alg.h"
65 #include "logp.h"
66 #include "systemStream.h"
68 #include <acp.h>
69 #include <acp_mds.h>
70 #include <acptype.h>
71 #include <acpbeta.h>
72 #include <acperr.h>
74 //#include "pafhjt.h"
75 //
76 //#ifdef RAM_REPORT
77 //#include <paf_alg_print.h>
78 //extern int IRAM;
79 //extern int SDRAM;
80 //extern int L3RAM;
81 //#endif /* RAM_REPORT */
83 #ifndef FULL_SPEAKER
84 #define FULL_SPEAKER
85 #endif
87 extern IALG_Status pafIdentification;
89 //
90 // systemStream : audio stream control function (main)
91 //
93 LINNO_DEFN (systemStreamMain);
94 ERRNO_DEFN (systemStreamMain);
96 Void
97 systemStreamMain(
98     const PAF_SST_Params *pP, 
99     PAF_SST_Config *pC
102     Int32 ss = pP->ss;
103     const PAF_SST_Fxns *fxns= pP->fxns;
104     PAF_SystemStatus *pStatus = pC->pStatus;
106     LINNO_RPRT (systemStreamMain, -1);
108     // Initialize on first invocation:
109     if (!pC->acp) 
110     {
111         ALG_Handle acpAlg;
112         ACP_Handle acp;
113         Int32 betaPrimeValue = ss - 1;
114         Int32 betaPrimeOffset;
115         Int32 betaPrime;
117         // Initialize algorithms
119         // Create an ACP algorithm instance with trace enabled
120         ACP_MDS_init();
122         if ( !(acpAlg = (ALG_Handle )ACP_MDS_create (NULL)) )
123         {
124             //LOG_printf(&trace, "SS%d: ACP algorithm instance creation failed",
125             //    ss);
126             Log_error1("SS%d: ACP algorithm instance creation failed", (IArg)ss);
127             LINNO_RPRT (systemStreamMain, __LINE__);
128             return;
129         }
131         acpAlg->fxns->algControl(acpAlg, ACP_GETBETAPRIMEOFFSET,
132             (IALG_Status *) &betaPrimeOffset);
133         betaPrime = betaPrimeOffset * betaPrimeValue;
135         acp = (ACP_Handle )acpAlg;
136         acp->fxns->attach(acp, ACP_SERIES_STD, STD_BETA_SYSIDL+betaPrime, (IALG_Status *)pStatus);
138         acpAlg->fxns->algControl(acpAlg, ACP_SETBETAPRIMEVALUE,
139             (IALG_Status *) &betaPrimeValue);
141         pC->acp = acp;
143         //LOG_printf(&trace, "SS%d: ACP processing initialized", ss);
144         Log_info1("SS%d: ACP processing initialized", (IArg)ss);
145         LINNO_RPRT(systemStreamMain, -2);
147         // Attach PAF IDENTITY
148         acp->fxns->attach(acp, ACP_SERIES_STD, STD_BETA_IDENTITY, (IALG_Status *) &pafIdentification);
149     }
151 #ifdef RAM_REPORT
152     {
153         static int count=0;
154         if (count < 10)
155         {
156             count++;            
157         }
158         else if (count == 10)
159         {
160             PAF_ALG_memStatusPrint(IRAM,SDRAM,L3RAM);
161             count++;
162         }
163     }
164 #endif /* RAM_REPORT */
165     // Invoke sub-functions as per mode:
166     if (fxns) 
167     {
168         Int32 i;
169         Int64 x[PAF_SYSTEMSTREAMFXNS_XN];
171         for (i=0; i < fxns->count; i++) 
172         {
173             if ((pStatus->mode & (1 << i)) == 0)
174                 continue;
175             if (! fxns->sub[i].compute)
176                 continue;
177             if (fxns->sub[i].compute (pP, pC, x))
178                 continue;
179             if (! fxns->sub[i].transmit)
180                 continue;
181             if (fxns->sub[i].transmit (pP, pC, x))
182                 continue;
183         }
184     }
187 //
188 // systemStream1 : audio stream control functions (sub)
189 //
190 //   Process listening mode, recreation mode, and speaker configuration
191 //   to set Decode Channel Configuration Request and Override Select
192 //   Registers.
193 //
195 #ifndef NODEC
197 Int32
198 systemStream1Compute(
199     const PAF_SST_Params *pP, 
200     PAF_SST_Config *pC, 
201     Int64 x[]
204     PAF_SystemStatus *pStatus = pC->pStatus;
205     static const PAF_ChannelConfiguration cs[PAF_SYS_RECREATIONMODE_N] = {
206         // PAF_SYS_RECREATIONMODE_NONE
207         { PAF_CC_SAT_NONE, PAF_CC_SUB_ZERO, 0, 0, 0, 0, 0, 0, },
208         // PAF_SYS_RECREATIONMODE_MONO (unused below)
209         { PAF_CC_SAT_MONO, PAF_CC_SUB_ZERO, 0, 0, 0, 0, 0, 0, },
210         // PAF_SYS_RECREATIONMODE_STEREO
211         { PAF_CC_SAT_STEREO, PAF_CC_SUB_ZERO, 0, 0, 0, 0, 0, 0, },
212         // PAF_SYS_RECREATIONMODE_PHANTOM0_1
213         { PAF_CC_SAT_STEREO, PAF_CC_SUB_ONE, 0, 0, 0, 0, 0, 0, },
214         // PAF_SYS_RECREATIONMODE_SURROUND0_1
215         { PAF_CC_SAT_3STEREO, PAF_CC_SUB_ONE, 0, 0, 0, 0, 0, 0, },
216         // PAF_SYS_RECREATIONMODE_PHANTOM2_1
217         { PAF_CC_SAT_PHANTOM2, PAF_CC_SUB_ONE, 0, 0, 0, 0, 0, 0, },
218         // PAF_SYS_RECREATIONMODE_SURROUND2_1
219         { PAF_CC_SAT_SURROUND2, PAF_CC_SUB_ONE, 0, 0, 0, 0, 0, 0, },
220     };
221     XDAS_UInt8 n;
222     PAF_ChannelConfiguration ccr; /* Channel Configuration Request */
223     PAF_ChannelConfiguration cco; /* Channel Configuration Override */
225     // Listening mode: ignored.
227     // Recreation mode: direct, select, or auto.
229     switch (n = pStatus->recreationMode) 
230     {
231         case PAF_SYS_RECREATIONMODE_DONT:
232             ccr.full = -1;
233             cco.full = -1;
234             break;
236         case PAF_SYS_RECREATIONMODE_DIRECT:
237             ccr = pStatus->channelConfigurationRequest;
238             cco.full = PAF_CC_UNKNOWN;
239             break;
241         case PAF_SYS_RECREATIONMODE_AUTO:
242             ccr.full = 0;
243             ccr.part.sat = PAF_CC_SAT_STEREO
244                 + (pStatus->speakerCntr & PAF_SYS_SPEAKERNUMB) * 5
245                 + (pStatus->speakerSurr & PAF_SYS_SPEAKERNUMB)
246                 + (pStatus->speakerBack & PAF_SYS_SPEAKERNUMB);
247             ccr.part.sub = (pStatus->speakerSubw & PAF_SYS_SPEAKERNUMB);
248             ccr.part.extMask =
249                   ((pStatus->speakerWide & PAF_SYS_SPEAKERNUMB) ? PAF_CC_EXTMASK_LwRw : 0)
250 #ifdef FULL_SPEAKER
251                 | ((pStatus->speakerLRCntr & PAF_SYS_SPEAKERNUMB) ? PAF_CC_EXTMASK_LcRc : 0)
252 #endif
253                 | ((pStatus->speakerHead & PAF_SYS_SPEAKERNUMB) ? PAF_CC_EXTMASK_LhRh : 0) ;
254 #ifdef FULL_SPEAKER
255         ccr.part.extMask2 =
256                     ((pStatus->speakerCntrSurr & PAF_SYS_SPEAKERNUMB) ? PAF_CC_EXTMASK_Cs : 0)
257                   | ((pStatus->speakerLRCntrSurr & PAF_SYS_SPEAKERNUMB) ? PAF_CC_EXTMASK_LcsRcs : 0)
258                   | ((pStatus->speakerRearSurr2 & PAF_SYS_SPEAKERNUMB) ? PAF_CC_EXTMASK_Lrs2Rrs2 : 0)
259                   | ((pStatus->speakerRearSurr1 & PAF_SYS_SPEAKERNUMB) ? PAF_CC_EXTMASK_Lrs1Rrs1 : 0)
260                   | ((pStatus->speakerSurr2 & PAF_SYS_SPEAKERNUMB) ? PAF_CC_EXTMASK_Ls2Rs2 : 0)
261                   | ((pStatus->speakerSurr1 & PAF_SYS_SPEAKERNUMB) ? PAF_CC_EXTMASK_Ls1Rs1 : 0)
262                   | ((pStatus->speakerScreen & PAF_SYS_SPEAKERNUMB) ? PAF_CC_EXTMASK_LscRsc : 0);
263 #endif
264             ccr.part.extMask3 =
265                   ((pStatus->speakerTopfront & PAF_SYS_SPEAKERNUMB) ? PAF_CC_EXTMASK_LtfRtf : 0)
266                 | ((pStatus->speakerToprear & PAF_SYS_SPEAKERNUMB) ? PAF_CC_EXTMASK_LtrRtr : 0)
267                 | ((pStatus->speakerTopmiddle & PAF_SYS_SPEAKERNUMB) ? PAF_CC_EXTMASK_LtmRtm : 0)
268                 | ((pStatus->speakerFrontheight & PAF_SYS_SPEAKERNUMB) ? PAF_CC_EXTMASK_LfhRfh : 0)
269                 | ((pStatus->speakerRearheight & PAF_SYS_SPEAKERNUMB) ? PAF_CC_EXTMASK_LrhRrh : 0);
271             pStatus->channelConfigurationRequest = ccr;
272             cco.full = PAF_CC_UNKNOWN;
273             break;
275         case PAF_SYS_RECREATIONMODE_MONO:
276             ccr.full = (pStatus->speakerCntr & PAF_SYS_SPEAKERNUMB)
277                 ? PAF_CC_MONO : PAF_CC_STEREO_MONO;
278             pStatus->channelConfigurationRequest = ccr;
279             cco.full = PAF_CC_UNKNOWN;
280             break;
282         default:
283             ccr = cs[n < lengthof (cs) ? n : 0];
284             pStatus->channelConfigurationRequest = ccr;
285             cco.full = PAF_CC_UNKNOWN;
286             break;
287     }
289     if (pStatus->channelConfigurationRequestType
290         != PAF_SYS_CCRTYPE_STANDARD) 
291     {
292         PAF_ChannelConfiguration ccs;
294         ccs = cco;
296         // CCO is computed CCR.
297         cco = ccr;
299         // CCR is as per request type:
300         // DecodeBypass - PAF_CC_UNKNOWN (see above)
301         // DecodeDirect - don't write, allow use as control register
302         ccr.full = pStatus->channelConfigurationRequestType
303             == PAF_SYS_CCRTYPE_DECODEDIRECT ? -1 : ccs.full;
304     }
306     x[0] = ccr.full; /* Channel Configuration Request */
307     x[1] = cco.full; /* Channel Configuration Override */
309     return 0;
312 Int32
313 systemStream1Transmit(
314     const PAF_SST_Params *pP, 
315     PAF_SST_Config *pC, 
316     Int64 x[]
319     Int32 ss = pP->ss;
320     ACP_Handle acp = pC->acp;
321     PAF_ChannelConfiguration ccr; /* Channel Configuration Request */
322     PAF_ChannelConfiguration cco; /* Channel Configuration Override */
324     ccr.full = x[0]; /* Channel Configuration Request */
325     cco.full = x[1]; /* Channel Configuration Override */
327     // Send Request to Audio Stream 1 Decode Status.
329     if (ccr.full != -1) 
330     {
331         ACP_Unit from[7];
332         Int32 errno;
334         // writeDECChannelConfigurationRequest 0xce24,0x3808
335         from[0] = 0xc906;
336         from[1] = 0xce24;
337         from[2] = 0x3808;
338         from[3] = ccr.full;
339         from[4] = ccr.full >> 16;
340         from[5] = ccr.full >> 32;
341         from[6] = ccr.full >> 48;
343         if (errno = acp->fxns->sequence(acp, from, NULL)) 
344         {
345             //LOG_printf(&trace, "SS%d: DEC sequence processing error (0x%04x)",
346             //    ss, errno);
347             Log_error2("SS%d: DEC sequence processing error (0x%04x)", (IArg)ss, (IArg)errno);
348             ERRNO_RPRT (systemStreamMain, errno);
349         }
351         // writeENCChannelConfigurationCompact(sat,sub,aux,ext0,ext2,ext3,rsvd1,rsvd2) 0xce25,0x9808
352         from[0] = 0xc906;
353         from[1] = 0xce25;
354         from[2] = 0x9808;
355         from[3] = ccr.full;
356         from[4] = ccr.full >> 16;
357         from[5] = ccr.full >> 32;
358         from[6] = ccr.full >> 48;
360         if (errno = acp->fxns->sequence(acp, from, NULL)) 
361         {
362             //LOG_printf(&trace, "SS%d: ENC sequence processing error (0x%04x)",
363             //    ss, errno);
364             Log_error2("SS%d: ENC sequence processing error (0x%04x)", (IArg)ss, (IArg)errno);
365             ERRNO_RPRT (systemStreamMain, errno);
366         }
367     }
369     // Send Override to Audio Stream 1 Decode Status.
371     if (cco.full != -1)
372     {
373         ACP_Unit from[7];
374         Int32 errno;
376         // writeDECChannelConfigurationOverride 0xce24,0x5808
377         from[0] = 0xc906;
378         from[1] = 0xce24;
379         from[2] = 0x5808; 
380         from[3] = cco.full;
381         from[4] = cco.full >> 16;
382         from[5] = cco.full >> 32;
383         from[6] = cco.full >> 48;
384     
385         if (errno = acp->fxns->sequence(acp, from, NULL)) 
386         {
387             //LOG_printf(&trace, "SS%d: DEC sequence processing error (0x%04x)",
388             //    ss, errno);
389             Log_error2("SS%d: DEC sequence processing error (0x%04x)", (IArg)ss, (IArg)errno);
390             ERRNO_RPRT (systemStreamMain, errno);
391         }
392     }
394     return 0;
397 #else /* NODEC */
399 asm(" .global _systemStream1Compute");
400 asm("_systemStream1Compute .set 0");
402 asm(" .global _systemStream1Transmit");
403 asm("_systemStream1Transmit .set 0");
405 #endif /* NODEC */
407 //
408 // systemStream2 : audio stream control functions (sub)
409 //
410 //   Process listening mode, recreation mode, and speaker configuration
411 //   to set Bass Management Output Configuration Select Register.
412 //
414 #ifndef NOBM
416 #define DOC_AUTO  0x0f  // 15, to leave some room
418 Int32
419 systemStream2Compute(
420     const PAF_SST_Params *pP, 
421     PAF_SST_Config *pC, 
422     Int64 x[]
425     PAF_SystemStatus *pStatus = pC->pStatus;
426     Int32 oc;
428     // Determine BM Output Configuration Select (if auto mode):
430     if ( pStatus->recreationMode == PAF_SYS_RECREATIONMODE_DONT
431       || pStatus->recreationMode == PAF_SYS_RECREATIONMODE_DIRECT )
432     {
433         return 1;
434     }
435     // Set channel flags, including channels beyond Dolby spec:
437     oc = (DOC_AUTO << 24) +
438         ((pStatus->speakerSubw & PAF_SYS_SPEAKERFREQ_HI ? 1 : 0) << 0) +
439         ((pStatus->speakerMain & PAF_SYS_SPEAKERFREQ_LO ? 1 : 0) << 1) +
440         ((pStatus->speakerCntr & PAF_SYS_SPEAKERFREQ_LO ? 1 : 0) << 2) +
441         ((pStatus->speakerSurr & PAF_SYS_SPEAKERFREQ_LO ? 1 : 0) << 3) +
442         ((pStatus->speakerBack & PAF_SYS_SPEAKERFREQ_LO ? 1 : 0) << 4) +
443         ((pStatus->speakerWide & PAF_SYS_SPEAKERFREQ_LO ? 1 : 0) << 5) +
444         ((pStatus->speakerHead & PAF_SYS_SPEAKERFREQ_LO ? 1 : 0) << 6) ;
446     x[0] = oc; /* Output Configuration */
448     return 0;
451 Int32
452 systemStream2Transmit(
453     const PAF_SST_Params *pP, 
454     PAF_SST_Config *pC, 
455     Int64 x[]
458     Int32 ss = pP->ss;
459     ACP_Handle acp = pC->acp;
460     Int32 oc;
462     oc = x[0]; /* Output Configuration */
464     // Send Select to Audio Stream 1 Bass Management Status if valid:
466     {
467         Int32 errno;
468         ACP_Unit from[6];
470         from[0] = 0xc905;
472         // writeBMOCSelectOCAuto(OCNO,AUTO) 0xcb40,0x000a,
473         //     ((OCNO) << 8)&0xff00+(AUTO)&0x00ff
475         from[1] = 0xcb40;
476         from[2] = 0x000a;
477         from[3] = (oc>>16) & 0xffff;
479         // writeBMOCSelectChannels(CHANS) 0xca40,
480         //     0x0800+((CHANS) & 0x00ff)
482         from[4] = 0xca40;
483         from[5] = 0x0800 + (oc & 0xff);
485         if (errno = acp->fxns->sequence(acp, from, NULL)) 
486         {
487             if (errno == ACPERR_APPLY_NOBETA) 
488             {
489                 // Return without reporting to trace Log if BM is not
490                 // part of the stream.
491                 return 1;
492             }
493             else 
494             {
495                 //LOG_printf(&trace, "SS%d: BM sequence processing error (0x%04x)",
496                 //    ss, errno);
497                 Log_error2("SS%d: BM sequence processing error (0x%04x)", (IArg)ss, (IArg)errno);
498                 ERRNO_RPRT (systemStreamMain, errno);
499             }
500         }
501     }
503     return 0;
506 #else /* NOBM */
508 asm(" .global _systemStream2Compute");
509 asm("_systemStream2Compute .set 0");
511 asm(" .global _systemStream2Transmit");
512 asm("_systemStream2Transmit .set 0");
514 #endif /* NOBM */
516 //
517 // systemStream3 : audio stream control functions (sub)
518 //
519 //   Process S/PDIF pre-emphasis flag information and Deemphasis Filter
520 //   Mode Control information to set Deemphasis Filter Active Select
521 //   Register if needed.
522 //
523 //   Note that this implementation is quite arbitrary and could be done
524 //   another way, including completely via a shortcut! --Kurt
525 //
527 #ifndef NODEM
529 Int32
530 systemStream3Compute(
531     const PAF_SST_Params *pP, 
532     PAF_SST_Config *pC, 
533     Int64 x[]
536     Int32 ss = pP->ss;
537     ACP_Handle acp = pC->acp;
538     Int32 errno;
539     ACP_Unit from[3], to[3];
541     // readDEMFilterMode 0xc250,0x0500
542     from[0] = 0xc902;
543     from[1] = 0xc250;
544     from[2] = 0x0500;
545     
546     if (errno = acp->fxns->sequence(acp, from, to)) 
547     {
548         if (errno == ACPERR_APPLY_NOBETA) 
549         {
550             // Return without reporting to trace Log if DEM is not
551             // part of the stream.
552             return 1;
553         }
554         else 
555         {
556             //LOG_printf(&trace, "SS%d: DEM sequence processing error (0x%04x)",
557             //    ss, errno);
558             Log_error2("SS%d: DEM sequence processing error (0x%04x)", (IArg)ss, (IArg)errno);
559             ERRNO_RPRT (systemStreamMain, errno);
560         }
561     }
563     // If Deemphasis Filter Mode Control is not "Auto", no further action.
564     if ((to[2] & 0xff) != 1)
565         return 1;
567     // readDECEmphasis  0xc224,0x33
568     from[0] = 0xc902;
569     from[1] = 0xc224;
570     from[2] = 0x3300;
572     if (errno = acp->fxns->sequence(acp, from, to)) 
573     {
574         //LOG_printf(&trace, "SS%d: DEC sequence processing error (0x%04x)",
575         //    ss, errno);
576         Log_error2("SS%d: DEC sequence processing error (0x%04x)", (IArg)ss, (IArg)errno);
577         ERRNO_RPRT (systemStreamMain, errno);
578     }
580     x[0] = (to[2] & 0xff) == 2 ? 1 : 0;
582     return 0;
585 Int32
586 systemStream3Transmit(
587     const PAF_SST_Params *pP, 
588     PAF_SST_Config *pC, 
589     Int64 x[]
592     Int32 ss = pP->ss;
593     ACP_Handle acp = pC->acp;
594     ACP_Unit from[3];
595     Int32 errno;
597     from[0] = 0xc902;
598     from[1] = 0xca50;
599     from[2] = 0x0600 + x[0];
601     if (errno = acp->fxns->sequence(acp, from, NULL)) 
602     {
603         if (errno == ACPERR_APPLY_NOBETA) 
604         {
605             // Return without reporting to trace Log if DEM is not
606             // part of the stream.
607             return 1;
608         }
609         else 
610         {
611             //LOG_printf(&trace, "SS%d: DEM sequence processing error (0x%04x)",
612             //    ss, errno);
613             Log_error2("SS%d: DEM sequence processing error (0x%04x)", (IArg)ss, (IArg)errno);
614             ERRNO_RPRT (systemStreamMain, errno);
615         }
616     }
618     return 0;
621 #else /* NODEM */
623 asm(" .global _systemStream3Compute");
624 asm("_systemStream3Compute .set 0");
626 asm(" .global _systemStream3Transmit");
627 asm("_systemStream3Transmit .set 0");
629 #endif /* NODEM */
632 //
633 // systemStream5 : CPU Load Graph
634 //
636 //#include <xdc/runtime/LoggerBuf.h>
637 //#include <xdc/runtime/System.h>
638 //#include <ti/bios/include/log.h>
639 //#include <ti/sysbios/knl/Task.h>
641 Int32
642 systemStream5Compute(
643     const PAF_SST_Params *pP, 
644     PAF_SST_Config *pC, 
645     Int64 x[]
648     PAF_SystemStatus *pStatus = pC->pStatus;
649     Load_Stat stat;
651     Load_getTaskLoad(Task_getIdleTask(), &stat);
652     pStatus->cpuLoad = (100 - Load_calculateLoad(&stat)) * 256;
653     if (pStatus->peakCpuLoad < pStatus->cpuLoad)
654         pStatus->peakCpuLoad = pStatus->cpuLoad;
656     return 0;
659 Int32
660 systemStream5Transmit(
661     const PAF_SST_Params *pP, 
662     PAF_SST_Config *pC, 
663     Int64 x[]
666     return 0;