Add port the BIOS version of noise-reduction demo to K2G
authorMing Wei <mwei@ti.com>
Tue, 12 Jul 2016 22:33:43 +0000 (17:33 -0500)
committerMing Wei <mwei@ti.com>
Tue, 12 Jul 2016 22:33:43 +0000 (17:33 -0500)
Add custom platforms for AM572x GP EVM, DA830 DSK and K2G EVM
Update readme files
Delete unused files

Signed-off-by: Ming Wei <mwei@ti.com>
233 files changed:
file_demo_bios/am572x/.cproject
file_demo_bios/am572x/bflinker.cmd
file_demo_bios/am572x/readme.txt
file_demo_bios/am572x/src/sysbios/BIOS.obj [deleted file]
file_demo_bios/am572x/src/sysbios/c62_TaskSupport_asm.obj [deleted file]
file_demo_bios/am572x/src/sysbios/c64p_Exception_asm.obj [deleted file]
file_demo_bios/am572x/src/sysbios/c64p_Hwi_asm.obj [deleted file]
file_demo_bios/am572x/src/sysbios/c64p_Hwi_asm_switch.obj [deleted file]
file_demo_bios/am572x/src/sysbios/c64p_Hwi_disp_always.obj [deleted file]
file_demo_bios/am572x/src/sysbios/dmtimer_Timer_asm.obj [deleted file]
file_demo_bios/am572x/src/sysbios/sysbios.ae66 [deleted file]
file_demo_bios/da830/.cproject
file_demo_bios/da830/src/sysbios/makefile [new file with mode: 0644]
file_demo_bios/k2g/.ccsproject [new file with mode: 0644]
file_demo_bios/k2g/.config/.productview.dat [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/.buildtime [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/.interfaces [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/.xdcenv.mak [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/compiler.opt [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/compiler.opt.defs [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/config.bld [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/custom.mak [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/package.bld [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/package.mak [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/package.xdc [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/package.xs [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/package/.vers_b160 [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/package/.vers_g180 [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/package/.vers_r170 [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/package/.xdc-B06 [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/package/build.cfg [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/package/cfg/app.xe66.mak [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/package/cfg/app_pe66.cfg [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/package/cfg/app_pe66.mak [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/package/package.bld.xml [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/package/package.defs.h [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/package/package.xdc.dep [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/package/package.xdc.inc [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/package/package_xconfig_app.c [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/package/rel/xconfig_app.xdc.inc [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/package/rel/xconfig_app.xdc.ninc [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/package/xconfig_app.ccs [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/package/xconfig_app.class [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/package/xconfig_app.java [new file with mode: 0644]
file_demo_bios/k2g/.config/xconfig_app/package/xconfig_app.sch [new file with mode: 0644]
file_demo_bios/k2g/.cproject [new file with mode: 0644]
file_demo_bios/k2g/.gitignore [new file with mode: 0644]
file_demo_bios/k2g/.project [new file with mode: 0644]
file_demo_bios/k2g/.settings/org.eclipse.cdt.codan.core.prefs [new file with mode: 0644]
file_demo_bios/k2g/.settings/org.eclipse.cdt.debug.core.prefs [new file with mode: 0644]
file_demo_bios/k2g/.xdchelp [new file with mode: 0644]
file_demo_bios/k2g/K2G_bf.ccxml [new file with mode: 0644]
file_demo_bios/k2g/app.cfg [new file with mode: 0644]
file_demo_bios/k2g/bflinker.cmd [new file with mode: 0644]
file_demo_bios/k2g/components/clk.c [new file with mode: 0644]
file_demo_bios/k2g/components/fil.c [new file with mode: 0644]
file_demo_bios/k2g/components/fil.h [new file with mode: 0644]
file_demo_bios/k2g/components/mhm/configspec.clearcase [new file with mode: 0644]
file_demo_bios/k2g/components/mhm/dcSpec.txt [new file with mode: 0644]
file_demo_bios/k2g/components/mhm/dcSpeclnx.txt [new file with mode: 0644]
file_demo_bios/k2g/components/mhm/mCspec.txt [new file with mode: 0644]
file_demo_bios/k2g/components/mhm/mCspeclnx.txt [new file with mode: 0644]
file_demo_bios/k2g/components/mhm/mhm.h [new file with mode: 0644]
file_demo_bios/k2g/components/mhm/package.bld [new file with mode: 0644]
file_demo_bios/k2g/components/mhm/package.xdc [new file with mode: 0644]
file_demo_bios/k2g/components/mhm/package.xs [new file with mode: 0644]
file_demo_bios/k2g/components/mhm/readme.txt [new file with mode: 0644]
file_demo_bios/k2g/components/mhm/src/arm/mhmport.h [new file with mode: 0644]
file_demo_bios/k2g/components/mhm/src/c54/mhmport.h [new file with mode: 0644]
file_demo_bios/k2g/components/mhm/src/c55/mhmport.h [new file with mode: 0644]
file_demo_bios/k2g/components/mhm/src/c64/mhmport.h [new file with mode: 0644]
file_demo_bios/k2g/components/mhm/src/mhm.c [new file with mode: 0644]
file_demo_bios/k2g/components/mhm/src/mhmport.h [new file with mode: 0644]
file_demo_bios/k2g/components/mss/mss.h [new file with mode: 0644]
file_demo_bios/k2g/components/mss/src/mss.c [new file with mode: 0644]
file_demo_bios/k2g/components/mss/src/mssloc.h [new file with mode: 0644]
file_demo_bios/k2g/components/mss/src/mssproc.c [new file with mode: 0644]
file_demo_bios/k2g/components/sys.c [new file with mode: 0644]
file_demo_bios/k2g/components/sys.h [new file with mode: 0644]
file_demo_bios/k2g/components/sysasnr.c [new file with mode: 0644]
file_demo_bios/k2g/components/sysbf.c [new file with mode: 0644]
file_demo_bios/k2g/components/sysbfflt.c [new file with mode: 0644]
file_demo_bios/k2g/components/sysbfflt.h [new file with mode: 0644]
file_demo_bios/k2g/components/syseram.c [new file with mode: 0644]
file_demo_bios/k2g/components/syseram.h [new file with mode: 0644]
file_demo_bios/k2g/components/sysiram.c [new file with mode: 0644]
file_demo_bios/k2g/components/sysiram.h [new file with mode: 0644]
file_demo_bios/k2g/components/sysmss.c [new file with mode: 0644]
file_demo_bios/k2g/components/sysvau.c [new file with mode: 0644]
file_demo_bios/k2g/evmk2g.gel [new file with mode: 0644]
file_demo_bios/k2g/filters/fir16L8g3m120.log [new file with mode: 0644]
file_demo_bios/k2g/filters/fir16L8g3m135.log [new file with mode: 0644]
file_demo_bios/k2g/filters/fir16L8g3m150.log [new file with mode: 0644]
file_demo_bios/k2g/filters/fir16L8g3m30.log [new file with mode: 0644]
file_demo_bios/k2g/filters/fir16L8g3m45.log [new file with mode: 0644]
file_demo_bios/k2g/filters/fir16L8g3m60.log [new file with mode: 0644]
file_demo_bios/k2g/filters/fir16L8g3m90.log [new file with mode: 0644]
file_demo_bios/k2g/filters/fir16L8g3p0.log [new file with mode: 0644]
file_demo_bios/k2g/filters/fir16L8g3p120.log [new file with mode: 0644]
file_demo_bios/k2g/filters/fir16L8g3p135.log [new file with mode: 0644]
file_demo_bios/k2g/filters/fir16L8g3p150.log [new file with mode: 0644]
file_demo_bios/k2g/filters/fir16L8g3p180.log [new file with mode: 0644]
file_demo_bios/k2g/filters/fir16L8g3p30.log [new file with mode: 0644]
file_demo_bios/k2g/filters/fir16L8g3p45.log [new file with mode: 0644]
file_demo_bios/k2g/filters/fir16L8g3p60.log [new file with mode: 0644]
file_demo_bios/k2g/filters/fir16L8g3p90.log [new file with mode: 0644]
file_demo_bios/k2g/main.c [new file with mode: 0644]
file_demo_bios/k2g/makefile.defs [new file with mode: 0644]
file_demo_bios/k2g/readme.txt [new file with mode: 0644]
file_demo_bios/k2g/signals/Exec1.JPG [new file with mode: 0644]
file_demo_bios/k2g/signals/Exec2.JPG [new file with mode: 0644]
file_demo_bios/k2g/signals/Exec3.JPG [new file with mode: 0644]
file_demo_bios/k2g/signals/msstrace.m [new file with mode: 0644]
file_demo_bios/k2g/signals/msstraceA12H500.csv [new file with mode: 0644]
file_demo_bios/k2g/signals/msstraceA12H500.xlsx [new file with mode: 0644]
file_demo_bios/k2g/signals/msstraceA8H500.csv [new file with mode: 0644]
file_demo_bios/k2g/signals/msstraceA8H500.xlsx [new file with mode: 0644]
file_demo_bios/k2g/signals/outmssA12H500.pcm [moved from file_demo_bios/da830/signals/outmssA12H500.pcm with 100% similarity]
file_demo_bios/k2g/signals/outmssA8H500.pcm [moved from file_demo_bios/da830/signals/outmssA8H500.pcm with 100% similarity]
file_demo_bios/k2g/signals/outvauA12H500.pcm [moved from file_demo_bios/da830/signals/outvauA12H500.pcm with 100% similarity]
file_demo_bios/k2g/signals/profile.xlsx [new file with mode: 0644]
file_demo_bios/k2g/signals/trace.JPG [new file with mode: 0644]
file_demo_bios/k2g/src/.exclude [new file with mode: 0644]
file_demo_bios/k2g/src/makefile.libs [new file with mode: 0644]
file_demo_bios/k2g/src/sysbios/makefile [new file with mode: 0644]
file_demo_bios/k2g/t8/fileOutput.bin [new file with mode: 0644]
file_demo_bios/k2g/t8/y16L8g3m7090_1.pcm [new file with mode: 0644]
file_demo_bios/k2g/t8/y16L8g3m7090_2.pcm [new file with mode: 0644]
file_demo_bios/k2g/t8/y16L8g3m7090_3.pcm [new file with mode: 0644]
file_demo_bios/k2g/t8/y16L8g3m7090_4.pcm [new file with mode: 0644]
file_demo_bios/k2g/t8/y16L8g3m7090_5.pcm [new file with mode: 0644]
file_demo_bios/k2g/t8/y16L8g3m7090_6.pcm [new file with mode: 0644]
file_demo_bios/k2g/t8/y16L8g3m7090_7.pcm [new file with mode: 0644]
file_demo_bios/k2g/t8/y16L8g3m7090_8.pcm [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/.dlls [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/.executables [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/.interfaces [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/.libraries [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/.xdcenv.mak [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/Platform.xdc [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/Platform.xs [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/config.bld [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/dskDA830Custom.zip [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/package.bld [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/package.mak [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/package.xdc [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/package/.vers_b160 [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/package/.vers_g180 [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/package/.vers_r170 [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/package/.xdc-B06 [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/package/build.cfg [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/package/dskDA830Custom.ccs [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/package/dskDA830Custom.class [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/package/dskDA830Custom.java [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/package/dskDA830Custom.sch [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/package/package.bld.xml [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/package/package.cfg.dep [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/package/package.cfg.xdc.inc [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/package/package.defs.h [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/package/package.xdc.dep [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/package/package.xdc.inc [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/package/package_dskDA830Custom.c [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/package/rel/dskDA830Custom.xdc.inc [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/package/rel/dskDA830Custom.xdc.inc.manifest [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/package/rel/dskDA830Custom.xdc.ninc [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/package/rel/dskDA830Custom.zip.dep [new file with mode: 0644]
file_demo_bios/platforms/packages/dskDA830Custom/package/rel/dskDA830Custom/dskDA830Custom/package/package.rel.xml [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/.dlls [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/.executables [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/.interfaces [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/.libraries [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/.xdcenv.mak [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/Platform.xdc [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/Platform.xs [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/config.bld [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/evmAM572XCustom.zip [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/package.bld [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/package.mak [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/package.xdc [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/package/.vers_b160 [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/package/.vers_g180 [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/package/.vers_r170 [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/package/.xdc-B06 [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/package/build.cfg [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/package/evmAM572XCustom.ccs [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/package/evmAM572XCustom.class [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/package/evmAM572XCustom.java [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/package/evmAM572XCustom.sch [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/package/package.bld.xml [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/package/package.cfg.dep [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/package/package.cfg.xdc.inc [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/package/package.defs.h [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/package/package.xdc.dep [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/package/package.xdc.inc [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/package/package_evmAM572XCustom.c [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/package/rel/evmAM572XCustom.xdc.inc [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/package/rel/evmAM572XCustom.xdc.inc.manifest [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/package/rel/evmAM572XCustom.xdc.ninc [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/package/rel/evmAM572XCustom.zip.dep [new file with mode: 0644]
file_demo_bios/platforms/packages/evmAM572XCustom/package/rel/evmAM572XCustom/evmAM572XCustom/package/package.rel.xml [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/.dlls [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/.executables [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/.interfaces [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/.libraries [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/.xdcenv.mak [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/Platform.xdc [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/Platform.xs [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/config.bld [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/evmTCI66AK2G02Custom.zip [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/package.bld [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/package.mak [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/package.xdc [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/package/.vers_b160 [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/package/.vers_g180 [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/package/.vers_r170 [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/package/.xdc-B06 [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/package/build.cfg [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/package/evmTCI66AK2G02Custom.ccs [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/package/evmTCI66AK2G02Custom.class [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/package/evmTCI66AK2G02Custom.java [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/package/evmTCI66AK2G02Custom.sch [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/package/package.bld.xml [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/package/package.cfg.dep [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/package/package.cfg.xdc.inc [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/package/package.defs.h [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/package/package.xdc.dep [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/package/package.xdc.inc [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/package/package_evmTCI66AK2G02Custom.c [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/package/rel/evmTCI66AK2G02Custom.xdc.inc [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/package/rel/evmTCI66AK2G02Custom.xdc.inc.manifest [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/package/rel/evmTCI66AK2G02Custom.xdc.ninc [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/package/rel/evmTCI66AK2G02Custom.zip.dep [new file with mode: 0644]
file_demo_bios/platforms/packages/evmTCI66AK2G02Custom/package/rel/evmTCI66AK2G02Custom/evmTCI66AK2G02Custom/package/package.rel.xml [new file with mode: 0644]

index 7ce3e00c2e79c960512e06b44d8bc9c484f35348..d21759a72054e6dd8a53152f390c93f637072968 100644 (file)
                                                        <tool id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.1063079859" name="XDCtools" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool">\r
                                                                <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR.1921523851" name="Compiler tools directory (-c)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR" value="&quot;${CG_TOOL_ROOT}&quot;" valueType="string"/>\r
                                                                <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET.196039924" name="Target (-t)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET" value="ti.targets.elf.C66" valueType="string"/>\r
-                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM.729164573" name="Platform (-p)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM" value="ti.platforms.evmAM572XCustom" valueType="string"/>\r
-                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW.1235218630" name="Platform (-p)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW" value="ti.platforms.evmAM572XCustom" valueType="string"/>\r
-                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE.1267793975" name="Build-profile (-r)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE" value="release" valueType="string"/>\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM.729164573" name="Platform (-p)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM" value="evmAM572XCustom" valueType="string"/>\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW.1235218630" name="Platform (-p)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW" value="evmAM572XCustom" valueType="string"/>\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE.1267793975" name="Build-profile (-r)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE" value="debug" valueType="string"/>\r
                                                                <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH.495390664" name="Package repositories (--xdcpath)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH" valueType="stringList">\r
                                                                        <listOptionValue builtIn="false" value="&quot;${BIOS_CG_ROOT}/packages&quot;"/>\r
                                                                        <listOptionValue builtIn="false" value="&quot;${TI_MAS_VOLIB_C66_INSTALL_DIR}/packages&quot;"/>\r
                                                                        <listOptionValue builtIn="false" value="&quot;${COM_TI_UIA_INSTALL_DIR}/packages&quot;"/>\r
                                                                        <listOptionValue builtIn="false" value="&quot;${XDAIS_CG_ROOT}/packages&quot;"/>\r
                                                                        <listOptionValue builtIn="false" value="&quot;${XDAIS_CG_ROOT}/examples&quot;"/>\r
-                                                                       <listOptionValue builtIn="false" value="&quot;C:\bf\FromBogdan\am572x_demo\platforms\packages&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${PROJECT_LOC}/../platforms/packages&quot;"/>\r
                                                                        <listOptionValue builtIn="false" value="&quot;${TI_MAS_AER_C64PX_INSTALL_DIR}/packages&quot;"/>\r
                                                                </option>\r
                                                                <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.COMPILE_OPTIONS.1904602078" name="Additional compiler options (--compileOptions)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.COMPILE_OPTIONS" value="&quot;-g --optimize_with_debug&quot;" valueType="string"/>\r
index 3e5729fab9143cefe091fc5af9a2a128a523b995..620e59652bc302830a12988e97ef61e8627f32ee 100644 (file)
@@ -6,6 +6,17 @@ SECTIONS
 {
     .bferam:        load >> EXT_RAM
     .bfiram:        load >> L2SRAM
+    .uiaLoggerBuffers load >> EXT_RAM
+    filOutBuf0           >> EXT_RAM
+       filBuf0              >> EXT_RAM
+       filBuf1              >> EXT_RAM
+       filBuf2              >> EXT_RAM
+       filBuf3              >> EXT_RAM
+       filBuf4              >> EXT_RAM
+       filBuf5              >> EXT_RAM
+       filBuf6              >> EXT_RAM
+       filBuf7              >> EXT_RAM
+       .far                 >> EXT_RAM
 }
 /* nothing past this point */
 
index 51130658de046204154d0ab1f5747a3a6510bad6..f41efc992a4e51b9c9da5145becc9c6248fa9802 100644 (file)
@@ -1,26 +1,25 @@
 1. Download AEC-AER and VOLIB(volib_C66_2_1_0_1) from http://www.ti.com/tool/telecomlib\r
 2. Install AEC-AER and VOLIB(volib_C66_2_1_0_1) at C:\ti\r
-3. Rename C:\ti\aer_c64Px_obj_17_0_0_0 to C:\ti\aer_c64Px_obj_17_0_0_0_mod\r
-4. Copy noise-reduction directory to C:\ti\noise-reduction\r
-5. Download and install bios_6_45_01_29\r
-6. Download and install xdais_7_24_00_04 and xdctools_3_32_00_06_core from TI website \r
-7. Downlaod CCS 6.1.3 from TI website\r
-8. Install CCS 6.1.3 at C:\ti\r
-9. Launch CCS 6.1.3\r
-10. Import AM572x_bf from C:\ti\noise-reduction\file_demo_bios\am572x\r
-11. Build the imported project\r
-12. Import the target configuration file AM572x_bf.ccxml from C:\ti\noise-reduction\file_demo_bios\am572x\r
-13. Connect the Blackhawk USB 560M JTAG to P4 on AM572x GP EVM\r
-14. Plug power adaptor(12V) into the AM572x GP EVM (Do not press the Power Button(S1) yet)\r
-15. Launch the AM572x_bf.ccxml using "Launch Selected Configuration" from CCS 6.1.3\r
-16. Press the Power Button(S1) and "Connect to CortexA15_0" immediately (Due to the EVM will be auto power off in 10 secs)\r
-17. Then "Connect to C66xx_DSP1"\r
-18. Load the AM572x_bf.out from C:\ti\noise-reduction\file_demo_bios\am572x\Debug\r
-19. Execute GEL function Scripts-->Microphone Load Functions-->BFMicLoadAll to load all 8 microphone input files \r
+3. Copy noise-reduction directory to C:\ti\noise-reduction\r
+4. Download and install bios_6_45_01_29\r
+5. Download and install xdais_7_24_00_04 and xdctools_3_32_00_06_core from TI website \r
+6. Downlaod CCS 6.1.3 from TI website\r
+7. Install CCS 6.1.3 at C:\ti\r
+8. Launch CCS 6.1.3\r
+9. Import AM572x_bf from C:\ti\noise-reduction\file_demo_bios\am572x\r
+10. Build the imported project\r
+11. Import the target configuration file AM572x_bf.ccxml from C:\ti\noise-reduction\file_demo_bios\am572x\r
+12. Connect the Blackhawk USB 560M JTAG to P4 on AM572x GP EVM\r
+13. Plug power adaptor(12V) into the AM572x GP EVM (Do not press the Power Button(S1) yet)\r
+14. Launch the AM572x_bf.ccxml using "Launch Selected Configuration" from CCS 6.1.3\r
+15. Press the Power Button(S1) and "Connect to CortexA15_0" immediately (Due to the EVM will be auto power off in 10 secs)\r
+16. Then "Connect to C66xx_DSP1"\r
+17. Load the AM572x_bf.out from C:\ti\noise-reduction\file_demo_bios\am572x\Debug\r
+18. Execute GEL function Scripts-->Microphone Load Functions-->BFMicLoadAll to load all 8 microphone input files \r
     (C:\ti\noise-reduction\file_demo_bios\am572x\t8\y16L8g3m7090_x.pcm) into external memory buffers\r
-20. Run the program (loaded in step 16) by pressing F8\r
-21. The program will print out the statistics and "Simulation End" when the program completes the prosessing\r
-22. Execute GEL function Scripts-->Microphone Save Functions-->BFSaveOutput to save the processed auido output from external memory buffer to a file \r
+19. Run the program (loaded in step 16) by pressing F8\r
+20. The program will print out the statistics and "Simulation End" when the program completes the prosessing\r
+21. Execute GEL function Scripts-->Microphone Save Functions-->BFSaveOutput to save the processed auido output from external memory buffer to a file \r
     (C:\ti\noise-reduction\file_demo_bios\am572x\t8\fileOutput.bin)\r
-23. By default 12 virtual microphones (30 degree apart) will be used\r
+22. By default 12 virtual microphones (30 degree apart) will be used\r
 \r
diff --git a/file_demo_bios/am572x/src/sysbios/BIOS.obj b/file_demo_bios/am572x/src/sysbios/BIOS.obj
deleted file mode 100644 (file)
index f2bcf0f..0000000
Binary files a/file_demo_bios/am572x/src/sysbios/BIOS.obj and /dev/null differ
diff --git a/file_demo_bios/am572x/src/sysbios/c62_TaskSupport_asm.obj b/file_demo_bios/am572x/src/sysbios/c62_TaskSupport_asm.obj
deleted file mode 100644 (file)
index b146988..0000000
Binary files a/file_demo_bios/am572x/src/sysbios/c62_TaskSupport_asm.obj and /dev/null differ
diff --git a/file_demo_bios/am572x/src/sysbios/c64p_Exception_asm.obj b/file_demo_bios/am572x/src/sysbios/c64p_Exception_asm.obj
deleted file mode 100644 (file)
index cfe04ff..0000000
Binary files a/file_demo_bios/am572x/src/sysbios/c64p_Exception_asm.obj and /dev/null differ
diff --git a/file_demo_bios/am572x/src/sysbios/c64p_Hwi_asm.obj b/file_demo_bios/am572x/src/sysbios/c64p_Hwi_asm.obj
deleted file mode 100644 (file)
index 44e81b2..0000000
Binary files a/file_demo_bios/am572x/src/sysbios/c64p_Hwi_asm.obj and /dev/null differ
diff --git a/file_demo_bios/am572x/src/sysbios/c64p_Hwi_asm_switch.obj b/file_demo_bios/am572x/src/sysbios/c64p_Hwi_asm_switch.obj
deleted file mode 100644 (file)
index c439d52..0000000
Binary files a/file_demo_bios/am572x/src/sysbios/c64p_Hwi_asm_switch.obj and /dev/null differ
diff --git a/file_demo_bios/am572x/src/sysbios/c64p_Hwi_disp_always.obj b/file_demo_bios/am572x/src/sysbios/c64p_Hwi_disp_always.obj
deleted file mode 100644 (file)
index 4465168..0000000
Binary files a/file_demo_bios/am572x/src/sysbios/c64p_Hwi_disp_always.obj and /dev/null differ
diff --git a/file_demo_bios/am572x/src/sysbios/dmtimer_Timer_asm.obj b/file_demo_bios/am572x/src/sysbios/dmtimer_Timer_asm.obj
deleted file mode 100644 (file)
index e5e4ee8..0000000
Binary files a/file_demo_bios/am572x/src/sysbios/dmtimer_Timer_asm.obj and /dev/null differ
diff --git a/file_demo_bios/am572x/src/sysbios/sysbios.ae66 b/file_demo_bios/am572x/src/sysbios/sysbios.ae66
deleted file mode 100644 (file)
index bda9dc6..0000000
Binary files a/file_demo_bios/am572x/src/sysbios/sysbios.ae66 and /dev/null differ
index 48230eb5a18861a6f58319e4cdec815a1bacc4ec..b6b770b49769f4ff276ac84fa7982e73a48e228f 100644 (file)
@@ -26,7 +26,7 @@
                                                                <listOptionValue builtIn="false" value="RTSC_MBS_VERSION=2.2.0"/>\r
                                                                <listOptionValue builtIn="false" value="XDC_VERSION=3.32.0.06_core"/>\r
                                                                <listOptionValue builtIn="false" value="RTSC_PRODUCTS=ti.mas.aer.c64Px:17.0.0;com.ti.rtsc.SYSBIOS:6.45.1.29;com.ti.uia:2.0.3.43;ti.mas.volib.C64P:2.1.0.1;com.ti.rtsc.XDAIS:7.24.0.04;"/>\r
-                                                               <listOptionValue builtIn="false" value="INACTIVE_REPOS=${TARGET_CONTENT_BASE};C:\bf\FromBogdan\am572x_demo\platforms\packages\ti\platforms\DA830DSKCustom;"/>\r
+                                                               <listOptionValue builtIn="false" value="INACTIVE_REPOS=${TARGET_CONTENT_BASE};"/>\r
                                                                <listOptionValue builtIn="false" value="EXPANDED_REPOS="/>\r
                                                                <listOptionValue builtIn="false" value="OUTPUT_TYPE=rtscApplication:executable"/>\r
                                                        </option>\r
@@ -94,7 +94,7 @@
                                                                        <listOptionValue builtIn="false" value="&quot;${XDAIS_CG_ROOT}/examples&quot;"/>\r
                                                                        <listOptionValue builtIn="false" value="&quot;${TI_MAS_AER_C64PX_INSTALL_DIR}/packages&quot;"/>\r
                                                                        <listOptionValue builtIn="false" value="&quot;${TI_MAS_VOLIB_C64P_INSTALL_DIR}/packages&quot;"/>\r
-                                                                       <listOptionValue builtIn="false" value="&quot;C:\bf\FromBogdan\am572x_demo\platforms\packages\ti\platforms&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${PROJECT_LOC}/../platforms/packages&quot;"/>\r
                                                                </option>\r
                                                                <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET.965151569" name="Target (-t)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET" value="ti.targets.elf.C674" valueType="string"/>\r
                                                                <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM.858134705" name="Platform (-p)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM" value="dskDA830Custom" valueType="string"/>\r
diff --git a/file_demo_bios/da830/src/sysbios/makefile b/file_demo_bios/da830/src/sysbios/makefile
new file mode 100644 (file)
index 0000000..23263b5
--- /dev/null
@@ -0,0 +1,104 @@
+
+XOPTS = -I"C:/ti/xdctools_3_32_00_06_core/packages/" -Dxdc_target_types__=C:/ti/bios_6_45_01_29/packages/ti/targets/elf/std.h -Dxdc_target_name__=C674
+
+vpath % C:/ti/bios_6_45_01_29/packages/ti/sysbios/
+vpath %.c C:/ti/xdctools_3_32_00_06_core/packages/
+
+CCOPTS    = -mv6740 --abi=eabi -q -mi10 -mo -pdr -pden -pds=238 -pds=880 -pds1110  --program_level_compile -o3 -g --optimize_with_debug  -Dti_sysbios_knl_Task_minimizeLatency__D=FALSE -Dti_sysbios_family_c64p_Exception_enableExternalMPC__D=FALSE -Dti_sysbios_family_c64p_Exception_enablePrint__D=TRUE -Dti_sysbios_knl_Clock_stopCheckNext__D=FALSE
+
+XDC_ROOT  = C:/ti/xdctools_3_32_00_06_core/packages/
+
+BIOS_ROOT = C:/ti/bios_6_45_01_29/packages/ti/sysbios/
+
+BIOS_DEFS =  -Dti_sysbios_BIOS_swiEnabled__D=TRUE -Dti_sysbios_BIOS_taskEnabled__D=TRUE -Dti_sysbios_BIOS_clockEnabled__D=TRUE -Dti_sysbios_BIOS_runtimeCreatesEnabled__D=TRUE -Dti_sysbios_hal_Hwi_DISABLE_ALL_HOOKS -Dti_sysbios_knl_Swi_DISABLE_ALL_HOOKS -Dti_sysbios_BIOS_smpEnabled__D=FALSE -Dti_sysbios_Build_useHwiMacros -Dti_sysbios_knl_Swi_numPriorities__D=16 -Dti_sysbios_knl_Task_deleteTerminatedTasks__D=FALSE -Dti_sysbios_knl_Task_numPriorities__D=16 -Dti_sysbios_knl_Task_checkStackFlag__D=TRUE -Dti_sysbios_knl_Task_initStackFlag__D=TRUE -Dti_sysbios_knl_Task_DISABLE_ALL_HOOKS -Dti_sysbios_knl_Clock_TICK_SOURCE=ti_sysbios_knl_Clock_TickSource_TIMER -Dti_sysbios_knl_Clock_TICK_MODE=ti_sysbios_knl_Clock_TickMode_PERIODIC -Dti_sysbios_hal_Core_delegate_getId=ti_sysbios_hal_CoreNull_getId__E -Dti_sysbios_hal_Core_delegate_interruptCore=ti_sysbios_hal_CoreNull_interruptCore__E -Dti_sysbios_hal_Core_delegate_lock=ti_sysbios_hal_CoreNull_lock__E -Dti_sysbios_hal_Core_delegate_unlock=ti_sysbios_hal_CoreNull_unlock__E -Dti_sysbios_hal_Core_numCores__D=1 -Dti_sysbios_hal_CoreNull_numCores__D=1 -Dti_sysbios_utils_Load_taskEnabled__D=FALSE -Dti_sysbios_utils_Load_swiEnabled__D=FALSE -Dti_sysbios_utils_Load_hwiEnabled__D=FALSE -Dti_sysbios_family_c64p_Hwi_dispatcherSwiSupport__D=TRUE -Dti_sysbios_family_c64p_Hwi_dispatcherTaskSupport__D=TRUE -Dti_sysbios_family_c64p_Hwi_dispatcherAutoNestingSupport__D=TRUE -Dti_sysbios_family_c64p_Hwi_dispatcherIrpTrackingSupport__D=TRUE -Dti_sysbios_knl_Semaphore_supportsEvents__D=FALSE -Dti_sysbios_knl_Semaphore_supportsPriority__D=TRUE
+
+BIOS_INC  = -I"C:/ti/bios_6_45_01_29/packages/"
+
+TARGET_INC = -I"C:/ti/bios_6_45_01_29/packages/"
+
+INCS = $(BIOS_INC) $(TARGET_INC)  
+
+CC = C:/ti/ccsv6/tools/compiler/ti-cgt-c6000_8.1.0/bin/cl6x -c $(CCOPTS) -I C:/ti/ccsv6/tools/compiler/ti-cgt-c6000_8.1.0/include
+ASM = C:/ti/ccsv6/tools/compiler/ti-cgt-c6000_8.1.0/bin/cl6x -c $(CCOPTS) -I C:/ti/ccsv6/tools/compiler/ti-cgt-c6000_8.1.0/include
+AR = C:/ti/ccsv6/tools/compiler/ti-cgt-c6000_8.1.0/bin/ar6x rq
+
+DEL = C:/ti/xdctools_3_32_00_06_core/packages/../bin/rm -f
+CP = C:/ti/xdctools_3_32_00_06_core/packages/../bin/cp -f
+
+define RM
+       $(if $(wildcard $1),$(DEL) $1,:)
+endef
+
+define ASSEMBLE
+       @echo asme674 $< ...
+       @$(ASM) $(BIOS_DEFS) $(XOPTS) $(INCS) $<
+endef
+
+all: sysbios.ae674
+
+c64p_Exception_asm.obj: family/c64p/Exception_asm.s64P makefile
+       @-$(call RM, $@)
+       $(ASSEMBLE) --output_file=c64p_Exception_asm.obj
+
+c64p_Hwi_asm.obj: family/c64p/Hwi_asm.s62 makefile
+       @-$(call RM, $@)
+       $(ASSEMBLE) --output_file=c64p_Hwi_asm.obj
+
+c64p_Hwi_asm_switch.obj: family/c64p/Hwi_asm_switch.s62 makefile
+       @-$(call RM, $@)
+       $(ASSEMBLE) --output_file=c64p_Hwi_asm_switch.obj
+
+c64p_Hwi_disp_always.obj: family/c64p/Hwi_disp_always.s64P makefile
+       @-$(call RM, $@)
+       $(ASSEMBLE) --output_file=c64p_Hwi_disp_always.obj
+
+c62_TaskSupport_asm.obj: family/c62/TaskSupport_asm.s62 makefile
+       @-$(call RM, $@)
+       $(ASSEMBLE) --output_file=c62_TaskSupport_asm.obj
+
+timer64_Timer_asm.obj: timers/timer64/Timer_asm.s64P makefile
+       @-$(call RM, $@)
+       $(ASSEMBLE) --output_file=timer64_Timer_asm.obj
+
+
+BIOS.obj: BIOS.c family/c64p/Exception.c family/c64p/Hwi.c family/c64p/Hwi_startup.c family/c64p/TimestampProvider.c family/c64p/Cache.c knl/Clock.c knl/Idle.c knl/Intrinsics.c knl/Event.c knl/Queue.c knl/Semaphore.c knl/Swi.c knl/Swi_andn.c knl/Task.c hal/Hwi.c hal/Hwi_stack.c hal/Hwi_startup.c gates/GateHwi.c gates/GateMutex.c family/c62/TaskSupport.c family/c62/IntrinsicsSupport.c heaps/HeapMem.c utils/Load.c utils/Load_CPU.c timers/timer64/Timer.c family/c64p/primus/TimerSupport.c makefile
+       @-$(call RM, $@)
+       @echo cle674 $< ...
+       @$(CC) $(BIOS_DEFS) $(XOPTS) $(INCS) \
+       $(BIOS_ROOT)BIOS.c \
+       $(BIOS_ROOT)family/c64p/Exception.c \
+       $(BIOS_ROOT)family/c64p/Hwi.c \
+       $(BIOS_ROOT)family/c64p/Hwi_startup.c \
+       $(BIOS_ROOT)family/c64p/TimestampProvider.c \
+       $(BIOS_ROOT)family/c64p/Cache.c \
+       $(BIOS_ROOT)knl/Clock.c \
+       $(BIOS_ROOT)knl/Idle.c \
+       $(BIOS_ROOT)knl/Intrinsics.c \
+       $(BIOS_ROOT)knl/Event.c \
+       $(BIOS_ROOT)knl/Queue.c \
+       $(BIOS_ROOT)knl/Semaphore.c \
+       $(BIOS_ROOT)knl/Swi.c \
+       $(BIOS_ROOT)knl/Swi_andn.c \
+       $(BIOS_ROOT)knl/Task.c \
+       $(BIOS_ROOT)hal/Hwi.c \
+       $(BIOS_ROOT)hal/Hwi_stack.c \
+       $(BIOS_ROOT)hal/Hwi_startup.c \
+       $(BIOS_ROOT)gates/GateHwi.c \
+       $(BIOS_ROOT)gates/GateMutex.c \
+       $(BIOS_ROOT)family/c62/TaskSupport.c \
+       $(BIOS_ROOT)family/c62/IntrinsicsSupport.c \
+       $(BIOS_ROOT)heaps/HeapMem.c \
+       $(BIOS_ROOT)utils/Load.c \
+       $(BIOS_ROOT)utils/Load_CPU.c \
+       $(BIOS_ROOT)timers/timer64/Timer.c \
+       $(BIOS_ROOT)family/c64p/primus/TimerSupport.c \
+
+sysbios.ae674: BIOS.obj c64p_Exception_asm.obj c64p_Hwi_asm.obj c64p_Hwi_asm_switch.obj c64p_Hwi_disp_always.obj c62_TaskSupport_asm.obj timer64_Timer_asm.obj
+       @-$(call RM, $@)
+       @echo are674 $^ ...
+       @$(AR) $@ $^
+
+
+clean:
+       @$(DEL) ..\makefile.libs
+       @-$(call RM, *)
diff --git a/file_demo_bios/k2g/.ccsproject b/file_demo_bios/k2g/.ccsproject
new file mode 100644 (file)
index 0000000..eb7fb1d
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<?ccsproject version="1.0"?>
+<projectOptions>
+       <deviceVariant value="TMS320C66XX.AM5728_RevA.GPEVM_AM572X_SiRevA"/>
+       <deviceFamily value="C6000"/>
+       <deviceEndianness value="little"/>
+       <codegenToolVersion value="8.1.0"/>
+       <isElfFormat value="true"/>
+       <rts value="libc.a"/>
+       <createSlaveProjects value=""/>
+       <templateProperties value="id=com_ti_rtsc_sysbios_example_143.projectspec.typical_GPEVM_AM572X_SiRevA_C66XX,type=rtsc,products=com.ti.rtsc.SYSBIOS,buildProfile=release,isHybrid=true,configuroOptions=--compileOptions &quot;-g --optimize_with_debug&quot;,"/>
+       <origin value="C:\ti\bios_6_45_01_29\resources\tiTargetExamples\com_ti_rtsc_sysbios_example_143.projectspec"/>
+       <filesToOpen value=""/>
+       <isTargetManual value="true"/>
+</projectOptions>
diff --git a/file_demo_bios/k2g/.config/.productview.dat b/file_demo_bios/k2g/.config/.productview.dat
new file mode 100644 (file)
index 0000000..f2e3531
Binary files /dev/null and b/file_demo_bios/k2g/.config/.productview.dat differ
diff --git a/file_demo_bios/k2g/.config/xconfig_app/.buildtime b/file_demo_bios/k2g/.config/xconfig_app/.buildtime
new file mode 100644 (file)
index 0000000..47c5c5e
--- /dev/null
@@ -0,0 +1 @@
+C:\ti\noise-reduction\file_demo_bios\k2g\.config\xconfig_app\.buildtime
\ No newline at end of file
diff --git a/file_demo_bios/k2g/.config/xconfig_app/.interfaces b/file_demo_bios/k2g/.config/xconfig_app/.interfaces
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/file_demo_bios/k2g/.config/xconfig_app/.xdcenv.mak b/file_demo_bios/k2g/.config/xconfig_app/.xdcenv.mak
new file mode 100644 (file)
index 0000000..3a386c4
--- /dev/null
@@ -0,0 +1,16 @@
+#
+_XDCBUILDCOUNT = 
+ifneq (,$(findstring path,$(_USEXDCENV_)))
+override XDCPATH = C:/ti/bios_6_45_01_29/packages;C:/ti/volib_C66_2_1_0_1/packages;C:/procsdk/download/ti_k2hk_2.0.1.7/uia_2_00_03_43/packages;C:/procsdk/download/ti_k2hk_2.0.1.7/xdais_7_24_00_04/packages;C:/procsdk/download/ti_k2hk_2.0.1.7/xdais_7_24_00_04/examples;C:/ti/aer_c64Px_obj_17_0_0_0/packages;C:/ti/noise-reduction/file_demo_bios/platforms/packages/ti/platforms/evmK2GCustom;C:/ti/pdk_k2g_1_0_2/packages;C:/ti/noise-reduction/file_demo_bios/k2g/.config
+override XDCROOT = C:/ti/xdctools_3_32_00_06_core
+override XDCBUILDCFG = ./config.bld
+endif
+ifneq (,$(findstring args,$(_USEXDCENV_)))
+override XDCARGS = 
+override XDCTARGETS = 
+endif
+#
+ifeq (0,1)
+PKGPATH = C:/ti/bios_6_45_01_29/packages;C:/ti/volib_C66_2_1_0_1/packages;C:/procsdk/download/ti_k2hk_2.0.1.7/uia_2_00_03_43/packages;C:/procsdk/download/ti_k2hk_2.0.1.7/xdais_7_24_00_04/packages;C:/procsdk/download/ti_k2hk_2.0.1.7/xdais_7_24_00_04/examples;C:/ti/aer_c64Px_obj_17_0_0_0/packages;C:/ti/noise-reduction/file_demo_bios/platforms/packages/ti/platforms/evmK2GCustom;C:/ti/pdk_k2g_1_0_2/packages;C:/ti/noise-reduction/file_demo_bios/k2g/.config;C:/ti/xdctools_3_32_00_06_core/packages;..
+HOSTOS = Windows
+endif
diff --git a/file_demo_bios/k2g/.config/xconfig_app/compiler.opt b/file_demo_bios/k2g/.config/xconfig_app/compiler.opt
new file mode 100644 (file)
index 0000000..b5d3473
--- /dev/null
@@ -0,0 +1 @@
+-mv6600 --abi=eabi -I"C:/ti/bios_6_45_01_29/packages" -I"C:/ti/volib_C66_2_1_0_1/packages" -I"C:/procsdk/download/ti_k2hk_2.0.1.7/uia_2_00_03_43/packages" -I"C:/procsdk/download/ti_k2hk_2.0.1.7/xdais_7_24_00_04/packages" -I"C:/procsdk/download/ti_k2hk_2.0.1.7/xdais_7_24_00_04/examples" -I"C:/ti/aer_c64Px_obj_17_0_0_0/packages" -I"C:/ti/noise-reduction/file_demo_bios/platforms/packages/ti/platforms/evmK2GCustom" -I"C:/ti/pdk_k2g_1_0_2/packages" -I"C:/ti/noise-reduction/file_demo_bios/k2g/.config" -I"C:/ti/xdctools_3_32_00_06_core/packages" -I"C:/ti/noise-reduction/file_demo_bios/k2g/.config/xconfig_app/.." -IC:/ti/ccsv6/tools/compiler/ti-cgt-c6000_8.1.0/include -Dxdc_target_types__="ti/targets/elf/std.h" -Dxdc_target_name__=C66 -Dxdc_cfg__xheader__="\"C:/ti/noise-reduction/file_demo_bios/k2g/.config/xconfig_app/package/cfg/app_pe66.h\""
diff --git a/file_demo_bios/k2g/.config/xconfig_app/compiler.opt.defs b/file_demo_bios/k2g/.config/xconfig_app/compiler.opt.defs
new file mode 100644 (file)
index 0000000..3710d52
--- /dev/null
@@ -0,0 +1 @@
+-I"C:/ti/bios_6_45_01_29/packages" -I"C:/ti/volib_C66_2_1_0_1/packages" -I"C:/procsdk/download/ti_k2hk_2.0.1.7/uia_2_00_03_43/packages" -I"C:/procsdk/download/ti_k2hk_2.0.1.7/xdais_7_24_00_04/packages" -I"C:/procsdk/download/ti_k2hk_2.0.1.7/xdais_7_24_00_04/examples" -I"C:/ti/aer_c64Px_obj_17_0_0_0/packages" -I"C:/ti/noise-reduction/file_demo_bios/platforms/packages/ti/platforms/evmK2GCustom" -I"C:/ti/pdk_k2g_1_0_2/packages" -I"C:/ti/noise-reduction/file_demo_bios/k2g/.config" -I"C:/ti/xdctools_3_32_00_06_core/packages" -I"C:/ti/noise-reduction/file_demo_bios/k2g/.config/xconfig_app/.." -IC:/ti/ccsv6/tools/compiler/ti-cgt-c6000_8.1.0/include -Dxdc_target_types__="ti/targets/elf/std.h" -Dxdc_target_name__=C66 -Dxdc_cfg__xheader__="\"C:/ti/noise-reduction/file_demo_bios/k2g/.config/xconfig_app/package/cfg/app_pe66.h\""
diff --git a/file_demo_bios/k2g/.config/xconfig_app/config.bld b/file_demo_bios/k2g/.config/xconfig_app/config.bld
new file mode 100644 (file)
index 0000000..5192b80
--- /dev/null
@@ -0,0 +1,24 @@
+/* THIS IS A GENERATED FILE -- DO NOT EDIT */
+
+var target;    /* the target used for this build */
+
+/* configuro was passed the target's name explicitly */
+try {
+    target = xdc.module('ti.targets.elf.C66');
+}
+catch (e) {
+    throw new Error("Can't find the target named '" + 'ti.targets.elf.C66'
+                    + "' along the path '" + environment["xdc.path"]
+                    + "': please check the spelling of the target's name and that it exists along this path.");
+}
+if (!(target instanceof xdc.module("xdc.bld.ITarget").Module)) {
+    throw new Error("The module named 'ti.targets.elf.C66' exists but it's not a target: please check the spelling of the target's name");
+}
+
+/* configuro was passed compiler options explicitly */
+target.ccOpts.prefix = unescape("-g%20--optimize_with_debug%20") + target.ccOpts.prefix;
+
+/* configuro was passed the target's rootDir explicitly */
+target.rootDir = 'C:/ti/ccsv6/tools/compiler/ti-cgt-c6000_8.1.0';
+
+Build.targets = [target];
diff --git a/file_demo_bios/k2g/.config/xconfig_app/custom.mak b/file_demo_bios/k2g/.config/xconfig_app/custom.mak
new file mode 100644 (file)
index 0000000..8c3ca86
--- /dev/null
@@ -0,0 +1,11 @@
+## THIS IS A GENERATED FILE -- DO NOT EDIT
+.configuro: .libraries,e66 linker.cmd package/cfg/app_pe66.oe66
+
+# To simplify configuro usage in makefiles:
+#     o create a generic linker command file name 
+#     o set modification times of compiler.opt* files to be greater than
+#       or equal to the generated config header
+#
+linker.cmd: package/cfg/app_pe66.xdl
+       $(SED) 's"^\"\(package/cfg/app_pe66cfg.cmd\)\"$""\"C:/ti/noise-reduction/file_demo_bios/k2g/.config/xconfig_app/\1\""' package/cfg/app_pe66.xdl > $@
+       -$(SETDATE) -r:max package/cfg/app_pe66.h compiler.opt compiler.opt.defs
diff --git a/file_demo_bios/k2g/.config/xconfig_app/package.bld b/file_demo_bios/k2g/.config/xconfig_app/package.bld
new file mode 100644 (file)
index 0000000..98c524d
--- /dev/null
@@ -0,0 +1,78 @@
+/* THIS IS A GENERATED FILE -- DO NOT EDIT */
+
+var targ = xdc.module('ti.targets.elf.C66');
+/* configuro was told the platform explicitly */
+var platform = 'evmK2GCustom';
+
+/* decide whether to make an assembly or an executable */
+var makeAssembly = false;
+
+
+var Executable = xdc.module('xdc.bld.Executable');
+
+var exeOpts = new Executable.Attrs({
+        cfgScript: 'C:/ti/noise-reduction/file_demo_bios/k2g/app.cfg',
+        profile: 'release',
+        cfgHome: 'xconfig_app',
+});
+
+exeOpts.cfgArgs = 'null';
+exeOpts.cfgArgsEncoded = true;
+
+var exe = Pkg[makeAssembly ? 'addAssembly': 'addExecutable'](
+    'app',
+    targ,
+    platform,
+    exeOpts
+);
+
+/*
+ * Generate the compiler.opt file
+ * Do this here instead of during the initial creation of the configuro
+ * package, because the contents of any config.bld script are unknown
+ * at that time. Config.bld can't be executed until the XDC build phase.
+ */
+if (makeAssembly) {
+    var suffix = targ.dllExt || '.p' + targ.suffix;
+}
+else {
+    var suffix = '.p' + targ.suffix;
+}
+
+var thisObj = {
+    cfg:        'C:/ti/noise-reduction/file_demo_bios/k2g/app.cfg',
+    outputPath: 'C:/ti/noise-reduction/file_demo_bios/k2g/.config/xconfig_app',
+    exeName:    'app' + suffix,
+    exeIntName: 'app' + suffix.replace('.', '_'),
+    targ:       targ,
+    linkerCommandFile: 'linker.cmd',
+    compilerOptFile: 'compiler.opt',
+    compilerDefsFile: 'compiler.opt' + ".defs",
+    makeAssembly: makeAssembly
+};
+var tmpl = xdc.loadTemplate('xdc/tools/configuro/template/compiler.opt.xdt');
+tmpl.genFile('compiler.opt', thisObj, [], false);
+
+/*
+ * Generate the custom makefile.
+ */
+var tmpl = xdc.loadTemplate('xdc/tools/configuro/template/' + 
+    (makeAssembly? 'custom.mak.asm.xdt' : 'custom.mak.exe.xdt'));
+tmpl.genFile('custom.mak', thisObj, [], false);
+Pkg.makeEpilogue = "include custom.mak";
+
+/*
+ * Generate the package script.
+ */
+var tmpl = xdc.loadTemplate('xdc/tools/configuro/template/package.xs.xdt');
+tmpl.genFile('package.xs', thisObj, [], false);
+
+if (makeAssembly) {
+/*
+ * Generate the linker options into a staging file, so that the presence or
+ * age of the advertised linker command file can be the makefile trigger to
+ * rebuild the package from the user's config script.
+ */
+    var tmpl = xdc.loadTemplate('xdc/tools/configuro/template/linker.cmd.asm.xdt');
+    tmpl.genFile('linker.cmd.cp', thisObj, [], false);
+}
diff --git a/file_demo_bios/k2g/.config/xconfig_app/package.mak b/file_demo_bios/k2g/.config/xconfig_app/package.mak
new file mode 100644 (file)
index 0000000..6cc7ddc
--- /dev/null
@@ -0,0 +1,256 @@
+#
+#  Do not edit this file.  This file is generated from 
+#  package.bld.  Any modifications to this file will be 
+#  overwritten whenever makefiles are re-generated.
+#
+
+unexport MAKEFILE_LIST
+MK_NOGENDEPS := $(filter clean,$(MAKECMDGOALS))
+override PKGDIR = xconfig_app
+XDCINCS = -I. -I$(strip $(subst ;, -I,$(subst $(space),\$(space),$(XPKGPATH))))
+XDCCFGDIR = package/cfg/
+
+#
+# The following dependencies ensure package.mak is rebuilt
+# in the event that some included BOM script changes.
+#
+ifneq (clean,$(MAKECMDGOALS))
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/utils.js:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/utils.js
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/xdc.tci:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/xdc.tci
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/template.xs:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/template.xs
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/om2.xs:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/om2.xs
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/xmlgen.xs:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/xmlgen.xs
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/xmlgen2.xs:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/xmlgen2.xs
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/Warnings.xs:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/Warnings.xs
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/IPackage.xs:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/IPackage.xs
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/package.xs:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/package.xs
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/services/global/Clock.xs:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/services/global/Clock.xs
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/services/global/Trace.xs:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/services/global/Trace.xs
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/bld.js:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/bld.js
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/BuildEnvironment.xs:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/BuildEnvironment.xs
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/PackageContents.xs:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/PackageContents.xs
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/_gen.xs:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/_gen.xs
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/Library.xs:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/Library.xs
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/Executable.xs:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/Executable.xs
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/Repository.xs:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/Repository.xs
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/Configuration.xs:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/Configuration.xs
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/Script.xs:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/Script.xs
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/Manifest.xs:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/Manifest.xs
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/Utils.xs:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/Utils.xs
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/ITarget.xs:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/ITarget.xs
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/ITarget2.xs:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/ITarget2.xs
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/ITarget3.xs:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/ITarget3.xs
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/ITargetFilter.xs:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/ITargetFilter.xs
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/package.xs:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/bld/package.xs
+package.mak: config.bld
+C:/ti/bios_6_45_01_29/packages/ti/targets/ITarget.xs:
+package.mak: C:/ti/bios_6_45_01_29/packages/ti/targets/ITarget.xs
+C:/ti/bios_6_45_01_29/packages/ti/targets/C28_large.xs:
+package.mak: C:/ti/bios_6_45_01_29/packages/ti/targets/C28_large.xs
+C:/ti/bios_6_45_01_29/packages/ti/targets/C28_float.xs:
+package.mak: C:/ti/bios_6_45_01_29/packages/ti/targets/C28_float.xs
+C:/ti/bios_6_45_01_29/packages/ti/targets/package.xs:
+package.mak: C:/ti/bios_6_45_01_29/packages/ti/targets/package.xs
+C:/ti/bios_6_45_01_29/packages/ti/targets/elf/ITarget.xs:
+package.mak: C:/ti/bios_6_45_01_29/packages/ti/targets/elf/ITarget.xs
+C:/ti/bios_6_45_01_29/packages/ti/targets/elf/package.xs:
+package.mak: C:/ti/bios_6_45_01_29/packages/ti/targets/elf/package.xs
+package.mak: package.bld
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/tools/configuro/template/compiler.opt.xdt:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/tools/configuro/template/compiler.opt.xdt
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/services/io/File.xs:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/services/io/File.xs
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/services/io/package.xs:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/services/io/package.xs
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/tools/configuro/template/compiler.defs.xdt:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/tools/configuro/template/compiler.defs.xdt
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/tools/configuro/template/custom.mak.exe.xdt:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/tools/configuro/template/custom.mak.exe.xdt
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/tools/configuro/template/package.xs.xdt:
+package.mak: C:/ti/xdctools_3_32_00_06_core/packages/xdc/tools/configuro/template/package.xs.xdt
+endif
+
+ti.targets.elf.C66.rootDir ?= C:/ti/ccsv6/tools/compiler/ti-cgt-c6000_8.1.0
+ti.targets.elf.packageBase ?= C:/ti/bios_6_45_01_29/packages/ti/targets/elf/
+.PRECIOUS: $(XDCCFGDIR)/%.oe66
+.PHONY: all,e66 .dlls,e66 .executables,e66 test,e66
+all,e66: .executables,e66
+.executables,e66: .libraries,e66
+.executables,e66: .dlls,e66
+.dlls,e66: .libraries,e66
+.libraries,e66: .interfaces
+       @$(RM) $@
+       @$(TOUCH) "$@"
+
+.help::
+       @$(ECHO) xdc test,e66
+       @$(ECHO) xdc .executables,e66
+       @$(ECHO) xdc .libraries,e66
+       @$(ECHO) xdc .dlls,e66
+
+
+all: .executables 
+.executables: .libraries .dlls
+.libraries: .interfaces
+
+PKGCFGS := $(wildcard package.xs) package/build.cfg
+.interfaces: package/package.xdc.inc package/package.defs.h package.xdc $(PKGCFGS)
+
+-include package/package.xdc.dep
+package/%.xdc.inc package/%_xconfig_app.c package/%.defs.h: %.xdc $(PKGCFGS)
+       @$(MSG) generating interfaces for package xconfig_app" (because $@ is older than $(firstword $?))" ...
+       $(XSRUN) -f xdc/services/intern/cmd/build.xs $(MK_IDLOPTS) -m package/package.xdc.dep -i package/package.xdc.inc package.xdc
+
+.dlls,e66 .dlls: app.pe66
+
+-include package/cfg/app_pe66.mak
+-include package/cfg/app_pe66.cfg.mak
+ifeq (,$(MK_NOGENDEPS))
+-include package/cfg/app_pe66.dep
+endif
+app.pe66: package/cfg/app_pe66.xdl
+       @
+
+
+ifeq (,$(wildcard .libraries,e66))
+app.pe66 package/cfg/app_pe66.c: .libraries,e66
+endif
+
+package/cfg/app_pe66.c package/cfg/app_pe66.h package/cfg/app_pe66.xdl: override _PROG_NAME := app.xe66
+package/cfg/app_pe66.c: package/cfg/app_pe66.cfg
+package/cfg/app_pe66.xdc.inc: package/cfg/app_pe66.xdl
+package/cfg/app_pe66.xdl package/cfg/app_pe66.c: .interfaces
+
+clean:: clean,e66
+       -$(RM) package/cfg/app_pe66.cfg
+       -$(RM) package/cfg/app_pe66.dep
+       -$(RM) package/cfg/app_pe66.c
+       -$(RM) package/cfg/app_pe66.xdc.inc
+
+clean,e66::
+       -$(RM) app.pe66
+.executables,e66 .executables: app.xe66
+
+app.xe66: |app.pe66
+
+-include package/cfg/app.xe66.mak
+app.xe66: package/cfg/app_pe66.oe66 
+       $(RM) $@
+       @$(MSG) lnke66 $@ ...
+       $(RM) $(XDCCFGDIR)/$@.map
+       $(ti.targets.elf.C66.rootDir)/bin/cl6x -fs $(XDCCFGDIR)$(dir $@). -q -u _c_int00 --abi=eabi -z  -o $@ package/cfg/app_pe66.oe66   package/cfg/app_pe66.xdl  -w -c -m $(XDCCFGDIR)/$@.map -l $(ti.targets.elf.C66.rootDir)/lib/libc.a
+       
+app.xe66: export C_DIR=
+app.xe66: PATH:=$(ti.targets.elf.C66.rootDir)/bin/;$(PATH)
+app.xe66: Path:=$(ti.targets.elf.C66.rootDir)/bin/;$(PATH)
+
+app.test test,e66 test: app.xe66.test
+
+app.xe66.test:: app.xe66
+ifeq (,$(_TESTLEVEL))
+       @$(MAKE) -R -r --no-print-directory -f $(XDCROOT)/packages/xdc/bld/xdc.mak _TESTLEVEL=1 app.xe66.test
+else
+       @$(MSG) running $<  ...
+       $(call EXEC.app.xe66, ) 
+endif
+
+clean,e66::
+       -$(RM) $(wildcard .tmp,app.xe66,*)
+
+
+clean:: clean,e66
+
+clean,e66::
+       -$(RM) app.xe66
+%,copy:
+       @$(if $<,,$(MSG) don\'t know how to build $*; exit 1)
+       @$(MSG) cp $< $@
+       $(RM) $@
+       $(CP) $< $@
+app_pe66.oe66,copy : package/cfg/app_pe66.oe66
+app_pe66.se66,copy : package/cfg/app_pe66.se66
+
+$(XDCCFGDIR)%.c $(XDCCFGDIR)%.h $(XDCCFGDIR)%.xdl: $(XDCCFGDIR)%.cfg $(XDCROOT)/packages/xdc/cfg/Main.xs | .interfaces
+       @$(MSG) "configuring $(_PROG_NAME) from $< ..."
+       $(CONFIG) $(_PROG_XSOPTS) xdc.cfg $(_PROG_NAME) $(XDCCFGDIR)$*.cfg $(XDCCFGDIR)$*
+
+.PHONY: release,xconfig_app
+ifeq (,$(MK_NOGENDEPS))
+-include package/rel/xconfig_app.tar.dep
+endif
+package/rel/xconfig_app/xconfig_app/package/package.rel.xml: package/package.bld.xml
+package/rel/xconfig_app/xconfig_app/package/package.rel.xml: package/build.cfg
+package/rel/xconfig_app/xconfig_app/package/package.rel.xml: package/package.xdc.inc
+package/rel/xconfig_app/xconfig_app/package/package.rel.xml: .force
+       @$(MSG) generating external release references $@ ...
+       $(XS) $(JSENV) -f $(XDCROOT)/packages/xdc/bld/rel.js $(MK_RELOPTS) . $@
+
+xconfig_app.tar: package/rel/xconfig_app.xdc.inc package/rel/xconfig_app/xconfig_app/package/package.rel.xml
+       @$(MSG) making release file $@ "(because of $(firstword $?))" ...
+       -$(RM) $@
+       $(call MKRELTAR,package/rel/xconfig_app.xdc.inc,package/rel/xconfig_app.tar.dep)
+
+
+release release,xconfig_app: all xconfig_app.tar
+clean:: .clean
+       -$(RM) xconfig_app.tar
+       -$(RM) package/rel/xconfig_app.xdc.inc
+       -$(RM) package/rel/xconfig_app.tar.dep
+
+clean:: .clean
+       -$(RM) .libraries $(wildcard .libraries,*)
+clean:: 
+       -$(RM) .dlls $(wildcard .dlls,*)
+#
+# The following clean rule removes user specified
+# generated files or directories.
+#
+
+ifneq (clean,$(MAKECMDGOALS))
+ifeq (,$(wildcard package))
+    $(shell $(MKDIR) package)
+endif
+ifeq (,$(wildcard package/cfg))
+    $(shell $(MKDIR) package/cfg)
+endif
+ifeq (,$(wildcard package/lib))
+    $(shell $(MKDIR) package/lib)
+endif
+ifeq (,$(wildcard package/rel))
+    $(shell $(MKDIR) package/rel)
+endif
+ifeq (,$(wildcard package/internal))
+    $(shell $(MKDIR) package/internal)
+endif
+endif
+clean::
+       -$(RMDIR) package
+
+include custom.mak
diff --git a/file_demo_bios/k2g/.config/xconfig_app/package.xdc b/file_demo_bios/k2g/.config/xconfig_app/package.xdc
new file mode 100644 (file)
index 0000000..5428985
--- /dev/null
@@ -0,0 +1,7 @@
+/*!
+ * Package generated by xdc.tools.configuro
+ *
+ * @_nodoc
+ */
+package xconfig_app {
+}
diff --git a/file_demo_bios/k2g/.config/xconfig_app/package.xs b/file_demo_bios/k2g/.config/xconfig_app/package.xs
new file mode 100644 (file)
index 0000000..373d44f
--- /dev/null
@@ -0,0 +1,20 @@
+/* THIS IS A GENERATED FILE -- DO NOT EDIT */
+
+/* return the names of the generated config objects */
+function getLibs(prog) {
+    /* for programs, push the generated config object file into the
+     * generated linker command file.
+     */
+    /* replace the last period in the name by an underscore */
+    var name = "package/cfg/" + prog.name.replace(/\.([^.]*)$/, "_$1");
+    /* base is a hack until we add cfgName to Program */
+    var base = "package/cfg/" + prog.name.replace(/\.([^.]*)$/, "");
+    var suffix = prog.build.target.suffix;
+
+    var libs = [
+//        name + '.o' + suffix, 
+        base + '_p' + suffix + '.o' + suffix
+    ];
+
+    return libs.join(';');
+}
diff --git a/file_demo_bios/k2g/.config/xconfig_app/package/.vers_b160 b/file_demo_bios/k2g/.config/xconfig_app/package/.vers_b160
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/file_demo_bios/k2g/.config/xconfig_app/package/.vers_g180 b/file_demo_bios/k2g/.config/xconfig_app/package/.vers_g180
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/file_demo_bios/k2g/.config/xconfig_app/package/.vers_r170 b/file_demo_bios/k2g/.config/xconfig_app/package/.vers_r170
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/file_demo_bios/k2g/.config/xconfig_app/package/.xdc-B06 b/file_demo_bios/k2g/.config/xconfig_app/package/.xdc-B06
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/file_demo_bios/k2g/.config/xconfig_app/package/build.cfg b/file_demo_bios/k2g/.config/xconfig_app/package/build.cfg
new file mode 100644 (file)
index 0000000..5ec1eb1
--- /dev/null
@@ -0,0 +1,9 @@
+if (pkg.$vers.length >= 3) {
+    pkg.$vers.push(Packages.xdc.services.global.Vers.getDate(xdc.csd() + '/..'));
+}
+
+pkg.build.libraries = [
+];
+
+pkg.build.libDesc = [
+];
diff --git a/file_demo_bios/k2g/.config/xconfig_app/package/cfg/app.xe66.mak b/file_demo_bios/k2g/.config/xconfig_app/package/cfg/app.xe66.mak
new file mode 100644 (file)
index 0000000..4dad3a9
--- /dev/null
@@ -0,0 +1,11 @@
+#
+#  Do not edit this file.  This file is generated from 
+#  package.bld.  Any modifications to this file will be 
+#  overwritten whenever makefiles are re-generated.
+#
+#  target compatibility key = ti.targets.elf.C66{1,0,8.1,0
+#
+app.xe66: package/cfg/app.xe66.mak
+
+clean::
+       -$(RM) package/cfg/app.xe66.mak
diff --git a/file_demo_bios/k2g/.config/xconfig_app/package/cfg/app_pe66.cfg b/file_demo_bios/k2g/.config/xconfig_app/package/cfg/app_pe66.cfg
new file mode 100644 (file)
index 0000000..f817fc3
--- /dev/null
@@ -0,0 +1,275 @@
+/*
+ *  ======== package/cfg/app_pe66.cfg ========
+ *  This generated configuration script runs the user's configuration script
+ *  the context of a specific target and platform in order to generate
+ *  all the files necessary to create an executable; e.g., linker command
+ *  files, static C/C++ data structures, etc.
+ */
+
+/*
+ *  ======== _applyChanges ========
+ *  Changes that bring the build target to the state at the end of the build
+ *  model
+ */
+function _applyChanges(obj, chgObj) {
+    var wasSealed = false;
+    if (obj.$sealed) {
+        wasSealed = true;
+        obj.$unseal();
+    }
+    for (var prop in chgObj) {
+        if (typeof obj[prop] == 'object' && obj[prop] != undefined) {
+            if ("$category" in obj[prop] && obj[prop].$category == "Vector") {
+               obj[prop].length = chgObj[prop].length;
+               for (var i = 0; i < chgObj[prop].length; i++) {
+                   if (obj[prop].length < i + 1) {
+                       obj[prop].length++;
+                   }
+                   obj[prop][i] = chgObj[prop][i];
+               }
+            }
+            else {
+               _applyChanges(obj[prop], chgObj[prop]);
+            }
+       }
+       else {
+            obj[prop] = chgObj[prop];
+       }
+    }
+    if (wasSealed) {
+        obj.$seal();
+    }
+}
+
+/*
+ *  ======== _runescape ========
+ *  Recursive unescape to decode serialized strings
+ */
+function _runescape(obj) {
+    for (var i in obj) {
+       if (obj[i] != null) {
+           if (typeof obj[i] == 'string') {
+               obj[i] = unescape(obj[i]);
+           }
+           else if (typeof obj[i] == 'object') {
+               _runescape(obj[i]);
+           }
+       }
+    }
+}
+
+/*
+ *  ======== _getPlatCfg ========
+ */
+function _getPlatCfg() {
+    var tmp = {};
+    _runescape(tmp);
+    return (tmp);
+}
+/*
+ *  ======== _cfginit ========
+ */
+function _cfginit() {
+    xdc.loadPackage('xdc.services.intern.cmd');
+    var prog = xdc.om['xdc.cfg.Program'];
+
+    /* initialize prog attrs from build model */
+    var build = {
+        profile: "release",
+        cfgScript: "C%3A/ti/noise-reduction/file_demo_bios/k2g/app.cfg",
+        cfgHome: "xconfig_app",
+        cfgArgs: "null",
+        cfgArgsEncoded: true,
+        releases: {
+            0: {
+                name: "xconfig_app",
+                attrs: {
+                    prefix: "",
+                    label: "default"
+                },
+                otherFiles: {},
+                excludeDirs: {}
+            }
+        },
+        prelink: false
+    };
+    _runescape(build);
+    build.cfgArgs = null;
+    build.target = xdc.module("ti.targets.elf.C66");
+    var targChange = {
+        platforms: [
+            "ti.platforms.simTCI6616"
+        ],
+        version: "ti.targets.elf.C66%7B1%2C0%2C8.1%2C0",
+        extensions: {
+            ".se66": {
+                suf: ".se66",
+                typ: "asm"
+            },
+            ".s66": {
+                suf: ".s66",
+                typ: "asm"
+            },
+            ".s674": {
+                suf: ".s674",
+                typ: "asm"
+            },
+            ".s64P": {
+                suf: ".s64P",
+                typ: "asm"
+            },
+            ".s64": {
+                suf: ".s64",
+                typ: "asm"
+            },
+            ".s62": {
+                suf: ".s62",
+                typ: "asm"
+            }
+        },
+        rootDir: "C%3A/ti/ccsv6/tools/compiler/ti-cgt-c6000_8.1.0",
+        ccOpts: {
+            prefix: "-g%20--optimize_with_debug%20-qq%20-pdsw225"
+        },
+        rawVersion: "8.1.0"
+    };
+    _runescape(targChange);
+    _applyChanges(build.target, targChange);
+
+    prog.build = build;
+
+    prog.name = "app.xe66";
+    prog.cfgBase = "package/cfg/app_pe66";
+
+    prog.endian = prog.build.target.model.endian;
+
+    /* use the platform package's Platform module */
+    var Platform = xdc.useModule("evmK2GCustom.Platform");
+    var platParams = _getPlatCfg();
+    var invalidParams = [];
+    for (var prop in platParams) {
+        if (!(prop in Platform.PARAMS)) {
+            delete platParams[prop];
+            invalidParams.push(prop);
+        }
+    }
+    prog.platformName = "evmK2GCustom";
+    prog.platform = Platform.create("", platParams);
+    for (var i = 0; i < invalidParams.length; i++) {
+        Platform.$logWarning("The parameter '" + invalidParams[i] + "' is " +
+            "passed to this platform instance through Build.platformTable, " +
+            "but the instance does not have a configuration parameter with " +
+            "that name.", prog.platform, "");
+    }
+
+    /* record the executable's package name */
+    prog.buildPackage = "xconfig_app";
+
+    /* record build-model information required during config generation */
+    prog.$$bind("$$isasm", 0);
+    prog.$$bind("$$isrom", 0);
+    prog.$$bind("$$gentab", [
+    ]);
+
+    /* bind prog to an appropriate execution context */
+    prog.cpu = prog.platform.getExeContext(prog);
+
+    /* import the target's run-time support pkg */
+    xdc.loadPackage("ti.targets.rts6000");
+}
+
+/* function to import the cfg script's package */
+function _userscript(script) {
+    var home;
+    var spath;
+    home = xdc.loadPackage("xconfig_app");
+
+    xdc.om.$$bind('$homepkg', home);
+
+    var cfgScript = "C:/ti/noise-reduction/file_demo_bios/k2g/app.cfg";
+    if (!script) {
+        utils.loadCapsule(cfgScript, false, spath);
+    }
+    else {
+        /* set up the same environment that loadCapsule would */
+        var $saveCsd = utils.csd;
+        var $cfgFile = utils.findFile(cfgScript, spath);
+        var cname = cfgScript;
+        if ($cfgFile) {
+            $cfgFile = java.io.File($cfgFile);
+            utils.csd = $cfgFile.getParentFile().getCanonicalPath();
+            cname = "" + $cfgFile.getCanonicalPath();
+        }
+
+        /* create the capsule object */
+        var cap = {
+            prototype:  utils.global,
+            $path:      cname,
+            $private:   {path: cname},
+            $capsule:   undefined,      /* set to cap below */
+        };
+
+        /* 'this.$capsule' is always cap object */
+        cap.$capsule = cap;
+
+        /* save the capsule object */
+        utils.$$capmap[cname] = cap;
+
+        try {
+            var cx =
+                Packages.org.mozilla.javascript.Context.getCurrentContext();
+            var rdr = new
+                java.io.BufferedReader(new java.io.StringReader(script));
+            Packages.config.Shell.evaluateLoad(cx, cap, rdr, cname, 1);
+        }
+        finally {
+            rdr.close();
+            utils.csd = $saveCsd;
+        }
+    }
+}
+
+function _postinit() {
+    var cout = null;
+
+    var Program = xdc.om['xdc.cfg.Program'];
+    /* get the exec command for this executable */
+    if (Program.execCmd == null) {
+        Program.execCmd = Program.platform.getExecCmd(Program,
+            xdc.om["evmK2GCustom"].packageBase);
+    }
+    cout = "define EXEC." + Program.name + '\n\n';
+    cout += Program.execCmd;
+    cout += "\nendef\n\n";
+
+    /* if SourceDir generates a makefile, we need to run it */
+    _genSourceDirMak("package/cfg/app_pe66", "app.pe66");
+
+    utils.genDep("package/cfg/app_pe66", "xconfig_app", utils.loadedFiles, cout, null);
+}
+
+function _genSourceDirMak(cfgBase, cfgName)
+{
+    var SourceDir = xdc.om['xdc.cfg.SourceDir'];
+
+    if (SourceDir && SourceDir.$instances.length > 0) {
+        /* construct rule to run SourceDir generated makefile */
+        var make = "\t$(MAKE) -f "
+            + SourceDir.outputDir + "/" + SourceDir.makefileName;
+
+        /* this file is included by package.mak (if it exists) */
+        var file = new java.io.File(cfgBase + ".cfg.mak");
+        file["delete"]();
+        var out = new java.io.BufferedWriter(new java.io.FileWriter(file));
+
+        /* add rules to run SourceDir generated makefile */
+        out.write("# invoke SourceDir generated makefile for " + cfgName
+            + "\n" + cfgName + ": .libraries," + cfgName
+            + "\n.libraries," + cfgName + ": " + cfgBase + ".xdl\n"
+            + make + "\n\n"
+            + "clean::\n" + make + " clean\n\n"
+        );
+        out.close();
+        out = null;
+    }
+}
diff --git a/file_demo_bios/k2g/.config/xconfig_app/package/cfg/app_pe66.mak b/file_demo_bios/k2g/.config/xconfig_app/package/cfg/app_pe66.mak
new file mode 100644 (file)
index 0000000..7a49033
--- /dev/null
@@ -0,0 +1,46 @@
+#
+#  Do not edit this file.  This file is generated from 
+#  package.bld.  Any modifications to this file will be 
+#  overwritten whenever makefiles are re-generated.
+#
+#  target compatibility key = ti.targets.elf.C66{1,0,8.1,0
+#
+ifeq (,$(MK_NOGENDEPS))
+-include package/cfg/app_pe66.oe66.dep
+package/cfg/app_pe66.oe66.dep: ;
+endif
+
+package/cfg/app_pe66.oe66: | .interfaces
+package/cfg/app_pe66.oe66: package/cfg/app_pe66.c package/cfg/app_pe66.mak
+       @$(RM) $@.dep
+       $(RM) $@
+       @$(MSG) cle66 $< ...
+       $(ti.targets.elf.C66.rootDir)/bin/cl6x -c  -g --optimize_with_debug -qq -pdsw225 -mo -mv6600 --abi=eabi -eo.oe66 -ea.se66   -Dxdc_cfg__xheader__='"xconfig_app/package/cfg/app_pe66.h"'  -Dxdc_target_name__=C66 -Dxdc_target_types__=ti/targets/elf/std.h -Dxdc_bld__profile_release -Dxdc_bld__vers_1_0_8_1_0 -O2  $(XDCINCS) -I$(ti.targets.elf.C66.rootDir)/include -fs=./package/cfg -fr=./package/cfg -fc $<
+       $(MKDEP) -a $@.dep -p package/cfg -s oe66 $< -C   -g --optimize_with_debug -qq -pdsw225 -mo -mv6600 --abi=eabi -eo.oe66 -ea.se66   -Dxdc_cfg__xheader__='"xconfig_app/package/cfg/app_pe66.h"'  -Dxdc_target_name__=C66 -Dxdc_target_types__=ti/targets/elf/std.h -Dxdc_bld__profile_release -Dxdc_bld__vers_1_0_8_1_0 -O2  $(XDCINCS) -I$(ti.targets.elf.C66.rootDir)/include -fs=./package/cfg -fr=./package/cfg
+       -@$(FIXDEP) $@.dep $@.dep
+       
+package/cfg/app_pe66.oe66: export C_DIR=
+package/cfg/app_pe66.oe66: PATH:=$(ti.targets.elf.C66.rootDir)/bin/;$(PATH)
+package/cfg/app_pe66.oe66: Path:=$(ti.targets.elf.C66.rootDir)/bin/;$(PATH)
+
+package/cfg/app_pe66.se66: | .interfaces
+package/cfg/app_pe66.se66: package/cfg/app_pe66.c package/cfg/app_pe66.mak
+       @$(RM) $@.dep
+       $(RM) $@
+       @$(MSG) cle66 -n $< ...
+       $(ti.targets.elf.C66.rootDir)/bin/cl6x -c -n -s --symdebug:none -g --optimize_with_debug -qq -pdsw225 -mv6600 --abi=eabi -eo.oe66 -ea.se66   -Dxdc_cfg__xheader__='"xconfig_app/package/cfg/app_pe66.h"'  -Dxdc_target_name__=C66 -Dxdc_target_types__=ti/targets/elf/std.h -Dxdc_bld__profile_release -Dxdc_bld__vers_1_0_8_1_0 -O2  $(XDCINCS) -I$(ti.targets.elf.C66.rootDir)/include -fs=./package/cfg -fr=./package/cfg -fc $<
+       $(MKDEP) -a $@.dep -p package/cfg -s oe66 $< -C  -n -s --symdebug:none -g --optimize_with_debug -qq -pdsw225 -mv6600 --abi=eabi -eo.oe66 -ea.se66   -Dxdc_cfg__xheader__='"xconfig_app/package/cfg/app_pe66.h"'  -Dxdc_target_name__=C66 -Dxdc_target_types__=ti/targets/elf/std.h -Dxdc_bld__profile_release -Dxdc_bld__vers_1_0_8_1_0 -O2  $(XDCINCS) -I$(ti.targets.elf.C66.rootDir)/include -fs=./package/cfg -fr=./package/cfg
+       -@$(FIXDEP) $@.dep $@.dep
+       
+package/cfg/app_pe66.se66: export C_DIR=
+package/cfg/app_pe66.se66: PATH:=$(ti.targets.elf.C66.rootDir)/bin/;$(PATH)
+package/cfg/app_pe66.se66: Path:=$(ti.targets.elf.C66.rootDir)/bin/;$(PATH)
+
+clean,e66 ::
+       -$(RM) package/cfg/app_pe66.oe66
+       -$(RM) package/cfg/app_pe66.se66
+
+app.pe66: package/cfg/app_pe66.oe66 package/cfg/app_pe66.mak
+
+clean::
+       -$(RM) package/cfg/app_pe66.mak
diff --git a/file_demo_bios/k2g/.config/xconfig_app/package/package.bld.xml b/file_demo_bios/k2g/.config/xconfig_app/package/package.bld.xml
new file mode 100644 (file)
index 0000000..a430ff0
--- /dev/null
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="windows-1252"?>
+<!--  This file conforms to the DTD xdc/bld/build.dtd -->
+<package name="xconfig_app" version="" producerId="undefined">
+    <units>
+    </units>
+    <sources>
+        <srcFile name="package/cfg/app_pe66.c"/>
+    </sources>
+    <configscripts>
+        <srcFile name="C:/ti/noise-reduction/file_demo_bios/k2g/app.cfg"/>
+    </configscripts>
+    <makefiles>
+        <srcFile name="package.mak" src="package.bld"/>
+        <srcFile name="package/package.xdc.dep" src="package.xdc"/>
+        <srcFile name="package/cfg/app_pe66.mak" src="package.bld"/>
+        <srcFile name="package/cfg/app_pe66.oe66.dep" src="package/cfg/app_pe66.c"/>
+        <srcFile name="package/cfg/app_pe66.dep" src="package/cfg/app_pe66.cfg"/>
+        <srcFile name="package/cfg/app.xe66.mak" src="package.bld"/>
+        <srcFile name="package/rel/xconfig_app.tar.dep" src="package/rel/xconfig_app.xdc.inc"/>
+    </makefiles>
+    <targets>
+        <target name="ti.targets.elf.C66"
+            version="ti.targets.elf.C66{1,0,8.1,0"
+            rawVersion="8.1.0"
+            platform="ti.platforms.simTCI6616"
+            isa="66"
+            suffix="e66"
+            rootDir="C:/ti/ccsv6/tools/compiler/ti-cgt-c6000_8.1.0"
+            os="undefined"
+            rts="ti.targets.rts6000">
+            <model endian="little"
+                codeModel="undefined"
+                dataModel="undefined"/>
+        </target>
+    </targets>
+    <libraries>
+    </libraries>
+    <configurations>
+    <configuration name="app"
+        pname="app.pe66"
+        target="ti.targets.elf.C66"
+        platform="evmK2GCustom"
+        profile="release"
+        isPartial="false"
+        xCfgScript="package/cfg/app_pe66.cfg"
+        xCfgPrefix="package/cfg/app_pe66"
+        cfgScript="C:/ti/noise-reduction/file_demo_bios/k2g/app.cfg"
+        cfgArgs="null"
+        />
+    </configurations>
+    <executables>
+    <executable name="app"
+        pname="app.xe66"
+        target="ti.targets.elf.C66"
+        platform="evmK2GCustom"
+        profile="release"
+        xCfgScript="package/cfg/app_pe66.cfg"
+        xCfgPrefix="package/cfg/app_pe66"
+        cfgScript="C:/ti/noise-reduction/file_demo_bios/k2g/app.cfg"
+        cfgArgs="null"
+        />
+    </executables>
+    <tests>
+    <test exeName="app.xe66"
+        args=""
+        groupName="app.xe66"
+        refOutput="undefined"
+        refExitCode="0"
+        execArgs=""
+        />
+    </tests>
+    <releases relDir="package/rel/">
+    <release name="xconfig_app"
+        pname="xconfig_app.tar"
+        label="default"
+    >
+        <file name="package/package.bld.xml"/>
+        <file name="package/build.cfg"/>
+        <file name="package/package.xdc.inc"/>
+    </release>
+    </releases>
+    <repositories>
+    </repositories>
+</package>
diff --git a/file_demo_bios/k2g/.config/xconfig_app/package/package.defs.h b/file_demo_bios/k2g/.config/xconfig_app/package/package.defs.h
new file mode 100644 (file)
index 0000000..1c810f2
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ *  Do not modify this file; it is automatically 
+ *  generated and any modifications will be overwritten.
+ *
+ * @(#) xdc-B06
+ */
+
+#ifndef xconfig_app__
+#define xconfig_app__
+
+
+
+#endif /* xconfig_app__ */ 
diff --git a/file_demo_bios/k2g/.config/xconfig_app/package/package.xdc.dep b/file_demo_bios/k2g/.config/xconfig_app/package/package.xdc.dep
new file mode 100644 (file)
index 0000000..5c1773e
--- /dev/null
@@ -0,0 +1,53 @@
+clean::\r
+       $(RM) package/xconfig_app.sch\r
+       $(RM) package/.vers_g180\r
+       $(RM) package/.vers_r170\r
+       $(RM) package/.vers_b160\r
+       $(RM) package/.xdc-B06\r
+       $(RM) package/xconfig_app.java\r
+       $(RM) package/xconfig_app.class\r
+       $(RM) package/package_xconfig_app.c\r
+       $(RM) package/package.defs.h\r
+       $(RM) package/xconfig_app.ccs\r
+
+.interfaces: package/xconfig_app.sch package/.vers_g180 package/.vers_r170 package/.vers_b160 package/.xdc-B06 package/xconfig_app.java package/package_xconfig_app.c package/package.defs.h package/xconfig_app.ccs 
+package/package.xdc.inc: package/.vers_g180
+package/.vers_g180:
+package/package.xdc.inc: package/.vers_r170
+package/.vers_r170:
+package/package.xdc.inc: package/.vers_b160
+package/.vers_b160:
+
+.interfaces: 
+
+# schema include file dependencies
+package.xs:\r
+package/package.xdc.inc: package.xs\r
+
+# schema update dependencies
+package/package.xdc.inc: xdc/IPackage.xdc\r
+xdc/IPackage.xdc:\r
+vpath xdc/IPackage.xdc $(XPKGVPATH)\r
+
+ifneq (clean,$(MAKECMDGOALS))
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/shelf/java/ecj.jar:\r
+package/package.xdc.inc: C:/ti/xdctools_3_32_00_06_core/packages/xdc/shelf/java/ecj.jar\r
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/services/intern/gen/java/package.jar:\r
+package/package.xdc.inc: C:/ti/xdctools_3_32_00_06_core/packages/xdc/services/intern/gen/java/package.jar\r
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/services/intern/cmd/java/package.jar:\r
+package/package.xdc.inc: C:/ti/xdctools_3_32_00_06_core/packages/xdc/services/intern/cmd/java/package.jar\r
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/shelf/java/js.jar:\r
+package/package.xdc.inc: C:/ti/xdctools_3_32_00_06_core/packages/xdc/shelf/java/js.jar\r
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/services/global/java/package.jar:\r
+package/package.xdc.inc: C:/ti/xdctools_3_32_00_06_core/packages/xdc/services/global/java/package.jar\r
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/shelf/java/antlr.jar:\r
+package/package.xdc.inc: C:/ti/xdctools_3_32_00_06_core/packages/xdc/shelf/java/antlr.jar\r
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/services/intern/xsr/java/package.jar:\r
+package/package.xdc.inc: C:/ti/xdctools_3_32_00_06_core/packages/xdc/services/intern/xsr/java/package.jar\r
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/shelf/java/tar.jar:\r
+package/package.xdc.inc: C:/ti/xdctools_3_32_00_06_core/packages/xdc/shelf/java/tar.jar\r
+C:/ti/xdctools_3_32_00_06_core/packages/xdc/services/spec/java/package.jar:\r
+package/package.xdc.inc: C:/ti/xdctools_3_32_00_06_core/packages/xdc/services/spec/java/package.jar\r
+endif
+# goals for files generated during schema generation but unspecified by schema's pattern rule
+
diff --git a/file_demo_bios/k2g/.config/xconfig_app/package/package.xdc.inc b/file_demo_bios/k2g/.config/xconfig_app/package/package.xdc.inc
new file mode 100644 (file)
index 0000000..65d6084
--- /dev/null
@@ -0,0 +1,12 @@
+package.xdc\r
+package.xs\r
+package/xconfig_app.sch\r
+package/.vers_g180\r
+package/.vers_r170\r
+package/.vers_b160\r
+package/.xdc-B06\r
+package/xconfig_app.java\r
+package/xconfig_app.class\r
+package/package_xconfig_app.c\r
+package/package.defs.h\r
+package/xconfig_app.ccs\r
diff --git a/file_demo_bios/k2g/.config/xconfig_app/package/package_xconfig_app.c b/file_demo_bios/k2g/.config/xconfig_app/package/package_xconfig_app.c
new file mode 100644 (file)
index 0000000..e0e9b92
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ *  Do not modify this file; it is automatically 
+ *  generated and any modifications will be overwritten.
+ *
+ * @(#) xdc-B06
+ */
+
+#include <xdc/std.h>
+
+__FAR__ char xconfig_app__dummy__;
+
+#define __xdc_PKGVERS null
+#define __xdc_PKGNAME xconfig_app
+#define __xdc_PKGPREFIX xconfig_app_
+
+#ifdef __xdc_bld_pkg_c__
+#define __stringify(a) #a
+#define __local_include(a) __stringify(a)
+#include __local_include(__xdc_bld_pkg_c__)
+#endif
+
diff --git a/file_demo_bios/k2g/.config/xconfig_app/package/rel/xconfig_app.xdc.inc b/file_demo_bios/k2g/.config/xconfig_app/package/rel/xconfig_app.xdc.inc
new file mode 100644 (file)
index 0000000..0f839ef
--- /dev/null
@@ -0,0 +1,3 @@
+package/package.bld.xml
+package/build.cfg
+package/package.xdc.inc
diff --git a/file_demo_bios/k2g/.config/xconfig_app/package/rel/xconfig_app.xdc.ninc b/file_demo_bios/k2g/.config/xconfig_app/package/rel/xconfig_app.xdc.ninc
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/file_demo_bios/k2g/.config/xconfig_app/package/xconfig_app.ccs b/file_demo_bios/k2g/.config/xconfig_app/package/xconfig_app.ccs
new file mode 100644 (file)
index 0000000..40884d8
Binary files /dev/null and b/file_demo_bios/k2g/.config/xconfig_app/package/xconfig_app.ccs differ
diff --git a/file_demo_bios/k2g/.config/xconfig_app/package/xconfig_app.class b/file_demo_bios/k2g/.config/xconfig_app/package/xconfig_app.class
new file mode 100644 (file)
index 0000000..433b0b9
Binary files /dev/null and b/file_demo_bios/k2g/.config/xconfig_app/package/xconfig_app.class differ
diff --git a/file_demo_bios/k2g/.config/xconfig_app/package/xconfig_app.java b/file_demo_bios/k2g/.config/xconfig_app/package/xconfig_app.java
new file mode 100644 (file)
index 0000000..f74f0b0
--- /dev/null
@@ -0,0 +1,143 @@
+/*
+ *  Do not modify this file; it is automatically 
+ *  generated and any modifications will be overwritten.
+ *
+ * @(#) xdc-B06
+ */
+import java.util.*;
+import org.mozilla.javascript.*;
+import xdc.services.intern.xsr.*;
+import xdc.services.spec.Session;
+
+public class xconfig_app
+{
+    static final String VERS = "@(#) xdc-B06\n";
+
+    static final Proto.Elm $$T_Bool = Proto.Elm.newBool();
+    static final Proto.Elm $$T_Num = Proto.Elm.newNum();
+    static final Proto.Elm $$T_Str = Proto.Elm.newStr();
+    static final Proto.Elm $$T_Obj = Proto.Elm.newObj();
+
+    static final Proto.Fxn $$T_Met = new Proto.Fxn(null, null, 0, -1, false);
+    static final Proto.Map $$T_Map = new Proto.Map($$T_Obj);
+    static final Proto.Arr $$T_Vec = new Proto.Arr($$T_Obj);
+
+    static final XScriptO $$DEFAULT = Value.DEFAULT;
+    static final Object $$UNDEF = Undefined.instance;
+
+    static final Proto.Obj $$Package = (Proto.Obj)Global.get("$$Package");
+    static final Proto.Obj $$Module = (Proto.Obj)Global.get("$$Module");
+    static final Proto.Obj $$Instance = (Proto.Obj)Global.get("$$Instance");
+    static final Proto.Obj $$Params = (Proto.Obj)Global.get("$$Params");
+
+    static final Object $$objFldGet = Global.get("$$objFldGet");
+    static final Object $$objFldSet = Global.get("$$objFldSet");
+    static final Object $$proxyGet = Global.get("$$proxyGet");
+    static final Object $$proxySet = Global.get("$$proxySet");
+    static final Object $$delegGet = Global.get("$$delegGet");
+    static final Object $$delegSet = Global.get("$$delegSet");
+
+    Scriptable xdcO;
+    Session ses;
+    Value.Obj om;
+
+    boolean isROV;
+    boolean isCFG;
+
+    Proto.Obj pkgP;
+    Value.Obj pkgV;
+
+    ArrayList<Object> imports = new ArrayList<Object>();
+    ArrayList<Object> loggables = new ArrayList<Object>();
+    ArrayList<Object> mcfgs = new ArrayList<Object>();
+    ArrayList<Object> icfgs = new ArrayList<Object>();
+    ArrayList<String> inherits = new ArrayList<String>();
+    ArrayList<Object> proxies = new ArrayList<Object>();
+    ArrayList<Object> sizes = new ArrayList<Object>();
+    ArrayList<Object> tdefs = new ArrayList<Object>();
+
+    void $$IMPORTS()
+    {
+        Global.callFxn("loadPackage", xdcO, "xdc");
+        Global.callFxn("loadPackage", xdcO, "xdc.corevers");
+    }
+
+    void $$OBJECTS()
+    {
+        pkgP = (Proto.Obj)om.bind("xconfig_app.Package", new Proto.Obj());
+        pkgV = (Value.Obj)om.bind("xconfig_app", new Value.Obj("xconfig_app", pkgP));
+    }
+
+    void $$SINGLETONS()
+    {
+        pkgP.init("xconfig_app.Package", (Proto.Obj)om.findStrict("xdc.IPackage.Module", "xconfig_app"));
+        Scriptable cap = (Scriptable)Global.callFxn("loadCapsule", xdcO, "xconfig_app/package.xs");
+        om.bind("xdc.IPackage$$capsule", cap);
+        Object fxn;
+                fxn = Global.get(cap, "init");
+                if (fxn != null) pkgP.addFxn("init", (Proto.Fxn)om.findStrict("xdc.IPackage$$init", "xconfig_app"), fxn);
+                fxn = Global.get(cap, "close");
+                if (fxn != null) pkgP.addFxn("close", (Proto.Fxn)om.findStrict("xdc.IPackage$$close", "xconfig_app"), fxn);
+                fxn = Global.get(cap, "validate");
+                if (fxn != null) pkgP.addFxn("validate", (Proto.Fxn)om.findStrict("xdc.IPackage$$validate", "xconfig_app"), fxn);
+                fxn = Global.get(cap, "exit");
+                if (fxn != null) pkgP.addFxn("exit", (Proto.Fxn)om.findStrict("xdc.IPackage$$exit", "xconfig_app"), fxn);
+                fxn = Global.get(cap, "getLibs");
+                if (fxn != null) pkgP.addFxn("getLibs", (Proto.Fxn)om.findStrict("xdc.IPackage$$getLibs", "xconfig_app"), fxn);
+                fxn = Global.get(cap, "getSects");
+                if (fxn != null) pkgP.addFxn("getSects", (Proto.Fxn)om.findStrict("xdc.IPackage$$getSects", "xconfig_app"), fxn);
+        pkgP.bind("$capsule", cap);
+        pkgV.init2(pkgP, "xconfig_app", Value.DEFAULT, false);
+        pkgV.bind("$name", "xconfig_app");
+        pkgV.bind("$category", "Package");
+        pkgV.bind("$$qn", "xconfig_app.");
+        pkgV.bind("$vers", Global.newArray());
+        Value.Map atmap = (Value.Map)pkgV.getv("$attr");
+        atmap.seal("length");
+        imports.clear();
+        pkgV.bind("$imports", imports);
+        StringBuilder sb = new StringBuilder();
+        sb.append("var pkg = xdc.om['xconfig_app'];\n");
+        sb.append("if (pkg.$vers.length >= 3) {\n");
+            sb.append("pkg.$vers.push(Packages.xdc.services.global.Vers.getDate(xdc.csd() + '/..'));\n");
+        sb.append("}\n");
+        sb.append("if ('xconfig_app$$stat$base' in xdc.om) {\n");
+            sb.append("pkg.packageBase = xdc.om['xconfig_app$$stat$base'];\n");
+            sb.append("pkg.packageRepository = xdc.om['xconfig_app$$stat$root'];\n");
+        sb.append("}\n");
+        sb.append("pkg.build.libraries = [\n");
+        sb.append("];\n");
+        sb.append("pkg.build.libDesc = [\n");
+        sb.append("];\n");
+        Global.eval(sb.toString());
+    }
+
+    void $$INITIALIZATION()
+    {
+        Value.Obj vo;
+
+        if (isCFG) {
+        }//isCFG
+        Global.callFxn("init", pkgV);
+        ((Value.Arr)om.findStrict("$packages", "xconfig_app")).add(pkgV);
+    }
+
+    public void exec( Scriptable xdcO, Session ses )
+    {
+        this.xdcO = xdcO;
+        this.ses = ses;
+        om = (Value.Obj)xdcO.get("om", null);
+
+        Object o = om.geto("$name");
+        String s = o instanceof String ? (String)o : null;
+        isCFG = s != null && s.equals("cfg");
+        isROV = s != null && s.equals("rov");
+
+        $$IMPORTS();
+        $$OBJECTS();
+        if (isROV) {
+        }//isROV
+        $$SINGLETONS();
+        $$INITIALIZATION();
+    }
+}
diff --git a/file_demo_bios/k2g/.config/xconfig_app/package/xconfig_app.sch b/file_demo_bios/k2g/.config/xconfig_app/package/xconfig_app.sch
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/file_demo_bios/k2g/.cproject b/file_demo_bios/k2g/.cproject
new file mode 100644 (file)
index 0000000..2847962
--- /dev/null
@@ -0,0 +1,230 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>\r
+<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">\r
+       <storageModule configRelations="2" moduleId="org.eclipse.cdt.core.settings">\r
+               <cconfiguration id="com.ti.ccstudio.buildDefinitions.C6000.Debug.1835316231">\r
+                       <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.C6000.Debug.1835316231" moduleId="org.eclipse.cdt.core.settings" name="Debug">\r
+                               <externalSettings/>\r
+                               <extensions>\r
+                                       <extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="org.eclipse.rtsc.xdctools.parsers.ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/>\r
+                               </extensions>\r
+                       </storageModule>\r
+                       <storageModule moduleId="cdtBuildSystem" version="4.0.0">\r
+                               <configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" errorParsers="org.eclipse.rtsc.xdctools.parsers.ErrorParser;com.ti.ccstudio.errorparser.CoffErrorParser;org.eclipse.cdt.core.GmakeErrorParser;com.ti.ccstudio.errorparser.LinkErrorParser;com.ti.ccstudio.errorparser.AsmErrorParser" id="com.ti.ccstudio.buildDefinitions.C6000.Debug.1835316231" name="Debug" parent="com.ti.ccstudio.buildDefinitions.C6000.Debug">\r
+                                       <folderInfo id="com.ti.ccstudio.buildDefinitions.C6000.Debug.1835316231." name="/" resourcePath="">\r
+                                               <toolChain id="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.DebugToolchain.344380526" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.linkerDebug.965411795">\r
+                                                       <option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.969050517" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">\r
+                                                               <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=TMS320C66XX.66AK2G02"/>\r
+                                                               <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>\r
+                                                               <listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>\r
+                                                               <listOptionValue builtIn="false" value="CCS_MBS_VERSION=6.1.3"/>\r
+                                                               <listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>\r
+                                                               <listOptionValue builtIn="false" value="RTSC_MBS_VERSION=2.2.0"/>\r
+                                                               <listOptionValue builtIn="false" value="XDC_VERSION=3.32.0.06_core"/>\r
+                                                               <listOptionValue builtIn="false" value="RTSC_PRODUCTS=ti.mas.aer.c64Px:17.0.0;com.ti.rtsc.SYSBIOS:6.45.1.29;com.ti.uia:2.0.3.43;ti.mas.volib.C66:2.1.0.1;com.ti.rtsc.XDAIS:7.24.0.04;"/>\r
+                                                               <listOptionValue builtIn="false" value="INACTIVE_REPOS=${TARGET_CONTENT_BASE};"/>\r
+                                                               <listOptionValue builtIn="false" value="EXPANDED_REPOS="/>\r
+                                                               <listOptionValue builtIn="false" value="OUTPUT_TYPE=rtscApplication:executable"/>\r
+                                                       </option>\r
+                                                       <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.963403336" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="8.1.0" valueType="string"/>\r
+                                                       <targetPlatform id="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.targetPlatformDebug.220293677" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.targetPlatformDebug"/>\r
+                                                       <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.builderDebug.2111411442" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.builderDebug"/>\r
+                                                       <tool id="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.compilerDebug.804526444" name="C6000 Compiler" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.compilerDebug">\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.DEFINE.543759738" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.DEFINE" valueType="definedSymbols">\r
+                                                                       <listOptionValue builtIn="false" value="k2g02"/>\r
+                                                                       <listOptionValue builtIn="false" value="dsp0"/>\r
+                                                               </option>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.SILICON_VERSION.1290834213" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.SILICON_VERSION" value="6600" valueType="string"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.INCLUDE_PATH.744891125" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.INCLUDE_PATH" valueType="includePath">\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${CG_TOOL_ROOT}/include&quot;"/>\r
+                                                               </option>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.DEBUGGING_MODEL.186410672" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.DIAG_WARNING.1008435753" name="Treat diagnostic &lt;id&gt; as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.DIAG_WARNING" valueType="stringList">\r
+                                                                       <listOptionValue builtIn="false" value="225"/>\r
+                                                               </option>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.DIAG_WRAP.940442525" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.DIAG_WRAP.off" valueType="enumerated"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.DISPLAY_ERROR_NUMBER.483254761" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.C6000_8.1.compiler.inputType__C_SRCS.1317236830" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.compiler.inputType__C_SRCS"/>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.C6000_8.1.compiler.inputType__CPP_SRCS.1679161302" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.compiler.inputType__CPP_SRCS"/>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.C6000_8.1.compiler.inputType__ASM_SRCS.110907742" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.compiler.inputType__ASM_SRCS"/>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.C6000_8.1.compiler.inputType__ASM2_SRCS.2045394746" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.compiler.inputType__ASM2_SRCS"/>\r
+                                                       </tool>\r
+                                                       <tool id="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.linkerDebug.965411795" name="C6000 Linker" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.linkerDebug">\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.DEFINE.500949423" name="Pre-define preprocessor macro _name_ to _value_ (--define)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.DEFINE" valueType="definedSymbols">\r
+                                                                       <listOptionValue builtIn="false" value="DSP_CORE=1"/>\r
+                                                               </option>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.STACK_SIZE.398244289" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.STACK_SIZE" value="0x800" valueType="string"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.HEAP_SIZE.923670801" name="Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.HEAP_SIZE" value="0x800" valueType="string"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.OUTPUT_FILE.249978722" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.OUTPUT_FILE" value="&quot;${ProjName}.out&quot;" valueType="string"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.MAP_FILE.746881898" name="Link information (map) listed into &lt;file&gt; (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.MAP_FILE" value="&quot;${ProjName}.map&quot;" valueType="string"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.LIBRARY.1030454472" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.LIBRARY" valueType="libs">\r
+                                                                       <listOptionValue builtIn="false" value="&quot;aer_c.ae64P&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;vau/lib/vau_c.ae66&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;vpe/lib/vpe_a.ae66&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;vpe/lib/vpe_c.ae66&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;util/lib/util_c.ae66&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;mhm/lib/mhm_c.ae66&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;libc.a&quot;"/>\r
+                                                               </option>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.SEARCH_PATH.895151274" name="Add &lt;dir&gt; to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.SEARCH_PATH" valueType="libPaths">\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${TI_MAS_AER_C64PX_INSTALL_DIR}/packages/ti/mas/aer/lib&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${TI_MAS_VOLIB_C66_INSTALL_DIR}/packages/ti/mas/&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${CG_TOOL_ROOT}/lib&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${CG_TOOL_ROOT}/include&quot;"/>\r
+                                                               </option>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.DIAG_WRAP.612749028" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.DIAG_WRAP.off" valueType="enumerated"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.DISPLAY_ERROR_NUMBER.2084630290" name="Emit diagnostic identifier numbers (--display_error_number)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.XML_LINK_INFO.1839711669" name="Detailed link information data-base into &lt;file&gt; (--xml_link_info, -xml_link_info)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.XML_LINK_INFO" value="&quot;${ProjName}_linkInfo.xml&quot;" valueType="string"/>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.C6000_8.1.exeLinker.inputType__CMD_SRCS.99912686" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.exeLinker.inputType__CMD_SRCS"/>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.C6000_8.1.exeLinker.inputType__CMD2_SRCS.1585953640" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.exeLinker.inputType__CMD2_SRCS"/>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.C6000_8.1.exeLinker.inputType__GEN_CMDS.1597601763" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.exeLinker.inputType__GEN_CMDS"/>\r
+                                                       </tool>\r
+                                                       <tool id="com.ti.ccstudio.buildDefinitions.C6000_8.1.hex.1707368945" name="C6000 Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.hex"/>\r
+                                                       <tool id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.1762840981" name="XDCtools" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool">\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH.1191046427" name="Package repositories (--xdcpath)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH" valueType="stringList">\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${BIOS_CG_ROOT}/packages&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${TI_MAS_VOLIB_C66_INSTALL_DIR}/packages&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${XDAIS_CG_ROOT}/packages&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${XDAIS_CG_ROOT}/examples&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${TI_MAS_AER_C64PX_INSTALL_DIR}/packages&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${PROJECT_LOC}/../platforms/packages&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${COM_TI_UIA_INSTALL_DIR}/packages&quot;"/>\r
+                                                               </option>\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET.1216531247" name="Target (-t)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET" value="ti.targets.elf.C66" valueType="string"/>\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM.1034504738" name="Platform (-p)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM" value="evmTCI66AK2G02Custom" valueType="string"/>\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW.1033675514" name="Platform (-p)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW" value="evmTCI66AK2G02Custom" valueType="string"/>\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE.322161814" name="Build-profile (-r)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE" value="debug" valueType="string"/>\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR.344977640" name="Compiler tools directory (-c)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR" value="&quot;${CG_TOOL_ROOT}&quot;" valueType="string"/>\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.COMPILE_OPTIONS.1844758151" name="Additional compiler options (--compileOptions)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.COMPILE_OPTIONS" value="&quot;-g --optimize_with_debug&quot;" valueType="string"/>\r
+                                                       </tool>\r
+                                               </toolChain>\r
+                                       </folderInfo>\r
+                                       <sourceEntries>\r
+                                               <entry excluding="AM57xx_C66.cmd|src" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>\r
+                                       </sourceEntries>\r
+                               </configuration>\r
+                       </storageModule>\r
+                       <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>\r
+               </cconfiguration>\r
+               <cconfiguration id="com.ti.ccstudio.buildDefinitions.C6000.Release.538536564">\r
+                       <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.C6000.Release.538536564" moduleId="org.eclipse.cdt.core.settings" name="Release">\r
+                               <externalSettings/>\r
+                               <extensions>\r
+                                       <extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="org.eclipse.rtsc.xdctools.parsers.ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/>\r
+                               </extensions>\r
+                       </storageModule>\r
+                       <storageModule moduleId="cdtBuildSystem" version="4.0.0">\r
+                               <configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" errorParsers="org.eclipse.rtsc.xdctools.parsers.ErrorParser;com.ti.ccstudio.errorparser.CoffErrorParser;org.eclipse.cdt.core.GmakeErrorParser;com.ti.ccstudio.errorparser.LinkErrorParser;com.ti.ccstudio.errorparser.AsmErrorParser" id="com.ti.ccstudio.buildDefinitions.C6000.Release.538536564" name="Release" parent="com.ti.ccstudio.buildDefinitions.C6000.Release">\r
+                                       <folderInfo id="com.ti.ccstudio.buildDefinitions.C6000.Release.538536564." name="/" resourcePath="">\r
+                                               <toolChain id="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.ReleaseToolchain.732070461" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.ReleaseToolchain" targetTool="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.linkerRelease.1315506571">\r
+                                                       <option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1380404355" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">\r
+                                                               <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=TMS320C66XX.AM5728_RevA.GPEVM_AM572X_SiRevA"/>\r
+                                                               <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>\r
+                                                               <listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>\r
+                                                               <listOptionValue builtIn="false" value="CCS_MBS_VERSION=6.1.3"/>\r
+                                                               <listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>\r
+                                                               <listOptionValue builtIn="false" value="RTSC_MBS_VERSION=2.2.0"/>\r
+                                                               <listOptionValue builtIn="false" value="XDC_VERSION=3.32.0.06_core"/>\r
+                                                               <listOptionValue builtIn="false" value="RTSC_PRODUCTS=com.ti.rtsc.SYSBIOS:6.45.1.29;"/>\r
+                                                               <listOptionValue builtIn="false" value="EXPANDED_REPOS="/>\r
+                                                               <listOptionValue builtIn="false" value="OUTPUT_TYPE=rtscApplication:executable"/>\r
+                                                       </option>\r
+                                                       <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.111350210" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="8.1.0" valueType="string"/>\r
+                                                       <targetPlatform id="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.targetPlatformRelease.526121302" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.targetPlatformRelease"/>\r
+                                                       <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.builderRelease.1020960975" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.builderRelease"/>\r
+                                                       <tool id="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.compilerRelease.1647715829" name="C6000 Compiler" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.compilerRelease">\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.DEFINE.101549308" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.DEFINE" valueType="definedSymbols">\r
+                                                                       <listOptionValue builtIn="false" value="am5728"/>\r
+                                                                       <listOptionValue builtIn="false" value="core1"/>\r
+                                                               </option>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.SILICON_VERSION.832953276" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.SILICON_VERSION" value="6600" valueType="string"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.DIAG_WARNING.1109229400" name="Treat diagnostic &lt;id&gt; as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.DIAG_WARNING" valueType="stringList">\r
+                                                                       <listOptionValue builtIn="false" value="225"/>\r
+                                                               </option>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.DISPLAY_ERROR_NUMBER.2017602906" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.DIAG_WRAP.727113076" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.DIAG_WRAP.off" valueType="enumerated"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.INCLUDE_PATH.1428405401" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.INCLUDE_PATH" valueType="includePath">\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${CG_TOOL_ROOT}/include&quot;"/>\r
+                                                               </option>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.C6000_8.1.compiler.inputType__C_SRCS.1214297227" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.compiler.inputType__C_SRCS"/>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.C6000_8.1.compiler.inputType__CPP_SRCS.1020478926" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.compiler.inputType__CPP_SRCS"/>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.C6000_8.1.compiler.inputType__ASM_SRCS.1026905756" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.compiler.inputType__ASM_SRCS"/>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.C6000_8.1.compiler.inputType__ASM2_SRCS.1252770672" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.compiler.inputType__ASM2_SRCS"/>\r
+                                                       </tool>\r
+                                                       <tool id="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.linkerRelease.1315506571" name="C6000 Linker" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.linkerRelease">\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.DEFINE.2020900851" name="Pre-define preprocessor macro _name_ to _value_ (--define)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.DEFINE" valueType="definedSymbols">\r
+                                                                       <listOptionValue builtIn="false" value="CORE1=1"/>\r
+                                                               </option>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.STACK_SIZE.665124913" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.STACK_SIZE" value="0x800" valueType="string"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.HEAP_SIZE.222498625" name="Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.HEAP_SIZE" value="0x800" valueType="string"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.OUTPUT_FILE.787997930" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.OUTPUT_FILE" value="&quot;${ProjName}.out&quot;" valueType="string"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.MAP_FILE.446206670" name="Link information (map) listed into &lt;file&gt; (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.MAP_FILE" value="&quot;${ProjName}.map&quot;" valueType="string"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.XML_LINK_INFO.985578203" name="Detailed link information data-base into &lt;file&gt; (--xml_link_info, -xml_link_info)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.XML_LINK_INFO" value="&quot;${ProjName}_linkInfo.xml&quot;" valueType="string"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.DISPLAY_ERROR_NUMBER.1525016395" name="Emit diagnostic identifier numbers (--display_error_number)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.DIAG_WRAP.8141476" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.DIAG_WRAP.off" valueType="enumerated"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.SEARCH_PATH.478971596" name="Add &lt;dir&gt; to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.SEARCH_PATH" valueType="libPaths">\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${CG_TOOL_ROOT}/lib&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${CG_TOOL_ROOT}/include&quot;"/>\r
+                                                               </option>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.LIBRARY.1924793564" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.linkerID.LIBRARY" valueType="libs">\r
+                                                                       <listOptionValue builtIn="false" value="&quot;libc.a&quot;"/>\r
+                                                               </option>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.C6000_8.1.exeLinker.inputType__CMD_SRCS.1728586432" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.exeLinker.inputType__CMD_SRCS"/>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.C6000_8.1.exeLinker.inputType__CMD2_SRCS.1738019169" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.exeLinker.inputType__CMD2_SRCS"/>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.C6000_8.1.exeLinker.inputType__GEN_CMDS.2007739607" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.exeLinker.inputType__GEN_CMDS"/>\r
+                                                       </tool>\r
+                                                       <tool id="com.ti.ccstudio.buildDefinitions.C6000_8.1.hex.2018362994" name="C6000 Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.hex"/>\r
+                                                       <tool id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.88080528" name="XDCtools" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool">\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR.1531724974" name="Compiler tools directory (-c)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR" value="&quot;${CG_TOOL_ROOT}&quot;" valueType="string"/>\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET.878328812" name="Target (-t)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET" value="ti.targets.elf.C66" valueType="string"/>\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM.1858021955" name="Platform (-p)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM" value="ti.platforms.evmAM572X" valueType="string"/>\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW.1914817284" name="Platform (-p)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW" value="ti.platforms.evmAM572X" valueType="string"/>\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE.1265873581" name="Build-profile (-r)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE" value="release" valueType="string"/>\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH.236166658" name="Package repositories (--xdcpath)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH" valueType="stringList">\r
+                                                                       <listOptionValue builtIn="false" value="${BIOS_CG_ROOT}/packages"/>\r
+                                                                       <listOptionValue builtIn="false" value="${TARGET_CONTENT_BASE}"/>\r
+                                                               </option>\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.COMPILE_OPTIONS.1881445727" name="Additional compiler options (--compileOptions)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.COMPILE_OPTIONS" value="&quot;-g --optimize_with_debug&quot;" valueType="string"/>\r
+                                                       </tool>\r
+                                               </toolChain>\r
+                                       </folderInfo>\r
+                                       <sourceEntries>\r
+                                               <entry excluding="src" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>\r
+                                       </sourceEntries>\r
+                               </configuration>\r
+                       </storageModule>\r
+                       <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>\r
+               </cconfiguration>\r
+       </storageModule>\r
+       <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>\r
+       <storageModule moduleId="cdtBuildSystem" version="4.0.0">\r
+               <project id="typical_GPEVM_AM572X_SiRevA_C66XX.com.ti.ccstudio.buildDefinitions.C6000.ProjectType.1164371994" name="C6000" projectType="com.ti.ccstudio.buildDefinitions.C6000.ProjectType"/>\r
+       </storageModule>\r
+       <storageModule moduleId="scannerConfiguration"/>\r
+       <storageModule moduleId="org.eclipse.cdt.core.language.mapping">\r
+               <project-mappings>\r
+                       <content-type-mapping configuration="" content-type="org.eclipse.cdt.core.asmSource" language="com.ti.ccstudio.core.TIASMLanguage"/>\r
+                       <content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cHeader" language="com.ti.ccstudio.core.TIGCCLanguage"/>\r
+                       <content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cSource" language="com.ti.ccstudio.core.TIGCCLanguage"/>\r
+                       <content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxHeader" language="com.ti.ccstudio.core.TIGPPLanguage"/>\r
+                       <content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxSource" language="com.ti.ccstudio.core.TIGPPLanguage"/>\r
+               </project-mappings>\r
+       </storageModule>\r
+       <storageModule moduleId="refreshScope" versionNumber="2">\r
+               <configuration configurationName="Release">\r
+                       <resource resourceType="PROJECT" workspacePath="/K2G_bf"/>\r
+               </configuration>\r
+               <configuration configurationName="Debug">\r
+                       <resource resourceType="PROJECT" workspacePath="/K2G_bf"/>\r
+               </configuration>\r
+       </storageModule>\r
+</cproject>\r
diff --git a/file_demo_bios/k2g/.gitignore b/file_demo_bios/k2g/.gitignore
new file mode 100644 (file)
index 0000000..3df573f
--- /dev/null
@@ -0,0 +1 @@
+/Debug/
diff --git a/file_demo_bios/k2g/.project b/file_demo_bios/k2g/.project
new file mode 100644 (file)
index 0000000..5abe183
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<projectDescription>\r
+       <name>K2G_bf</name>\r
+       <comment></comment>\r
+       <projects>\r
+       </projects>\r
+       <buildSpec>\r
+               <buildCommand>\r
+                       <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>\r
+                       <arguments>\r
+                       </arguments>\r
+               </buildCommand>\r
+               <buildCommand>\r
+                       <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>\r
+                       <triggers>full,incremental,</triggers>\r
+                       <arguments>\r
+                       </arguments>\r
+               </buildCommand>\r
+       </buildSpec>\r
+       <natures>\r
+               <nature>org.eclipse.rtsc.xdctools.buildDefinitions.XDC.xdcNature</nature>\r
+               <nature>com.ti.ccstudio.core.ccsNature</nature>\r
+               <nature>org.eclipse.cdt.core.cnature</nature>\r
+               <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>\r
+               <nature>org.eclipse.cdt.core.ccnature</nature>\r
+               <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>\r
+       </natures>\r
+</projectDescription>\r
diff --git a/file_demo_bios/k2g/.settings/org.eclipse.cdt.codan.core.prefs b/file_demo_bios/k2g/.settings/org.eclipse.cdt.codan.core.prefs
new file mode 100644 (file)
index 0000000..98b6350
--- /dev/null
@@ -0,0 +1,3 @@
+eclipse.preferences.version=1\r
+inEditor=false\r
+onBuild=false\r
diff --git a/file_demo_bios/k2g/.settings/org.eclipse.cdt.debug.core.prefs b/file_demo_bios/k2g/.settings/org.eclipse.cdt.debug.core.prefs
new file mode 100644 (file)
index 0000000..58d4fb2
--- /dev/null
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1\r
+org.eclipse.cdt.debug.core.toggleBreakpointModel=com.ti.ccstudio.debug.CCSBreakpointMarker\r
diff --git a/file_demo_bios/k2g/.xdchelp b/file_demo_bios/k2g/.xdchelp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/file_demo_bios/k2g/K2G_bf.ccxml b/file_demo_bios/k2g/K2G_bf.ccxml
new file mode 100644 (file)
index 0000000..95a3f30
--- /dev/null
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>\r
+<configurations XML_version="1.2" id="configurations_0">\r
+    <configuration XML_version="1.2" id="Texas Instruments XDS2xx USB Onboard Debug Probe_0">\r
+        <instance XML_version="1.2" desc="Texas Instruments XDS2xx USB Onboard Debug Probe_0" href="connections/TIXDS2XXUSB_onboard_Connection.xml" id="Texas Instruments XDS2xx USB Onboard Debug Probe_0" xml="TIXDS2XXUSB_onboard_Connection.xml" xmlpath="connections"/>\r
+        <connection XML_version="1.2" id="Texas Instruments XDS2xx USB Onboard Debug Probe_0">\r
+            <instance XML_version="1.2" href="drivers/tixds560icepick_d.xml" id="drivers" xml="tixds560icepick_d.xml" xmlpath="drivers"/>\r
+            <instance XML_version="1.2" href="drivers/tixds560c66xx.xml" id="drivers" xml="tixds560c66xx.xml" xmlpath="drivers"/>\r
+            <instance XML_version="1.2" href="drivers/tixds560cs_dap.xml" id="drivers" xml="tixds560cs_dap.xml" xmlpath="drivers"/>\r
+            <instance XML_version="1.2" href="drivers/tixds560cortexA15.xml" id="drivers" xml="tixds560cortexA15.xml" xmlpath="drivers"/>\r
+            <instance XML_version="1.2" href="drivers/tixds560csstm.xml" id="drivers" xml="tixds560csstm.xml" xmlpath="drivers"/>\r
+            <instance XML_version="1.2" href="drivers/tixds560etbcs.xml" id="drivers" xml="tixds560etbcs.xml" xmlpath="drivers"/>\r
+            <instance XML_version="1.2" href="drivers/tixds560pru.xml" id="drivers" xml="tixds560pru.xml" xmlpath="drivers"/>\r
+            <platform XML_version="1.2" id="platform_0">\r
+                <instance XML_version="1.2" desc="K2GEVM_0" href="boards/k2gevm.xml" id="K2GEVM_0" xml="k2gevm.xml" xmlpath="boards"/>\r
+            <board XML_version="1.2" description="66AK2G02 Evaluation Module" id="K2GEVM_0">\r
+                    <device HW_revision="1.0" XML_version="1.2" description="66AK2G02 - C66x DSP and Cortex A15 Embedded Processor" id="66AK2G02_0" partnum="66AK2G02">\r
+                        <router HW_revision="1.0" XML_version="1.2" description="ICEPick_D Router" id="IcePick_D_0" isa="ICEPICK_D">\r
+                            <subpath id="c66xx_0">\r
+                                <cpu HW_revision="1.0" XML_version="1.2" description="C66xx CGEM+FP CPU" id="C66xx" isa="TMS320C66XX">\r
+                                    <property Type="filepathfield" Value=".\evmk2g.gel" id="GEL File"/>\r
+                                </cpu>\r
+                            </subpath>\r
+                        </router>\r
+                    </device>\r
+                </board>\r
+            </platform>\r
+        </connection>\r
+    </configuration>\r
+</configurations>\r
diff --git a/file_demo_bios/k2g/app.cfg b/file_demo_bios/k2g/app.cfg
new file mode 100644 (file)
index 0000000..c7ffe86
--- /dev/null
@@ -0,0 +1,137 @@
+var Defaults = xdc.useModule('xdc.runtime.Defaults');
+var Diags = xdc.useModule('xdc.runtime.Diags');
+var Error = xdc.useModule('xdc.runtime.Error');
+var Log = xdc.useModule('xdc.runtime.Log');
+var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
+var Main = xdc.useModule('xdc.runtime.Main');
+var Memory = xdc.useModule('xdc.runtime.Memory')
+var SysMin = xdc.useModule('xdc.runtime.SysMin');
+var System = xdc.useModule('xdc.runtime.System');
+var Text = xdc.useModule('xdc.runtime.Text');
+
+var BIOS = xdc.useModule('ti.sysbios.BIOS');
+var Clock = xdc.useModule('ti.sysbios.knl.Clock');
+var Swi = xdc.useModule('ti.sysbios.knl.Swi');
+var Task = xdc.useModule('ti.sysbios.knl.Task');
+var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
+var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
+var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
+///var Timer = xdc.useModule('ti.sysbios.hal.Timer');
+var Load = xdc.useModule('ti.sysbios.utils.Load');
+
+/*
+ * Uncomment this line to globally disable Asserts.
+ * All modules inherit the default from the 'Defaults' module.  You
+ * can override these defaults on a per-module basis using Module.common$. 
+ * Disabling Asserts will save code space and improve runtime performance.
+Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF;
+ */
+
+/*
+ * Uncomment this line to keep module names from being loaded on the target.
+ * The module name strings are placed in the .const section. Setting this
+ * parameter to false will save space in the .const section.  Error and
+ * Assert messages will contain an "unknown module" prefix instead
+ * of the actual module name.
+Defaults.common$.namedModule = false;
+ */
+
+/*
+ * Minimize exit handler array in System.  The System module includes
+ * an array of functions that are registered with System_atexit() to be
+ * called by System_exit().
+ */
+System.maxAtexitHandlers = 4;       
+
+/* 
+ * Uncomment this line to disable the Error print function.  
+ * We lose error information when this is disabled since the errors are
+ * not printed.  Disabling the raiseHook will save some code space if
+ * your app is not using System_printf() since the Error_print() function
+ * calls System_printf().
+Error.raiseHook = null;
+ */
+
+/* 
+ * Uncomment this line to keep Error, Assert, and Log strings from being
+ * loaded on the target.  These strings are placed in the .const section.
+ * Setting this parameter to false will save space in the .const section.
+ * Error, Assert and Log message will print raw ids and args instead of
+ * a formatted message.
+Text.isLoaded = false;
+ */
+
+/*
+ * Uncomment this line to disable the output of characters by SysMin
+ * when the program exits.  SysMin writes characters to a circular buffer.
+ * This buffer can be viewed using the SysMin Output view in ROV.
+SysMin.flushAtExit = false;
+ */
+
+/*
+ * The BIOS module will create the default heap for the system.
+ * Specify the size of this default heap.
+ */
+BIOS.heapSize = 0x1000;
+
+/*
+ * Build a custom SYS/BIOS library from sources.
+ */
+BIOS.libType = BIOS.LibType_Custom;
+
+/* System stack size (used by ISRs and Swis) */
+Program.stack = 0x2000;
+
+/* Circular buffer size for System_printf() */
+SysMin.bufSize = 0x200;
+
+/* 
+ * Create and install logger for the whole system
+ */
+var loggerBufParams = new LoggerBuf.Params();
+loggerBufParams.numEntries = 16;
+var logger0 = LoggerBuf.create(loggerBufParams);
+Defaults.common$.logger = logger0;
+Main.common$.diags_INFO = Diags.ALWAYS_ON;
+
+System.SupportProxy = SysMin;
+
+Program.memoryExclude = false;
+var clock0Params = new Clock.Params();
+clock0Params.instance.name = "clkhandle";
+clock0Params.period = 10;
+clock0Params.startFlag = true;
+Program.global.clkhandle = Clock.create("&clkDataIn", 10, clock0Params);
+LoggingSetup.sysbiosSwiLogging = true;
+LoggingSetup.loadLoggerSize = 8192;
+LoggingSetup.sysbiosLoggerSize = 16384;
+LoggingSetup.mainLoggerSize = 16384;
+var swi0Params = new Swi.Params();
+swi0Params.instance.name = "swidatainhandle";
+swi0Params.priority = 8;
+Program.global.swidatainhandle = Swi.create("&swiDataIn", swi0Params);
+var task0Params = new Task.Params();
+task0Params.instance.name = "tasktxhandle";
+task0Params.priority = 5;
+Program.global.tasktxhandle = Task.create("&taskTx", task0Params);
+var semaphore0Params = new Semaphore.Params();
+semaphore0Params.instance.name = "semTxWakeUp";
+Program.global.semTxWakeUp = Semaphore.create(0, semaphore0Params);
+LoggingSetup.sysbiosSemaphoreLogging = false;
+LoggingSetup.loggerType = LoggingSetup.LoggerType_STOPMODE;
+LoggingSetup.loadTaskLogging = false;
+LoggingSetup.enableTaskProfiler = false;
+LoggingSetup.sysbiosHwiLogging = true;
+/* Set CPU frequency to 600 MHz */
+BIOS.cpuFreq.lo = 600000000;
+BIOS.cpuFreq.hi = 0;
+/* Set Sysclock period (usec.) */
+Clock.tickPeriod = 1000;
+///Timer.intFreq.lo = 20000000;
+///Timer.intFreqs[4].lo = 20000000;
+///Timer.intFreqs[4].hi = 0;
+LoggingSetup.countingAndGraphingLogging = true;
+LoggingSetup.memorySectionName = "L2SRAM";
+Load.hwiEnabled = true;
+Load.swiEnabled = true;
+Load.taskEnabled = true;
diff --git a/file_demo_bios/k2g/bflinker.cmd b/file_demo_bios/k2g/bflinker.cmd
new file mode 100644 (file)
index 0000000..ce327af
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * bflinker.cmd: Linker command file for Beamformer
+ */
+
+SECTIONS
+{
+    .bferam:        load >> L2SRAM
+    .bfiram:        load >> L2SRAM
+    .uiaLoggerBuffers load >> EXT_RAM
+    filOutBuf0           >> EXT_RAM
+       filBuf0              >> EXT_RAM
+       filBuf1              >> EXT_RAM
+       filBuf2              >> EXT_RAM
+       filBuf3              >> EXT_RAM
+       filBuf4              >> EXT_RAM
+       filBuf5              >> EXT_RAM
+       filBuf6              >> EXT_RAM
+       filBuf7              >> EXT_RAM
+       .far                 >> EXT_RAM
+}
+/* nothing past this point */
+
diff --git a/file_demo_bios/k2g/components/clk.c b/file_demo_bios/k2g/components/clk.c
new file mode 100644 (file)
index 0000000..a1c6673
--- /dev/null
@@ -0,0 +1,394 @@
+/*=================================================================\r
+ *  clk.c: Clock functions, SWI's, Tx Task\r
+ *=================================================================*/\r
+\r
+#include <strings.h>\r
+\r
+/* The infamous xdc/std.h must come before any header file which uses XDC symbols */\r
+#include <xdc/std.h>              /* mandatory - have to include first, for BIOS types */\r
+#include <ti/mas/types/types.h>\r
+#include <ti/mas/aer/bf.h>\r
+//#include <ti/mas/aer/mss.h>\r
+#include "mss/mss.h"              /* local version used */\r
+#include <ti/mas/vpe/asnr.h>\r
+#include <ti/mas/vau/vau.h>\r
+\r
+/*----------------------------------------\r
+ *  BIOS header files\r
+ *----------------------------------------*/\r
+#include <ti/sysbios/BIOS.h>          /* mandatory - if you call APIs like BIOS_start() */\r
+#include <xdc/cfg/global.h>           /* header file for statically defined objects/handles */\r
+#include <xdc/runtime/System.h>       /* for System_printf, and similar */\r
+#include <xdc/runtime/Timestamp.h>    /* for benchmarking/profiling */\r
+\r
+#include <xdc/runtime/Log.h>          /* for tracing */\r
+#include <xdc/runtime/Diags.h>\r
+#include <ti/uia/events/UIAEvt.h>     /* and more tracing */\r
+\r
+#include <ti/sysbios/knl/Semaphore.h> /* this looks obvious */\r
+\r
+#include "fil.h"                      /* FILE I/O implementation */\r
+#include "sys.h"                      /* System API and structures */\r
+#include "sysbfflt.h"                 /* System support for BF filters */\r
+\r
+#define Timestamp_get Timestamp_get32 /* use 32-bit time stamps */\r
+\r
+#define MIN(a,b)    (((a)>(b))?(b):(a))     /* Min/Max macros */\r
+#define MAX(a,b)    (((a)<(b))?(b):(a))\r
+#define loop        while(1)                /* endless loop for the task */\r
+\r
+/*=============================\r
+ * Functions\r
+ *=============================*/\r
+\r
+/*=================================================================\r
+ *  void clkDataIn(void)\r
+ *\r
+ *  This is a clock function that would start SWI to read input data.\r
+ *  In this case from a file/memory. It is statically configured in BIOS.\r
+ *=================================================================*/\r
+\r
+void clkDataIn(void)\r
+{\r
+  Swi_post(swidatainhandle);\r
+} /* clkDataIn */\r
+\r
+/*===========================================\r
+ *  SWI for getting data in from file/memory or A/D\r
+ *\r
+ *  Uses filRead() API to read frame of samples from "memory file".\r
+ *  Swaps the read/write pointers so that the system can read new data.\r
+ *  It wakes up the txTask to do that. It is statically configured in BIOS.\r
+ *\r
+ *===========================================*/\r
+\r
+/* A few debug stats */\r
+tuint  swiDataIn_errcnt = 0uL;      /* count errors reading data */\r
+tuint  swiDataIn_overflow = 0uL;    /* count how many times r/w pointers were the same */\r
+tint   swiDataIn_last_error;        /* last error code */\r
+\r
+void swiDataIn(void)\r
+{\r
+  tint err;\r
+  void *fid, *in_w, *in_r;\r
+\r
+  in_w = sysContext.in_w;     /* Fetch the read and write pointers for input buffer */\r
+  in_r = sysContext.in_r;\r
+  if (in_r == in_w) {         /* this should never happen */\r
+    swiDataIn_overflow++;\r
+    return;\r
+  }\r
+\r
+  /* Assume the write pointer is valid and use it to read the frame in */\r
+  fid = filGetHandle();\r
+  err = filRead(fid, SYS_FRAME_LENGTH, in_w, SYS_FRAME_LENGTH);\r
+  if (err != SYS_ERR_SUCCESS) {\r
+    swiDataIn_errcnt++;\r
+    swiDataIn_last_error = err;\r
+    return;\r
+  }\r
+  else {  /* Swap the r/w pointers */\r
+    sysContext.in_r = in_w;   /* we can do this because this SWI is at higher priority */\r
+    sysContext.in_w = in_r;   /* than the Tx Task and we know that r/w are different */\r
+    /* We assume that the Tx Task already finished using the read pointer */\r
+    /* So, next time we come we would write into the "other" buffer. */\r
+  }\r
+\r
+  /* Here we need to post a semaphore to wake up the Tx task */\r
+  Semaphore_post(semTxWakeUp);\r
+\r
+} /* swiDataIn */\r
+\r
+/*===========================================\r
+ *  Tx Task\r
+ *\r
+ *  It wakes up on semaphore (semTxWakeUp).\r
+ *  It performs the following tasks:\r
+ *    - give next frame to the BF's\r
+ *    - Run ASNR at the output of each BF to reduce noise further\r
+ *    - Provide all virtual mic outputs to the MSS for selection\r
+ *    - Pass output of MSS through VAU for speech activity detection\r
+ *    - Write the output signal to the output buffer/file or D/A\r
+ *    - Profile execution of all major modules\r
+ *    - Trace beam selection and VAU activity\r
+ *\r
+ *===========================================*/\r
+\r
+/* Output frame for MSS, input for VAU */\r
+#pragma DATA_ALIGN(txOutFrame,8)\r
+linSample txOutFrame[SYS_FRAME_LENGTH];\r
+\r
+typedef struct txBfDebug_stc {\r
+ tulong frmcnt;     /* normal frames */\r
+ tulong silcnt;     /* silence frames */\r
+ tuint  invsrc;     /* no mic active, invalid output */\r
+ tuint  invopt;     /* >1 mic active, invalid output */\r
+} txBfDebug_t;\r
+\r
+typedef struct txTaskDebug_stc {\r
+  tuint overrun;                    /* counts how many times we ran out of MIPS */\r
+  txBfDebug_t bf[SYS_VMICS_MAX];    /* beamformer statistics */\r
+} txTaskDebug_t;\r
+\r
+txTaskDebug_t txTaskDebug;      /* Tx task debug stats */\r
+\r
+/* Profiling/benchmarking information for the Tx task */\r
+typedef struct txTaskProfileData_stc {\r
+  tulong  min;              /* Minimum number of cycles */\r
+  tulong  max;              /* Maximum number of cycles */\r
+  tulong  n;                /* Number of measurements */\r
+  float   total;            /* Total number of cycles */\r
+} txTaskProfileData_t;\r
+\r
+typedef struct txTaskProfile_stc {\r
+  txTaskProfileData_t   bf;       /* Beamformer profile */\r
+  txTaskProfileData_t   asnr;     /* ASNR profile */\r
+  txTaskProfileData_t   mss;      /* MSS profile */\r
+  txTaskProfileData_t   vau;      /* VAU profile */\r
+} txTaskProfile_t;\r
+volatile txTaskProfile_t  txTaskProfile = {\r
+  {~(0uL), 0, 0, 0.0f},\r
+  {~(0uL), 0, 0, 0.0f},\r
+  {~(0uL), 0, 0, 0.0f},\r
+  {~(0uL), 0, 0, 0.0f}\r
+};\r
+\r
+/* To be used for debug trace */\r
+mssSrc_t    mssDbgCurSrc = {\r
+  -1, -1                        /* Current source group/index */\r
+};\r
+mssSrc_t    mssDbgNewSrc = {\r
+  -1, -1                        /* New source group/index */\r
+};\r
+\r
+/* Tx Task main routine */\r
+void taskTx(void)\r
+{\r
+  Int       semcnt;     /* count from a counting semaphore */\r
+  int       k;          /* loop counter */\r
+  tint      nmics, nvmics, err, angle, alert, oldalert = -1;\r
+\r
+  volatile tulong t1, t2;       /* for profiling */\r
+  tulong          delta;\r
+\r
+  void      *inst_p, *fid;\r
+  linSample *in_r;                      /* pointer to current microphone input buffer */\r
+  linSample *frame_p;                   /* pointer to signal frame */\r
+  linSample *outframe_p;                /* Output frame pointer for VAU */\r
+  linSample *mics_in[SYS_MICS_MAX];     /* pointers to microphone inputs */\r
+\r
+  mssDebugStat_t  mssDbg;\r
+\r
+  ISPHENC1_FrameType vauOldFrameType;       /* previous speech/noise */\r
+  ISPHENC1_FrameType vauFrameType;          /* use for every frame */\r
+\r
+  vauOldFrameType = (ISPHENC1_FrameType)255;    /* Start with invalid, update only on changes */\r
+\r
+  memset(&txTaskDebug,0,sizeof(txTaskDebug));   /* zero debug stats */\r
+\r
+  Log_print0(Diags_USER1,"taskTxStart");        /* Timestamp the beginning of the task */\r
+\r
+  fid = filGetHandle();\r
+  loop {\r
+\r
+    /*-------------------------------------------------------------------------------------*/\r
+    Semaphore_pend(semTxWakeUp, BIOS_WAIT_FOREVER);   /* wait for swiDataIn to wake you up */\r
+    /*-------------------------------------------------------------------------------------*/\r
+\r
+    /* In a real system, it could make sense to wait with time-out and post error condition\r
+     *    if the time-out expires. For example, if the frame duration is 10ms, we could wait\r
+     *    for 15ms or longer. */\r
+\r
+    semcnt = Semaphore_getCount(semTxWakeUp);\r
+    if (semcnt > 0) {\r
+      txTaskDebug.overrun++;  /* indicate we ran out of MIPS since we were asked to be waken up\r
+                               * multiple times before getting here. There were more events pending.\r
+                               * We are dropping a frame of input data here. */\r
+      continue;               /* Skip this pass through the loop to catch up to the last pending event */\r
+    }\r
+    nmics = sysContext.nmics;                   /* fetch number of mics */\r
+    in_r  = (linSample *)sysContext.in_r;       /* this was written by swiDataIn */\r
+    for (k = 0; k < nmics; k++) {\r
+      mics_in[k] = &in_r[k*SYS_FRAME_LENGTH];   /* find the frame start for each microphone */\r
+    }\r
+    /* consume samples pointed to by read pointer in_r as provided in misc_in[] */\r
+\r
+    /* Here comes a lot of work */\r
+    /* We start with beamformers */\r
+\r
+    nvmics = sysContext.nvmics;\r
+    t1 = Timestamp_get();\r
+    for (k = 0; k < nvmics; k++) {\r
+      inst_p  = sysContext.bfInst_p[k];     /* fetch the bf instance pointer */\r
+      frame_p = sysContext.vmicfrm[k];      /* point to the output frame buffer */\r
+\r
+      err = bfProcess(inst_p, (void*)&mics_in[0], (void*)frame_p);\r
+\r
+      if (err == bf_NOERR) {\r
+        txTaskDebug.bf[k].frmcnt++;             /* Record some debug info */\r
+      }\r
+      else if (err == bf_ERR_NOTOPENED) {\r
+        SYS_CHECK_ERROR(SYS_ERR_BFERROR);\r
+      }\r
+      else if (err == bf_ERR_DISABLED) {\r
+        txTaskDebug.bf[k].silcnt++;\r
+      }\r
+      else if (err == bf_ERR_INVALIDSRC) {\r
+        txTaskDebug.bf[k].invsrc = TRUE;\r
+      }\r
+      else if (err == bf_ERR_INVALIDOPT) {\r
+        txTaskDebug.bf[k].invopt = TRUE;\r
+      }\r
+      else {\r
+        SYS_CHECK_ERROR(SYS_ERR_BFERROR);\r
+      } /* if */\r
+    } /* for */\r
+    t2 = Timestamp_get();\r
+    delta = t2-t1;\r
+    txTaskProfile.bf.min = MIN(txTaskProfile.bf.min,delta);\r
+    txTaskProfile.bf.max = MAX(txTaskProfile.bf.max,delta);\r
+    txTaskProfile.bf.n++;\r
+    txTaskProfile.bf.total += (float)delta;\r
+\r
+    /* At this point we have consumed all input samples. Currently we did not implement\r
+     * any protection to prevent the swiDataIn from stepping over while we were doing this.\r
+     * We could let this task to handle the read pointer and SWI to handle write pointer which \r
+     * could be used to detect if such overrun would happen. */\r
+\r
+    /* Done with the beamformers */\r
+    /* Start ASNR's */\r
+\r
+    t1 = Timestamp_get();\r
+    for (k = 0; k < nvmics; k++) {\r
+      inst_p  = sysContext.asnrInst_p[k];   /* fetch the bf instance pointer */\r
+      frame_p = sysContext.vmicfrm[k];      /* point to the output frame buffer */\r
+\r
+      err = asnrProcess(inst_p, (void*)frame_p, (void*)frame_p);\r
+\r
+      if (err != asnr_NOERR) {\r
+        SYS_CHECK_ERROR(SYS_ERR_ASNRERROR);\r
+      } /* if */\r
+    } /* for */\r
+    t2 = Timestamp_get();\r
+    delta = t2-t1;\r
+    txTaskProfile.asnr.min = MIN(txTaskProfile.asnr.min,delta);\r
+    txTaskProfile.asnr.max = MAX(txTaskProfile.asnr.max,delta);\r
+    txTaskProfile.asnr.n++;\r
+    txTaskProfile.asnr.total += (float)delta;\r
+\r
+    /* Done with the ASNR's */\r
+    /* Run MSS */\r
+\r
+    t1 = Timestamp_get();\r
+    inst_p  = sysContext.mssInst_p;         /* fetch the MSS instance pointer */\r
+    frame_p = txOutFrame;                   /* point to the output frame buffer */\r
+\r
+    err = mssProcess(inst_p, (void*)frame_p,      /* instance and output frame pointers */\r
+                     (void*)frame_p,              /* WORKAROUND (not used, but no NULL) */\r
+                     (void**)sysContext.vmicfrm,  /* Virtual microphones (beams) */\r
+                     NULL,                        /* No remote mics */\r
+                     NULL,                        /* No clean mics */\r
+                     (void**)mics_in,             /* Raw microphone array inputs */\r
+                     NULL);                       /* Beam not supported (see fixed inputs) */\r
+\r
+    if (err != mss_NOERR) {\r
+      SYS_CHECK_ERROR(SYS_ERR_MSSERROR);\r
+    } /* if */\r
+    t2 = Timestamp_get();\r
+    delta = t2-t1;\r
+    txTaskProfile.mss.min = MIN(txTaskProfile.mss.min,delta);\r
+    txTaskProfile.mss.max = MAX(txTaskProfile.mss.max,delta);\r
+    txTaskProfile.mss.n++;\r
+    txTaskProfile.mss.total += (float)delta;\r
+\r
+    /* Trace source selection */\r
+    /*    Write Args:\r
+     *      arg2: (value) Angle in degrees\r
+     *      arg3: (aux1)  0 - current source, 1 - new source\r
+     *      arg4: (aux2)  source index\r
+     */\r
+    err = mssDebugStat(inst_p, &mssDbg);\r
+    if (err !=mss_NOERR) {\r
+      SYS_CHECK_ERROR(SYS_ERR_MSSDEBUG);\r
+    }\r
+    /* mssDbg.cur_src.group/.index has the current source */\r
+    /* mssDbg.new_src.group/.index has "proposed" source */\r
+    if (mssDbg.cur_src.group != mssDbgCurSrc.group ||\r
+        mssDbg.cur_src.index != mssDbgCurSrc.index)\r
+    {\r
+      mssDbgCurSrc = mssDbg.cur_src;\r
+      angle = sysBfFilterAngles[sysBfVMicAngles[mssDbgCurSrc.index]];\r
+      Log_write6(UIAEvt_intWithKey, angle, 0, mssDbgCurSrc.index, (IArg)"MSS-C: %d, G:%d", 0, mssDbgCurSrc.group);\r
+    }\r
+    if (mssDbg.new_src.group != mssDbgNewSrc.group ||\r
+        mssDbg.new_src.index != mssDbgNewSrc.index)\r
+    {\r
+      mssDbgNewSrc = mssDbg.new_src;\r
+      angle = sysBfFilterAngles[sysBfVMicAngles[mssDbgNewSrc.index]];\r
+      Log_write6(UIAEvt_intWithKey, angle, 1, mssDbgNewSrc.index, (IArg)"MSS-N: %d, G:%d", 1, mssDbgNewSrc.group);\r
+    }\r
+\r
+    /* Done with MSS */\r
+    /* Run VAU */\r
+\r
+    t1 = Timestamp_get();\r
+    inst_p  = sysContext.vauInst_p;         /* fetch the VAU instance pointer */\r
+    frame_p = txOutFrame;                   /* point to the Tx output frame buffer and use it as input */\r
+    alert = (tint)vauProcess(inst_p, frame_p,   /* instance and input frame pointers */\r
+                             &outframe_p,       /* pointer to output buffer pointer */\r
+                             &vauFrameType);    /* Indicating speech/noise */\r
+                                                /*  ISPHENC1_FTYPE_SPEECH or ISPHENC1_FTYPE_NODATA */\r
+    t2 = Timestamp_get();\r
+    delta = t2-t1;\r
+    txTaskProfile.vau.min = MIN(txTaskProfile.vau.min,delta);\r
+    txTaskProfile.vau.max = MAX(txTaskProfile.vau.max,delta);\r
+    txTaskProfile.vau.n++;\r
+    txTaskProfile.vau.total += (float)delta;\r
+\r
+    if (vauFrameType != vauOldFrameType) {\r
+      vauOldFrameType = vauFrameType;         /* Record new frame type */\r
+\r
+      /* Trace source selection */\r
+      /*    Write Args:\r
+       *      arg2: (value) 2-(VAU Frame Type)  So, silence will be 0, speech will be 2\r
+       *      arg3: (aux1)  2 - indicate VAU trace\r
+       *      arg4: (aux2)  0\r
+       */\r
+\r
+      Log_write4(UIAEvt_intWithKey, 15*(ISPHENC1_FTYPE_NODATA-vauFrameType), 2, 0, (IArg)"VAU-FT");\r
+    }\r
+    if (alert != oldalert) {\r
+      oldalert = alert;         /* Record new alert state */\r
+\r
+      /* Trace source selection */\r
+      /*    Write Args:\r
+       *      arg2: (value) Alert status\r
+       *      arg3: (aux1)  3 - indicate VAU alert trace\r
+       *      arg4: (aux2)  0\r
+       */\r
+\r
+      Log_write4(UIAEvt_intWithKey, 20*alert, 3, 0, (IArg)"VAU-ALERT");\r
+    }\r
+\r
+    /*---------------------------------*/\r
+    /* Save samples to the output file */\r
+    /*---------------------------------*/\r
+\r
+    err = filWrite(fid, SYS_FRAME_LENGTH, outframe_p);\r
+    if (err != SYS_ERR_SUCCESS) {\r
+      if (err == SYS_ERR_EOF) {\r
+        if (!sysContext.eof) {\r
+          sysContext.eof = TRUE;\r
+          System_printf("taskTx: EOF Reached.\n");\r
+          System_flush();\r
+        }\r
+      }\r
+      else {\r
+        SYS_CHECK_ERROR(err);\r
+      }\r
+    } /* if */\r
+  } /* loop */\r
+} /* taskTx */\r
+\r
+/* nothing past this point */\r
+\r
diff --git a/file_demo_bios/k2g/components/fil.c b/file_demo_bios/k2g/components/fil.c
new file mode 100644 (file)
index 0000000..637e6a1
--- /dev/null
@@ -0,0 +1,373 @@
+/*=================================================================\r
+ *  fil.c: File related functions.\r
+ *=================================================================*/\r
+\r
+#define HIGH_LEVEL 1      /* Use Low level file I/O */\r
+\r
+#if HIGH_LEVEL\r
+# include <stdio.h>       /* needs high level file I/O */\r
+#else\r
+# include <file.h>        /* needs low level file I/O */\r
+#endif\r
+\r
+/* The infamous xdc/std.h must come before any header file which uses XDC symbols */\r
+#include <xdc/std.h>\r
+#include <ti/mas/types/types.h>\r
+\r
+#include "sys.h"\r
+#include "fil.h"\r
+\r
+/* Globals */\r
+\r
+#pragma DATA_ALIGN(filOutBuf0,8)\r
+tuint filOutBuf0[FIL_OUTLEN_MAX];     /* Output buf/file #0 samples */\r
+\r
+#pragma DATA_ALIGN(filBuf0,8)\r
+tuint filBuf0[FIL_LENGTH_MAX];    /* File #0 samples */\r
+\r
+#pragma DATA_ALIGN(filBuf1,8)\r
+tuint filBuf1[FIL_LENGTH_MAX];    /* File #1 samples */\r
+\r
+#pragma DATA_ALIGN(filBuf2,8)\r
+tuint filBuf2[FIL_LENGTH_MAX];    /* File #2 samples */\r
+\r
+#pragma DATA_ALIGN(filBuf3,8)\r
+tuint filBuf3[FIL_LENGTH_MAX];    /* File #3 samples */\r
+\r
+#pragma DATA_ALIGN(filBuf4,8)\r
+tuint filBuf4[FIL_LENGTH_MAX];    /* File #4 samples */\r
+\r
+#pragma DATA_ALIGN(filBuf5,8)\r
+tuint filBuf5[FIL_LENGTH_MAX];    /* File #5 samples */\r
+\r
+#pragma DATA_ALIGN(filBuf6,8)\r
+tuint filBuf6[FIL_LENGTH_MAX];    /* File #6 samples */\r
+\r
+#pragma DATA_ALIGN(filBuf7,8)\r
+tuint filBuf7[FIL_LENGTH_MAX];    /* File #7 samples */\r
+\r
+filDescriptor_t  filDescriptor;   /* Global File Descriptor structure */\r
+\r
+/*=============================\r
+ * Functions\r
+ *=============================*/\r
+\r
+/*=================================================================\r
+ *  void *filCreate(      Create mic input file(s) descriptor\r
+ *    void **fid,         - File ID pointer\r
+ *    filConfig_t cfg);   - File configuration (see fil.h)\r
+ *=================================================================*/\r
+\r
+int filCreate(void **fid, filConfig_t *cfg)\r
+{\r
+  tint nfiles;\r
+\r
+  /* Check the input arguments consistency */\r
+  if (fid == (void*)NULL ||\r
+      cfg->nfiles < 1 || cfg->nfiles > FIL_MAX ||\r
+      cfg->length < 1 || cfg->length > FIL_LENGTH_MAX ||\r
+      cfg->outlen < 1 || cfg->length > FIL_OUTLEN_MAX ||\r
+      (cfg->big != TRUE && cfg->big != FALSE) ||\r
+      (cfg->wrap != TRUE && cfg->wrap != FALSE)) {\r
+    return(SYS_ERR_BADCONFIG);\r
+  }\r
+  filDescriptor.r_idx = 0L;                     /* reset to start of "file" */\r
+  filDescriptor.w_idx = 0L;                     /* reset to start of output "file" */\r
+  filDescriptor.length = cfg->length;           /* record to total file length in samples */\r
+  nfiles = filDescriptor.nfiles = cfg->nfiles;  /* how many files do we have */\r
+  filDescriptor.big = cfg->big;                 /* is it big endian byte order */\r
+  filDescriptor.wrap = cfg->wrap;               /* should we wrap around at EOF? */\r
+  filDescriptor.outlen = cfg->outlen;           /* output buf/file length in samples */\r
+\r
+  /* Initialize base addresses for file buffers */\r
+\r
+  filDescriptor.filbase[0] = (void*)&filBuf0[0];    /* we must use at least one file */\r
+  filDescriptor.filbase[1] = (void*)(nfiles > 1 ? &filBuf1[0]:NULL);\r
+  filDescriptor.filbase[2] = (void*)(nfiles > 2 ? &filBuf2[0]:NULL);\r
+  filDescriptor.filbase[3] = (void*)(nfiles > 3 ? &filBuf3[0]:NULL);\r
+  filDescriptor.filbase[4] = (void*)(nfiles > 4 ? &filBuf4[0]:NULL);\r
+  filDescriptor.filbase[5] = (void*)(nfiles > 5 ? &filBuf5[0]:NULL);\r
+  filDescriptor.filbase[6] = (void*)(nfiles > 6 ? &filBuf6[0]:NULL);\r
+  filDescriptor.filbase[7] = (void*)(nfiles > 7 ? &filBuf7[0]:NULL);\r
+\r
+# if FIL_MAX > 8\r
+#   error need to implement support for more than 8 files\r
+# endif\r
+\r
+  filDescriptor.outbuf = &filOutBuf0[0];        /* point to output buffer */\r
+\r
+  *fid = (void*)&filDescriptor;    /* Return a pointer to file descriptor */\r
+\r
+  return(SYS_ERR_SUCCESS);\r
+} /* filCreate */\r
+\r
+/*=================================================================\r
+ *  void *filGetHandle(void)      - get input file(s) descriptor\r
+ *=================================================================*/\r
+\r
+void *filGetHandle(void)\r
+{\r
+  return((void*)&filDescriptor);\r
+} /* filGetHandle */\r
+\r
+/*=================================================================\r
+ *  int filLoad(       - Load input file(s) to memory\r
+ *    char *filpath,        - file path\r
+ *    tlong n,              - number of samples to read\r
+ *    int bufnum)           - buffer number to receive data\r
+ *  \r
+ *    Return: Number of samples read.\r
+ *=================================================================*/\r
+\r
+tlong filLoad(char *filpath, tlong n, int bufnum)\r
+{\r
+  int nread;\r
+  tuint *buf;\r
+# if HIGH_LEVEL\r
+    FILE *fid;\r
+# else\r
+    int fid;\r
+# endif\r
+\r
+  if (bufnum > FIL_MAX) {   /* Make sure we have appropriate buffer to store data */\r
+    return(SYS_ERR_FMAXBUF);\r
+  }\r
+  nread = 0;\r
+# if HIGH_LEVEL\r
+    fid = fopen(filpath, "rb");   /* Open file */\r
+    if (fid == NULL) {\r
+      return(SYS_ERR_FOPEN);\r
+    }\r
+# else\r
+    fid = open(filpath, O_RDONLY|O_BINARY,0);\r
+    if (fid < 0) {\r
+      return(SYS_ERR_FOPEN);\r
+    }\r
+# endif\r
+\r
+  buf = filDescriptor.filbase[bufnum];    /* Fetch the buffer address to receive data */\r
+  if (buf == NULL) {\r
+#   if HIGH_LEVEL\r
+      fclose(fid);\r
+#   else\r
+      close(fid);\r
+#   endif\r
+    return(SYS_ERR_FLOAD);\r
+  }\r
+# if HIGH_LEVEL\r
+    nread = fread(buf, sizeof(linSample), n, fid);\r
+# else\r
+  {\r
+    tlong nsamp, nleft_w, nread_w;\r
+\r
+    nleft_w = n*sizeof(linSample);\r
+    nread_w = 0;\r
+    while (nleft_w > 0) {\r
+      nread_w = read(fid,(char*)buf,nleft_w);\r
+      if (nread_w > 0) {\r
+        nleft_w -= nread_w;                     /* reduce #-words left */\r
+        nsamp    = nread_w/sizeof(linSample);   /* this many samples fetched */\r
+        buf      = &buf[nsamp];                 /* move the buffer pointer */\r
+        nread   += nsamp;                       /* count how many read */\r
+      }\r
+      else if (nread_w == 0) {\r
+        break;\r
+      }\r
+      else {  /* nread_w < 0 indicating error */\r
+        nread = nread_w;\r
+        break;\r
+      }\r
+    }\r
+  }\r
+# endif\r
+\r
+# if HIGH_LEVEL\r
+    fclose(fid);\r
+# else\r
+    close(fid);\r
+# endif\r
+\r
+  if (nread < 0) {\r
+    nread = SYS_ERR_FREAD;\r
+  }\r
+\r
+  return(nread);\r
+} /* filLoad */\r
+\r
+/*=================================================================\r
+ *  int filRead(        - Read a frame from input files in memory\r
+ *    void *fid,            - a pointer to file descriptor\r
+ *    int n,                - number of samples to read\r
+ *    linSample inbuf[],    - input buffer to receive samples\r
+ *    int buflen)           - input buffer capacity in number of samples\r
+ *=================================================================*/\r
+\r
+int filRead(void *fid, int n, linSample inbuf[], int buflen)\r
+{\r
+  int       k, ch, r_idx, r_idx_new, nfiles, length, ncopy, overflow;\r
+  tuint     *in_p, *in_base_p, value;\r
+  linSample *out_p;\r
+  tbool     wrap, big, write_zeros;\r
+\r
+  filDescriptor_t *fd = (filDescriptor_t*)fid;\r
+\r
+  if (fid == (void*)NULL) {\r
+    return(SYS_INV_HANDLE);\r
+  }\r
+  if (n > buflen) {\r
+    return(SYS_ERR_BUFLENGTH);\r
+  }\r
+\r
+  /* Fetch the file descriptor parameters */\r
+  r_idx   = fd->r_idx;      /* current read index */\r
+  nfiles  = fd->nfiles;     /* # of active files */\r
+  length  = fd->length;     /* actual file length in samples */\r
+  wrap    = fd->wrap;\r
+  big     = fd->big;\r
+\r
+  /* Test read index */\r
+  if (r_idx >= length) {\r
+    write_zeros = !wrap;    /* If past the end write zeros */\r
+    if (wrap) {\r
+      return(SYS_INV_LOGIC);    /* Cannot be past the end in this case! */\r
+    }\r
+  }\r
+  else {\r
+    write_zeros = FALSE;\r
+  }\r
+\r
+  out_p = &inbuf[0];      /* start from the beginning of a buffer */\r
+  if (!write_zeros) {\r
+    for (ch = 0; ch < nfiles; ch++) {\r
+      in_base_p = (tuint*)fd->filbase[ch];\r
+      in_p = &in_base_p[r_idx];\r
+\r
+      r_idx_new = r_idx + n;\r
+      overflow = r_idx_new - length;\r
+      if (overflow >= 0) {\r
+        ncopy = n - overflow;\r
+      }\r
+      else {\r
+        overflow = 0;     /* overflow did not occur */\r
+        ncopy = n;\r
+      }\r
+\r
+      /* Copy frame of samples (before wrap) */\r
+      for (k = 0; k < ncopy; k++) {\r
+        value = *in_p++;\r
+        if (big) {\r
+          *out_p++ = (linSample)FIL_SWAP_BYTES(value);\r
+        }\r
+        else {\r
+          *out_p++ = (linSample)value;\r
+        }\r
+      }\r
+\r
+      if (!wrap) {\r
+        for (k = 0; k < overflow; k++) {    /* pad zeros if no-wrap */\r
+          *out_p++ = 0;\r
+        }\r
+      }\r
+      else {  /* wrap part */\r
+        if (overflow > 0) {\r
+          in_p = &in_base_p[0];     /* Wrap around the pointer */\r
+          for (k = 0; k < overflow; k++) {  /* copy wrapped samples */\r
+            value = *in_p++;\r
+            if (big) {\r
+              *out_p++ = (linSample)FIL_SWAP_BYTES(value);\r
+            }\r
+            else {\r
+              *out_p++ = (linSample)value;\r
+            }\r
+          }\r
+        }\r
+        r_idx_new = overflow;     /* Reset read index if wrap required */\r
+      } /* wrap */\r
+    } /* ch loop */\r
+\r
+    fd->r_idx = r_idx_new;        /* Update the read index for next time */\r
+\r
+  } /* do not write zeros */\r
+  else {  /* write zeros */\r
+    for (k = 0; k < n; k++) {\r
+      *out_p++ = 0;\r
+    }\r
+  }\r
+\r
+  return(SYS_ERR_SUCCESS);\r
+} /* filRead */\r
+\r
+/*===============================================================================*/\r
+/* This is the WRITE Part */\r
+/*===============================================================================*/\r
+\r
+/*=================================================================\r
+ *  int filWrite(         - Write a frame into output file in memory\r
+ *    void *fid,            - a pointer to file descriptor\r
+ *    int n,                - number of samples to write\r
+ *    linSample outbuf[])   - output buffer that contains samples\r
+ *=================================================================*/\r
+\r
+int filWrite(void *fid, int n, linSample outbuf[])\r
+{\r
+  int       k, w_idx, w_idx_new, ncopy, overflow, err;\r
+  tuint     *out_p, *out_base_p, value;\r
+  tlong     outlen;\r
+  linSample *in_p;\r
+  tbool     big;\r
+\r
+  filDescriptor_t *fd = (filDescriptor_t*)fid;\r
+  outlen = fd->outlen;        /* Total output buffer length */\r
+\r
+  if (fid == (void*)NULL) {\r
+    return(SYS_INV_HANDLE);\r
+  }\r
+  if (n > outlen) {\r
+    return(SYS_ERR_BUFLENGTH);\r
+  }\r
+\r
+  /* Fetch the file descriptor parameters */\r
+  w_idx   = fd->w_idx;          /* current write index */\r
+  big     = fd->big;\r
+\r
+  /* Test write index */\r
+  if (w_idx >= outlen) {\r
+    return(SYS_ERR_EOF);        /* Indicate end of file */\r
+  }\r
+\r
+  in_p = &outbuf[0];        /* start from the beginning of a buffer (our input) */\r
+\r
+  out_base_p = (tuint*)fd->outbuf;\r
+  out_p = &out_base_p[w_idx];         /* Find where to write samples */\r
+\r
+  w_idx_new = w_idx + n;\r
+  overflow = w_idx_new - outlen;\r
+  if (overflow >= 0) {\r
+    ncopy = n - overflow;\r
+    err = SYS_ERR_EOF;\r
+  }\r
+  else {\r
+    overflow = 0;     /* overflow did not occur */\r
+    ncopy = n;\r
+    err = SYS_ERR_SUCCESS;\r
+  }\r
+\r
+  /* Copy frame of samples (before end of file) */\r
+  for (k = 0; k < ncopy; k++) {\r
+    value = *in_p++;\r
+    if (big) {\r
+      *out_p++ = (linSample)FIL_SWAP_BYTES(value);\r
+    }\r
+    else {\r
+      *out_p++ = (linSample)value;\r
+    }\r
+  }\r
+\r
+  fd->w_idx = w_idx_new;        /* Update the write index for next time */\r
+\r
+  return(err);\r
+\r
+} /* filWrite */\r
+\r
+/* nothing past this point */\r
+\r
diff --git a/file_demo_bios/k2g/components/fil.h b/file_demo_bios/k2g/components/fil.h
new file mode 100644 (file)
index 0000000..10f8307
--- /dev/null
@@ -0,0 +1,84 @@
+/* \r
+ *  fil.h: Definitions for file handling functions (file stored in memory!)\r
+*/\r
+#ifndef _FIL_H\r
+#define _FIL_H\r
+\r
+#include <xdc/std.h>                /* required for types.h */\r
+#include <ti/mas/types/types.h>\r
+\r
+#include "sys.h"      /* for eampling rate, etc. */\r
+\r
+/*======================================================================\r
+ * File related constants\r
+ *======================================================================*/\r
+\r
+#define FIL_MAX         SYS_MICS_MAX    /* Maximum number of files */\r
+\r
+#define FIL_L_ENDIAN    (FALSE)     /* Little endian byte ordering in file */\r
+#define FIL_B_ENDIAN    (TRUE)1     /* Big endian byte ordering in file */\r
+\r
+#define FIL_DURATION_MAX_MS     (60*1000L)                              /* 1min max duration */\r
+#define FIL_LENGTH_MAX          (SYS_FS_HZ*FIL_DURATION_MAX_MS/1000)    /* max length in samples */\r
+#define FIL_OUTDURATION_MAX_MS  (FIL_DURATION_MAX_MS+1*1000L)           /* 1s longer than input */\r
+#define FIL_OUTLEN_MAX          (SYS_FS_HZ*FIL_OUTDURATION_MAX_MS/1000) /* in samples */\r
+\r
+/*======================================================================\r
+ * Bit masks, byte swapping macros, error codes\r
+ *======================================================================*/\r
+\r
+/* Bit masks for byte swapping */\r
+#define FIL_LOW_BYTE    0x00FFu\r
+#define FIL_HIGH_BYTE   0xFF00u\r
+\r
+/* Macros for bit-mask manipulations */\r
+#define FIL_GET_LOW(x)    ((x)&FIL_LOW_BYTE)\r
+#define FIL_GET_HIGH(x)   (((x)>>8)&FIL_LOW_BYTE)\r
+#define FIL_SWAP_BYTES(x) ((FIL_GET_LOW(x)<<8)|FIL_GET_HIGH(x))\r
+\r
+/*======================================================================\r
+ * File related types\r
+ *======================================================================*/\r
+\r
+/* File Configuration Structure */\r
+struct filConfig_stc {\r
+  tlong length;   /* number of samples in the input files */\r
+  tint  nfiles;   /* number of memory input files to create */\r
+  tbool big;      /* TRUE: big endian, FALSE: little endian byte order */\r
+  tbool wrap;     /* TRUE: do wrap-around, FALSE: do not wrap-around */\r
+  tlong outlen;   /* number of samples in the output file */\r
+};\r
+typedef struct filConfig_stc filConfig_t;\r
+\r
+/* File Descriptor Structure (handles all files) */\r
+struct filDescriptor_stc {\r
+  tlong r_idx;    /* current read index (sample based) */\r
+  tlong w_idx;    /* current write index (sample based) */\r
+  tlong length;   /* number of samples in an input file (does not apply to output!) */\r
+  tint  nfiles;   /* numbner of configured files */\r
+\r
+  void  *filbase[FIL_MAX];    /* base addresses of file buffers */\r
+\r
+  /* Use 'big' for both R&W */\r
+  tbool big;      /* TRUE: big endian, FALSE: little endian byte order */\r
+  tbool wrap;     /* TRUE: do wrap-around, FLASE: do not wrap-around (input only) */\r
+\r
+  /* WRITE Part */\r
+  tlong outlen;   /* Output buffer length in samples */\r
+  void  *outbuf;  /* A pointer to the output buffer */\r
+};\r
+typedef struct filDescriptor_stc filDescriptor_t;\r
+\r
+/*======================================================================\r
+ * API Prototypes\r
+ *======================================================================*/\r
+\r
+extern int    filCreate(void**,filConfig_t*);         /* Initialize file descriptor */\r
+extern void   *filGetHandle(void);                    /* Return file handle */\r
+extern tlong  filLoad(char*, tlong, int);             /* Load file into memory */\r
+extern int    filRead(void*,int,linSample*,int);      /* Read samples from files */\r
+extern int    filWrite(void*, int, linSample*);       /* Write sample into file */\r
+\r
+#endif\r
+/* nothing past this point */\r
+\r
diff --git a/file_demo_bios/k2g/components/mhm/configspec.clearcase b/file_demo_bios/k2g/components/mhm/configspec.clearcase
new file mode 100644 (file)
index 0000000..0d1f6a4
--- /dev/null
@@ -0,0 +1,25 @@
+# This is my name and my current version number\r
+
+Begin_ME\r
+  ti.mas.mhm   2.5.1.0  dsps_gtmas\r
+End_ME
+\r
+# These are the packages I need for proper operation within the system
+\r
+Begin_DEP\r
+  ti.mas.types 5.5.5.0  dsps_gtmas\r
+End_DEP\r
+
+# These are the packages I need internally
+\r
+Begin_INTERNAL\r
+  ti.mas.swtools       5.0.4.0  dsps_gtmas\r
+End_INTERNAL\r
+
+# These are the additional packages I need for unit testing
+\r
+#Begin_TST\r
+#  <pnameT> <MT>.<mT>.<pT>.<bT>\r
+#End_TST\r
+
+# nothing past this point\r
diff --git a/file_demo_bios/k2g/components/mhm/dcSpec.txt b/file_demo_bios/k2g/components/mhm/dcSpec.txt
new file mode 100644 (file)
index 0000000..1c86296
--- /dev/null
@@ -0,0 +1,33 @@
+# Development config spec for MHM 2.5.1.0 and later\r
+# (the Master version - checkouts allowed for MHM only!)\r
+# Based on the tip of the main branch for MHM.\r
+#\r
+# Please note that the ti_mas_mhm_V_R_X_P_dev branch does NOT exist!\r
+\r
+# Show any checkedout files\r
+element * CHECKEDOUT\r
+\r
+# Specify how to select the folders that lead to the packages\r
+# and how to select some of the shared folders (e.g. docs)\r
+element /dsps_gtmas /main/LATEST -nocheckout\r
+\r
+element /dsps_gtmas/lost+found  /main/0\r
+element /dsps_gtmas/ti             /main/LATEST -nocheckout\r
+\r
+element /dsps_gtmas/ti/mas             /main/LATEST -nocheckout\r
+element /dsps_gtmas/ti/mas/docs/...    /main/LATEST -nocheckout\r
+\r
+# Specify dependent packages (to allow debug branching remove -nocheckout as needed)\r
+# mkbranch and end mkbranch lines would allow these packages to appear on MHM branch!\r
+#mkbranch ti_mas_mhm_V_R_X_P_dev\r
+element /dsps_gtmas/ti/mas/swtools/...   DEV_TI_MAS_SWTOOLS_5_0_4_0 -nocheckout\r
+element /dsps_gtmas/ti/mas/types/...   DEV_TI_MAS_TYPES_5_5_5_0 -nocheckout\r
+\r
+# Specify packages used for unit testing\r
+# NONE\r
+\r
+#end mkbranch ti_mas_mhm_V_R_X_P_dev\r
+\r
+# Normal development in /main branch\r
+element /dsps_gtmas/ti/mas/mhm/... /main/LATEST\r
+\r
diff --git a/file_demo_bios/k2g/components/mhm/dcSpeclnx.txt b/file_demo_bios/k2g/components/mhm/dcSpeclnx.txt
new file mode 100644 (file)
index 0000000..8041316
--- /dev/null
@@ -0,0 +1,33 @@
+# Development config spec for MHM 2.5.1.0 and later\r
+# (the Master version - checkouts allowed for MHM only!)\r
+# Based on the tip of the main branch for MHM.\r
+#\r
+# Please note that the ti_mas_mhm_V_R_X_P_dev branch does NOT exist!\r
+\r
+# Show any checkedout files\r
+element * CHECKEDOUT\r
+\r
+# Specify how to select the folders that lead to the packages\r
+# and how to select some of the shared folders (e.g. docs)\r
+element /vobs/dsps_gtmas /main/LATEST -nocheckout\r
+\r
+element /vobs/dsps_gtmas/lost+found  /main/0\r
+element /vobs/dsps_gtmas/ti             /main/LATEST -nocheckout\r
+\r
+element /vobs/dsps_gtmas/ti/mas             /main/LATEST -nocheckout\r
+element /vobs/dsps_gtmas/ti/mas/docs/...    /main/LATEST -nocheckout\r
+\r
+# Specify dependent packages (to allow debug branching remove -nocheckout as needed)\r
+# mkbranch and end mkbranch lines would allow these packages to appear on MHM branch!\r
+#mkbranch ti_mas_mhm_V_R_X_P_dev\r
+element /vobs/dsps_gtmas/ti/mas/swtools/...   DEV_TI_MAS_SWTOOLS_5_0_4_0 -nocheckout\r
+element /vobs/dsps_gtmas/ti/mas/types/...   DEV_TI_MAS_TYPES_5_5_5_0 -nocheckout\r
+\r
+# Specify packages used for unit testing\r
+# NONE\r
+\r
+#end mkbranch ti_mas_mhm_V_R_X_P_dev\r
+\r
+# Normal development in /main branch\r
+element /vobs/dsps_gtmas/ti/mas/mhm/... /main/LATEST\r
+\r
diff --git a/file_demo_bios/k2g/components/mhm/mCspec.txt b/file_demo_bios/k2g/components/mhm/mCspec.txt
new file mode 100644 (file)
index 0000000..6ad21d8
--- /dev/null
@@ -0,0 +1,39 @@
+# Maintenance config spec for MHM 2.5.1.x\r
+# (the Master version - checkouts allowed for MHM only!)\r
+# Based on DEV_TI_MAS_MHM_2_5_1_0\r
+\r
+# Show any checkedout files\r
+element * CHECKEDOUT\r
+\r
+# Specify how to select the folders that lead to the packages\r
+# and how to select some of the shared folders (e.g. docs, swtools)\r
+element /dsps_gtmas  DEV_TI_MAS_MHM_2_5_1_0 -nocheckout\r
+\r
+element /dsps_gtmas/lost+found  /main/0\r
+element /dsps_gtmas/ti DEV_TI_MAS_MHM_2_5_1_0 -nocheckout\r
+\r
+# The following line assumes that MHM branch would be allowed for all mas packages!\r
+#element /dsps_gtmas/ti/mas/... .../ti_mas_mhm_2_5_1_0_maint/LATEST\r
+\r
+# The following line assumes that mas folder could end up in MHM branch if modified\r
+#element /dsps_gtmas/ti/mas    DEV_TI_MAS_MHM_2_5_1_0 -mkbranch ti_mas_mhm_2_5_1_0_maint\r
+\r
+element /dsps_gtmas/ti/mas     DEV_TI_MAS_MHM_2_5_1_0   -nocheckout\r
+element /dsps_gtmas/ti/mas/docs/...    /main/LATEST    -nocheckout\r
+\r
+# Specify dependent packages (to allow debug branching remove -nocheckout as needed)\r
+# mkbranch and end mkbranch lines would allow these packages to appear on MHM branch!\r
+#mkbranch ti_mas_mhm_2_5_1_0_maint\r
+element /dsps_gtmas/ti/mas/swtools/...   DEV_TI_MAS_SWTOOLS_5_0_4_0 -nocheckout\r
+element /dsps_gtmas/ti/mas/types/...   DEV_TI_MAS_TYPES_5_5_5_0 -nocheckout\r
+\r
+# Specify packages used for unit testing\r
+# NONE\r
+\r
+#end mkbranch ti_mas_mhm_2_5_1_0_maint\r
+\r
+# Specify development/maintenance branch for 2.5.1.x MHM\r
+element /dsps_gtmas/ti/mas/mhm/... .../ti_mas_mhm_2_5_1_0_maint/LATEST\r
+element /dsps_gtmas/ti/mas/mhm/... DEV_TI_MAS_MHM_2_5_1_0 -mkbranch ti_mas_mhm_2_5_1_0_maint\r
+element /dsps_gtmas/ti/mas/mhm/... /main/0 -mkbranch ti_mas_mhm_2_5_1_0_maint\r
+\r
diff --git a/file_demo_bios/k2g/components/mhm/mCspeclnx.txt b/file_demo_bios/k2g/components/mhm/mCspeclnx.txt
new file mode 100644 (file)
index 0000000..b1f03d7
--- /dev/null
@@ -0,0 +1,39 @@
+# Maintenance config spec for MHM 2.5.1.x\r
+# (the Master version - checkouts allowed for MHM only!)\r
+# Based on DEV_TI_MAS_MHM_2_5_1_0\r
+\r
+# Show any checkedout files\r
+element * CHECKEDOUT\r
+\r
+# Specify how to select the folders that lead to the packages\r
+# and how to select some of the shared folders (e.g. docs, swtools)\r
+element /vobs/dsps_gtmas  DEV_TI_MAS_MHM_2_5_1_0 -nocheckout\r
+\r
+element /vobs/dsps_gtmas/lost+found  /main/0\r
+element /vobs/dsps_gtmas/ti    DEV_TI_MAS_MHM_2_5_1_0 -nocheckout\r
+\r
+# The following line assumes that MHM branch would be allowed for all mas packages!\r
+#element /vobs/dsps_gtmas/ti/mas/... .../ti_mas_mhm_2_5_1_0_maint/LATEST\r
+\r
+# The following line assumes that mas folder could end up in MHM branch if modified\r
+#element /vobs/dsps_gtmas/ti/mas       DEV_TI_MAS_MHM_2_5_1_0 -mkbranch ti_mas_mhm_2_5_1_0_maint\r
+\r
+element /vobs/dsps_gtmas/ti/mas        DEV_TI_MAS_MHM_2_5_1_0   -nocheckout\r
+element /vobs/dsps_gtmas/ti/mas/docs/...    /main/LATEST       -nocheckout\r
+\r
+# Specify dependent packages (to allow debug branching remove -nocheckout as needed)\r
+# mkbranch and end mkbranch lines would allow these packages to appear on MHM branch!\r
+#mkbranch ti_mas_mhm_2_5_1_0_maint\r
+element /vobs/dsps_gtmas/ti/mas/swtools/...   DEV_TI_MAS_SWTOOLS_5_0_4_0 -nocheckout\r
+element /vobs/dsps_gtmas/ti/mas/types/...   DEV_TI_MAS_TYPES_5_5_5_0 -nocheckout\r
+\r
+# Specify packages used for unit testing\r
+# NONE\r
+\r
+#end mkbranch ti_mas_mhm_2_5_1_0_maint\r
+\r
+# Specify development/maintenance branch for 2.5.1.x MHM\r
+element /vobs/dsps_gtmas/ti/mas/mhm/... .../ti_mas_mhm_2_5_1_0_maint/LATEST\r
+element /vobs/dsps_gtmas/ti/mas/mhm/... DEV_TI_MAS_MHM_2_5_1_0 -mkbranch ti_mas_mhm_2_5_1_0_maint\r
+element /vobs/dsps_gtmas/ti/mas/mhm/... /main/0 -mkbranch ti_mas_mhm_2_5_1_0_maint\r
+\r
diff --git a/file_demo_bios/k2g/components/mhm/mhm.h b/file_demo_bios/k2g/components/mhm/mhm.h
new file mode 100644 (file)
index 0000000..8e37847
--- /dev/null
@@ -0,0 +1,95 @@
+#ifndef _MHM_H\r
+#define _MHM_H\r
+/******************************************************************************\r
+ * FILE PURPOSE: Definitions and API's for the multiple heap manager.\r
+ ******************************************************************************\r
+ * FILE NAME:   MHM.H\r
+ *\r
+ * DESCRIPTION: Contains definitions and API's for the multiple heap manager.\r
+ *\r
+ * TABS: NONE\r
+ *\r
+ * $Id: mhm.h 1.1 1997/06/25 11:40:55 BOGDANK Exp $\r
+ *\r
+ * REVISION HISTORY:\r
+ *\r
+ * $Log: mhm.h $\r
+ * Revision 1.1  1997/06/25 11:40:55  BOGDANK\r
+ * Initial revision\r
+ *\r
+ *        Copyright (c) 2007 \96 2013 Texas Instruments Incorporated                
+ *                                                                                
+ *              All rights reserved not granted herein.                           
+ *                                                                                
+ *                         Limited License.                                       
+ *                                                                                
+ *  Texas Instruments Incorporated grants a world-wide, royalty-free,             
+ *  non-exclusive license under copyrights and patents it now or hereafter owns   
+ *  or controls to make, have made, use, import, offer to sell and sell           
+ *  ("Utilize") this software subject to the terms herein.  With respect to the   
+ *  foregoing patent license, such license is granted solely to the extent that   
+ *  any such patent is necessary to Utilize the software alone.  The patent       
+ *  license shall not apply to any combinations which include this software,      
+ *  other than combinations with devices manufactured by or for TI (\93TI           
+ *  Devices\94).  No hardware patent is licensed hereunder.                         
+ *                                                                                
+ *  Redistributions must preserve existing copyright notices and reproduce this   
+ *  license (including the above copyright notice and the disclaimer and (if      
+ *  applicable) source code license limitations below) in the documentation       
+ *  and/or other materials provided with the distribution                         
+ *                                                                                
+ *  Redistribution and use in binary form, without modification, are permitted    
+ *  provided that the following conditions are met:                               
+ *                                                                                
+ *    *  No reverse engineering, decompilation, or disassembly of this software   
+ *  is permitted with respect to any software provided in binary form.            
+ *                                                                                
+ *    *  any redistribution and use are licensed by TI for use only with TI       
+ *  Devices.                                                                      
+ *                                                                                
+ *    *  Nothing shall obligate TI to provide you with source code for the        
+ *  software licensed and provided to you in object code.                         
+ *                                                                                
+ *  If software source code is provided to you, modification and redistribution   
+ *  of the source code are permitted provided that the following conditions are   
+ *  met:                                                                          
+ *                                                                                
+ *    *  any redistribution and use of the source code, including any resulting   
+ *  derivative works, are licensed by TI for use only with TI Devices.            
+ *                                                                                
+ *    *  any redistribution and use of any object code compiled from the source   
+ *  code and any resulting derivative works, are licensed by TI for use only      
+ *  with TI Devices.                                                              
+ *                                                                                
+ *  Neither the name of Texas Instruments Incorporated nor the names of its       
+ *  suppliers may be used to endorse or promote products derived from this        
+ *  software without specific prior written permission.                           
+ *                                                                                
+ *  DISCLAIMER.                                                                   
+ *                                                                                
+ *  THIS SOFTWARE IS PROVIDED BY TI AND TI\92S LICENSORS "AS IS" AND ANY EXPRESS    
+ *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED             
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE        
+ *  DISCLAIMED. IN NO EVENT SHALL TI AND TI\92S LICENSORS BE LIABLE FOR ANY         
+ *  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES    
+ *  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR            
+ *  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER    
+ *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT            
+ *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY     
+ *  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH   
+ *  DAMAGE.                                                                       \r
+ *****************************************************************************/\r
+\r
+/* System definitions and utilities */\r
+#include <ti/mas/types/types.h>               /* DSP types                   */\r
+\r
+/* API */\r
+void *mhmCreate       (void *base, tuint size, tword initPattern);\r
+void *mhmAlloc        (void *handle, tuint size);\r
+void *mhmAllocAligned (void *handle, tuint size, tint log2align);\r
+void  mhmFree         (void *handle, void *base);\r
+void  mhmReset        (void *handle);\r
+\r
+#endif  /* _MHM_H */\r
+/* nothing past this point */\r
+\r
diff --git a/file_demo_bios/k2g/components/mhm/package.bld b/file_demo_bios/k2g/components/mhm/package.bld
new file mode 100644 (file)
index 0000000..64df6c1
--- /dev/null
@@ -0,0 +1,113 @@
+/******************************************************************************\r
+ * FILE PURPOSE: Build description for package ti.mas.mhm\r
+ ******************************************************************************\r
+ * FILE NAME: package.bld  \r
+ *\r
+ * DESCRIPTION: This file contains build attributes for package ti.mas.mhm\r
+ *\r
+ * TABS: NONE\r
+ *\r
+ * Copyright (C) 2006, Texas Instruments, Inc.\r
+ *****************************************************************************/\r
+  \r
+  var Package=xdc.loadCapsule('ti/mas/swtools/CommonBld.xs');\r
+  Package.name="mhm";\r
+\r
+  Package.files["commonCsrc"]= {\r
+    base_directory: "src",\r
+    files:  ["mhm.c"\r
+            ]  \r
+  }\r
+\r
+  Package.archiveFiles["C64Header"]= {\r
+    base_directory: "src/c64",\r
+    target: ["c64le", \r
+             "c64be", \r
+             "c64Ple", \r
+             "c64Pbe",  \r
+             "ce64Ple",\r
+             "ce64Pbe",\r
+             "c66le", \r
+             "c66be",\r
+             "ce66le",\r
+             "ce66be"\r
+            ],\r
+    files:  ["mhmport.h"\r
+            ] \r
+  }\r
+   \r
+  Package.archiveFiles["C55Header"]= {\r
+    base_directory: "src/c55",\r
+    target: ["c55l", \r
+             "c55s"\r
+            ],\r
+    files:  ["mhmport.h"\r
+            ] \r
+  }\r
+   \r
+  Package.archiveFiles["C54Header"]= {\r
+    base_directory: "src/c54",\r
+    target: ["c54n", \r
+             "c54f"\r
+            ],\r
+    files:  ["mhmport.h"\r
+            ] \r
+  }\r
+   \r
+  Package.archiveFiles["CommonHeader"]= {\r
+    base_directory: "src",\r
+    files:  ["mhmport.h"\r
+            ] \r
+  }\r
+  \r
+\r
+/**********************************************************************************************\r
+  The main package.bld routine starts here \r
+***********************************************************************************************/\r
+\r
+  /* Set up the target architecture */\r
+  Package.targets = [C54, \r
+                     C54_far, \r
+                     C55, \r
+                     C55_large, \r
+                     C64, \r
+                     C64_big_endian, \r
+                     C64P, \r
+                     C64P_big_endian, \r
+                     C64P_elf,\r
+                     C64P_big_endian_elf,\r
+                     C66, \r
+                     C66_big_endian, \r
+                     C66_elf,\r
+                     C66_big_endian_elf,\r
+                     C674, \r
+                     C674_big_endian, \r
+                     GCArmv7A\r
+                    ];\r
+\r
+ /* Set up version numbers for this package */\r
+  Package.pkgStdVer = "2.0";\r
+  Package.version = [2,5,1,0, 3,0];\r
+\r
+  Package.createVersion();\r
+\r
+  /* Include custom makefile to generate doxygen documents */\r
+/*  Package.includeMake("Makedocs.mk"); */\r
+  \r
+  /* Parse XDC Arguments */\r
+  Package.parseArgs(arguments);\r
+\r
+  /* Create Library */ \r
+  Package.createLib();\r
+\r
+  /* Create Archive */ \r
+  Package.createArchive();\r
+  \r
+  /* Clean Package */\r
+  Package.packageClean();\r
+\r
+\r
+/* nothing past this point */\r
+\r
+\r
+\r
diff --git a/file_demo_bios/k2g/components/mhm/package.xdc b/file_demo_bios/k2g/components/mhm/package.xdc
new file mode 100644 (file)
index 0000000..d4fe246
--- /dev/null
@@ -0,0 +1,87 @@
+requires ti.mas.types[5,0,8,1];\r
+requires internal ti.mas.swtools[3,0,0,0];\r
+\r
+/*! MHM package\r
+ * \r
+ * @a(NAME)  `ti.mas.mhm`\r
+ *\r
+ * @a(DESCRIPTION)\r
+ *\r
+ *        This package creates the mhm system. It depends on the following packages:\r
+ * @p(dlist)\r
+ * - `ti.mas.types`\r
+ * \r
+ * @a(CONTENTS)\r
+ * @p(dlist)\r
+ * - 'mhm' module\r
+ *      provides APIs for multiple heap management.\r
+ * - `version` module\r
+ *      provides version numbering for the package and is described in\r
+ *      `version.xdc`. Note that `version.xdc` is generated from the template file \r
+ *      `version.xdt`.\r
+ * @p\r
+ * @a(TARGETS) The following architecture targets are supported:\r
+ *\r
+ * @p(dlist)\r
+ * - `C54`\r
+ * - `C55`\r
+ * - `C55_large`\r
+ * - `C64`\r
+ * - `C64_big_endian`\r
+ * - `C64P`\r
+ * - `C64P_big_endian`\r
+ * @p\r
+ * @a(BUILD)  The build options are implemented in the file `package.bld`.\r
+ *\r
+ * Build command: `xdc XDCARGS="option"`.\r
+ * option = [c54, c55, c55L, c64, c64_be, c64P, c64P_be, all]\r
+ * If any other option other than above is used then the package is not built correctly\r
+ * and will crash when used in conjunction with other packages. \r
+ *\r
+ *\r
+ * Generated files:\r
+ *\r
+ * @p(dlist)\r
+ * -  `version.h`\r
+ * @p\r
+ *\r
+ * Command to clean: `xdc clean`\r
+ *\r
+ * @a(RELEASES)\r
+ *\r
+ * Release creation: `xdc XDCARGS="option1 option2" release`\r
+ * option1 = [c54, c55, c55L, c64, c64_be, c64P, c64P_be, all]\r
+ * option2 = [obj, src, docs]\r
+ *\r
+ * Using the option1 as given and option 2="obj" creates the released tar file containing object code only:\r
+ * `ti_mas_mhm_<arch>_src_<v>_<r>_<x>_<p>.tar`\r
+ * or `ti_mas_mhm_all_src_<v>_<r>_<x>_<p>.tar` if option 1="all"\r
+ * \r
+ * Using the option1 as given and option 2="src" creates the released tar file containing source with object code:\r
+ * `ti_mas_mhm_<arch>_src_<v>_<r>_<x>_<p>.tar`\r
+ * or `ti_mas_mhm_all_src_<v>_<r>_<x>_<p>.tar` if option 1="all"\r
+ *\r
+ * If option2 = "obj" or empty then `ti_mas_mhm_all_<v>_<r>_<x>_<p>.tar` is created containing only object code\r
+ *\r
+ * To generate document only the following should be used:\r
+ * `xdc XDCARGS="docs" release` or `xdc XDCARGS="option1,docs"`\r
+ * and `ti_mas_mhm_docs_<v>_<r>_<x>_<p>.tar` is created\r
+ * \r
+ * If any other option other than the ones listed above is used, no release is created.\r
+ * \r
+ *\r
+ * \r
+ *\r
+ * @a(Copyright)\r
+ * @p(html)\r
+ * &#169; 2006 Texas Instruments, Inc.\r
+ * @p\r
+ */\r
+\r
+package ti.mas.mhm[2,0,0,0] {\r
+  \r
+  /* Specification of units for package mhm */\r
+   module Version;\r
+}\r
+\r
+/* nothing past this point */\r
diff --git a/file_demo_bios/k2g/components/mhm/package.xs b/file_demo_bios/k2g/components/mhm/package.xs
new file mode 100644 (file)
index 0000000..af68cb8
--- /dev/null
@@ -0,0 +1,28 @@
+/******************************************************************************\r
+ * FILE PURPOSE: Defines libarary directory name using getLibs\r
+ ******************************************************************************\r
+ * FILE NAME: package.xs\r
+ *\r
+ * DESCRIPTION: This file defines the library directory name for proper build\r
+ *              in case a different directory name for storing library files \r
+ *              other than "lib" is used. XDC by default assumes that the \r
+ *              library directory is "lib" is not sepcifically indicated by use\r
+ *              the attributes in a file called package.xs  \r
+ *\r
+ * TABS: NONE\r
+ *\r
+ * Copyright (C) 2012, Texas Instruments, Inc.\r
+ *****************************************************************************/\r
+\r
+/* "mangle" program build attrs into an appropriate directory name */\r
+function getLibs (prog)\r
+{\r
+  var suff = prog.build.target.suffix;\r
+  var lib  = "";\r
+  \r
+  lib += "lib/mhm_c.a"  + suff;\r
+\r
+  return (lib);\r
+}\r
+\r
+/* nothing past this point */\r
diff --git a/file_demo_bios/k2g/components/mhm/readme.txt b/file_demo_bios/k2g/components/mhm/readme.txt
new file mode 100644 (file)
index 0000000..a57e32a
--- /dev/null
@@ -0,0 +1,12 @@
+Date: 12/12/2006          Jianzhong Xu \r
+Version 1.0.0.0\r
+\r
+The initial version of the package has three files: mhm.h, c55x/mhmport.h, mhm.c.\r
+1. mhm.h: This file was taken from the latest of main branch. It was chagned in branch \r
+          blr_ggxvipp_r001_04_12_01_videoDSP_framework_start. The change was ignored since that brach is for video.\r
+\r
+2. mhmport.h: This file was taken from the latest of main branch. It is the same among all branches.\r
+\r
+3. mhm.c: This file was taken from the latest of main branch. It was changed in branch \r
+          blr_ggxcore_r10_03_06_14_core_10_0_0_5_core10_2 and ggdcm_desktop_vc_port. \r
+          Changes were ignored sicne the changes were not done properly. They should be outside of mhm.c.
\ No newline at end of file
diff --git a/file_demo_bios/k2g/components/mhm/src/arm/mhmport.h b/file_demo_bios/k2g/components/mhm/src/arm/mhmport.h
new file mode 100644 (file)
index 0000000..d0c0116
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef _MHMPORT_H\r
+#define _MHMPORT_H\r
+/******************************************************************************\r
+ * FILE PURPOSE: Definitions that are used on a ARM platform.\r
+ ******************************************************************************\r
+ * FILE NAME:   MHMPORT.H\r
+ *\r
+ * DESCRIPTION: Contains definitions that are used on a ARM platform.\r
+ *\r
+ * (C) Copyright 2010, Texas Instruments, Inc.\r
+ *****************************************************************************/\r
+\r
+/* System definitions and utilities */\r
+#include <ti/mas/types/types.h>               /* DSP types                   */\r
+\r
+/* The address type is an unsigned integer type that has the same number of\r
+ *  bits as the longest possible (data) address on this platform. */\r
+typedef tulong  mhmAddress_t;\r
+\r
+#endif  /* _MHMPORT_H */\r
+/* nothing past this point */\r
diff --git a/file_demo_bios/k2g/components/mhm/src/c54/mhmport.h b/file_demo_bios/k2g/components/mhm/src/c54/mhmport.h
new file mode 100644 (file)
index 0000000..0785384
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef _MHMPORT_H\r
+#define _MHMPORT_H\r
+/******************************************************************************\r
+ * FILE PURPOSE: Definitions that are used on a C54x platform.\r
+ ******************************************************************************\r
+ * FILE NAME:   MHMPORT.H\r
+ *\r
+ * DESCRIPTION: Contains definitions that are used on a C54x platform.\r
+ *\r
+ * TABS: NONE\r
+ *\r
+ * $Id: mhmport.h 1.1 1997/06/25 11:41:02 BOGDANK Exp $\r
+ *\r
+ * REVISION HISTORY:\r
+ *\r
+ * $Log: mhmport.h $\r
+ * Revision 1.1  1997/06/25 11:41:02  BOGDANK\r
+ * Initial revision\r
+ *\r
+ * (C) Copyright 1997, TELOGY Networks, Inc.\r
+ *****************************************************************************/\r
+\r
+/* System definitions and utilities */\r
+#include <ti/mas/types/types.h>               /* DSP types                   */\r
+\r
+/* The address type is an unsigned integer type that has the same number of\r
+ *  bits as the longest possible (data) address on this platform. */\r
+typedef tuint  mhmAddress_t;\r
+\r
+#endif  /* _MHMPORT_H */\r
+/* nothing past this point */\r
diff --git a/file_demo_bios/k2g/components/mhm/src/c55/mhmport.h b/file_demo_bios/k2g/components/mhm/src/c55/mhmport.h
new file mode 100644 (file)
index 0000000..b43c847
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef _MHMPORT_H\r
+#define _MHMPORT_H\r
+/******************************************************************************\r
+ * FILE PURPOSE: Definitions that are used on a C54x platform.\r
+ ******************************************************************************\r
+ * FILE NAME:   MHMPORT.H\r
+ *\r
+ * DESCRIPTION: Contains definitions that are used on a C54x platform.\r
+ *\r
+ * TABS: NONE\r
+ *\r
+ * $Id: mhmport.h 1.1 1997/06/25 11:41:02 BOGDANK Exp $\r
+ *\r
+ * REVISION HISTORY:\r
+ *\r
+ * $Log: mhmport.h $\r
+ * Revision 1.1  1997/06/25 11:41:02  BOGDANK\r
+ * Initial revision\r
+ *\r
+ * (C) Copyright 1997, TELOGY Networks, Inc.\r
+ *****************************************************************************/\r
+\r
+/* System definitions and utilities */\r
+#include <ti/mas/types/types.h>               /* DSP types                   */\r
+\r
+/* The address type is an unsigned integer type that has the same number of\r
+ *  bits as the longest possible (data) address on this platform. */\r
+typedef tulong  mhmAddress_t;\r
+\r
+#endif  /* _MHMPORT_H */\r
+/* nothing past this point */\r
diff --git a/file_demo_bios/k2g/components/mhm/src/c64/mhmport.h b/file_demo_bios/k2g/components/mhm/src/c64/mhmport.h
new file mode 100644 (file)
index 0000000..13177b4
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef _MHMPORT_H\r
+#define _MHMPORT_H\r
+/******************************************************************************\r
+ * FILE PURPOSE: Definitions that are used on a C6x platform.\r
+ ******************************************************************************\r
+ * FILE NAME:   MHMPORT.H\r
+ *\r
+ * DESCRIPTION: Contains definitions that are used on a C6x platform.\r
+ *\r
+ * TABS: NONE\r
+ *\r
+ * $Id: mhmport.h 1.2 1998/08/06 16:50:04 jdowdal Exp $\r
+ *\r
+ * REVISION HISTORY:\r
+ *\r
+ * $Log: mhmport.h $\r
+ * Revision 1.2  1998/08/06 16:50:04  jdowdal\r
+ *      Fixed size of mhmAddress_t.\r
+ * Revision 1.1  1998/07/22 14:12:15  jdowdal\r
+ * Initial revision\r
+ * Initial revision taken from c54x\mhmport.h\r
+ *\r
+ * (C) Copyright 1997, TELOGY Networks, Inc.\r
+ *****************************************************************************/\r
+\r
+/* System definitions and utilities */\r
+#include <ti/mas/types/types.h>               /* DSP types                   */\r
+\r
+/* The address type is an unsigned integer type that has the same number of\r
+ *  bits as the longest possible (data) address on this platform. */\r
+typedef tulong  mhmAddress_t;\r
+\r
+#endif  /* _MHMPORT_H */\r
+/* nothing past this point */\r
diff --git a/file_demo_bios/k2g/components/mhm/src/mhm.c b/file_demo_bios/k2g/components/mhm/src/mhm.c
new file mode 100644 (file)
index 0000000..2741b48
--- /dev/null
@@ -0,0 +1,249 @@
+/******************************************************************************\r
+ * FILE PURPOSE: Multiple heap manager.\r
+ ******************************************************************************\r
+ * FILE NAME:   mhm.c\r
+ *\r
+ * DESCRIPTION: Contains routines for multiple heap management. These functions\r
+ *              may be used in allocating memory from several independent\r
+ *              memory pools.\r
+ *\r
+ *              NOTE: Current implementation does NOT provide deallocation!\r
+ *\r
+ * TABS: NONE\r
+ *\r
+ * $Id: mhm.c 1.1 1997/06/25 11:40:55 BOGDANK Exp $\r
+ *\r
+ * REVISION HISTORY:\r
+ *\r
+ * $Log: mhm.c $\r
+ * Revision 1.1  1997/06/25 11:40:55  BOGDANK\r
+ * Initial revision\r
+ *\r
+ * (C) Copyright 1997, TELOGY Networks, Inc.\r
+ *****************************************************************************/\r
+\r
+#include <stdlib.h>\r
+#include <string.h>                                            /* for memset */\r
+\r
+#include <xdc/std.h>\r
+/* System definitions and utilities */\r
+#include <ti/mas/types/types.h>               /* DSP types                   */\r
+\r
+//#include <ti/mas/mhm/mhm.h>\r
+//#include <ti/mas/mhm/src/mhmport.h>\r
+\r
+#include "../mhm.h"\r
+#include "mhmport.h"\r
+\r
+/* Heap header that is placed at the beginning of a memory pool. */\r
+typedef struct {\r
+  tuint  total_size;   /* total number of words in a memory pool */\r
+  tuint  used_size;    /* index of the first available word */\r
+} mhmHead_t;\r
+\r
+/* The minimum and maximum number of words in a memory pool. Align gap and\r
+ *  maximum size value are specified in mhmport.h. */\r
+#define MHM_MIN_POOLSIZE  (sizeof(mhmHead_t)+MHM_MAX_ALIGNGAP+1)\r
+#define MHM_MAX_POOLSIZE  MHM_MAX_SIZEVAL\r
+\f\r
+/******************************************************************************\r
+ * FUNCTION PURPOSE: Create and initialize a heap.\r
+ ******************************************************************************\r
+ * DESCRIPTION: Creates and initializes a heap. If successful returns a heap\r
+ *              handle, otherwise returns NULL.\r
+ *\r
+ *  void *mhmCreate (\r
+ *    void *base,         - base address of a memory pool (!= NULL)\r
+ *    tuint size,          - number of words within the memory pool\r
+ *    word initPattern)   - initializing pattern for the heap\r
+ *\r
+ *  RETURN VALUE: A heap handle, or NULL in case of error.\r
+ *\r
+ *****************************************************************************/\r
+\r
+void *mhmCreate (void *base, tuint size, tword initPattern)\r
+{\r
+  tuint      used_size;\r
+  mhmHead_t *head;\r
+  tword      *w_base = (tword *)base;\r
+  tword      *block;\r
+  mhmAddress_t  wa_base_new, wa_block_new;\r
+\r
+  /* initialize the raw space */\r
+  memset (w_base, initPattern, size);\r
+  \r
+  /* In the first part we align the base address of the memory pool */\r
+  used_size = 0;\r
+  wa_base_new = ((mhmAddress_t)w_base + MHM_MAX_ALIGNGAP) & (~MHM_ALIGN_MASK);\r
+  used_size += wa_base_new - (mhmAddress_t)w_base;\r
+  w_base = (tword *)wa_base_new;        /* this is the new base after any gap */\r
+\r
+  if (size < used_size+MHM_MIN_POOLSIZE || size-used_size > MHM_MAX_POOLSIZE ||\r
+      base == NULL)\r
+    return(NULL);\r
+\r
+  /* Skip the pool alignment gap and start fresh. Do not forget to reset used size. */\r
+  /* w_base points to aligned address now and used_size is currently the gap size (if any) */\r
+  head = (mhmHead_t*)w_base;            /* This will be the actual head of the heap */\r
+  head->total_size = size - used_size;  /* record total heap size by removing the gap size */\r
+\r
+  used_size = sizeof(mhmHead_t);    /* reserve space for the header and make that the used size */\r
+  block     = &w_base[used_size];   /* skip the header */\r
+\r
+  /* Remember to align the remaining pool to the minimum alignment required by MHM  */\r
+  wa_block_new = ((mhmAddress_t)block + MHM_MAX_ALIGNGAP) & (~MHM_ALIGN_MASK);\r
+  used_size += wa_block_new - (mhmAddress_t)block;\r
+\r
+  head->used_size = used_size;    /* record an index to empty space which is with minimum alignment */\r
+  return(head);                   /* return heap handle */\r
+} /* mhmCreate */\r
+\f\r
+/******************************************************************************\r
+ * FUNCTION PURPOSE: Allocate a block of memory from a heap.\r
+ ******************************************************************************\r
+ * DESCRIPTION: Allocates a block of memory from a heap. Block size must be\r
+ *              bigger than zero. It returns a pointer to block start or a\r
+ *              NULL if unsuccessful.\r
+ *\r
+ *  void *mhmAlloc (\r
+ *    void *handle,     - heap handle obtained in mhmCreate()\r
+ *    tuint size)        - number of words to allocate for the block\r
+ *\r
+ *  RETURN VALUE: A pointer to block start, or NULL when unsuccessful.\r
+ *\r
+ *****************************************************************************/\r
+\r
+void *mhmAlloc (void *handle, tuint size)\r
+{\r
+  tuint      left;\r
+  mhmHead_t *head = (mhmHead_t*)handle;\r
+  tword      *w_base = (tword *)handle;\r
+  tword      *block;\r
+\r
+  if (size == 0 || size > MHM_MAX_SIZE || head->total_size <= head->used_size)\r
+    return(NULL);\r
+\r
+  /* Make sure the actual used size will be resulting in minimum required MHM alignment */\r
+  size = (tuint)((size + MHM_MAX_ALIGNGAP) & (~MHM_ALIGN_MASK));\r
+\r
+  left = head->total_size - head->used_size;\r
+  if (left < size)                      /* do we have space for this block? */\r
+    return(NULL);\r
+  block = &w_base[head->used_size];\r
+  head->used_size += (tuint)size;       /* increase the used space */\r
+\r
+  /* no need for additional alignment since the size was already aligned above and base is\r
+   *  always kept aligned to the minimum requried MHM alignment */\r
+\r
+  return(block);                        /* return a pointer to start */\r
+} /* mhmAlloc */\r
+\r
+/******************************************************************************\r
+ * FUNCTION PURPOSE: Allocate a block of memory from a heap log2 aligned\r
+ ******************************************************************************\r
+ * DESCRIPTION: Allocates a block of memory from a heap. Block size must be\r
+ *              bigger than zero. It returns a pointer to block start or a\r
+ *              NULL if unsuccessful. The start address will be aligned to pow-2\r
+ *              boundary.\r
+ *\r
+ *  void *mhmAllocAligned (\r
+ *    void *handle,     - heap handle obtained in mhmCreate()\r
+ *    tuint size,       - number of words to allocate for the block\r
+ *    tint  log2align)  - log2 alignment that is required (e.g. 3 for 0xFF..FF8 mask)\r
+ *\r
+ *  RETURN VALUE: A pointer to block start, or NULL when unsuccessful.\r
+ *\r
+ *****************************************************************************/\r
+\r
+void *mhmAllocAligned (void *handle, tuint size, tint log2align)\r
+{\r
+  tuint         left, used_size;\r
+  mhmHead_t     *head   = (mhmHead_t*)handle;\r
+  tword         *w_base = (tword *)handle;\r
+  tword         *block;\r
+  tulong        align_mask, align_gap;\r
+  mhmAddress_t  wa_block_new;\r
+\r
+  if (size == 0 || size > MHM_MAX_SIZE || head->total_size <= head->used_size)\r
+    return(NULL);\r
+\r
+  if (log2align < 1) {                  /* use simple alloc function if no alignment required */\r
+    block = mhmAlloc(handle, size);\r
+    return(block);\r
+  }\r
+  used_size = head->used_size;      /* current used size */\r
+  block     = &w_base[used_size];   /* skip the already used size */\r
+\r
+  /* Remember to align the new block address to the requested alignment */\r
+  align_mask = ((~0UL) << log2align);\r
+  align_gap = (~align_mask);\r
+\r
+  wa_block_new = (((mhmAddress_t)block + align_gap) & align_mask);\r
+  size += wa_block_new - (mhmAddress_t)block;       /* update size with the gap (if any) */\r
+\r
+  /* Make sure the actual used size will be resulting in minimum required MHM alignment */\r
+  /* This in general may be different from the requested start address alignment! */\r
+  size = (tuint)((size + MHM_MAX_ALIGNGAP) & (~MHM_ALIGN_MASK));\r
+\r
+  left = head->total_size - used_size;\r
+  if (left < size)                      /* do we have space for this block? (and any gaps) */\r
+    return(NULL);\r
+  block = (tword*)wa_block_new;         /* this is where we would start new block */\r
+  head->used_size = used_size+size;     /* increase the used space */\r
+\r
+  /* no need for additional alignment since the size and base were already aligned above */\r
+\r
+  return(block);                        /* return a pointer to start */\r
+} /* mhmAllocAligned */\r
+\r
+/******************************************************************************\r
+ * FUNCTION PURPOSE: Deallocate a memory block from a heap.\r
+ ******************************************************************************\r
+ * DESCRIPTION: Deallocates a memory block from a heap.\r
+ *\r
+ *  void mhmFree (\r
+ *    void *handle,     - a heap handle\r
+ *    void *base)       - base address of a block\r
+ *\r
+ *****************************************************************************/\r
+\r
+void mhmFree (void *handle, void *base)\r
+{\r
+  return;           /* currently NOT supported */\r
+} /* mhmFree */\r
+\r
+/******************************************************************************\r
+ * FUNCTION PURPOSE: Reset heap and start allocating form the beginning.\r
+ ******************************************************************************\r
+ * DESCRIPTION: Resets heap and allows for allocation to start from the beginning.\r
+ *\r
+ *  void mhmReset (\r
+ *    void *handle)     - a heap handle\r
+ *\r
+ *****************************************************************************/\r
+\r
+void mhmReset (void *handle)\r
+{\r
+  tuint         used_size;\r
+  mhmHead_t     *head = (mhmHead_t*)handle;\r
+  tword         *w_base = (tword*)handle;\r
+  tword         *block;\r
+  mhmAddress_t  wa_block_new;\r
+\r
+  /* no need to change the total size */\r
+  /* we start from empty heap */\r
+  used_size = sizeof(mhmHead_t);    /* reserve space for the header and make that the used size */\r
+  block     = &w_base[used_size];   /* skip the header */\r
+\r
+  /* Remember to align the remaining pool to the minimum alignment required by MHM  */\r
+  wa_block_new = ((mhmAddress_t)block + MHM_MAX_ALIGNGAP) & (~MHM_ALIGN_MASK);\r
+  used_size += wa_block_new - (mhmAddress_t)block;\r
+\r
+  head->used_size = used_size;    /* record an index to empty space which is with minimum alignment */\r
+\r
+  /* the head which is the base of the heap is already aligned */\r
+  return;\r
+} /* mhmreset */\r
+\r
+/* nothing past this point */\r
+\r
diff --git a/file_demo_bios/k2g/components/mhm/src/mhmport.h b/file_demo_bios/k2g/components/mhm/src/mhmport.h
new file mode 100644 (file)
index 0000000..468bdd4
--- /dev/null
@@ -0,0 +1,142 @@
+/******************************************************************************\r
+ * FILE PURPOSE: Target specific definitions.\r
+ ******************************************************************************\r
+ * FILE NAME:   MHMPORT.H\r
+ *\r
+ * DESCRIPTION: Contains definitions that are specific to different targets.\r
+ *\r
+ * (C) Copyright 1997, TELOGY Networks, Inc.\r
+ *****************************************************************************/\r
+\r
+#ifdef ti_targets_C54\r
+#define _MHMPORT_C54 1\r
+#else\r
+#define _MHMPORT_C54 0\r
+#endif\r
+\r
+#ifdef ti_targets_C54_far\r
+#define _MHMPORT_C54F 1\r
+#else\r
+#define _MHMPORT_C54F 0\r
+#endif\r
+\r
+#ifdef ti_targets_C55\r
+#define _MHMPORT_C55 1\r
+#else\r
+#define _MHMPORT_C55 0\r
+#endif\r
+\r
+#ifdef ti_targets_C55_large\r
+#define _MHMPORT_C55L 1\r
+#else\r
+#define _MHMPORT_C55L 0\r
+#endif\r
+\r
+#ifdef ti_targets_C64\r
+#define _MHMPORT_C64 1\r
+#else\r
+#define _MHMPORT_C64 0\r
+#endif\r
+\r
+#ifdef ti_targets_C64_big_endian\r
+#define _MHMPORT_C64_BIG_ENDIAN 1\r
+#else\r
+#define _MHMPORT_C64_BIG_ENDIAN 0\r
+#endif\r
+\r
+#ifdef ti_targets_C64P\r
+#define _MHMPORT_C64P 1\r
+#else\r
+#define _MHMPORT_C64P 0\r
+#endif\r
+\r
+#ifdef ti_targets_elf_C64P \r
+#define _MHMPORT_ELF_C64P 1\r
+#else\r
+#define _MHMPORT_ELF_C64P 0\r
+#endif\r
+\r
+#ifdef ti_targets_C64P_big_endian\r
+#define _MHMPORT_C64P_BIG_ENDIAN 1\r
+#else\r
+#define _MHMPORT_C64P_BIG_ENDIAN 0\r
+#endif\r
+\r
+#ifdef ti_targets_elf_C64P_big_endian\r
+#define _MHMPORT_ELF_C64P_BIG_ENDIAN 1\r
+#else\r
+#define _MHMPORT_ELF_C64P_BIG_ENDIAN 0\r
+#endif\r
+\r
+#ifdef ti_targets_C66\r
+#define _MHMPORT_C66 1\r
+#else\r
+#define _MHMPORT_C66 0\r
+#endif\r
+\r
+#ifdef ti_targets_elf_C66\r
+#define _MHMPORT_ELF_C66 1\r
+#else\r
+#define _MHMPORT_ELF_C66 0\r
+#endif\r
+\r
+#ifdef ti_targets_C66_big_endian\r
+#define _MHMPORT_C66_BIG_ENDIAN 1\r
+#else\r
+#define _MHMPORT_C66_BIG_ENDIAN 0\r
+#endif\r
+\r
+#ifdef ti_targets_elf_C66_big_endian\r
+#define _MHMPORT_ELF_C66_BIG_ENDIAN 1\r
+#else\r
+#define _MHMPORT_ELF_C66_BIG_ENDIAN 0\r
+#endif\r
+\r
+#ifdef ti_targets_C674\r
+#define _MHMPORT_C674 1\r
+#else\r
+#define _MHMPORT_C674 0\r
+#endif\r
+\r
+#ifdef ti_targets_C674_big_endian\r
+#define _MHMPORT_C674_BIG_ENDIAN 1\r
+#else\r
+#define _MHMPORT_C674_BIG_ENDIAN 0\r
+#endif\r
+\r
+#ifdef gnu_targets_arm_GCArmv7A\r
+#define _MHMPORT_ARM_GCARMV7A 1\r
+#else\r
+#define _MHMPORT_ARM_GCARMV7A 0\r
+#endif\r
+\r
+#if   (_MHMPORT_C54 || _MHMPORT_C54F)\r
+#include <ti/mas/mhm/src/c54/mhmport.h>\r
+#elif (_MHMPORT_C55 || _MHMPORT_C55L)\r
+#include <ti/mas/mhm/src/c55/mhmport.h>\r
+#elif _MHMPORT_ARM_GCARMV7A\r
+#include <ti/mas/mhm/src/arm/mhmport.h>\r
+#elif (_MHMPORT_C64       || _MHMPORT_C64_BIG_ENDIAN      || \\r
+       _MHMPORT_C64P      || _MHMPORT_C64P_BIG_ENDIAN     || \\r
+       _MHMPORT_ELF_C64P  || _MHMPORT_ELF_C64P_BIG_ENDIAN || \\r
+       _MHMPORT_C66       || _MHMPORT_C66_BIG_ENDIAN      || \\r
+       _MHMPORT_ELF_C66   || _MHMPORT_ELF_C66_BIG_ENDIAN  || \\r
+       _MHMPORT_C674      || _MHMPORT_C674_BIG_ENDIAN)\r
+#include <ti/mas/mhm/src/c64/mhmport.h>\r
+#else\r
+#error invalid target\r
+#endif\r
+\r
+#define MHM_ALIGN_BITS    TYP_STRUCT_LOG2ALIGN\r
+#define MHM_ALIGN_MASK    (~((~0U)<<MHM_ALIGN_BITS))   \r
+\r
+/* Align gap is the maximum number of words that may be used to fill a gap\r
+ *  to the next memory block due to alignment requirements. */\r
+#define MHM_MAX_ALIGNGAP  MHM_ALIGN_MASK\r
+\r
+/* The maximum value of a buffer size and the maximum buffer size. They are\r
+ *  not the same due to alignment gap. */\r
+#define MHM_MAX_SIZEVAL   (~0U)\r
+#define MHM_MAX_SIZE      (MHM_MAX_SIZEVAL - MHM_MAX_ALIGNGAP)\r
+\r
+/* Nothing past this point */\r
diff --git a/file_demo_bios/k2g/components/mss/mss.h b/file_demo_bios/k2g/components/mss/mss.h
new file mode 100644 (file)
index 0000000..0405222
--- /dev/null
@@ -0,0 +1,472 @@
+#ifndef _MSS_H\r
+#define _MSS_H\r
+\r
+/**\r
+ *  @file   mss.h\r
+ *  @brief  Contains external API for Multi-Source Selection (MSS) module.\r
+ *\r
+ *        Copyright (c) 2007 – 2013 Texas Instruments Incorporated                \r
+ *                     ALL RIGHTS RESERVED\r
+ */\r
+\r
+#include <ti/mas/types/types.h>\r
+#include <ti/mas/util/ecomem.h>               /* memory descriptor structure */\r
+\r
+/* Define MSS Module as a master group in Doxygen format and add all MSS API \r
+   definitions to this group. */\r
+/** @defgroup mss_module MSS Module API\r
+ *  @{\r
+ */\r
+/** @} */\r
+\r
+/** @defgroup mss_api_functions MSS Functions\r
+ *  @ingroup mss_module\r
+ */\r
+\r
+/** @defgroup mss_api_structures MSS Data Structures\r
+ *  @ingroup mss_module\r
+ */\r
+\r
+/** @defgroup mss_api_constants MSS Constants (enum's and define's)\r
+ *  @ingroup mss_module\r
+ */\r
+\f\r
+/** @defgroup mss_err_code MSS Error Codes\r
+ *  @ingroup mss_api_constants\r
+ *  @{\r
+ *\r
+ *  @name MSS error codes\r
+ *\r
+ *  Error codes returned by MSS API functions.\r
+ */\r
+/*@{*/\r
+enum {\r
+  mss_NOERR              = 0,  /**< success, no error */\r
+  mss_ERR_NOMEMORY       = 1,  /**< supplied memory are not enough            */\r
+  mss_ERR_NOTOPENED      = 2,  /**< MSS instance not in opened state          */\r
+  mss_ERR_NOTCLOSED      = 3,  /**< MSS instance not in closed state          */\r
+  mss_ERR_INVALIDPAR     = 4,  /**< configuration parameter is invalid        */\r
+  mss_ERR_INVALIDSRC     = 5   /**< no valid source is provided to process    */\r
+};\r
+/*@}*/\r
+/** @} */\r
+\r
+/** @defgroup mss_samp_rate MSS Sampling Rates Definitions\r
+ *  @ingroup mss_api_constants\r
+ *  @{\r
+ *\r
+ *  @name MSS sampling rates\r
+ *\r
+ *  Sampling rates that are supported by MSS. \r
+*/\r
+/*@{*/\r
+enum {\r
+  mss_SAMP_RATE_8K  = 1,                   /**< 8kHz  */\r
+  mss_SAMP_RATE_16K = 2                    /**< 16kHz */\r
+};\r
+typedef tint mssSampRate_t;\r
+\r
+/*@}*/\r
+/** @} */\r
+\r
+/** @defgroup mss_src_type MSS Source Type Definitions\r
+ *  @ingroup mss_api_constants\r
+ *  @{\r
+ *\r
+ *  @name MSS source types\r
+ *\r
+ *  MSS supports multiple types of sources which can be microphones, beams, etc.\r
+ *  Microphones can be fixed (mounted on the device) or remote, and can have \r
+ *  their own built-in acoustic echo canceller. \r
+*/\r
+/*@{*/\r
+enum {\r
+  mss_SRC_INVALID     = -1,       /**< Invalid source type                    */\r
+  mss_SRC_MIC_FIXED   =  0,       /**< Fixed microphones                      */\r
+  mss_SRC_MIC_REMOTE  =  1,       /**< Remote microphones                     */\r
+  mss_SRC_MIC_CLEAN   =  2,       /**< Clean microphones (with built-in AEC)  */\r
+  mss_SRC_BEAM        =  3,       /**< Beams from microphone arrays    */\r
+  mss_SRC_MAX         =  mss_SRC_BEAM\r
+};\r
+\r
+typedef tint mssSrcType_t;\r
+#define mss_MAX_NUM_SRC_TYPES (mss_SRC_MAX+1) /**< Max # of supported source types */\r
+/*@}*/\r
+/** @} */\r
+\r
+/** \r
+ *  @ingroup mss_api_structures\r
+ *\r
+ *  @brief Source structure used to manually select a source. \r
+ */\r
+typedef struct mssSrc_s {\r
+  mssSrcType_t group;    /**< source group to be manually selected:\r
+                              valid values: mss_SRC_MIC_FIXED, etc.  */\r
+  tint         index;    /**< group index of the source to be manually selected:\r
+                              range: 0 - number of sources minus 1 */\r
+} mssSrc_t;\r
+\r
+/** \r
+ *  @ingroup mss_api_structures\r
+ *\r
+ *  @brief Configuration structure for mssGetSizes()\r
+ *  \brief This structure is used for getting memory requirements of MSS through \r
+ *         function mssGetSizes().\r
+ */\r
+typedef struct mssSizeConfig_s {\r
+  mssSampRate_t max_sampling_rate;      /**< Maximum sampling rate: \r
+                                             8kHz:  set to mss_SAMP_RATE_8K. \r
+                                             16kHz: set to mss_SAMP_RATE_16K. */  \r
+  tint max_num_mic_fixed;  /**< Maximum number of fixed microphones           */\r
+  tint max_num_mic_remote; /**< Maximum number of remote microphones          */\r
+  tint max_num_mic_clean;  /**< Maximum number of microphones with built-in AEC */\r
+  tint max_num_beam;       /**< Maximum number of beams from microphone array   */\r
+} mssSizeConfig_t;\r
+\r
+/** \r
+ *  @ingroup mss_api_structures\r
+ *\r
+ *  @brief Configuration structure for mssNew()\r
+ *  \brief This structure is used for creating a new MSS instance through \r
+ *         function mssNew().\r
+ */\r
+typedef struct mssNewConfig_s {\r
+  void  *handle;                                     /**< handle              */\r
+  mssSizeConfig_t  sizeCfg;                          /**< size configration   */\r
+} mssNewConfig_t;\r
+\r
+/** \r
+ *  @ingroup mss_api_structures\r
+ *\r
+ *  @brief Configuration structure for mssOpen()\r
+ *  \brief This structure contains system parameters to configure an MSS \r
+ *         instance through mssOpen(). MSS doesn't have default value for these\r
+ *         parameters, and they must be set explicitly when mssOpen() is called\r
+ *         the first time after mssNew(). \r
+ *  \remarks This structure doesn't contain any configurable parameters that are\r
+ *           controlled through mssControl_s to avoid confusion.\r
+ */\r
+typedef struct mssConfig_s {\r
+  mssSampRate_t sampling_rate;  /**< Sampling rate: \r
+                                     8kHz:  set to mss_SAMP_RATE_8K. \r
+                                     16kHz: set to mss_SAMP_RATE_16K.         */  \r
+  tint  num_mic_fixed;          /**< Number of fixed microphones              */\r
+  tint  num_mic_remote;         /**< Number of remote microphones             */\r
+  tint  num_mic_clean;          /**< Number of microphones with built-in AEC  */\r
+  tint  num_mic_array;          /**< Number of microphones in microphone-array*/\r
+  tint  num_beam;               /**< Number of beams from microphone array    */\r
+} mssConfig_t;\r
+\r
+/** \r
+ *  @ingroup mss_api_structures\r
+ *\r
+ *  @brief MSS control bitfield structure \r
+ *\r
+ *  Bitfield masks mss_CTL_MODES_XYZ may be used to change MSS operation modes\r
+ *  through mssControl(), by constructing elements "mask" and "value" of mssModes_s.\r
+ *\r
+ *  @verbatim\r
+    MSS Modes Control Bitfield: \r
+    ---------------------------------------\r
+    |15|14|13|12|11|10|9|8|7|6|5|4|3|2|1|0|\r
+    ---------------------------------------\r
+       bits      values       meaning\r
+    (from LSB) \r
+        0          1       MSS bypass operation - MSS always selects the \r
+                           first available source passed to mssProcess().               \r
+                   0       MSS normal operation. \r
+        1          1       Freeze the update of MSS states - MSS always selects \r
+                           whatever source that was selcted before update was \r
+                           frozen. \r
+                   0       Enable the update of MSS states - normal operation.                   \r
+ *\r
+ */\r
+typedef struct mssCtlBf_s {\r
+  tuint mask;            /**< Indicates the bits to be changed.               */\r
+  tuint value;           /**< Gives new value of each bit indicated by mask.  */\r
+/*@{*/\r
+#define mss_CTL_MODES_BYPASS   0x0001  /**< Bypass MSS */\r
+#define mss_CTL_MODES_FREEZE   0x0002  /**< Freeze MSS internal states update */\r
+#define mss_CTL_MODES_DEFAULT  0x0000  /**< Default (normal) operation modes  */\r
+/*@}*/\r
+} mssCtlBf_t;\r
+\r
+/** \r
+ *  @ingroup mss_api_structures\r
+ *\r
+ *  @brief Control structure for mssControl()\r
+ *\r
+ *  \brief This structure is used to change MSS configurable parameters. \r
+ *         Element mssControl_s.valid_bitfield indicates which parameter to be\r
+ *         changed, and other elements give the parameter values. \r
+ */\r
+typedef struct mssControl_s {\r
+    tuint      valid_bitfield;\r
+/*@{*/\r
+#define mss_CTL_MODES           0x0001 /**< change mssControl_s.modes         */\r
+#define mss_CTL_SELECT_SRC      0x0002 /**< change mssControl_s.source        */\r
+#define mss_CTL_SWITCH_THRESH   0x0004 /**< change mssControl_s.switch_thresh */\r
+#define mss_CTL_SWITCH_DURATION 0x0008 /**< change mssControl_s.switch_duration */\r
+#define mss_CTL_SWITCH_HNAGOVER 0x0010 /**< change mssControl_s.switch_hangover */\r
+#define mss_CTL_ALL              (  mss_CTL_MODES \\r
+                                  | mss_CTL_SELECT_SRC \\r
+                                  | mss_CTL_SWITCH_THRESH \\r
+                                  | mss_CTL_SWITCH_DURATION \\r
+                                  | mss_CTL_SWITCH_HNAGOVER ) /**< change all */\r
+/*@}*/   \r
+    mssCtlBf_t modes;             /**< controls MSS operation modes */\r
+    mssSrc_t   source;            /**< the source selected by external user   */\r
+    tint       switch_thresh;     /**< switch threshold in msec: a source needs\r
+                                       to meet the selection criteria for this\r
+                                       amount of time before switch to this \r
+                                       source starts. Default is 250msec      */\r
+    tint       switch_duration;   /**< switch duration in msec: it takes this\r
+                                       amount of time to switch from one source \r
+                                       to another. Default is 500msec.        */\r
+    tint       switch_hangover;   /**< switch hangover in msec: after a new \r
+                                       source is selected, it has to wait this \r
+                                       time before evaluating next possible \r
+                                       source switch. Default is 1000msec.    */\r
+} mssControl_t;\r
+\r
+/** \r
+ *  @ingroup mss_api_structures\r
+ *\r
+ *  @brief MSS debug structure \r
+ *\r
+ *  \brief This structure is used to provide MSS debugging information.\r
+ */\r
+#define mss_DEBUG_STATE_NUM_TUINT 16 \r
+typedef struct mssDebugStat_s {\r
+  mssSrc_t cur_src;                                 /**< Current source */\r
+  mssSrc_t new_src;                                 /**< Temporary new source */\r
+  tuint    states[mss_DEBUG_STATE_NUM_TUINT];       /**< MSS internal states */\r
+} mssDebugStat_t;\r
+\r
\r
+/**\r
+ *  @ingroup mss_api_functions\r
+ *\r
+ *  @brief Function mssGetSizes() obtains from MSS the memory requirements of  \r
+ *         an instance, which depend on provided configuration parameters.   \r
+ *\r
+ *  @param[in]   cfg     Pointer to a size configuration structure.\r
+ *  @param[out]  nbufs   Memory location to store the returned number of buffers\r
+ *                       required by the instance.\r
+ *  @param[out]  bufs    Memory location to store the returned address of the \r
+ *                       vector of memory buffer descriptions required by MSS. \r
+ *\r
+ *  @remark Type ecomemBuffer_t is defined in ecomem.h of util package.\r
+ *\r
+ *  @retval              MSS error code, always mss_NOERR.\r
+ */\r
+tint mssGetSizes(tint *nbufs, const ecomemBuffer_t **bufs, mssSizeConfig_t *cfg);\r
+\r
+/**\r
+ *  @ingroup mss_api_functions\r
+ *\r
+ *  @brief Function mssNew() creates a new instance of MSS.  \r
+ *  \remark Function mssNew() must be called before mssOpen()is called.\r
+ *\r
+ *  @param[in]     nbufs     Number of memory buffers allocated by the user.\r
+ *  @param[in]     bufs      Pointer to memory buffer descriptors defined by\r
+ *                           user.\r
+ *  \remark Buffer alignment property of each buffer passed to mssNew() must be \r
+ *          equal to or better than what is returned by mssGetSizes(), and must\r
+ *          be in consistency with the base address of the buffer.\r
+ *\r
+ *  @param[in]     cfg       Pointer to new instance configuration structure.\r
+ *  @param[in,out] mssInst   Memory location that will receive a pointer to \r
+ *                           the created MSS instance. This pointer will be  \r
+ *                           returned by mssNew().\r
+ *  @retval                  MSS error code. See \ref mss_err_code.\r
+ *  @verbatim\r
+     error code              description\r
+     mss_NOERR               success\r
+     mss_ERR_INVALIDPAR      *mssInst is not NULL or nbufs is not correct \r
+     mss_ERR_NOMEMORY        properties of certain buffer are bad:\r
+                             - size is not zero but base address is NULL,\r
+                             - alignment and base address are not consistent,\r
+                             - volatility does not meet requirement.\r
+    \endverbatim\r
+ *\r
+ *  @pre  The pointer at the location pointed to by mssInst must be set to NULL \r
+ *        before this function is called.\r
+ *  @post A pointer to the MSS instance buffer will be returned to the location\r
+ *        pointed to by mssInst. Instance state will be set to closed.\r
+ */\r
+tint mssNew (void **mssInst, tint nbufs, ecomemBuffer_t *bufs, mssNewConfig_t *cfg);\r
+\r
+/**\r
+ *  @ingroup mss_api_functions \r
+ *\r
+ *  @brief Function mssOpen() initializes and configures an MSS instance.\r
+ *\r
+ *  @remark This function must be called after mssNew() to initialize a new MSS\r
+ *          instance. It may also be called to reconfigure an instance that \r
+ *          has been closed by mssClose() but not deleted by mssDelete().\r
+ *\r
+ *  @param[in]      cfg      Pointer to MSS configuration parameter.\r
+ *  @param[in]      mssInst  Pointer to MSS instance.\r
+ *  @retval                  MSS error code. See \ref mss_err_code.\r
+ *  @verbatim\r
+     error code              description\r
+     mss_NOERR               success\r
+     mss_ERR_NOTCLOSED       MSS instance state has not been set to closed, i.e,\r
+                             mssNew() or mssClose() not called for the instance.\r
+     mss_ERR_INVALIDPAR      bad configuration parameters:\r
+                             - cfg is NULL\r
+                             - total number of sources is less than or equal to 0.\r
+    \endverbatim\r
+ *\r
+ *  @pre  Function mssNew() must be called before mssOpen() is called the first\r
+ *        time to open a new instance. For subsequent calls to open an existing\r
+ *        instance, mssClose() must be called before mssOpen() to close the\r
+ *        instance.\r
+ *  @post All the parameters that are not part of mssConfig_t are set to \r
+ *        default values by mssOpen. \r
+ *  @post After MSS instance is opened, mssControl() and mssProcess() may \r
+ *        be called for control or processing.  \r
+ *\r
+ */\r
+tint mssOpen (void *mssInst, mssConfig_t *cfg);\r
+\r
+/**\r
+ *  @ingroup mss_api_functions\r
+ *\r
+ *  @brief Function mssControl() changes MSS operation modes or parameters. \r
+ *\r
+ *  @param[in]      mssInst   Pointer to MSS instance.\r
+ *  @param[in,out]  ctl       Pointer to MSS control structure. \r
+ *\r
+ *  @retval                   MSS error code. See \ref mss_err_code.\r
+ *  @verbatim\r
+     error code              description\r
+     mss_NOERR               success\r
+     mss_ERR_NOTOPENED       MSS instance has not been opened\r
+     mss_ERR_INVALIDSRC      mssControl_s.source is an invalid source\r
+    \endverbatim\r
+ *\r
+ */\r
+tint mssControl (void *mssInst, mssControl_t *ctl);\r
+\r
+/**\r
+ *  @ingroup mss_api_functions\r
+ *\r
+ *  @brief Function mssProcess() examines all input sources to MSS and selects \r
+ *         the best one.\r
+ *\r
+ *  @param[in]  mssInst         Pointer to MSS instance.\r
+ *  @param[in]  rx_out_sync     Synchronized Rx path output signal, NOT to be\r
+ *                              selected, but to assist source\r
+ *                              selection. (Not used)\r
+ *  @param[in]  mic_fixed       Signals from fixed mics.\r
+ *  @param[in]  mic_remote      Signals from remote mics.\r
+ *  @param[in]  mic_clean       Signals from mics with own AEC.\r
+ *  @param[in]  mic_array       Signals from mics in the mic-array.\r
+ *  @param[in]  beam            Signals from beams formed from mic-array.\r
+ *\r
+ *  @param[out] out             Buffer to store the selected source signal\r
+ *\r
+ *  @remark All input signals and output signal are 16-bit linear samples \r
+ *          of 10 msec. \r
+ *\r
+ *  @retval                   MSS error code. See \ref mss_err_code.\r
+ *  @verbatim\r
+     error code              description\r
+     mss_NOERR               success\r
+     mss_ERR_NOTOPENED       MSS instance has not been opened\r
+     mss_ERR_INVALIDSRC      mssControl_s.source is an invalid source\r
+    \endverbatim\r
+ *\r
+ */\r
+tint mssProcess(void *mssInst, void *out, void *rx_out_sync, void *mic_fixed[],\r
+         void *mic_remote[], void *mic_clean[], void *mic_array[], void *beam[]);\r
+\r
+/**\r
+ *  @ingroup mss_api_functions\r
+ *\r
+ *  @brief Function mssDebugStat() returns debug information.\r
+ *\r
+ *  @param[in]  mssInst         Pointer to MSS instance.\r
+ *  @param[out] mssDbg          Debug information.\r
+ *\r
+ *  @retval                   MSS error code. See \ref mss_err_code.\r
+ *  @verbatim\r
+     error code              description\r
+     mss_NOERR               success\r
+     mss_ERR_NOTOPENED       MSS instance has not been opened\r
+    \endverbatim\r
+ *\r
+ */         \r
+tint mssDebugStat(void *mssInst, mssDebugStat_t *mssDbg);\r
+\r
+/**\r
+ *  @ingroup mss_api_functions\r
+ *\r
+ *  @brief Function mssClose() closes an MSS instance. \r
+ *  \remark Function mssClose() must be called before mssDelete() is called.\r
+ *\r
+ *  @param[in]  mssInst      pointer to the instance to be closed\r
+ *  @retval                  MSS error code. See \ref mss_err_code.\r
+ *  @verbatim\r
+     error code              description\r
+     mss_NOERR               success\r
+     mss_ERR_NOTOPENED       MSS instance is not in open state\r
+    \endverbatim\r
+ *\r
+ */\r
+tint mssClose(void *mssInst);\r
+\r
+/**\r
+ *  @ingroup mss_api_functions\r
+ *\r
+ *  @brief Function mssDelete() deletes the MSS instance identified by mssInst\r
+ *         and returns the addresses of those buffers used by this instance.  \r
+ *\r
+ *  @param[in]      nbufs    Number of buffers used by this instance.\r
+ *  @param[in]      bufs     Pointer to buffer descriptors to store returned\r
+ *                           addresses of the buffers used by this instance.\r
+ *  @param[in,out]  mssInst  Memory location where the pointer to MSS instance\r
+ *                           is stored.\r
+ *  @retval                  MSS error code. See \ref mss_err_code.\r
+ *  @verbatim\r
+     error code              description\r
+     mss_NOERR               success\r
+     mss_ERR_NOTCLOSED       MSS instance has not been closed.\r
+     mss_ERR_NOMEMORY        Not enough buffer descriptors to store all returned \r
+                             buffer addresses.\r
+    \endverbatim\r
+ *\r
+ *  @pre  MSS instance must be closed by mssClose() before mssDelete() is called. \r
+ *  @post After mssDelete() is called, MSS instance pointer stored at mssInst \r
+          will be set to NULL, and the addresses of the buffers used by this \r
+          instance will be returned to the location pointed to by bufs.\r
+ */\r
+tint mssDelete(void **mssInst, tint nbufs, ecomemBuffer_t *bufs);\r
+\r
+\r
+/* -------------------------- MSS Call Table -------------------------------- */\r
+/**\r
+ *  @ingroup mss_api_structures\r
+ *\r
+ *  @brief MSS call table\r
+ *\r
+ */\r
+typedef struct {\r
+  tint  (*mssClose)     (void *mssInst);\r
+  tint  (*mssControl)   (void *mssInst, mssControl_t *ctl);\r
+  tint  (*mssDelete)    (void **mssInst, tint nbufs, ecomemBuffer_t *bufs);\r
+  tint  (*mssGetSizes)  (tint *nbufs, const ecomemBuffer_t **bufs,\r
+                         mssSizeConfig_t *cfg);\r
+  tint  (*mssNew)       (void **mssInst, tint nbufs, ecomemBuffer_t *bufs,\r
+                         mssNewConfig_t *cfg);\r
+  tint  (*mssOpen)      (void *mssInst, mssConfig_t *cfg);\r
+  tint  (*mssProcess)   (void *mssInst, void *out, void *rx_out_sync, \r
+                         void *mic_fixed[], void *mic_remote[], void *mic_clean[], \r
+                         void *mic_array[], void *beam[]);                               \r
+} mssCallTable_t;\r
+\r
+#endif\r
+/* Nothing past this point */\r
+\r
diff --git a/file_demo_bios/k2g/components/mss/src/mss.c b/file_demo_bios/k2g/components/mss/src/mss.c
new file mode 100644 (file)
index 0000000..c5068e2
--- /dev/null
@@ -0,0 +1,497 @@
+/**\r
+ *  @file   mss.c\r
+ *  @brief  Contains external API for Multi-Source Selection (MSS) module \r
+ *          instantiation.\r
+ *\r
+ *  (C) Copyright 2011, Texas Instruments, Inc.\r
+ */\r
+\r
+#include <xdc/std.h>\r
+#include <ti/mas/types/types.h>\r
+#include <ti/mas/fract/fract.h>\r
+#include <ti/mas/vpe/svd.h>\r
+\r
+//#include <ti/mas/aer/mss.h>\r
+//#include <ti/mas/aer/src/mssloc.h>\r
+#include "../mss.h"\r
+#include "mssloc.h"\r
+\r
+#define MSS_DEF_SWITCH_WAIT_TIME  250     /* msec */\r
+#define MSS_DEF_SWITCH_DURATION   500     /* msec */\r
+#define MSS_DEF_SWITCH_HANGOVER   1000    /* msec */\r
+#define MSS_DEF_FADE_PHA_INC_8KHZ 268435L  /* Q31 phase increment of crossfade for \r
+                                              switch duration of 1 second at 8kHz:\r
+                                              2^31/8000, where 2^31 corresponds to pi. */\r
+/* MSS memory buffer descriptors */\r
+#define MSS_NUM_BUFS 1\r
+#define MSS_INSTANCE_BUF 0\r
+ecomemBuffer_t mssBufs[MSS_NUM_BUFS] = {                             \r
+  /* CLASS, LOG2 ALIGNMENT, BUFFER SIZE, VOLATILITY, BASE */\r
+  ecomem_CLASS_EXTERNAL, TYP_STRUCT_LOG2ALIGN, 0, FALSE, NULL\r
+};\r
+\r
+/******************************************************************************\r
+ * FUNCTION PURPOSE: Return buffer sizes for the MSS module\r
+ ******************************************************************************\r
+ * DESCRIPTION: Calculate the worst case buffer sizes for the MSS. Also specify\r
+ *              alignment and volatility requirements.\r
+ *\r
+ *  tint mssGetSizes (\r
+ *    tint              *nbufs,    - address to store number of buffers\r
+ *    const ecomemBuffer_t **bufs, - address to store buffer descriptors\r
+ *    mssSizeConfig_t   *cfg)      - information to be used in calculating the\r
+ *                                   worst case buffer sizes\r
+ *****************************************************************************/\r
+tint mssGetSizes(tint *nbufs, const ecomemBuffer_t **bufs, mssSizeConfig_t *cfg)\r
+{\r
+  tint svd_size, mss_size, mss_inst_size, num_src;\r
+\r
+  /* Get memory requirement of SVD */\r
+  svdGetSizes (&svd_size);\r
+  \r
+  /* Calculate total memory of MSS: instance + all SVDs*/\r
+  svd_size = mss_SIZE_ALIGN(svd_size,TYP_STRUCT_LOG2ALIGN);\r
+  mss_inst_size = sizeof(mssInst_t);\r
+  mss_inst_size = mss_SIZE_ALIGN(mss_inst_size,TYP_STRUCT_LOG2ALIGN);\r
+  num_src =  cfg->max_num_mic_fixed + cfg->max_num_mic_remote\r
+           + cfg->max_num_mic_clean + cfg->max_num_beam;\r
+  mss_size = svd_size*num_src + mss_inst_size;\r
+  mssBufs[MSS_INSTANCE_BUF].size = mss_size;\r
+\r
+  /* Return number of buffers required by MSS */  \r
+  *nbufs = MSS_NUM_BUFS;\r
+  \r
+  /* Return buffer specifications */\r
+  *bufs = &mssBufs[0];                  \r
+  \r
+  return(mss_NOERR);\r
+  \r
+} /* mssGetSizes */\r
+\r
+/******************************************************************************\r
+ * FUNCTION PURPOSE: Create an instance of the MSS module.\r
+ ******************************************************************************\r
+ * DESCRIPTION: Creates an instance of the MSS and initializes memory buffers.\r
+ *\r
+ *  tint mssNew (\r
+ *    void            **mssInst,  - address of the memory location that will\r
+ *                                  receive a pointer to instance structure\r
+ *    tint            nbufs,      - number of memory buffers\r
+ *    ecomemBuffer_t  *bufs,      - a vector of buffer descriptors\r
+ *    mssNewConfig_t  *cfg)       - a pointer to configuration structure\r
+ *\r
+ *  Return value: \r
+ *          mss_NOERR             - success\r
+ *          mss_ERR_INVALIDPAR    - *mssInst is not NULL or nbufs is not correct \r
+ *          mss_ERR_NOMEMORY      - MSS instance pointer is not NULL, or\r
+ *                                  number of buffers is not correct, or\r
+ *                                  buffer properties are not correct\r
+ *****************************************************************************/\r
+tint mssNew (void **mssInst, tint nbufs, ecomemBuffer_t *bufs, mssNewConfig_t *cfg)\r
+{\r
+  mssInst_t       *inst;\r
+  ecomemBuffer_t  *bufp;\r
+  tint svd_size, mss_size, mss_inst_size, num_src;\r
+  int i;\r
+  \r
+  /* Test instance pointer (must be NULL) */\r
+  if ((*mssInst != NULL) || (nbufs != MSS_NUM_BUFS)) {\r
+    return(mss_ERR_INVALIDPAR);\r
+  }\r
+\r
+  /* Check all dynamic buffers (base address != NULL) */\r
+  for (i=0, bufp=&bufs[0]; i<MSS_NUM_BUFS; i++, bufp++) {\r
+    if ((bufp->size>0) && (bufp->base==NULL)) {\r
+      return(mss_ERR_NOMEMORY);\r
+    }\r
+  }\r
+\r
+  /* Get the instance buffer descriptor returned by the user */\r
+  bufp = &bufs[MSS_INSTANCE_BUF];\r
+\r
+  /* Calculate total memory of MSS: instance + all SVDs */\r
+  svdGetSizes (&svd_size);\r
+  svd_size = mss_SIZE_ALIGN(svd_size,TYP_STRUCT_LOG2ALIGN);\r
+  mss_inst_size = sizeof(mssInst_t);\r
+  mss_inst_size = mss_SIZE_ALIGN(mss_inst_size,TYP_STRUCT_LOG2ALIGN);\r
+  num_src =  cfg->sizeCfg.max_num_mic_fixed + cfg->sizeCfg.max_num_mic_remote\r
+           + cfg->sizeCfg.max_num_mic_clean + cfg->sizeCfg.max_num_beam;\r
+  mss_size = svd_size*num_src + mss_inst_size;\r
+  \r
+  /* Check if the provided memory is good: size, alignment, and volatility */\r
+  if ( (bufp->size < mss_size) \r
+      || (!typChkAlign(bufp->base, bufp->log2align)) || bufp->volat) {\r
+    return(mss_ERR_NOMEMORY);\r
+  }\r
+  \r
+  /* Assign instance memory and initialize instance */\r
+  inst = (mssInst_t *)bufp->base;\r
+  inst->max_sampling_rate = cfg->sizeCfg.max_sampling_rate;\r
+  inst->svd = (tword *)bufp->base + mss_inst_size; /* SVD address for 1st src */\r
+  inst->svd_size = svd_size;\r
+  inst->handle = cfg->handle;        /* init handle in instance */\r
+  inst->state = MSS_CLOSED;          /* set MSS state to CLOSED */\r
+\r
+  /* Return instance address */\r
+  *mssInst = (void *)inst;\r
+\r
+  return(mss_NOERR);\r
+  \r
+} /* mssNew() */\r
+\r
+/******************************************************************************\r
+ * FUNCTION PURPOSE: Control of MSS\r
+ ******************************************************************************\r
+ * DESCRIPTION: Controls the operation and parameters of the MSS.\r
+ *\r
+ *  tint mssControl (\r
+ *    void  *mssInst,              - a pointer to MSS instance\r
+ *    tint  mssControl *ctl)       - a pointer to the control code structure \r
+ *\r
+ *  Return value: mss_NOERR           - success\r
+ *                mss_ERR_NOTOPENED   - MSS not opened\r
+ *                mss_ERR_INVALIDSRC  - the manually selected source is invalid \r
+ *                mss_ERR_INVALIDPAR  - parameter is invalid \r
+ *****************************************************************************/\r
+tint mssControl (void *mssInst, mssControl_t *ctl)\r
+{\r
+  mssInst_t *inst = (mssInst_t *)mssInst;\r
+  tint ret_val;\r
+\r
+  /* Make sure that MSS is open */\r
+  if (inst->state != MSS_OPEN) {\r
+    return (mss_ERR_NOTOPENED);\r
+  }  \r
+  \r
+  ret_val = mss_NOERR;\r
+\r
+  /* Change the operation modes bitfield */\r
+  if(mss_chkbit(ctl->valid_bitfield, mss_CTL_MODES)) {\r
+    inst->modes_bf =  (inst->modes_bf & (~ctl->modes.mask))\r
+                    | (ctl->modes.value & ctl->modes.mask);\r
+  } /* mss_CTL_MODES */\r
+  \r
+  /* Manually select source */\r
+  if(mss_chkbit(ctl->valid_bitfield, mss_CTL_SELECT_SRC)) {\r
+    /* Check if selected source is valid:\r
+         - source group must be one of the groups defined in mss.h,      \r
+         - source index must be less than the number of sources in the group. */\r
+    if(   (ctl->source.group > mss_SRC_MAX)\r
+       || (ctl->source.group < mss_SRC_MIC_FIXED) ){\r
+      ret_val = mss_ERR_INVALIDSRC;\r
+    } \r
+    else if (ctl->source.index > inst->num_src_per_group[ctl->source.group]) {\r
+      ret_val = mss_ERR_INVALIDSRC;\r
+    }\r
+    else if (   (ctl->source.group != inst->cur_src.group) \r
+             || (ctl->source.index != inst->cur_src.index) ) {      \r
+      /* Prepare to switch source if selected source is valid. If in the middle of a \r
+         source switch initiated by MSS internally, internal switch will be stopped. */\r
+      inst->switch_src_cnt  = 0;\r
+      inst->crossfade_phase = MSS_FADE_PHA_INIT;\r
+      inst->switch_hang_cnt = inst->params.switch_hangover;\r
+      inst->new_src = ctl->source;\r
+      mss_setbit(inst->state_bf, MSS_STATE_BIT_SWITCH_SRC);\r
+    }\r
+  } /* mss_CTL_SELECT_SRC */\r
+\r
+  /* Change the threshold of source switch */\r
+  if(mss_chkbit(ctl->valid_bitfield, mss_CTL_SWITCH_THRESH)) {\r
+    /* Convert parameter from msec to # of samples */\r
+    inst->params.switch_threshold = MSS_NUM_SAMP_1MS_8KHZ * inst->sampling_rate\r
+                                    * ctl->switch_thresh;\r
+  }\r
+  \r
+  /* Change the duration of source switch */\r
+  if(mss_chkbit(ctl->valid_bitfield, mss_CTL_SWITCH_DURATION)) {\r
+    /* Convert parameter from msec to # of samples */\r
+    inst->params.switch_duration = MSS_NUM_SAMP_1MS_8KHZ * inst->sampling_rate\r
+                                   * ctl->switch_duration;\r
+    /* Calculate per sample Q31 phase increment for crossfade implementation: \r
+       2^31/duration, where 2^31 corresponds to pi. */                                     \r
+    inst->crossfade_phase_inc = frct_LFRCT_MAX/inst->params.switch_duration;                                     \r
+  } /* mss_CTL_SWITCH_DURATION */\r
+\r
+  /* Change hangover of source switch */\r
+  if(mss_chkbit(ctl->valid_bitfield, mss_CTL_SWITCH_HNAGOVER)) {\r
+    /* Convert parameter from msec to # of samples */\r
+    inst->params.switch_hangover = MSS_NUM_SAMP_1MS_8KHZ * inst->sampling_rate\r
+                                   * ctl->switch_hangover;\r
+  } /* mss_CTL_SWITCH_HNAGOVER */\r
+  \r
+  return ret_val;\r
+} /* mssControl */\r
+  \r
+/******************************************************************************\r
+ * FUNCTION PURPOSE: Open and configure an MSS instance.\r
+ ******************************************************************************\r
+ * DESCRIPTION: This function configures an instance of the MSS.\r
+ *\r
+ *  tint mssOpen (\r
+ *    void        *mssInst,   - a pointer to MSS instance\r
+ *    mssConfig_t *cfg)       - a pointer to MSS configuration structure\r
+ *\r
+ *****************************************************************************/\r
+tint mssOpen (void *mssInst, mssConfig_t *cfg)\r
+{\r
+  mssInst_t * inst = (mssInst_t *)mssInst;\r
+  tword * svd_ptr;\r
+  tint num_src, svd_size;\r
+  int i;\r
+  \r
+  /* Return error if state is not CLOSED */  \r
+  if(inst->state != MSS_CLOSED) {\r
+    return(mss_ERR_NOTCLOSED);\r
+  }\r
+  \r
+  /* Return error if no configuration parameters */\r
+  if(cfg == NULL){\r
+    return(mss_ERR_INVALIDPAR);\r
+  }\r
+  \r
+  /* Read configuration */\r
+  num_src = cfg->num_mic_fixed+cfg->num_mic_remote+cfg->num_mic_clean+cfg->num_beam;\r
+  if(num_src <= 0) {\r
+    return(mss_ERR_INVALIDPAR);\r
+  }\r
+  \r
+  inst->sampling_rate  = cfg->sampling_rate;\r
+  inst->num_src_per_group[mss_SRC_MIC_FIXED]  = cfg->num_mic_fixed;\r
+  inst->num_src_per_group[mss_SRC_MIC_REMOTE] = cfg->num_mic_remote;\r
+  inst->num_src_per_group[mss_SRC_MIC_CLEAN]  = cfg->num_mic_clean;\r
+  inst->num_src_per_group[mss_SRC_BEAM]       = cfg->num_beam;\r
+  inst->num_mic_array  = cfg->num_mic_array; /* not considered as source to select */\r
+  \r
+  /* Init SVDs */\r
+  svd_ptr = (tword *)inst->svd;\r
+  for(i=0; i<num_src; i++) {\r
+    if (!typChkAlign(svd_ptr, TYP_STRUCT_LOG2ALIGN)) {\r
+      return(mss_ERR_NOMEMORY);\r
+    }\r
+    svdInit((void *)svd_ptr, inst->sampling_rate);\r
+    svd_ptr += svd_size;\r
+  }    \r
+  \r
+  /* Set parameters to default */\r
+  inst->params.switch_threshold = MSS_DEF_SWITCH_WAIT_TIME * MSS_NUM_SAMP_1MS_8KHZ\r
+                                 * inst->sampling_rate; /* convert msec to # of samples */\r
+  inst->params.switch_duration = MSS_DEF_SWITCH_DURATION * MSS_NUM_SAMP_1MS_8KHZ\r
+                                 * inst->sampling_rate; /* convert msec to # of samples */\r
+  inst->crossfade_phase_inc    = MSS_DEF_FADE_PHA_INC_8KHZ / inst->sampling_rate;\r
+  inst->params.switch_hangover = MSS_DEF_SWITCH_HANGOVER * MSS_NUM_SAMP_1MS_8KHZ \r
+                                 * inst->sampling_rate; /* convert msec to # of samples */\r
+  inst->modes_bf = mss_CTL_MODES_DEFAULT;\r
+  \r
+  /* Set initially selected source - the first valid source */\r
+  if(cfg->num_mic_fixed > 0) {\r
+    inst->cur_src.group = mss_SRC_MIC_FIXED;\r
+    inst->cur_src.index = 0;\r
+  }\r
+  else if(cfg->num_mic_remote > 0) {\r
+    inst->cur_src.group = mss_SRC_MIC_REMOTE;\r
+    inst->cur_src.index = 0;\r
+  }\r
+  else if(cfg->num_mic_clean > 0) {\r
+    inst->cur_src.group = mss_SRC_MIC_CLEAN;\r
+    inst->cur_src.index = 0;\r
+  }\r
+  else {\r
+    inst->cur_src.group = mss_SRC_BEAM;\r
+    inst->cur_src.index = 0;\r
+  }\r
+  \r
+  /* Initialize instance */ \r
+  inst->frame_size = inst->sampling_rate * MSS_FRAME_SIZE_8KHZ;\r
+  inst->switch_hang_cnt = inst->params.switch_hangover;\r
+  inst->crossfade_cnt  = 0;\r
+  inst->state_bf = 0;\r
+  \r
+  /* Declare the instance OPEN */\r
+  inst->state = MSS_OPEN;   \r
+\r
+  return(mss_NOERR);\r
+} /* mssOpen */\r
+\r
+/******************************************************************************\r
+ * FUNCTION PURPOSE: Returns debuging information for an MSS instance.\r
+ ******************************************************************************\r
+ * DESCRIPTION: This function returns debuging information.\r
+ *\r
+ *  tint mssDebugStat (\r
+ *    void        *mssInst,   - a pointer to MSS instance\r
+ *    mssDebugStat_t *mssDbg) - a pointer to MSS debug structure\r
+ *\r
+ *****************************************************************************/\r
+tint mssDebugStat(void *mssInst, mssDebugStat_t *mssDbg)\r
+{\r
+  tint svd_decision;\r
+  tword *svd_ptr;\r
+  LFract sig_pow;\r
+  Fract spch_db, noise_db;\r
+  UFract svd_thresh;\r
+  mssInst_t *inst = (mssInst_t *)mssInst;\r
+\r
+  /* Make sure that MSS is open */\r
+  if (inst->state != MSS_OPEN) {\r
+    return (mss_ERR_NOTOPENED);\r
+  }  \r
+  \r
+  mssDbg->cur_src = inst->cur_src;\r
+  mssDbg->new_src = inst->new_src;\r
+  mssDbg->states[0] = (tuint)(inst->crossfade_phase>>16);\r
+  mssDbg->states[1] = (tuint)inst->gain_in;\r
+  mssDbg->states[2] = (tuint)inst->gain_out;\r
+  mssDbg->states[3] = (tuint)inst->switch_src_cnt; \r
+  mssDbg->states[4] = (tuint)inst->state_bf;\r
+\r
+  /* only debug fixed mics for now */\r
+  if(inst->num_src_per_group[mss_SRC_MIC_FIXED] > 1) {\r
+    svd_ptr = inst->svd;\r
+    svd_decision = svdGetDecision(svd_ptr, &sig_pow);\r
+    mssDbg->states[5] = (tuint)svd_decision;\r
+    \r
+    svdGetLevels (svd_ptr, &spch_db, &noise_db, &svd_thresh);\r
+    mssDbg->states[6] = (tuint)spch_db;\r
+    mssDbg->states[7] = (tuint)noise_db;\r
+  \r
+    svd_ptr += inst->svd_size;\r
+    svd_decision = svdGetDecision(svd_ptr, &sig_pow);\r
+    mssDbg->states[8] = (tuint)svd_decision;\r
+    \r
+    svdGetLevels (svd_ptr, &spch_db, &noise_db, &svd_thresh);\r
+    mssDbg->states[9] = (tuint)spch_db;\r
+    mssDbg->states[10] = (tuint)noise_db;\r
+  }\r
+  \r
+  return(mss_NOERR);\r
+  \r
+} /* mssDebugStat */\r
+\r
+/******************************************************************************\r
+ * FUNCTION PURPOSE: Close an instance of MSS.\r
+ ******************************************************************************\r
+ * DESCRIPTION: This function closes an instance of MSS by simply changing\r
+ *              the state to CLOSED.\r
+ *\r
+ *  tint mssClose (\r
+ *    void *mssInst)    - a pointer to MSS instance\r
+ *\r
+ *****************************************************************************/\r
+tint mssClose (void *mssInst)\r
+{\r
+  mssInst_t *inst = (mssInst_t *)mssInst;\r
+\r
+  if(inst->state != MSS_OPEN) {\r
+    return(mss_ERR_NOTOPENED);\r
+  }\r
+  \r
+  /*Change the MSS state to CLOSED */\r
+  inst->state = MSS_CLOSED;     \r
+  \r
+  return(mss_NOERR);\r
+} /* mssClose */\r
+\r
+/******************************************************************************\r
+ * FUNCTION PURPOSE: Delete an MSS instance.\r
+ ******************************************************************************\r
+ * DESCRIPTION: Deletes an instance of MSS. Clears the instance pointer.\r
+ *              Actual "deallocation" of instance should be done elsewhere\r
+ *              after this function is called. Hence, one has to save the\r
+ *              buffer descriptors to make "deallocation" possible.\r
+ *\r
+ *  tint mssDelete (\r
+ *    void           **mssInst,  - an address of memory location that contains\r
+ *                                 a pointer to instance structure\r
+ *    tint           nbufs,      - number of memory buffers\r
+ *    ecomemBuffer_t *bufs)      - vector of buffer descriptors\r
+ *\r
+ *****************************************************************************/\r
+tint mssDelete (void **mssInst, tint nbufs, ecomemBuffer_t *bufs)\r
+{\r
+  mssInst_t *inst = (mssInst_t *)*mssInst;\r
+\r
+  /* check if instance is already closed */\r
+  if (inst->state != MSS_CLOSED) {      \r
+    return (mss_ERR_NOTCLOSED);\r
+  }\r
+  \r
+  /* check if enough descriptors are provided to store all buffer addresses */\r
+  if (nbufs < MSS_NUM_BUFS) { \r
+    return (mss_ERR_NOMEMORY);\r
+  }\r
\r
+  /* return buffer addresses */\r
+  bufs[MSS_INSTANCE_BUF].base      = inst;   /* instance structure */\r
+\r
+  /* clear the instance pointer */\r
+  *mssInst = NULL;                              \r
+\r
+  return(mss_NOERR);\r
+} /* mssDelete */\r
+\r
+/******************************************************************************\r
+ * FUNCTION PURPOSE: Validates the input sources to MSS.\r
+ ******************************************************************************\r
+ * DESCRIPTION: This function examines the input sources to MSS to make sure\r
+ *              all sources are valid.\r
+ *\r
+ *****************************************************************************/\r
+\r
+tint mss_src_validation(mssInst_t *inst, void *rx_out_sync, void *mic_fix[],\r
+                void *mic_rem[], void *mic_cln[], void *mic_arr[], void *beam[])\r
+{                \r
+  int i;\r
+  \r
+  /* Return error if synchronized Rx out doesn't have valid data (NOT USED!!!) */\r
+  /*\r
+   *  if ( rx_out_sync == NULL ) {  \r
+   *    return (mss_ERR_INVALIDSRC); \r
+   *  }\r
+   */\r
+\r
+  /* Check if all sources have valid data.\r
+     Currently MSS only supports fixed mic, remote mic, and clean mic.\r
+  */\r
+  if(inst->num_src_per_group[mss_SRC_MIC_FIXED] > 0) {\r
+    if(mic_fix == NULL) {\r
+      return (mss_ERR_INVALIDSRC);\r
+    }\r
+    else {\r
+      for (i=0; i<inst->num_src_per_group[mss_SRC_MIC_FIXED]; i++) {\r
+        if(mic_fix[i] == NULL) {\r
+          return (mss_ERR_INVALIDSRC);\r
+        }\r
+      }\r
+    }\r
+  } /* mss_SRC_MIC_FIXED */\r
+  \r
+  if(inst->num_src_per_group[mss_SRC_MIC_REMOTE] > 0) {\r
+    if(mic_rem == NULL) {\r
+      return (mss_ERR_INVALIDSRC);\r
+    }\r
+    else {\r
+      for (i=0; i<inst->num_src_per_group[mss_SRC_MIC_REMOTE]; i++) {\r
+        if(mic_rem[i] == NULL) {\r
+          return (mss_ERR_INVALIDSRC);\r
+        }\r
+      }\r
+    }\r
+  } /* mss_SRC_MIC_REMOTE */\r
+  \r
+  if(inst->num_src_per_group[mss_SRC_MIC_CLEAN] > 0) {\r
+    if(mic_cln == NULL) {\r
+      return (mss_ERR_INVALIDSRC);\r
+    }\r
+    else {\r
+      for (i=0; i<inst->num_src_per_group[mss_SRC_MIC_CLEAN]; i++) {\r
+        if(mic_cln[i] == NULL) {\r
+          return (mss_ERR_INVALIDSRC);\r
+        }\r
+      }\r
+    }\r
+  } /* mss_SRC_MIC_CLEAN */\r
\r
+  return (mss_NOERR);  \r
+} /* mss_src_validation */\r
+\r
+/* Nothing past this point */\r
diff --git a/file_demo_bios/k2g/components/mss/src/mssloc.h b/file_demo_bios/k2g/components/mss/src/mssloc.h
new file mode 100644 (file)
index 0000000..cb6d97c
--- /dev/null
@@ -0,0 +1,83 @@
+#ifndef _MSSLOC_H\r
+#define _MSSLOC_H\r
+\r
+//#include <ti/mas/aer/mss.h>\r
+\r
+#include "../mss.h"\r
+\r
+/* MSS states */\r
+enum {\r
+  MSS_CLOSED  = 0,\r
+  MSS_OPEN    = 1\r
+};\r
+\r
+\r
+#define MSS_STATE_BIT_SWITCH_SRC 0x0001\r
+\r
+#define MSS_FRAME_SIZE_8KHZ 80   /* samples */\r
+#define MSS_NUM_SAMP_1MS_8KHZ 8  /* samples per msec at 8kHz */\r
+#define MSS_FADE_PHA_INIT      0xC0000000  /* Q31 initial phase of crossfade:\r
+                                              -1/2 corresponding to -pi/2  */\r
+\r
+typedef struct mssParams_s {\r
+  tint   switch_threshold;\r
+  tint   switch_duration;\r
+  tint   switch_hangover;\r
+} mssParams_t;\r
+\r
+typedef struct mssInst_s {\r
+  tint      state;                          /* MSS_CLOSED or MSS_OPEN         */\r
+  void *    handle;                         /* MSS instance handle            */\r
+  \r
+  mssParams_t params;\r
+  mssSrc_t    cur_src;\r
+  mssSrc_t    new_src;\r
+  tword       *svd;\r
+  \r
+  tint   num_src_per_group[mss_MAX_NUM_SRC_TYPES];\r
+  tint   modes_bf;\r
+  tint   state_bf;\r
+\r
+  LFract crossfade_phase;\r
+  LFract crossfade_phase_inc;\r
+  tint   crossfade_cnt;\r
+  tint   switch_hang_cnt;\r
+  tint   svd_size;\r
+  tint   max_sampling_rate;\r
+  tint   sampling_rate;\r
+  tint   frame_size;\r
+  tint   num_mic_array;\r
+\r
+  tint   switch_src_cnt;\r
+  tuint  ramp_up;\r
+  Fract  ramp_alpha;\r
+  \r
+  /* for debugging only */\r
+  mssSrc_t temp_src;  \r
+  Fract    gain_in;   \r
+  Fract    gain_out;  \r
+} mssInst_t;\r
+\r
+/* MSS control bitfield macros */\r
+#define mss_setbit(field,b) ( (field) |= (  b))\r
+#define mss_clrbit(field,b) ( (field) &= (~(b)))\r
+#define mss_chkbit(field,b) (((field) &  (  b)) == (b))\r
+\r
+/* min, max macros */\r
+#define mss_MAX(x,y)        ( ((x) > (y)) ? (x) : (y) )\r
+#define mss_MIN(x,y)        ( ((x) < (y)) ? (x) : (y) )\r
+\r
+/* Size align to L2 power of 2: for L2=3 floor((x+7)/8)*8   */\r
+#define mss_SIZE_ALIGN(x,L2)  (((L2) < 1) ? (x) : (((x) + ( (1<<(L2)) - 1 )) & ((~0uL)<<(L2))))\r
+\r
+void mss_src_selection(mssInst_t *inst, void *mic_fix[], void *mic_rem[], \r
+                        void *mic_cln[]);\r
+void mss_src_output(mssInst_t *inst, void *out, void *mic_fix[], \r
+                     void *mic_rem[], void *mic_cln[]);\r
+tint mss_src_validation(mssInst_t *inst, void *rx_out_sync, void *mic_fix[],\r
+                void *mic_rem[], void *mic_cln[], void *mic_arr[], void *beam[]);\r
+void * mss_get_first_src(mssInst_t *inst, void *mic_fix[], void *mic_rem[], \r
+                         void *mic_cln[]);\r
+\r
+#endif\r
+/* Nothing past this point */\r
diff --git a/file_demo_bios/k2g/components/mss/src/mssproc.c b/file_demo_bios/k2g/components/mss/src/mssproc.c
new file mode 100644 (file)
index 0000000..1323098
--- /dev/null
@@ -0,0 +1,365 @@
+/**\r
+ *  @file   mssproc.c\r
+ *  @brief  Contains Main Processing Routines for Multi-Source Selection \r
+ *          (MSS) module.\r
+ *\r
+ *  (C) Copyright 2011, Texas Instruments, Inc.\r
+ */\r
+\r
+#include <xdc/std.h>\r
+#include <ti/mas/types/types.h>\r
+#include <ti/mas/fract/fract.h>\r
+#include <ti/mas/util/utl.h>\r
+#include <ti/mas/vpe/svd.h>\r
+#include "string.h"\r
+\r
+//#include <ti/mas/aer/mss.h>\r
+//#include <ti/mas/aer/src/mssloc.h>\r
+\r
+#include "../mss.h"\r
+#include "mssloc.h"\r
+\r
+#define MSS_MIN_POW 2684  /* correpsonds to -50dBm */\r
+\r
+/******************************************************************************\r
+ * FUNCTION PURPOSE: Main Processing API of MSS \r
+ ******************************************************************************\r
+ * DESCRIPTION: This function processes the multi-source inputs and selects one\r
+ *              source as the output. Crossfading is implemented during the \r
+ *              switch of two sources. \r
+ *\r
+ *  tint mssProcess (\r
+ *  Input:\r
+ *    void *mssInst,      - pointer to MSS instance\r
+ *    void *rx_out_sync,  - synchronized Rx out, NOT to be selected, but used to\r
+ *                          help make right selection.\r
+ *    void *mic_fix[],    - data from fixed mics, may be selected.\r
+ *    void *mic_rem[],    - data from remote mics, may be selected.\r
+ *    void *mic_cln[],    - data from clean mics, may be selected.\r
+ *    void *mic_arr[],    - data from microphone arrays, NOT to be selected, but\r
+ *                          used to help make right selection.\r
+ *    void *beam[],       - data from beamformers, may be selected.\r
+ *  Output:\r
+ *    void *out,          - data of the selected source, or a mix of two sources\r
+ *                          during the switch. \r
+ *\r
+ *****************************************************************************/\r
+tint mssProcess(void *mssInst, void *out, void *rx_out_sync, void *mic_fix[],\r
+                void *mic_rem[], void *mic_cln[], void *mic_arr[], void *beam[])\r
+{\r
+  tint src_err; \r
+  void *first_src;\r
+  mssInst_t * inst = (mssInst_t *)mssInst;\r
+  \r
+  /* Return error if state is not OPENED */  \r
+  if(inst->state != MSS_OPEN) {\r
+    return(mss_ERR_NOTOPENED);\r
+  }\r
+\r
+  /* Check if all sources are valid and return error if any one is invalid. */  \r
+  src_err = mss_src_validation(inst, rx_out_sync, mic_fix, mic_rem, mic_cln,\r
+                               mic_arr, beam);                             \r
+  if(src_err == mss_ERR_INVALIDSRC) {\r
+    return(mss_ERR_INVALIDSRC);\r
+  }\r
+\r
+  /* The BYPASS mode just gets the first available source passed to the output */\r
+  if(mss_chkbit(inst->modes_bf, mss_CTL_MODES_BYPASS)) {\r
+    first_src = mss_get_first_src(inst, mic_fix, mic_rem, mic_cln);\r
+    memcpy(out, first_src, inst->frame_size*sizeof(linSample));\r
+  }\r
+  else { /* If not bypass, check for FREEZE */\r
+    if(!mss_chkbit(inst->modes_bf, mss_CTL_MODES_FREEZE)) {\r
+      /* Multi-source selection: \r
+         Currently only supports fixed, remote and clean mics. */\r
+      mss_src_selection(inst, mic_fix, mic_rem, mic_cln); \r
+    }\r
+\r
+    /* Output selected source, crossfading during switch between two sources. */\r
+    mss_src_output(inst, out, mic_fix, mic_rem, mic_cln);\r
+  }\r
+  \r
+  return src_err;\r
+} /* mssProcess */\r
+\r
+/******************************************************************************\r
+ * FUNCTION PURPOSE: Get the First Valid Source \r
+ ******************************************************************************\r
+ * DESCRIPTION: This function orted.\r
+ *\r
+ *  tint mss_get_first_src (\r
+ *  Input:\r
+ *    void *inst,         - pointer to MSS instance\r
+ *    void *mic_fix[],    - data from fixed mics, may be selected.\r
+ *    void *mic_rem[],    - data from remote mics, may be selected.\r
+ *    void *mic_cln[],    - data from clean mics, may be selected.\r
+ *  Output:\r
+ *    void * ,            - address of the first valid source\r
+ *****************************************************************************/\r
+void * mss_get_first_src(mssInst_t *inst, void *mic_fix[], void *mic_rem[], \r
+                         void *mic_cln[])\r
+{\r
+  void * first_src;\r
+  \r
+  if(inst->num_src_per_group[mss_SRC_MIC_FIXED] > 0) {\r
+    first_src = mic_fix[0];\r
+  }\r
+  else if(inst->num_src_per_group[mss_SRC_MIC_REMOTE] > 0) {\r
+    first_src = mic_rem[0];\r
+  }\r
+  else {\r
+    first_src = mic_cln[0];\r
+  }\r
+  \r
+  return first_src;\r
+} /* mss_get_first_src */                        \r
+\r
+/******************************************************************************\r
+ * FUNCTION PURPOSE: Source selection of MSS \r
+ ******************************************************************************\r
+ * DESCRIPTION: This function processes the multi-source inputs and selects one\r
+ *              source as the output. The selectin criteria is the exponential\r
+ *              average of power. The source with maximum power is selected. \r
+ *              Currently, only fixed mic, remote mic, and clean mic are supported.\r
+ *\r
+ *  tint mss_src_selection (\r
+ *  Input:\r
+ *    void *inst,         - pointer to MSS instance\r
+ *    void *mic_fix[],    - data from fixed mics, may be selected.\r
+ *    void *mic_rem[],    - data from remote mics, may be selected.\r
+ *    void *mic_cln[],    - data from clean mics, may be selected.\r
+ *  Output:\r
+ *    Instance variables: MSS_STATE_BIT_SWITCH_SRC of inst->state_bf\r
+ *                        temp_src\r
+ *                        switch_hang_cnt\r
+ *                        new_src\r
+ *                        crossfade_phase\r
+ *                        crossface_cnt\r
+ * \r
+ *****************************************************************************/\r
+void mss_src_selection(mssInst_t *inst, void *mic_fix[], void *mic_rem[], \r
+                        void *mic_cln[])\r
+{\r
+  int i, max_pow_src_index, svd_decision;\r
+  LFract max_pow, sig_pow;\r
+  tword *svd_ptr;\r
+  mssSrcType_t max_pow_src_group;\r
+  tint frm_len;\r
+\r
+  /* Initialization */\r
+  svd_ptr = inst->svd;\r
+  frm_len = inst->frame_size;\r
+  max_pow = (LFract)0;\r
+  max_pow_src_group = mss_SRC_INVALID;\r
+  \r
+  /*\r
+   * Task 1: Analyze sources to select the best one.\r
+   * Current selection criteria is the exponential average power. Whichever\r
+   * source has the largest power will be selected. \r
+   */\r
+  /* Analyze fixed microphones */ \r
+  for (i=0; i<inst->num_src_per_group[mss_SRC_MIC_FIXED]; i++) {\r
+    svdProcess(svd_ptr, mic_fix[i], frm_len);\r
+    svd_decision = svdGetDecision(svd_ptr, &sig_pow);\r
+    \r
+    /* only look at power of mics having speech (MSS_MIN_POW is -50.0109dBm) */\r
+    if(   (svd_decision != svd_VOICE_INACTIVE)  /* even when undefined? */\r
+       && (sig_pow > MSS_MIN_POW) && (sig_pow > max_pow)) {\r
+      max_pow = sig_pow;\r
+      max_pow_src_group = mss_SRC_MIC_FIXED;\r
+      max_pow_src_index = i;\r
+    }\r
+    \r
+    svd_ptr += inst->svd_size;\r
+  } /* num_mic_fix */\r
+\r
+  /* Analyze remote microphones */ \r
+  for (i=0; i<inst->num_src_per_group[mss_SRC_MIC_REMOTE]; i++) {\r
+    svdProcess(svd_ptr, mic_rem[i], frm_len);\r
+    svd_decision = svdGetDecision(svd_ptr, &sig_pow);\r
+    \r
+    /* only look at power of mics having speech */\r
+    if(   (svd_decision != svd_VOICE_INACTIVE) \r
+       && (sig_pow > MSS_MIN_POW) && (sig_pow > max_pow)) {\r
+      max_pow = sig_pow;\r
+      max_pow_src_group = mss_SRC_MIC_REMOTE;\r
+      max_pow_src_index = i;\r
+    }\r
+    \r
+    svd_ptr += inst->svd_size;\r
+  } /* num_mic_remote */\r
+\r
+  /* Analyze clean microphones */ \r
+  for (i=0; i<inst->num_src_per_group[mss_SRC_MIC_CLEAN]; i++) {\r
+    svdProcess(svd_ptr, mic_cln[i], frm_len);\r
+    svd_decision = svdGetDecision(svd_ptr, &sig_pow);\r
+    \r
+    /* only look at power of mics having speech */\r
+    if(   (svd_decision != svd_VOICE_INACTIVE) \r
+       && (sig_pow > MSS_MIN_POW) && (sig_pow > max_pow)) {\r
+      max_pow = sig_pow;\r
+      max_pow_src_group = mss_SRC_MIC_CLEAN;\r
+      max_pow_src_index = i;\r
+    }\r
+    \r
+    svd_ptr += inst->svd_size;\r
+  } /* num_mic_clean */\r
+\r
+  /* for debugging only */\r
+  inst->temp_src.group = max_pow_src_group;\r
+  inst->temp_src.index = max_pow_src_index;\r
+  \r
+  /*\r
+   * Task 2: Decide whether to switch source based on the selection obtained above.\r
+   */  \r
+  /* Don's consider switching source in the middle of a switch */\r
+  if(!mss_chkbit(inst->state_bf, MSS_STATE_BIT_SWITCH_SRC)) {\r
+    /* If not in the middle of a switch, wait until hangover expires. */  \r
+    if(inst->switch_hang_cnt > 0) {\r
+      inst->switch_hang_cnt -= frm_len;  /* expiring hangover */\r
+    }\r
+    else { /* hangover expires and we can look for switch again */\r
+      /* Don't consider switching source if:\r
+         1. speech is not present in any source (max_pow_src_group == mss_SRC_MAX), or \r
+         2. source with max power is the current selected source.\r
+      */\r
+      if(  (max_pow_src_group == mss_SRC_INVALID)  \r
+        || (   (max_pow_src_group == inst->cur_src.group) \r
+            && (max_pow_src_index == inst->cur_src.index) )\r
+        ) {\r
+        if (inst->switch_src_cnt > frm_len) {\r
+          inst->switch_src_cnt -= frm_len;     /* Count in opposite direction with same speed */\r
+        }\r
+        else {  /* give up on "new src" */\r
+          inst->switch_src_cnt = 0;\r
+          inst->new_src = inst->cur_src;\r
+        }\r
+      }\r
+      /* Consider switching source if the source with max power is not the \r
+         current active source. */\r
+      else if(   (max_pow_src_group == inst->new_src.group)\r
+              && (max_pow_src_index == inst->new_src.index) \r
+             ) {\r
+        /* Increment counter since the source with max power doesn't change \r
+           from previous frame. */\r
+        inst->switch_src_cnt += frm_len;\r
+        if(inst->switch_src_cnt >= inst->params.switch_threshold) {\r
+          /* Confirm and switch source because the same source had max power long enough */\r
+          inst->switch_src_cnt  = 0;\r
+          inst->crossfade_phase = MSS_FADE_PHA_INIT;\r
+          inst->crossfade_cnt  = 0;\r
+          inst->switch_hang_cnt = inst->params.switch_hangover;\r
+          mss_setbit(inst->state_bf, MSS_STATE_BIT_SWITCH_SRC);\r
+        }\r
+      }\r
+      else {  /* Source with max power might be changing to something other then current/new */\r
+        if (inst->switch_src_cnt > frm_len) {\r
+          inst->switch_src_cnt -= frm_len/2;      /* Lower speed, this should smooth the "new" selection */\r
+        }\r
+        else {\r
+          /* Don't switch since source with max power is changing. */\r
+          inst->new_src.group  = max_pow_src_group;\r
+          inst->new_src.index  = max_pow_src_index;\r
+          inst->switch_src_cnt = 0;\r
+        }\r
+      }\r
+    } /* hangover expires */\r
+  } /* !mss_chkbit(inst->state_bf, MSS_STATE_BIT_SWITCH_SRC) */ \r
+} /* mss_src_selection */                       \r
+\r
+/******************************************************************************\r
+ * FUNCTION PURPOSE: Generating Single Output from Multiple Sources \r
+ ******************************************************************************\r
+ * DESCRIPTION: This function generates single output from multiple input sources.\r
+ *              Generally, it passes the selected source to the output, but when\r
+ *              there is a switch from one source to another, it will mix the\r
+ *              the previously selected and newly selected sources. \r
+ *\r
+ *  tint mss_src_output (\r
+ *  Input:\r
+ *    void *inst,         - pointer to MSS instance\r
+ *    void *mic_fix[],    - data from fixed mics, may be selected.\r
+ *    void *mic_rem[],    - data from remote mics, may be selected.\r
+ *    void *mic_cln[],    - data from clean mics, may be selected.\r
+ *  Output:\r
+ *    void *out           - single source or mixed sources\r
+ *****************************************************************************/\r
+#define MSS_SIN_PIOVER2 16388\r
+void mss_src_output(mssInst_t *inst, void *out, void *mic_fix[], \r
+                     void *mic_rem[], void *mic_cln[])\r
+{\r
+  int i;\r
+  linSample * cur_sel_src;\r
+  linSample * new_sel_src;\r
+  linSample * output;\r
+  Fract fade_in_alpha, fade_out_alpha, sin_phase;\r
+  LFract phase, phase_inc;\r
+  \r
+  /* Identify the buffer of the current selected source. */\r
+  if(inst->cur_src.group == mss_SRC_MIC_FIXED) {\r
+    cur_sel_src = mic_fix[inst->cur_src.index];\r
+  }\r
+  else if (inst->cur_src.group == mss_SRC_MIC_REMOTE) {\r
+    cur_sel_src = mic_rem[inst->cur_src.index];\r
+  }\r
+  else if (inst->cur_src.group == mss_SRC_MIC_CLEAN) {\r
+    cur_sel_src = mic_cln[inst->cur_src.index];\r
+  }\r
+  else {\r
+    /* error message */\r
+  }\r
+\r
+  /* Check if in the middle of a switch. */\r
+  if(!mss_chkbit(inst->state_bf, MSS_STATE_BIT_SWITCH_SRC)) {\r
+    /* If it is not during a switch, copy the current selected source to output \r
+       without any modification. */\r
+    memcpy(out, cur_sel_src, inst->frame_size*sizeof(linSample));\r
+  }  \r
+  else {\r
+    /* If it is during a switch, identify the buffer of the new selected source. */\r
+    if(inst->new_src.group == mss_SRC_MIC_FIXED) {\r
+      new_sel_src = mic_fix[inst->new_src.index];\r
+    }\r
+    else if (inst->new_src.group == mss_SRC_MIC_REMOTE) {\r
+      new_sel_src = mic_rem[inst->new_src.index];\r
+    }\r
+    else if (inst->new_src.group == mss_SRC_MIC_CLEAN) {\r
+      new_sel_src = mic_cln[inst->new_src.index];\r
+    }\r
+    else {\r
+      /* error message */\r
+    }   \r
+  \r
+    /* Mix the previously selected and newly selected sources by crossfading: \r
+       fading out previously selected source and fading in new selected source. */\r
+    phase = inst->crossfade_phase; \r
+    phase_inc = inst->crossfade_phase_inc;\r
+    output = (linSample *)out;\r
+\r
+    for(i=0; i<inst->frame_size; i++) {\r
+//      alpha = (1-utlSin(phase>>16)) / 2; /* to use macros */\r
+      sin_phase = utlSin(phase>>16);   /* Q.31 to Q.15 */\r
+      fade_out_alpha = MSS_SIN_PIOVER2/2 - sin_phase/2; /* (1-sin(pha))/2 in Q.14 */\r
+      fade_in_alpha  = MSS_SIN_PIOVER2/2 + sin_phase/2; /* (1+sin(pha))/2 in Q.14 */\r
+      fade_out_alpha = mss_MIN(16383, fade_out_alpha);\r
+      fade_in_alpha  = mss_MIN(16383, fade_in_alpha);\r
+      output[i] = frctMul(cur_sel_src[i], 0, fade_out_alpha, 14, 0) \r
+                 +frctMul(new_sel_src[i], 0, fade_in_alpha,  14, 0);\r
+      phase +=