summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 83b570e)
raw | patch | inline | side by side (parent: 83b570e)
author | Ming Wei <a0868762@ti.com> | |
Tue, 31 Jan 2017 23:12:04 +0000 (17:12 -0600) | ||
committer | Ming Wei <a0868762@ti.com> | |
Tue, 31 Jan 2017 23:12:04 +0000 (17:12 -0600) |
Signed-off-by: Ming Wei <a0868762@ti.com>
77 files changed:
diff --git a/file_demo_bios/am572x/AM572x_dsp_startup.gel b/file_demo_bios/am572x/AM572x_dsp_startup.gel
+++ /dev/null
@@ -1,295 +0,0 @@
-/*******************************************************************/
-/* This GEL file is loaded on the command line of Code Composer */
-/* The StartUp() function is called every time you start */
-/* Code Composer. You can customize this function to */
-/* initialize wait states or to perform other initialization. */
-/* */
-/* AM572x C66x DSP */
-/* */
-/* */
-/*******************************************************************/
-
-
-#define WR_MEM_32(addr, data) *(unsigned int*)(addr) =(unsigned int)(data)
-#define RD_MEM_32(addr) *(unsigned int*)(addr)
-#define uint32_t unsigned int
-
-
-
-StartUp()
-{
- GEL_TextOut("--->>> (local) AM572x C66x DSP Startup Sequence In Progress... <<<---\n");
-
- /*------------------ Memory Map Config -------------------*/
- GEL_MapOff();
- GEL_MapReset();
- memorymap_init();
- GEL_MapOn();
-
- /*------------------ Load Common Gel Files -------------------*/
- /* GEL_LoadGel("$(GEL_file_dir)//AM572x_dsp_basic_emulation.gel"); */
- /* GEL_LoadGel("$(GEL_file_dir)//AM572x_dsp_cross_triggering.gel"); */
-
- /* GEL_LoadGel(".//load_mics.gel"); */
-
- GEL_TextOut("--->>> AM572x C66x DSP Startup Sequence DONE! <<<---\n");
-}
-
-memorymap_init()
-{
- GEL_MapAddStr(0x00800000, 0, 0x00800000, "R|W|AS4", 0); /* DSP RAM Access 288K (L2 RAM) + 32K (L1P SRAM) + 32K (L1D SRAM)*/
- GEL_MapAddStr(0x01BC0000, 0, 0x00001000, "R|W|AS4", 0); /* DSP EDM register - 4KBytes */
- GEL_MapAddStr(0x01C20000, 0, 0x00001000, "R|W|AS4", 0); /* SYSC- CONFIG - 4KBytes */
- GEL_MapAddStr(0x01C21000, 0, 0x00001000, "R|W|AS4", 0); /* WUGEN - 4KBytes */
- GEL_MapAddStr(0x01C30000, 0, 0x00000100, "R|W|AS4", 0); /* L1 config register - 256Bytes */
- GEL_MapAddStr(0x01C30200, 0, 0x00000100, "R|W|AS4", 0); /* L2 config register - 256Bytes */
- GEL_MapAddStr(0x01C30400, 0, 0x00000200, "R|W|AS4", 0); /* Unicache debug - 512Bytes */
- GEL_MapAddStr(0x01C30800, 0, 0x00000800, "R|W|AS4", 0); /* Attr MMU - 2KBytes */
- GEL_MapAddStr(0x01D10000, 0, 0x00010000, "R|W|AS4", 0); /* 3PCC CONFIG - 64KBytes */
- GEL_MapAddStr(0x01D05000, 0, 0x00000400, "R|W|AS4", 0); /* 3PTC0- CONFIG - 1KBytes */
- GEL_MapAddStr(0x01D06000, 0, 0x00000400, "R|W|AS4", 0); /* 3PTC1- CONFIG - 1KBytes */
- GEL_MapAddStr(0x01800000, 0, 0x00010000, "R|W|AS4", 0); /* Interrupt controller - 64KBytes */
- GEL_MapAddStr(0x01810000, 0, 0x00001000, "R|W|AS4", 0); /* DSP Securty ID - 4KBytes */
- GEL_MapAddStr(0x01812000, 0, 0x00001000, "R|W|AS4", 0); /* DSP Revision ID - 4KBytes */
- GEL_MapAddStr(0x01840000, 0, 0x00010000, "R|W|AS4", 0); /* DSP Cache CFG and MAR registers */
- GEL_MapAddStr(0x01D00000, 0, 0x00020000, "R|W|AS4", 0); /* ABE NC L4 S3220 */
- GEL_MapAddStr(0x01D22000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC McBSPLP1 - module */
- GEL_MapAddStr(0x01D23000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC McBSPLP1 - L4 interconnect */
- GEL_MapAddStr(0x01D24000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC McBSPLP2 - module */
- GEL_MapAddStr(0x01D25000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC McBSPLP2 - L4 interconnect */
- GEL_MapAddStr(0x01D26000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC McBSPLP3 - module */
- GEL_MapAddStr(0x01D27000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC McBSPLP3 - L4 interconnect */
- GEL_MapAddStr(0x01D28000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC McASP1 CFG Port */
- GEL_MapAddStr(0x01D29000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC McASP1 CFG - L4 interconnect */
- GEL_MapAddStr(0x01D2A000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC McASP1 DATA Port */
- GEL_MapAddStr(0x01D2B000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC McASP1 DATA - L4 interconnect */
- GEL_MapAddStr(0x01D2C000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC SLIMBUS1 - module */
- GEL_MapAddStr(0x01D2D000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC SLIMBUS1 - L4 interconnect */
- GEL_MapAddStr(0x01D2E000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC DMIC - module */
- GEL_MapAddStr(0x01D2F000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC DMIC - L4 interconnect */
- GEL_MapAddStr(0x01D30000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC WDT3 - module */
- GEL_MapAddStr(0x01D31000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC WDT3 - L4 interconnect */
- GEL_MapAddStr(0x01D32000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC McPDM - module */
- GEL_MapAddStr(0x01D33000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC McPDM - L4 interconnect */
- GEL_MapAddStr(0x01D38000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC GPTIMER5 - module */
- GEL_MapAddStr(0x01D39000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC GPTIMER5 - L4 interconnect */
- GEL_MapAddStr(0x01D3A000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC GPTIMER6 - module */
- GEL_MapAddStr(0x01D3B000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC GPTIMER6 - L4 interconnect */
- GEL_MapAddStr(0x01D3C000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC GPTIMER7 - module */
- GEL_MapAddStr(0x01D3D000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC GPTIMER7 - L4 interconnect */
- GEL_MapAddStr(0x01D3E000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC GPTIMER8 - module */
- GEL_MapAddStr(0x01D3F000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC GPTIMER8 - L4 interconnect */
- GEL_MapAddStr(0x01D80000, 0, 0x00010000, "R|W|AS4", 0); /* ABE NC DMEM - module */
- GEL_MapAddStr(0x01D90000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC DMEM - L4 interconnect */
- GEL_MapAddStr(0x01DA0000, 0, 0x00010000, "R|W|AS4", 0); /* ABE NC CMEM - module */
- GEL_MapAddStr(0x01DB0000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC CMEM - L4 interconnect */
- GEL_MapAddStr(0x01DC0000, 0, 0x00010000, "R|W|AS4", 0); /* ABE NC SMEM - module */
- GEL_MapAddStr(0x01DD0000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC SMEM - L4 interconnect */
- GEL_MapAddStr(0x01DE0000, 0, 0x00010000, "R|W|AS4", 0); /* ABE NC PMEM - module */
- GEL_MapAddStr(0x01DF0000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC PMEM - L4 interconnect */
- GEL_MapAddStr(0x01DF1000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC AESS - module */
- GEL_MapAddStr(0x01DF2000, 0, 0x00001000, "R|W|AS4", 0); /* ABE NC AESS - L4 interconnect */
- GEL_MapAddStr(0x01E00000, 0, 0x00100000, "R|W|AS4", 0); /* IVA-HD - 1MBytes */
- GEL_MapAddStr(0x01F00000, 0, 0x00100000, "R|W|AS4", 0); /* OCP Interconnect Registers - 1MBytes */
- GEL_MapAddStr(0x10800000, 0, 0x00020000, "R|W|AS4", 0); /* SL2->L1 - 128KBytes */
- GEL_MapAddStr(0x10820000, 0, 0x00020000, "R|W|AS4", 0); /* SL2->L2 - 128KBytes */
- GEL_MapAddStr(0x10900000, 0, 0x00040000, "R|W|AS4", 0); /* SL2 locked Region - 256KBytes */
-
- GEL_MapAddStr(0x10D00000, 0, 0x00004000, "R|W|AS4", 0); /* ABE L4 S3220 */
- GEL_MapAddStr(0x10D22000, 0, 0x00001000, "R|W|AS4", 0); /* ABE McBSPLP1 - module */
- GEL_MapAddStr(0x10D23000, 0, 0x00001000, "R|W|AS4", 0); /* ABE McBSPLP1 - L4 interconnect */
- GEL_MapAddStr(0x10D24000, 0, 0x00001000, "R|W|AS4", 0); /* ABE McBSPLP2 - module */
- GEL_MapAddStr(0x10D25000, 0, 0x00001000, "R|W|AS4", 0); /* ABE McBSPLP2 - L4 interconnect */
- GEL_MapAddStr(0x10D26000, 0, 0x00001000, "R|W|AS4", 0); /* ABE McBSPLP3 - module */
- GEL_MapAddStr(0x10D27000, 0, 0x00001000, "R|W|AS4", 0); /* ABE McBSPLP3 - L4 interconnect */
- GEL_MapAddStr(0x10D28000, 0, 0x00001000, "R|W|AS4", 0); /* ABE McASP1 CFG Port */
- GEL_MapAddStr(0x10D29000, 0, 0x00001000, "R|W|AS4", 0); /* ABE McASP1 CFG - L4 interconnect */
- GEL_MapAddStr(0x10D2A000, 0, 0x00001000, "R|W|AS4", 0); /* ABE McASP1 DATA Port */
- GEL_MapAddStr(0x10D2B000, 0, 0x00001000, "R|W|AS4", 0); /* ABE McASP1 DATA - L4 interconnect */
- GEL_MapAddStr(0x10D2C000, 0, 0x00001000, "R|W|AS4", 0); /* ABE SLIMBUS1 - module */
- GEL_MapAddStr(0x10D2D000, 0, 0x00001000, "R|W|AS4", 0); /* ABE SLIMBUS1 - L4 interconnect */
- GEL_MapAddStr(0x10D2E000, 0, 0x00001000, "R|W|AS4", 0); /* ABE DMIC - module */
- GEL_MapAddStr(0x10D2F000, 0, 0x00001000, "R|W|AS4", 0); /* ABE DMIC - L4 interconnect */
- GEL_MapAddStr(0x10D30000, 0, 0x00001000, "R|W|AS4", 0); /* ABE WDT3 - module */
- GEL_MapAddStr(0x10D31000, 0, 0x00001000, "R|W|AS4", 0); /* ABE WDT3 - L4 interconnect */
- GEL_MapAddStr(0x10D32000, 0, 0x00001000, "R|W|AS4", 0); /* ABE McPDM - module */
- GEL_MapAddStr(0x10D33000, 0, 0x00001000, "R|W|AS4", 0); /* ABE McPDM - L4 interconnect */
- GEL_MapAddStr(0x10D38000, 0, 0x00001000, "R|W|AS4", 0); /* ABE GPTIMER5 - module */
- GEL_MapAddStr(0x10D39000, 0, 0x00001000, "R|W|AS4", 0); /* ABE GPTIMER5 - L4 interconnect */
- GEL_MapAddStr(0x10D3A000, 0, 0x00001000, "R|W|AS4", 0); /* ABE GPTIMER6 - module */
- GEL_MapAddStr(0x10D3B000, 0, 0x00001000, "R|W|AS4", 0); /* ABE GPTIMER6 - L4 interconnect */
- GEL_MapAddStr(0x10D3C000, 0, 0x00001000, "R|W|AS4", 0); /* ABE GPTIMER7 - module */
- GEL_MapAddStr(0x10D3D000, 0, 0x00001000, "R|W|AS4", 0); /* ABE GPTIMER7 - L4 interconnect */
- GEL_MapAddStr(0x10D3E000, 0, 0x00001000, "R|W|AS4", 0); /* ABE GPTIMER8 - module */
- GEL_MapAddStr(0x10D3F000, 0, 0x00001000, "R|W|AS4", 0); /* ABE GPTIMER8 - L4 interconnect */
- GEL_MapAddStr(0x10D80000, 0, 0x00010000, "R|W|AS4", 0); /* ABE DMEM - module */
- GEL_MapAddStr(0x10D90000, 0, 0x00001000, "R|W|AS4", 0); /* ABE DMEM - L4 interconnect */
- GEL_MapAddStr(0x10DA0000, 0, 0x00010000, "R|W|AS4", 0); /* ABE CMEM - module */
- GEL_MapAddStr(0x10DB0000, 0, 0x00001000, "R|W|AS4", 0); /* ABE CMEM - L4 interconnect */
- GEL_MapAddStr(0x10DC0000, 0, 0x00010000, "R|W|AS4", 0); /* ABE SMEM - module */
- GEL_MapAddStr(0x10DD0000, 0, 0x00001000, "R|W|AS4", 0); /* ABE SMEM - L4 interconnect */
- GEL_MapAddStr(0x10DE0000, 0, 0x00010000, "R|W|AS4", 0); /* ABE PMEM - module */
- GEL_MapAddStr(0x10DF0000, 0, 0x00001000, "R|W|AS4", 0); /* ABE PMEM - L4 interconnect */
- GEL_MapAddStr(0x10DF1000, 0, 0x00001000, "R|W|AS4", 0); /* ABE AESS - module */
- GEL_MapAddStr(0x10DF2000, 0, 0x00001000, "R|W|AS4", 0); /* ABE AESS - L4 interconnect */
-
- GEL_MapAddStr(0x10E00000, 0, 0x00004000, "R|W|AS4", 0); /* ABE Locked Region L4 S3220 */
- GEL_MapAddStr(0x10E22000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region McBSPLP1 - module */
- GEL_MapAddStr(0x10E23000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region McBSPLP1 - L4 interconnect */
- GEL_MapAddStr(0x10E24000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region McBSPLP2 - module */
- GEL_MapAddStr(0x10E25000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region McBSPLP2 - L4 interconnect */
- GEL_MapAddStr(0x10E26000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region McBSPLP3 - module */
- GEL_MapAddStr(0x10E27000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region McBSPLP3 - L4 interconnect */
- GEL_MapAddStr(0x10E28000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region McASP1 CFG Port */
- GEL_MapAddStr(0x10E29000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region McASP1 CFG - L4 interconnect */
- GEL_MapAddStr(0x10E2A000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region McASP1 DATA Port */
- GEL_MapAddStr(0x10E2B000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region McASP1 DATA - L4 interconnect */
- GEL_MapAddStr(0x10E2C000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region SLIMBUS1 - module */
- GEL_MapAddStr(0x10E2D000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region SLIMBUS1 - L4 interconnect */
- GEL_MapAddStr(0x10E2E000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region DMIC - module */
- GEL_MapAddStr(0x10E2F000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region DMIC - L4 interconnect */
- GEL_MapAddStr(0x10E30000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region WDT3 - module */
- GEL_MapAddStr(0x10E31000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region WDT3 - L4 interconnect */
- GEL_MapAddStr(0x10E32000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region McPDM - module */
- GEL_MapAddStr(0x10E33000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region McPDM - L4 interconnect */
- GEL_MapAddStr(0x10E38000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region GPTIMER5 - module */
- GEL_MapAddStr(0x10E39000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region GPTIMER5 - L4 interconnect */
- GEL_MapAddStr(0x10E3A000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region GPTIMER6 - module */
- GEL_MapAddStr(0x10E3B000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region GPTIMER6 - L4 interconnect */
- GEL_MapAddStr(0x10E3C000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region GPTIMER7 - module */
- GEL_MapAddStr(0x10E3D000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region GPTIMER7 - L4 interconnect */
- GEL_MapAddStr(0x10E3E000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region GPTIMER8 - module */
- GEL_MapAddStr(0x10E3F000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region GPTIMER8 - L4 interconnect */
- GEL_MapAddStr(0x10E80000, 0, 0x00010000, "R|W|AS4", 0); /* ABE Locked Region DMEM - module */
- GEL_MapAddStr(0x10E90000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region DMEM - L4 interconnect */
- GEL_MapAddStr(0x10EA0000, 0, 0x00010000, "R|W|AS4", 0); /* ABE Locked Region CMEM - module */
- GEL_MapAddStr(0x10EB0000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region CMEM - L4 interconnect */
- GEL_MapAddStr(0x10EC0000, 0, 0x00010000, "R|W|AS4", 0); /* ABE Locked Region SMEM - module */
- GEL_MapAddStr(0x10ED0000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region SMEM - L4 interconnect */
- GEL_MapAddStr(0x10EE0000, 0, 0x00010000, "R|W|AS4", 0); /* ABE Locked Region PMEM - module */
- GEL_MapAddStr(0x10EF0000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region PMEM - L4 interconnect */
- GEL_MapAddStr(0x10EF1000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region AESS - module */
- GEL_MapAddStr(0x10EF2000, 0, 0x00001000, "R|W|AS4", 0); /* ABE Locked Region AESS - L4 interconnect */
-
- GEL_MapAddStr(0x20000000, 0, 0xE0000000, "R|W|AS4", 0); /* External - SOC Mems andPeripherals - 3.5GBytes */
-
- GEL_MapAddStr(0x80000000, 0, 0x40000000, "R|W|AS4", 0); /* External - EMIF1 - 1GBytes */
- GEL_MapAddStr(0xC0000000, 0, 0x40000000, "R|W|AS4", 0); /* External - EMIF2 - 1GBytes */
-}
-
-OnReset()
-{
-
-}
-
-OnResetDetected()
-{
-
- GEL_TextOut( "Core Reset has occurred.\n\n" );
-}
-
-OnTargetConnect()
-{
-
-}
-
-
-/* GEL file to load microphone files */
-
-#define MIC1PATH "$(GEL_file_dir)/t8/y16L8g3m7090_1.pcm"
-#define MIC2PATH "$(GEL_file_dir)/t8/y16L8g3m7090_2.pcm"
-#define MIC3PATH "$(GEL_file_dir)/t8/y16L8g3m7090_3.pcm"
-#define MIC4PATH "$(GEL_file_dir)/t8/y16L8g3m7090_4.pcm"
-#define MIC5PATH "$(GEL_file_dir)/t8/y16L8g3m7090_5.pcm"
-#define MIC6PATH "$(GEL_file_dir)/t8/y16L8g3m7090_6.pcm"
-#define MIC7PATH "$(GEL_file_dir)/t8/y16L8g3m7090_7.pcm"
-#define MIC8PATH "$(GEL_file_dir)/t8/y16L8g3m7090_8.pcm"
-
-#define OUTPUTPATH "$(GEL_file_dir)/t8/fileOutput.bin"
-
-BFLoadMic(buffer,micpath)
-{
- GEL_MemoryLoad(buffer,0,160,micpath,32);
-}
-
-BFSaveMic(buffer,num, micpath)
-{
- GEL_MemorySave(buffer,0,num,micpath,8,0,32);
-}
-
-menuitem "Microphone Load Functions";
-
-dialog BFLoadOneMic(buffer "Buffer Address",micpath "Microphone File Path")
-{
- GEL_TextOut("Loading %s\n","",,,,micpath);
- BFLoadMic(buffer,micpath);
-}
-
-hotmenu BFLoadMic1()
-{
- GEL_TextOut("Loading %s\n","",,,,MIC1PATH);
- BFLoadMic(filBuf0,MIC1PATH);
-}
-
-hotmenu BFLoadMic2()
-{
- GEL_TextOut("Loading %s\n","",,,,MIC2PATH);
- BFLoadMic(filBuf1,MIC2PATH);
-}
-
-hotmenu BFLoadMic3()
-{
- GEL_TextOut("Loading %s\n","",,,,MIC3PATH);
- BFLoadMic(filBuf2,MIC3PATH);
-}
-
-hotmenu BFLoadMic4()
-{
- GEL_TextOut("Loading %s\n","",,,,MIC4PATH);
- BFLoadMic(filBuf3,MIC4PATH);
-}
-
-hotmenu BFLoadMic5()
-{
- GEL_TextOut("Loading %s\n","",,,,MIC5PATH);
- BFLoadMic(filBuf4,MIC5PATH);
-}
-
-hotmenu BFLoadMic6()
-{
- GEL_TextOut("Loading %s\n","",,,,MIC6PATH);
- BFLoadMic(filBuf5,MIC6PATH);
-}
-
-hotmenu BFLoadMic7()
-{
- GEL_TextOut("Loading %s\n","",,,,MIC7PATH);
- BFLoadMic(filBuf6,MIC7PATH);
-}
-
-hotmenu BFLoadMic8()
-{
- GEL_TextOut("Loading %s\n","",,,,MIC8PATH);
- BFLoadMic(filBuf7,MIC8PATH);
-}
-
-hotmenu BFLoadMicAll()
-{
- BFLoadMic1();
- BFLoadMic2();
- BFLoadMic3();
- BFLoadMic4();
- BFLoadMic5();
- BFLoadMic6();
- BFLoadMic7();
- BFLoadMic8();
- GEL_TextOut("Done Loading Microphones\n");
-}
-
-menuitem "Microphone Save Functions";
-
-hotmenu BFSaveOutput()
-{
- GEL_TextOut("Saving %s\n","",,,,OUTPUTPATH);
- BFSaveMic(filOutBuf0,filConfig.outlen/2,OUTPUTPATH);
-}
index df367e14a7049059f46cd6ec7a8ac5a00b4e2c6f..68317df2c67394de50c79ae01b6c3466819d4e65 100644 (file)
"./sysasnr.obj" \
"./sysbf.obj" \
"./sysbfflt.obj" \
+"./sysdrc.obj" \\r
"./syseram.obj" \
"./sysiram.obj" \
"./sysmss.obj" \
-"./sysvau.obj" \
"./mhm.obj" \
"./mss.obj" \
"./mssproc.obj" \
"configPkg/compiler.opt" \r
GEN_MISC_DIRS__QUOTED += \\r
"configPkg/" \r
-DEPEND_FILES = "main.d" "clk.d" "fil.d" "sys.d" "sysasnr.d" "sysbf.d" "sysbfflt.d" "syseram.d" "sysiram.d" "sysmss.d" "sysvau.d" "mhm.d" "mss.d" "mssproc.d" \r
-OBJECT_FILES = "main.obj" "clk.obj" "fil.obj" "sys.obj" "sysasnr.obj" "sysbf.obj" "sysbfflt.obj" "syseram.obj" "sysiram.obj" "sysmss.obj" "sysvau.obj" "mhm.obj" "mss.obj" "mssproc.obj" \r
+DEPEND_FILES = "main.d" "clk.d" "fil.d" "sys.d" "sysasnr.d" "sysbf.d" "sysbfflt.d" "sysdrc.d" "syseram.d" "sysiram.d" "sysmss.d" "mhm.d" "mss.d" "mssproc.d" \r
+OBJECT_FILES = "main.obj" "clk.obj" "fil.obj" "sys.obj" "sysasnr.obj" "sysbf.obj" "sysbfflt.obj" "sysdrc.obj" "syseram.obj" "sysiram.obj" "sysmss.obj" "mhm.obj" "mss.obj" "mssproc.obj" \r
else\r
GEN_FILES__QUOTED += \\r
"configPkg\linker.cmd" \\r
"configPkg\compiler.opt" \r
GEN_MISC_DIRS__QUOTED += \\r
"configPkg" \r
-DEPEND_FILES = "main.d" "clk.d" "fil.d" "sys.d" "sysasnr.d" "sysbf.d" "sysbfflt.d" "syseram.d" "sysiram.d" "sysmss.d" "sysvau.d" "mhm.d" "mss.d" "mssproc.d" \r
-OBJECT_FILES = "main.obj" "clk.obj" "fil.obj" "sys.obj" "sysasnr.obj" "sysbf.obj" "sysbfflt.obj" "syseram.obj" "sysiram.obj" "sysmss.obj" "sysvau.obj" "mhm.obj" "mss.obj" "mssproc.obj" \r
+DEPEND_FILES = "main.d" "clk.d" "fil.d" "sys.d" "sysasnr.d" "sysbf.d" "sysbfflt.d" "sysdrc.d" "syseram.d" "sysiram.d" "sysmss.d" "mhm.d" "mss.d" "mssproc.d" \r
+OBJECT_FILES = "main.obj" "clk.obj" "fil.obj" "sys.obj" "sysasnr.obj" "sysbf.obj" "sysbfflt.obj" "sysdrc.obj" "syseram.obj" "sysiram.obj" "sysmss.obj" "mhm.obj" "mss.obj" "mssproc.obj" \r
endif\r
\r
C_DEPS__QUOTED += \\r
\r
##-include components/subdir_vars.mk\r
C_SRCS += \\r
-../components/clk.c \\r
-../components/fil.c \\r
-../components/sys.c \\r
-../components/sysasnr.c \\r
-../components/sysbf.c \\r
-../components/sysbfflt.c \\r
-../components/syseram.c \\r
-../components/sysiram.c \\r
-../components/sysmss.c \\r
-../components/sysvau.c \r
+../../../common/components/clk.c \\r
+../../../common/components/fil.c \\r
+../../../common/components/sys.c \\r
+../../../common/components/sysasnr.c \\r
+../../../common/components/sysbf.c \\r
+../../../common/components/sysbfflt.c \\r
+../../../common/components/sysdrc.c \\r
+../../../common/components/syseram.c \\r
+../../../common/components/sysiram.c \\r
+../../../common/components/sysmss.c \r
\r
OBJS += \\r
clk.obj \\r
sysasnr.obj \\r
sysbf.obj \\r
sysbfflt.obj \\r
+sysdrc.obj \\r
syseram.obj \\r
sysiram.obj \\r
-sysmss.obj \\r
-sysvau.obj \r
+sysmss.obj \r
\r
C_DEPS += \\r
clk.d \\r
sysasnr.d \\r
sysbf.d \\r
sysbfflt.d \\r
+sysdrc.d \\r
syseram.d \\r
sysiram.d \\r
-sysmss.d \\r
-sysvau.d \r
+sysmss.d \r
\r
C_DEPS__QUOTED += \\r
"clk.d" \\r
"sysasnr.d" \\r
"sysbf.d" \\r
"sysbfflt.d" \\r
+"sysdrc.d" \\r
"syseram.d" \\r
"sysiram.d" \\r
-"sysmss.d" \\r
-"sysvau.d" \r
+"sysmss.d"\r
\r
OBJS__QUOTED += \\r
"clk.obj" \\r
"sysasnr.obj" \\r
"sysbf.obj" \\r
"sysbfflt.obj" \\r
+"sysdrc.obj" \\r
"syseram.obj" \\r
"sysiram.obj" \\r
-"sysmss.obj" \\r
-"sysvau.obj" \r
+"sysmss.obj" \r
\r
C_SRCS__QUOTED += \\r
-"../components/clk.c" \\r
-"../components/fil.c" \\r
-"../components/sys.c" \\r
-"../components/sysasnr.c" \\r
-"../components/sysbf.c" \\r
-"../components/sysbfflt.c" \\r
-"../components/syseram.c" \\r
-"../components/sysiram.c" \\r
-"../components/sysmss.c" \\r
-"../components/sysvau.c" \r
+"../../../common/components/clk.c" \\r
+"../../../common/components/fil.c" \\r
+"../../../common/components/sys.c" \\r
+"../../../common/components/sysasnr.c" \\r
+"../../../common/components/sysbf.c" \\r
+"../../../common/components/sysbfflt.c" \\r
+"../../../common/components/sysdrc.c" \\r
+"../../../common/components/syseram.c" \\r
+"../../../common/components/sysiram.c" \\r
+"../../../common/components/sysmss.c" \r
\r
\r
\r
##-include components/mhm/src/subdir_vars.mk\r
C_SRCS += \\r
-../components/mhm/src/mhm.c \r
+../../../common/components/mhm/src/mhm.c \r
\r
OBJS += \\r
mhm.obj \r
"mhm.obj" \r
\r
C_SRCS__QUOTED += \\r
-"../components/mhm/src/mhm.c" \r
+"../../../common/components/mhm/src/mhm.c" \r
\r
\r
\r
##-include components/mss/src/subdir_vars.mk\r
C_SRCS += \\r
-../components/mss/src/mss.c \\r
-../components/mss/src/mssproc.c \r
+../../../common/components/mss/src/mss.c \\r
+../../../common/components/mss/src/mssproc.c \r
\r
OBJS += \\r
mss.obj \\r
"mssproc.obj" \r
\r
C_SRCS__QUOTED += \\r
-"../components/mss/src/mss.c" \\r
-"../components/mss/src/mssproc.c" \r
+"../../../common/components/mss/src/mss.c" \\r
+"../../../common/components/mss/src/mssproc.c" \r
\r
\r
\r
\r
\r
##-include components/subdir_rules.mk\r
-clk.obj: ../components/clk.c $(GEN_OPTS) $(GEN_HDRS)\r
+clk.obj: ../../../common/components/clk.c $(GEN_OPTS) $(GEN_HDRS)\r
@echo 'Building file: $<'\r
@echo 'Invoking: C6000 Compiler'\r
"$(C6X_GEN_INSTALL_PATH)/bin/cl6x" -mv6600 --include_path="$(C6X_GEN_INSTALL_PATH)/include" -g --define=am5728 --define=core1 --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="./clk.d" --obj_directory="." $(GEN_OPTS__FLAG) "$<"\r
@echo 'Finished building: $<'\r
@echo ' '\r
\r
-fil.obj: ../components/fil.c $(GEN_OPTS) $(GEN_HDRS)\r
+fil.obj: ../../../common/components/fil.c $(GEN_OPTS) $(GEN_HDRS)\r
@echo 'Building file: $<'\r
@echo 'Invoking: C6000 Compiler'\r
"$(C6X_GEN_INSTALL_PATH)/bin/cl6x" -mv6600 --include_path="$(C6X_GEN_INSTALL_PATH)/include" -g --define=am5728 --define=core1 --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="fil.d" --obj_directory="." $(GEN_OPTS__FLAG) "$<"\r
@echo 'Finished building: $<'\r
@echo ' '\r
\r
-sys.obj: ../components/sys.c $(GEN_OPTS) $(GEN_HDRS)\r
+sys.obj: ../../../common/components/sys.c $(GEN_OPTS) $(GEN_HDRS)\r
@echo 'Building file: $<'\r
@echo 'Invoking: C6000 Compiler'\r
"$(C6X_GEN_INSTALL_PATH)/bin/cl6x" -mv6600 --include_path="$(C6X_GEN_INSTALL_PATH)/include" -g --define=am5728 --define=core1 --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="sys.d" --obj_directory="." $(GEN_OPTS__FLAG) "$<"\r
@echo 'Finished building: $<'\r
@echo ' '\r
\r
-sysasnr.obj: ../components/sysasnr.c $(GEN_OPTS) $(GEN_HDRS)\r
+sysasnr.obj: ../../../common/components/sysasnr.c $(GEN_OPTS) $(GEN_HDRS)\r
@echo 'Building file: $<'\r
@echo 'Invoking: C6000 Compiler'\r
"$(C6X_GEN_INSTALL_PATH)/bin/cl6x" -mv6600 --include_path="$(C6X_GEN_INSTALL_PATH)/include" -g --define=am5728 --define=core1 --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="sysasnr.d" --obj_directory="." $(GEN_OPTS__FLAG) "$<"\r
@echo 'Finished building: $<'\r
@echo ' '\r
\r
-sysbf.obj: ../components/sysbf.c $(GEN_OPTS) $(GEN_HDRS)\r
+sysbf.obj: ../../../common/components/sysbf.c $(GEN_OPTS) $(GEN_HDRS)\r
@echo 'Building file: $<'\r
@echo 'Invoking: C6000 Compiler'\r
"$(C6X_GEN_INSTALL_PATH)/bin/cl6x" -mv6600 --include_path="$(C6X_GEN_INSTALL_PATH)/include" -g --define=am5728 --define=core1 --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="sysbf.d" --obj_directory="." $(GEN_OPTS__FLAG) "$<"\r
@echo 'Finished building: $<'\r
@echo ' '\r
\r
-sysbfflt.obj: ../components/sysbfflt.c $(GEN_OPTS) $(GEN_HDRS)\r
+sysbfflt.obj: ../../../common/components/sysbfflt.c $(GEN_OPTS) $(GEN_HDRS)\r
@echo 'Building file: $<'\r
@echo 'Invoking: C6000 Compiler'\r
"$(C6X_GEN_INSTALL_PATH)/bin/cl6x" -mv6600 --include_path="$(C6X_GEN_INSTALL_PATH)/include" -g --define=am5728 --define=core1 --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="sysbfflt.d" --obj_directory="." $(GEN_OPTS__FLAG) "$<"\r
@echo 'Finished building: $<'\r
@echo ' '\r
\r
-syseram.obj: ../components/syseram.c $(GEN_OPTS) $(GEN_HDRS)\r
+sysdrc.obj: ../../../common/components/sysdrc.c $(GEN_OPTS) $(GEN_HDRS)\r
@echo 'Building file: $<'\r
@echo 'Invoking: C6000 Compiler'\r
- "$(C6X_GEN_INSTALL_PATH)/bin/cl6x" -mv6600 --include_path="$(C6X_GEN_INSTALL_PATH)/include" -g --define=am5728 --define=core1 --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="syseram.d" --obj_directory="." $(GEN_OPTS__FLAG) "$<"\r
+ "$(C6X_GEN_INSTALL_PATH)/bin/cl6x" -mv6600 --include_path="$(C6X_GEN_INSTALL_PATH)/include" -g --define=am5728 --define=core1 --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="sysdrc.d" --obj_directory="." $(GEN_OPTS__FLAG) "$<"\r
@echo 'Finished building: $<'\r
@echo ' '\r
\r
-sysiram.obj: ../components/sysiram.c $(GEN_OPTS) $(GEN_HDRS)\r
+syseram.obj: ../../../common/components/syseram.c $(GEN_OPTS) $(GEN_HDRS)\r
@echo 'Building file: $<'\r
@echo 'Invoking: C6000 Compiler'\r
- "$(C6X_GEN_INSTALL_PATH)/bin/cl6x" -mv6600 --include_path="$(C6X_GEN_INSTALL_PATH)/include" -g --define=am5728 --define=core1 --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="sysiram.d" --obj_directory="." $(GEN_OPTS__FLAG) "$<"\r
+ "$(C6X_GEN_INSTALL_PATH)/bin/cl6x" -mv6600 --include_path="$(C6X_GEN_INSTALL_PATH)/include" -g --define=am5728 --define=core1 --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="syseram.d" --obj_directory="." $(GEN_OPTS__FLAG) "$<"\r
@echo 'Finished building: $<'\r
@echo ' '\r
\r
-sysmss.obj: ../components/sysmss.c $(GEN_OPTS) $(GEN_HDRS)\r
+sysiram.obj: ../../../common/components/sysiram.c $(GEN_OPTS) $(GEN_HDRS)\r
@echo 'Building file: $<'\r
@echo 'Invoking: C6000 Compiler'\r
- "$(C6X_GEN_INSTALL_PATH)/bin/cl6x" -mv6600 --include_path="$(C6X_GEN_INSTALL_PATH)/include" -g --define=am5728 --define=core1 --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="sysmss.d" --obj_directory="." $(GEN_OPTS__FLAG) "$<"\r
+ "$(C6X_GEN_INSTALL_PATH)/bin/cl6x" -mv6600 --include_path="$(C6X_GEN_INSTALL_PATH)/include" -g --define=am5728 --define=core1 --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="sysiram.d" --obj_directory="." $(GEN_OPTS__FLAG) "$<"\r
@echo 'Finished building: $<'\r
@echo ' '\r
\r
-sysvau.obj: ../components/sysvau.c $(GEN_OPTS) $(GEN_HDRS)\r
+sysmss.obj: ../../../common/components/sysmss.c $(GEN_OPTS) $(GEN_HDRS)\r
@echo 'Building file: $<'\r
@echo 'Invoking: C6000 Compiler'\r
- "$(C6X_GEN_INSTALL_PATH)/bin/cl6x" -mv6600 --include_path="$(C6X_GEN_INSTALL_PATH)/include" -g --define=am5728 --define=core1 --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="sysvau.d" --obj_directory="." $(GEN_OPTS__FLAG) "$<"\r
+ "$(C6X_GEN_INSTALL_PATH)/bin/cl6x" -mv6600 --include_path="$(C6X_GEN_INSTALL_PATH)/include" -g --define=am5728 --define=core1 --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="sysmss.d" --obj_directory="." $(GEN_OPTS__FLAG) "$<"\r
@echo 'Finished building: $<'\r
@echo ' '\r
\r
\r
\r
##-include components/mhm/src/subdir_rules.mk\r
-mhm.obj: ../components/mhm/src/mhm.c $(GEN_OPTS) $(GEN_HDRS)\r
+mhm.obj: ../../../common/components/mhm/src/mhm.c $(GEN_OPTS) $(GEN_HDRS)\r
@echo 'Building file: $<'\r
@echo 'Invoking: C6000 Compiler'\r
"$(C6X_GEN_INSTALL_PATH)/bin/cl6x" -mv6600 --include_path="$(C6X_GEN_INSTALL_PATH)/include" -g --define=am5728 --define=core1 --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="mhm.d" --obj_directory="." $(GEN_OPTS__FLAG) "$<"\r
\r
\r
##-include components/mss/src/subdir_rules.mk\r
-mss.obj: ../components/mss/src/mss.c $(GEN_OPTS) $(GEN_HDRS)\r
+mss.obj: ../../../common/components/mss/src/mss.c $(GEN_OPTS) $(GEN_HDRS)\r
@echo 'Building file: $<'\r
@echo 'Invoking: C6000 Compiler'\r
"$(C6X_GEN_INSTALL_PATH)/bin/cl6x" -mv6600 --include_path="$(C6X_GEN_INSTALL_PATH)/include" -g --define=am5728 --define=core1 --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="mss.d" --obj_directory="." $(GEN_OPTS__FLAG) "$<"\r
@echo 'Finished building: $<'\r
@echo ' '\r
\r
-mssproc.obj: ../components/mss/src/mssproc.c $(GEN_OPTS) $(GEN_HDRS)\r
+mssproc.obj: ../../../common/components/mss/src/mssproc.c $(GEN_OPTS) $(GEN_HDRS)\r
@echo 'Building file: $<'\r
@echo 'Invoking: C6000 Compiler'\r
"$(C6X_GEN_INSTALL_PATH)/bin/cl6x" -mv6600 --include_path="$(C6X_GEN_INSTALL_PATH)/include" -g --define=am5728 --define=core1 --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="mssproc.d" --obj_directory="." $(GEN_OPTS__FLAG) "$<"\r
diff --git a/file_demo_bios/am572x/components/clk.c b/file_demo_bios/am572x/components/clk.c
+++ /dev/null
@@ -1,427 +0,0 @@
-/*
- * Copyright (c) 2016, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
- * CONTRIBUTORS 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
- * 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/am572x/components/fil.c b/file_demo_bios/am572x/components/fil.c
+++ /dev/null
@@ -1,406 +0,0 @@
-/*
- * Copyright (c) 2016, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
- * CONTRIBUTORS 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
- * 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/am572x/components/fil.h b/file_demo_bios/am572x/components/fil.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (c) 2016, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
- * CONTRIBUTORS 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
- * 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/am572x/components/mhm/configspec.clearcase b/file_demo_bios/am572x/components/mhm/configspec.clearcase
+++ /dev/null
@@ -1,25 +0,0 @@
-# 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/am572x/components/mhm/dcSpec.txt b/file_demo_bios/am572x/components/mhm/dcSpec.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-# 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/am572x/components/mhm/dcSpeclnx.txt b/file_demo_bios/am572x/components/mhm/dcSpeclnx.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-# 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/am572x/components/mhm/mCspec.txt b/file_demo_bios/am572x/components/mhm/mCspec.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-# 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/am572x/components/mhm/mCspeclnx.txt b/file_demo_bios/am572x/components/mhm/mCspeclnx.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-# 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/am572x/components/mhm/mhm.h b/file_demo_bios/am572x/components/mhm/mhm.h
+++ /dev/null
@@ -1,64 +0,0 @@
-#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) 2016, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
- * CONTRIBUTORS 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
-/* 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/am572x/components/mhm/package.bld b/file_demo_bios/am572x/components/mhm/package.bld
+++ /dev/null
@@ -1,113 +0,0 @@
-/******************************************************************************\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/am572x/components/mhm/package.xdc b/file_demo_bios/am572x/components/mhm/package.xdc
+++ /dev/null
@@ -1,87 +0,0 @@
-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
- * © 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/am572x/components/mhm/package.xs b/file_demo_bios/am572x/components/mhm/package.xs
+++ /dev/null
@@ -1,28 +0,0 @@
-/******************************************************************************\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/am572x/components/mhm/readme.txt b/file_demo_bios/am572x/components/mhm/readme.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-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/am572x/components/mhm/src/arm/mhmport.h b/file_demo_bios/am572x/components/mhm/src/arm/mhmport.h
+++ /dev/null
@@ -1,51 +0,0 @@
-#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
- * Copyright (c) 2016, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
- * CONTRIBUTORS 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
-/* 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/am572x/components/mhm/src/c54/mhmport.h b/file_demo_bios/am572x/components/mhm/src/c54/mhmport.h
+++ /dev/null
@@ -1,61 +0,0 @@
-#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
- *
- * Copyright (c) 2016, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
- * CONTRIBUTORS 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
-/* 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/am572x/components/mhm/src/c55/mhmport.h b/file_demo_bios/am572x/components/mhm/src/c55/mhmport.h
+++ /dev/null
@@ -1,61 +0,0 @@
-#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
- * Copyright (c) 2016, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
- * CONTRIBUTORS 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
-/* 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/am572x/components/mhm/src/c64/mhmport.h b/file_demo_bios/am572x/components/mhm/src/c64/mhmport.h
+++ /dev/null
@@ -1,64 +0,0 @@
-#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
- *
- * Copyright (c) 2016, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
- * CONTRIBUTORS 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
-/* 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/am572x/components/mhm/src/mhm.c b/file_demo_bios/am572x/components/mhm/src/mhm.c
+++ /dev/null
@@ -1,278 +0,0 @@
-/******************************************************************************\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
- * Copyright (c) 2016, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
- * CONTRIBUTORS 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
-#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/am572x/components/mhm/src/mhmport.h b/file_demo_bios/am572x/components/mhm/src/mhmport.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (c) 2016, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
- * CONTRIBUTORS 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
-#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/am572x/components/mss/mss.h b/file_demo_bios/am572x/components/mss/mss.h
+++ /dev/null
@@ -1,501 +0,0 @@
-#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) 2016, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
- * CONTRIBUTORS 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
-#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/am572x/components/mss/src/mss.c b/file_demo_bios/am572x/components/mss/src/mss.c
+++ /dev/null
@@ -1,528 +0,0 @@
-/**\r
- * @file mss.c\r
- * @brief Contains external API for Multi-Source Selection (MSS) module \r
- * instantiation.\r
- *\r
- * Copyright (c) 2016, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
- * CONTRIBUTORS 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
-#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_size = inst->svd_size;\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/am572x/components/mss/src/mssloc.h b/file_demo_bios/am572x/components/mss/src/mssloc.h
+++ /dev/null
@@ -1,116 +0,0 @@
-#ifndef _MSSLOC_H\r
-#define _MSSLOC_H\r
-\r
-/*
- * Copyright (c) 2016, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
- * CONTRIBUTORS 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
-//#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/am572x/components/mss/src/mssproc.c b/file_demo_bios/am572x/components/mss/src/mssproc.c
+++ /dev/null
@@ -1,395 +0,0 @@
-/**\r
- * @file mssproc.c\r
- * @brief Contains Main Processing Routines for Multi-Source Selection \r
- * (MSS) module.\r
- *\r
- * Copyright (c) 2016, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
- * CONTRIBUTORS 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
-#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 += phase_inc;\r
- }\r
- inst->crossfade_phase = phase;\r
-\r
- /* for debugging only */\r
- inst->gain_in = fade_in_alpha;\r
- inst->gain_out = fade_out_alpha;\r
- \r
- inst->crossfade_cnt += inst->frame_size;\r
- if(inst->crossfade_cnt >= inst->params.switch_duration) {\r
- inst->crossfade_cnt = 0;\r
- inst->cur_src = inst->new_src;\r
- mss_clrbit(inst->state_bf, MSS_STATE_BIT_SWITCH_SRC);\r
- } \r
- } \r
-} /* mss_src_output */ \r
-\r
-/* Nothing past this point */\r
diff --git a/file_demo_bios/am572x/components/sys.c b/file_demo_bios/am572x/components/sys.c
+++ /dev/null
@@ -1,383 +0,0 @@
-/*
- * Copyright (c) 2016, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
- * CONTRIBUTORS 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
- * sys.c: Basic system functions.\r
- *=================================================================*/\r
-\r
-#include <string.h>\r
-\r
-#include <xdc/std.h>\r
-#include <ti/sysbios/BIOS.h>\r
-#include <xdc/runtime/System.h>\r
-\r
-#include <ti/mas/types/types.h>\r
-#include <ti/mas/util/ecomem.h>\r
-//#include <ti/mas/mhm/mhm.h>\r
-\r
-#include "mhm/mhm.h"\r
-\r
-#include "sys.h"\r
-#include "syseram.h"\r
-#include "sysiram.h"\r
-#include "sysbfflt.h"\r
-\r
-/* Globals */\r
-\r
-/* Buffer descriptor array for memory allocations */\r
-ecomemBuffer_t sysCompBufs[SYS_COMP_MAXBUFS];\r
-\r
-/* Input sample buffer (dual) (align=8) */\r
-#pragma DATA_ALIGN(sysInBuf,8)\r
-tword sysInBuf[SYS_IN_SIZE];\r
-\r
-/* Virtual microphone frame outputs (align=8)*/\r
-#pragma DATA_ALIGN(sysVmicFrame,8)\r
-linSample sysVmicFrame[SYS_VMICS_MAX*SYS_FRAME_LENGTH];\r
-\r
-/* Virtual microphone angles to be used (default is all 12, every 30 degrees) */\r
-tint sysBfVMicAngles[SYS_VMICS_MAX] = {\r
- SYS_BF_ANGLE_P0,\r
- SYS_BF_ANGLE_P30,\r
- SYS_BF_ANGLE_P60,\r
- SYS_BF_ANGLE_P90,\r
- SYS_BF_ANGLE_P120,\r
- SYS_BF_ANGLE_P150,\r
- SYS_BF_ANGLE_P180,\r
- SYS_BF_ANGLE_M150,\r
- SYS_BF_ANGLE_M120,\r
- SYS_BF_ANGLE_M90,\r
- SYS_BF_ANGLE_M60,\r
- SYS_BF_ANGLE_M30\r
-};\r
-\r
-sysContext_t sysContext; /* Global System Context structure */\r
-\r
-#define max(a,b) (((a)>(b))?(a):(b))\r
-\r
-/*=============================\r
- * Functions\r
- *=============================*/\r
-\r
-/*=================================================================\r
- * int sysAngleConfig( Configure default virtual microphones\r
- * tint nvmics) - Number of virtual mics to configure\r
- * \r
- * This function accespts only 4,6,8,12 virtual microphones.\r
- * If different number is used, manual configuration must be done\r
- * with potentially providing different microphone filters for the array.\r
- *=================================================================*/\r
-\r
-int sysAngleConfig(tint nvmics)\r
-{\r
- int err;\r
-\r
- err = SYS_ERR_SUCCESS;\r
- nvmics = sysContext.nvmics;\r
- switch (nvmics) {\r
- case 4:\r
- sysBfVMicAngles[0] = SYS_BF_ANGLE_P0;\r
- sysBfVMicAngles[1] = SYS_BF_ANGLE_P90;\r
- sysBfVMicAngles[2] = SYS_BF_ANGLE_P180;\r
- sysBfVMicAngles[3] = SYS_BF_ANGLE_M90;\r
- break;\r
- case 6:\r
- sysBfVMicAngles[0] = SYS_BF_ANGLE_P0;\r
- sysBfVMicAngles[1] = SYS_BF_ANGLE_P60;\r
- sysBfVMicAngles[2] = SYS_BF_ANGLE_P120;\r
- sysBfVMicAngles[3] = SYS_BF_ANGLE_P180;\r
- sysBfVMicAngles[4] = SYS_BF_ANGLE_M120;\r
- sysBfVMicAngles[5] = SYS_BF_ANGLE_M60;\r
- break;\r
- case 8:\r
- sysBfVMicAngles[0] = SYS_BF_ANGLE_P0;\r
- sysBfVMicAngles[1] = SYS_BF_ANGLE_P45;\r
- sysBfVMicAngles[2] = SYS_BF_ANGLE_P90;\r
- sysBfVMicAngles[3] = SYS_BF_ANGLE_P135;\r
- sysBfVMicAngles[4] = SYS_BF_ANGLE_P180;\r
- sysBfVMicAngles[5] = SYS_BF_ANGLE_M135;\r
- sysBfVMicAngles[6] = SYS_BF_ANGLE_M90;\r
- sysBfVMicAngles[7] = SYS_BF_ANGLE_M45;\r
- break;\r
- case 12:\r
- sysBfVMicAngles[0] = SYS_BF_ANGLE_P0;\r
- sysBfVMicAngles[1] = SYS_BF_ANGLE_P30;\r
- sysBfVMicAngles[2] = SYS_BF_ANGLE_P60;\r
- sysBfVMicAngles[3] = SYS_BF_ANGLE_P90;\r
- sysBfVMicAngles[4] = SYS_BF_ANGLE_P120;\r
- sysBfVMicAngles[5] = SYS_BF_ANGLE_P150;\r
- sysBfVMicAngles[6] = SYS_BF_ANGLE_P180;\r
- sysBfVMicAngles[7] = SYS_BF_ANGLE_M150;\r
- sysBfVMicAngles[8] = SYS_BF_ANGLE_M120;\r
- sysBfVMicAngles[9] = SYS_BF_ANGLE_M90;\r
- sysBfVMicAngles[10] = SYS_BF_ANGLE_M60;\r
- sysBfVMicAngles[11] = SYS_BF_ANGLE_M30;\r
- break;\r
- default:\r
- err = SYS_ERR_ANGLECONFIG;\r
- break;\r
- }\r
- return(err);\r
-} /* sysAngleConfig */\r
-\r
-/*=================================================================\r
- * int sysCreate(\r
- * sysConfig_t cfg); - System configuration (see sys.h)\r
- *=================================================================*/\r
-\r
-int sysCreate(sysConfig_t *cfg)\r
-{\r
- int k, err, nvmics;\r
- void *heap_p;\r
- linSample *x_p;\r
-\r
- if (cfg->nmics < 1 || cfg->nmics > SYS_MICS_MAX ||\r
- cfg->nvmics < 1 || cfg->nvmics > SYS_VMICS_MAX) {\r
- return(SYS_ERR_BADCONFIG);\r
- }\r
- sysContext.nmics = cfg->nmics; /* Store # of mics used */\r
- nvmics = sysContext.nvmics = cfg->nvmics; /* Store # of virtual mics used */\r
- sysContext.use_fileio = cfg->use_fileio; /* probably FALSE since slow */\r
- sysContext.eof = FALSE; /* no EOF reached yet */\r
- sysContext.use_default = cfg->use_default; /* TRUE for default vmic angles */\r
-\r
- /* Initialize input buffer pointers and read portion */\r
- sysContext.in_lo = &sysInBuf[0]; /* Input buffer start (Low part) */\r
- sysContext.in_hi = &sysInBuf[SYS_IN_SIZE/2]; /* High part of input buffer */\r
- sysContext.in_w = sysContext.in_lo; /* Write pointer */\r
- sysContext.in_r = sysContext.in_hi; /* Read pointer */\r
- memset(sysContext.in_r, 0xBA, SYS_IN_SIZE/2); /* Initial the read portion */\r
-\r
- /* Clear instance pointers */\r
- for (k = 0; k < SYS_VMICS_MAX; k++) {\r
- sysContext.bfInst_p[k] = sysContext.asnrInst_p[k] = NULL;\r
- }\r
- sysContext.mssInst_p = sysContext.vauInst_p = NULL;\r
-\r
- /* Initialize virtual microphone frame pointers */\r
-\r
- /* First check to see if default configurations are used */\r
- if (sysContext.use_default) {\r
- err = sysAngleConfig(nvmics);\r
- if (err != SYS_ERR_SUCCESS) {\r
- return(err);\r
- }\r
- }\r
- x_p = &sysVmicFrame[0];\r
- for (k = 0; k < nvmics; k++) {\r
- sysContext.vmicfrm[k] = &x_p[k*SYS_FRAME_LENGTH];\r
- sysContext.vmicangles[k] = sysBfVMicAngles[k];\r
- }\r
- for ( ; k < SYS_VMICS_MAX; k++) {\r
- sysContext.vmicfrm[k] = (linSample*)NULL;\r
- sysContext.vmicangles[k] = 0;\r
- }\r
-\r
- /* Create heaps */\r
- heap_p = mhmCreate(sysEramPermanent,SYS_ERAM_PERMANENT_SIZE,0);\r
- if (heap_p == NULL) {\r
- return(SYS_ERR_HEAPINIT);\r
- }\r
- sysContext.heapEP = heap_p;\r
-\r
- heap_p = mhmCreate(sysEramScratch,SYS_ERAM_SCRATCH_SIZE,0);\r
- if (heap_p == NULL) {\r
- return(SYS_ERR_HEAPINIT);\r
- }\r
- sysContext.heapES = heap_p;\r
-\r
- heap_p = mhmCreate(sysIramPermanent,SYS_IRAM_PERMANENT_SIZE,0);\r
- if (heap_p == NULL) {\r
- return(SYS_ERR_HEAPINIT);\r
- }\r
- sysContext.heapIP = heap_p;\r
-\r
- heap_p = mhmCreate(sysIramScratch,SYS_IRAM_SCRATCH_SIZE,0);\r
- if (heap_p == NULL) {\r
- return(SYS_ERR_HEAPINIT);\r
- }\r
- sysContext.heapIS = heap_p;\r
-\r
- return(SYS_ERR_SUCCESS);\r
-} /* sysCreate */\r
-\r
-/*=================================================================\r
- * void sysError( Print error and exit\r
- * int err); - System errror code (see sys.h)\r
- *=================================================================*/\r
-\r
-void sysError(int err)\r
-{\r
- System_printf("*** ERROR: %d\n", err);\r
- BIOS_exit(0);\r
-} /* sysError */\r
-\r
-/*=================================================================\r
- * int sysHeapAlloc( Allocate buffer from appropriate heap\r
- * void *bd, - buffer descriptor\r
- * tint reset) - 1: reset heap, 0: don't\r
- *=================================================================*/\r
-\r
-int sysHeapAlloc(void *bd_in, tint reset)\r
-{\r
- tuint size;\r
- void *handle;\r
- tword *base_w;\r
- tulong *used_p;\r
-\r
- ecomemBuffer_t *bd_p = (ecomemBuffer_t*) bd_in;\r
-\r
- if (bd_p->mclass == ecomem_CLASS_EXTERNAL) {\r
- if (bd_p->volat) {\r
- handle = sysContext.heapES;\r
- used_p = &sysContext.heapES_used;\r
- }\r
- else { /* permanent */\r
- handle = sysContext.heapEP;\r
- used_p = &sysContext.heapEP_used;\r
- }\r
- }\r
- else if (bd_p->mclass == ecomem_CLASS_INTERNAL) {\r
- if (bd_p->volat) {\r
- handle = sysContext.heapIS;\r
- used_p = &sysContext.heapIS_used;\r
- }\r
- else { /* permanent */\r
- handle = sysContext.heapIP;\r
- used_p = &sysContext.heapIP_used;\r
- }\r
- }\r
- else {\r
- return(SYS_ERR_INVHEAPCLASS);\r
- }\r
-\r
- if (reset != 0) {\r
- mhmReset(handle); /* optionally reset the heap */\r
- *used_p = 0; /* reset used size to zero */\r
- }\r
- size = bd_p->size;\r
- base_w = (tword*)mhmAllocAligned(handle, size, bd_p->log2align);\r
- *used_p += size; /* update the used size */\r
-\r
- bd_p->base = base_w; /* store the bsae address for a buffer */\r
-\r
- return(SYS_ERR_SUCCESS);\r
-} /* sysHeapAlloc */\r
-\r
-/*=================================================================\r
- * int sysHeapAllocAll( Allocate ALL buffers from appropriate heaps\r
- * tint nbufs, - number of buffers\r
- * void *bdout, - output buffer descriptors\r
- * void *bdin) - input buffer descriptors\r
- *=================================================================*/\r
-\r
-int sysHeapAllocAll(tint nbufs, void *bdout_p, const void *bdin_p)\r
-{\r
- int err;\r
- tint k, volatile_found;\r
- tulong es_used, is_used; /* place to save scratch used sizes */\r
- ecomemBuffer_t *bdout = bdout_p;\r
- const ecomemBuffer_t *bdin = bdin_p;\r
-\r
- es_used = sysContext.heapES_used; /* save in case scratch was reset */\r
- is_used = sysContext.heapIS_used;\r
-\r
- /* Allocate memory for all buffers */\r
- volatile_found = FALSE;\r
- for (k = 0; k < nbufs; k++) {\r
- bdout[k] = bdin[k];\r
- if (bdout[k].volat && !volatile_found) { /* first volatile? */\r
- err=sysHeapAlloc(&bdout[k], TRUE); /* reset heap for the first volatile buffer */\r
- if (err < 0) {\r
- return(err);\r
- }\r
- volatile_found = TRUE;\r
- }\r
- else { /* no need to reset heap */\r
- err=sysHeapAlloc(&bdout[k], FALSE);\r
- if (err < 0) {\r
- return(err);\r
- }\r
- }\r
- }\r
-\r
- /* fix the scratch heap used sizes if necessary */\r
- sysContext.heapES_used = max(es_used,sysContext.heapES_used);\r
- sysContext.heapIS_used = max(is_used,sysContext.heapIS_used);\r
-\r
- return(SYS_ERR_SUCCESS);\r
-} /* sysHeapAllocAll */\r
-\r
-/*==================================================*/\r
-/* The following was based on MHM implementation!!! */\r
-/*==================================================*/\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
-} sysMhmHead_t;\r
-typedef tulong sysMhmAddress_t;\r
-\r
-/*=================================================================\r
- * int sysPrintConfig(\r
- * tuint scope); - SYSM_SCOPE_STATIC: Static configuration like default constants\r
- * SYSM_SCOPE_DYNAMIC: Dynamic configuraiton like actual run-time values \r
- *=================================================================*/\r
-\r
-int sysPrintConfig(tuint scope)\r
-{\r
- if (SYS_MASK_TEST(scope,SYSM_SCOPE_STATIC)) {\r
- System_printf("\nStatic information:\n");\r
- System_printf("tword: %d\n", sizeof(tword));\r
- System_printf("tint: %d\n", sizeof(tint));\r
- System_printf("tlong: %d\n", sizeof(tlong));\r
- System_printf("Max #mics: %d\n", SYS_MICS_MAX);\r
- System_printf("Max #vmics: %d\n", SYS_VMICS_MAX);\r
- System_printf("Fs: %d [Hz]\n", SYS_FS_HZ);\r
- System_printf("Frame duration: %d [ms]\n", SYS_FRAME_DURATION_MS);\r
- System_printf("Frame length: %ld samples\n", SYS_FRAME_LENGTH);\r
- System_printf("Frame size: %ld bytes\n", SYS_FRAME_SIZE);\r
- System_printf("Input buffer length: %ld samples\n", SYS_IN_LENGTH);\r
- System_printf("Frame buffer size: %ld bytes\n", SYS_IN_SIZE);\r
- }\r
- if (SYS_MASK_TEST(scope,SYSM_SCOPE_DYNAMIC)) {\r
- System_printf("\nDynamic information:\n");\r
- System_printf("#mics: %d\n", sysContext.nmics);\r
- System_printf("#vmics: %d\n", sysContext.nvmics);\r
- }\r
- return(SYS_ERR_SUCCESS);\r
-} /* sysPrintConfig */\r
-\r
-/* nothing past this point */\r
-\r
diff --git a/file_demo_bios/am572x/components/sys.h b/file_demo_bios/am572x/components/sys.h
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Copyright (c) 2016, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
- * CONTRIBUTORS 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
- sys.h: System constants, data types, prototypes.\r
-*/\r
-#ifndef _SYS_H\r
-#define _SYS_H\r
-\r
-#include <xdc/std.h> /* required for types.h */\r
-#include <ti/mas/types/types.h>\r
-#include <ti/mas/util/ecomem.h>\r
-\r
-/*======================================================================\r
- * Static system configuration parameters\r
- *======================================================================*/\r
-\r
-#define SYS_MICS_MAX 8 /* Maximum number of microphones in the system */\r
-#define SYS_VMICS_MAX 12 /* Maximum number of virtual microphones in the system */\r
-#define SYS_FS_HZ 16000 /* Sampling rate in Hz */\r
-#define SYS_FRAME_DURATION_MS 10 /* Frame duration in ms */\r
-#define SYS_FRAME_LENGTH (1L*SYS_FS_HZ*SYS_FRAME_DURATION_MS/1000) /* Frame length in samples */\r
-#define SYS_FRAME_SIZE (TYP_LINSAMPLE_SIZE*SYS_FRAME_LENGTH/TYP_TWORD_SIZE) /* Frame size in bytes */\r
-#define SYS_IN_LENGTH (2L*SYS_FRAME_LENGTH*SYS_MICS_MAX) /* Input buffer length (dual) */\r
-#define SYS_IN_SIZE (TYP_LINSAMPLE_SIZE*SYS_IN_LENGTH/TYP_TWORD_SIZE) /* # of words in input buffer */\r
-\r
-/*======================================================================\r
- * Bit masks, bit-mask handling macros, error codes\r
- *======================================================================*/\r
-\r
-/* Bit masks for sysPrintConfig */\r
-#define SYSM_SCOPE_STATIC 0x1 /* Static system information */\r
-#define SYSM_SCOPE_DYNAMIC 0x2 /* Dynamic system onfirmation */\r
-\r
-/* Macros for bit-mask manipulations */\r
-#define SYS_MASK_GET(value,mask) ((value)&(mask))\r
-#define SYS_MASK_SET(value,mask) ((value)|(mask))\r
-#define SYS_MASK_TEST(value,mask) (SYS_MASK_GET(value,mask)!=0)\r
-\r
-/* System error codes */\r
-#define SYS_ERR_SUCCESS 0\r
-#define SYS_ERR_BADCONFIG (-1)\r
-#define SYS_INV_HANDLE (-2)\r
-#define SYS_INV_LOGIC (-3)\r
-#define SYS_ERR_BUFLENGTH (-4)\r
-#define SYS_ERR_FOPEN (-5)\r
-#define SYS_ERR_FLOAD (-6)\r
-#define SYS_ERR_FMAXBUF (-7)\r
-#define SYS_ERR_FREAD (-8)\r
-#define SYS_ERR_HEAPINIT (-9)\r
-#define SYS_ERR_INVHEAPCLASS (-10)\r
-#define SYS_ERR_BFERROR (-11)\r
-#define SYS_ERR_EOF (-12)\r
-#define SYS_ERR_ASNRERROR (-13)\r
-#define SYS_ERR_MSSERROR (-14)\r
-#define SYS_ERR_MSSDEBUG (-15)\r
-#define SYS_ERR_ANGLECONFIG (-16)\r
-#define SYS_ERR_VAUERROR (-17)\r
-\r
-/*======================================================================\r
- * System Data Types\r
- *======================================================================*/\r
-\r
-/* System Configuration Structure */\r
-struct sysConfig_stc {\r
- tint nmics; /* The actual number of microphones in ths system */\r
- tint nvmics; /* The acutal number of virtual microphones in the system */\r
- tbool use_fileio; /* Use file I/O to load microphone files */\r
- tbool use_default; /* Use default angles for virtual microphones */\r
-};\r
-typedef struct sysConfig_stc sysConfig_t;\r
-\r
-/* System Context Structure */\r
-struct sysContext_stc {\r
- tint nmics; /* The actual number of microphones in ths system */\r
- tint nvmics; /* The acutal number of virtual microphones in the system */\r
-\r
- /* heap handles (point to head header) */\r
- void *heapEP;\r
- void *heapES;\r
- void *heapIP;\r
- void *heapIS;\r
-\r
- /* used heap */\r
- tulong heapEP_used; /* how many used in words */\r
- tulong heapES_used;\r
- tulong heapIP_used;\r
- tulong heapIS_used;\r
-\r
- /* Mic input buffer */\r
- /* This is a dual buffer. Each part has SYS_FRAME_LENGTH*SYS_MICS_MAX samples\r
- * to accomodate all microphone inputs. The samples are written contiguously\r
- * without any gaps. Channel after channel.\r
- */\r
- void *in_w; /* Mic input buffer being written to */\r
- void *in_r; /* Mic input buffer being read from */\r
- void *in_lo; /* Low part of mic input buffer */\r
- void *in_hi; /* High part of mic input buffer */\r
-\r
- linSample *vmicfrm[SYS_VMICS_MAX]; /* Virtual mic frames */\r
-\r
- /* Instance pointers */\r
- void *bfInst_p[SYS_VMICS_MAX]; /* beamformer instance pointers */\r
- void *asnrInst_p[SYS_VMICS_MAX]; /* ASNR instance pointers */\r
- void *mssInst_p; /* MSS instance pointer */\r
- void *vauInst_p; /* VAU instance pointer */\r
-\r
- tint vmicangles[SYS_VMICS_MAX]; /* use SYS_BF_ANGLE_xxx from sysbfflt.h */\r
-\r
- tbool use_fileio; /* Use file I/O to load microphone files */\r
- tbool eof; /* End of file reached */\r
- tbool use_default; /* Use default vmic angles (4,6,8,12 vmics supported only) */\r
-};\r
-typedef struct sysContext_stc sysContext_t;\r
-\r
-/*======================================================================\r
- * Global variable declarations\r
- *======================================================================*/\r
-\r
-extern sysContext_t sysContext; /* Defined in sys.c */\r
-extern tint sysBfVMicAngles[]; /* Defined in sys.c */\r
-\r
-/* Buffer descriptor array for memory allocations */\r
-#define SYS_COMP_MAXBUFS 10\r
-extern ecomemBuffer_t sysCompBufs[];\r
-\r
-/*======================================================================\r
- * Additional Macros\r
- *======================================================================*/\r
-\r
-/* Misc macros */\r
-#define SYS_CHECK_ERROR(err) if((err)<0){sysError(err);}\r
-\r
-/*======================================================================\r
- * API Prototypes\r
- *======================================================================*/\r
-\r
-/* sys.c */\r
-extern int sysCreate(sysConfig_t*); /* Initialize system context */\r
-extern void sysError(int); /* Printf error code and exit */\r
-extern int sysHeapAlloc(void*, tint); /* Allocate from appropriate heap */\r
-extern int sysHeapAllocAll(tint, void*, const void*); /* Allocate ALL buffers */\r
-extern int sysPrintConfig(tuint); /* Print system configuration */\r
-\r
-/* sysbf.c */\r
-extern void sysBfCreate(void); /* Create all active beamformers */\r
-\r
-/* sysasnr.c */\r
-extern void sysAsnrCreate(void); /* Create all active ASNR's */\r
-\r
-/* sysmss.c */\r
-extern void sysMssCreate(void); /* Create the MSS module */\r
-\r
-/* sysvau.c */\r
-extern void sysVauCreate(void); /* Create the VAU module */\r
-\r
-#endif\r
-/* nothing past this point */\r
-\r
diff --git a/file_demo_bios/am572x/components/sysasnr.c b/file_demo_bios/am572x/components/sysasnr.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (c) 2016, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
- * CONTRIBUTORS 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
- * sysasnr.c: ASNR creation routines.\r
- *=================================================================*/\r
-\r
-#include <xdc/std.h>\r
-#include <ti/sysbios/BIOS.h>\r
-#include <xdc/runtime/System.h>\r
-\r
-#include <ti/mas/types/types.h>\r
-#include <ti/mas/util/ecomem.h>\r
-#include <ti/mas/vpe/asnr.h>\r
-\r
-#include "sys.h"\r
-\r
-asnrSizeConfig_t asnrSizeConfig = {\r
- asnr_SRATE_16K /* 16kHz sampling rate */\r
-};\r
-\r
-asnrOpenConfig_t asnrOpenConfig = {\r
- asnr_SRATE_16K /* use 16kHz sampling rate */\r
-};\r
-\r
-/*=================================================================\r
- * void sysAsnrCreate(void) Create ASNR's within virtual mics\r
- *=================================================================*/\r
-void sysAsnrCreate(void)\r
-{\r
- int k, err;\r
- tint nbufs;\r
- const ecomemBuffer_t *bufs;\r
- asnrNewConfig_t asnrNewConfig;\r
- asnrControl_t asnrCtl;\r
-\r
- System_printf("...Initializing ASNR's\n");\r
- System_flush();\r
-\r
- /* Configure ASNR's (use same configuration for all) */\r
- err = asnrGetSizes(&nbufs, &bufs, &asnrSizeConfig);\r
- if (err != asnr_NOERR) {\r
- System_printf("*** ASNR's getsizes error: %d\n", err);\r
- BIOS_exit(0);\r
- }\r
- /* Allocate memory for ASNR's */\r
- if (nbufs > SYS_COMP_MAXBUFS) {\r
- System_printf("*** not enough buffer descriptors");\r
- BIOS_exit(0);\r
- }\r
-\r
- asnrNewConfig.sizeCfg = asnrSizeConfig; /* Use same configuration for all */\r
- for (k = 0; k < sysContext.nvmics; k++) {\r
- err = sysHeapAllocAll(nbufs, sysCompBufs, (const void*)bufs);\r
- SYS_CHECK_ERROR(err);\r
- \r
- /* Give memory to ASNR #k */\r
- asnrNewConfig.handle = (void*)k; /* Indicate ASNR instance #k */\r
- sysContext.asnrInst_p[k] = NULL;\r
- err = asnrNew(&sysContext.asnrInst_p[k], nbufs, sysCompBufs, &asnrNewConfig);\r
- if (err != asnr_NOERR) {\r
- System_printf("*** ASNR #%d new error: %d\n", k, err);\r
- BIOS_exit(0);\r
- }\r
- }\r
-\r
- /* Open ASNR for business */\r
- for (k = 0; k < sysContext.nvmics; k++) {\r
- err = asnrOpen(sysContext.asnrInst_p[k],&asnrOpenConfig);\r
- if (err != asnr_NOERR) {\r
- System_printf("*** ASNR #%d open error: %d\n", k, err);\r
- BIOS_exit(0);\r
- }\r
- }\r
- /* At this point ASNR's are open, but may need additional configuration */\r
-\r
- /* Here we reconfigure the ASNR */\r
- asnrCtl.valid_bitfield = (asnr_CTL_VALID_BAND1_MAX_ATTEN |\r
- asnr_CTL_VALID_BAND2_MAX_ATTEN |\r
- asnr_CTL_VALID_BAND3_MAX_ATTEN);\r
- asnrCtl.band1_max_atten = 12;\r
- asnrCtl.band2_max_atten = 9;\r
- asnrCtl.band3_max_atten = 6;\r
- for (k = 0; k < sysContext.nvmics; k++) {\r
- err = asnrControl (sysContext.asnrInst_p[k], &asnrCtl);\r
- if (err != asnr_NOERR) {\r
- System_printf("*** ASNR #%d control error: %d\n", k, err);\r
- BIOS_exit(0);\r
- }\r
- }\r
-\r
- System_printf("Done with ASNR's\n");\r
- System_flush();\r
-\r
-} /* sysAsnrCreate */\r
-\r
-/* nothing past this point */\r
-\r
diff --git a/file_demo_bios/am572x/components/sysbf.c b/file_demo_bios/am572x/components/sysbf.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Copyright (c) 2016, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
- * CONTRIBUTORS 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
- * sysbf.c: BF creation routines.\r
- *=================================================================*/\r
-\r
-#include <xdc/std.h>\r
-#include <ti/sysbios/BIOS.h>\r
-#include <xdc/runtime/System.h>\r
-\r
-#include <ti/mas/types/types.h>\r
-#include <ti/mas/util/ecomem.h>\r
-#include <ti/mas/aer/bf.h>\r
-\r
-#include "sysbfflt.h"\r
-#include "sys.h"\r
-\r
-bfSizeConfig_t bfSizeConfig = {\r
- bf_SAMP_RATE_16K, /* 16kHz sampling rate */\r
- SYS_MICS_MAX, /* Maximum number of mics in the system */\r
- 32, /* Maximum beamformer filter length */\r
- bf_TYPE_FIXED /* Fixed beamformer type */\r
-};\r
-\r
-bfConfig_t bfConfig = {\r
- bf_SAMP_RATE_16K, /* use 16kHz sampling rate */\r
- SYS_MICS_MAX, /* use all mics */\r
-};\r
-\r
-/*=================================================================\r
- * void sysBfCreate(void) Create beamformers\r
- *=================================================================*/\r
-void sysBfCreate(void)\r
-{\r
- int k, n, err;\r
- tint nbufs;\r
- Fract *coeff_p;\r
- const ecomemBuffer_t *bufs;\r
- bfNewConfig_t bfNewConfig;\r
- bfControl_t bfCtl;\r
-\r
- System_printf("...Initializing beamformers\n");\r
- System_flush();\r
-\r
- /* Configure Beamformers (use same configuration for all) */\r
- err = bfGetSizes(&nbufs, &bufs, &bfSizeConfig);\r
- if (err != bf_NOERR) {\r
- System_printf("*** beamformer getsizes error: %d\n", err);\r
- BIOS_exit(0);\r
- }\r
- /* Allocate memory for beamformer */\r
- if (nbufs > SYS_COMP_MAXBUFS) {\r
- System_printf("*** not enough buffer descriptors");\r
- BIOS_exit(0);\r
- }\r
-\r
- bfNewConfig.sizeCfg = bfSizeConfig; /* Use same configuration for all */\r
- for (k = 0; k < sysContext.nvmics; k++) {\r
- err = sysHeapAllocAll(nbufs, sysCompBufs, (const void*)bufs);\r
- SYS_CHECK_ERROR(err);\r
- \r
- /* Give memory to beamformer #k */\r
- bfNewConfig.handle = (void*)k; /* Indicate BF instance #k */\r
- sysContext.bfInst_p[k] = NULL;\r
- err = bfNew(&sysContext.bfInst_p[k], nbufs, sysCompBufs, &bfNewConfig);\r
- if (err != bf_NOERR) {\r
- System_printf("*** beamformer #%d new error: %d\n", k, err);\r
- BIOS_exit(0);\r
- }\r
- }\r
-\r
- /* Open BF for business */\r
- for (k = 0; k < sysContext.nvmics; k++) {\r
- err = bfOpen(sysContext.bfInst_p[k],&bfConfig);\r
- if (err != bf_NOERR) {\r
- System_printf("*** beamformer #%d open error: %d\n", k, err);\r
- BIOS_exit(0);\r
- }\r
- }\r
- /* At this point BF's are open, but DISABLED! */\r
- /* We need to initialize filters prior to enabling them. */\r
-\r
- for (k = 0; k < sysContext.nvmics; k++) {\r
- coeff_p = sysBfFilters[sysContext.vmicangles[k]];\r
- for (n = 0; n < sysContext.nmics; n++) {\r
- err = bfPutFilter (sysContext.bfInst_p[k], coeff_p, bf_FG_BF, n, SYS_BF_FILTER_LENGTH);\r
- if (err != bf_NOERR) {\r
- System_printf("*** beamformer #%d put-filter error: %d\n", k, err);\r
- BIOS_exit(0);\r
- }\r
- coeff_p += SYS_BF_FILTER_LENGTH; /* point to the filter for next mic */\r
- }\r
- }\r
-\r
- /* Now we can enable beamformers */\r
- bfCtl.valid_bitfield = bf_CTL_CONFIG;\r
- bfCtl.config.mask = bf_CTL_CFG_ENABLE;\r
- bfCtl.config.value = bf_ENABLE;\r
- for (k = 0; k < sysContext.nvmics; k++) {\r
- err = bfControl (sysContext.bfInst_p[k], &bfCtl);\r
- if (err != bf_NOERR) {\r
- System_printf("*** beamformer #%d control error: %d\n", k, err);\r
- BIOS_exit(0);\r
- }\r
- }\r
-\r
- System_printf("Done with beamformers\n");\r
- System_flush();\r
-\r
-} /* sysBfCreate */\r
-\r
-/* nothing past this point */\r
-\r
diff --git a/file_demo_bios/am572x/components/sysbfflt.c b/file_demo_bios/am572x/components/sysbfflt.c
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- * Copyright (c) 2016, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
- * CONTRIBUTORS 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
- * sysbfflt.c: BF filters for all angles of interest\r
- *=================================================================*/\r
-\r
-#include <xdc/std.h>\r
-#include <ti/mas/types/types.h>\r
-\r
-#include "sysbfflt.h"\r
-\r
-/* SYS_BF_ANGLE_P0 */\r
-Fract sysBfFltP0[][SYS_BF_FILTER_LENGTH] = {\r
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r
- { 4, -20, 50, -99, 170, -273, 423, -658, 1088, -2242, 32453, 2628, -1190, 706, -452, 292, -183, 108, -56, 24, -6, 0, 0, 0},\r
- { -30, 103, -230, 426, -710, 1120, -1731, 2732, -4766, 12228, 27878, -6328, 3324, -2054, 1326, -851, 524, -297, 145, -53, 8, 0, 0, 0},\r
- { 4, -20, 50, -99, 170, -273, 423, -658, 1088, -2242, 32453, 2628, -1190, 706, -452, 292, -183, 108, -56, 24, -6, 0, 0, 0},\r
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r
- { 0, 0, -6, 24, -56, 108, -183, 292, -452, 706, -1190, 2628, 32453, -2242, 1088, -658, 423, -273, 170, -99, 50, -20, 4, 0},\r
- { 0, 0, 8, -53, 145, -297, 524, -851, 1326, -2054, 3324, -6328, 27878, 12228, -4766, 2732, -1731, 1120, -710, 426, -230, 103, -30, 0},\r
- { 0, 0, -6, 24, -56, 108, -183, 292, -452, 706, -1190, 2628, 32453, -2242, 1088, -658, 423, -273, 170, -99, 50, -20, 4, 0}\r
-};\r
-\r
-/* SYS_BF_ANGLE_P30 */\r
-Fract sysBfFltP30[][SYS_BF_FILTER_LENGTH] = {\r
- { 8, -54, 152, -312, 554, -902, 1407, -2178, 3513, -6613, 26596, 14027, -5285, 3007, -1902, 1231, -782, 470, -255, 116, -35, 0, 0, 0},\r
- { -25, 88, -199, 371, -621, 981, -1517, 2388, -4136, 10250, 29149, -5866, 3041, -1872, 1208, -776, 479, -273, 134, -50, 8, 0, 0, 0},\r
- { -11, 42, -100, 189, -319, 507, -784, 1228, -2086, 4748, 31832, -3605, 1788, -1087, 700, -451, 280, -162, 82, -32, 6, 0, 0, 0},\r
- { 0, -34, 113, -250, 461, -767, 1209, -1868, 2952, -5179, 13643, 26879, -6563, 3478, -2155, 1392, -893, 548, -310, 150, -54, 8, 0, 0},\r
- { 0, 0, -35, 116, -255, 470, -782, 1231, -1902, 3007, -5285, 14027, 26596, -6613, 3513, -2178, 1407, -902, 554, -312, 152, -54, 8, 0},\r
- { 0, 0, 8, -50, 134, -273, 479, -776, 1208, -1872, 3041, -5866, 29149, 10250, -4136, 2388, -1517, 981, -621, 371, -199, 88, -25, 0},\r
- { 0, 0, 6, -32, 82, -162, 280, -451, 700, -1087, 1788, -3605, 31832, 4748, -2086, 1228, -784, 507, -319, 189, -100, 42, -11, 0},\r
- { 0, 8, -54, 150, -310, 548, -893, 1392, -2155, 3478, -6563, 26879, 13643, -5179, 2952, -1868, 1209, -767, 461, -250, 113, -34, 0, 0}\r
-};\r
-\r
-/* SYS_BF_ANGLE_P45 */\r
-Fract sysBfFltP45[][SYS_BF_FILTER_LENGTH] = {\r
- { 4, -20, 50, -99, 170, -273, 423, -658, 1088, -2242, 32453, 2628, -1190, 706, -452, 292, -183, 108, -56, 24, -6, 0, 0, 0},\r
- { -30, 103, -230, 426, -710, 1120, -1731, 2732, -4766, 12228, 27878, -6328, 3324, -2054, 1326, -851, 524, -297, 145, -53, 8, 0, 0, 0},\r
- { 4, -20, 50, -99, 170, -273, 423, -658, 1088, -2242, 32453, 2628, -1190, 706, -452, 292, -183, 108, -56, 24, -6, 0, 0, 0},\r
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r
- { 0, 0, -6, 24, -56, 108, -183, 292, -452, 706, -1190, 2628, 32453, -2242, 1088, -658, 423, -273, 170, -99, 50, -20, 4, 0},\r
- { 0, 0, 8, -53, 145, -297, 524, -851, 1326, -2054, 3324, -6328, 27878, 12228, -4766, 2732, -1731, 1120, -710, 426, -230, 103, -30, 0},\r
- { 0, 0, -6, 24, -56, 108, -183, 292, -452, 706, -1190, 2628, 32453, -2242, 1088, -658, 423, -273, 170, -99, 50, -20, 4, 0},\r
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}\r
-};\r
-\r
-/* SYS_BF_ANGLE_P60 */\r
-Fract sysBfFltP60[][SYS_BF_FILTER_LENGTH] = {\r
- { -11, 42, -100, 189, -319, 507, -784, 1228, -2086, 4748, 31832, -3605, 1788, -1087, 700, -451, 280, -162, 82, -32, 6, 0, 0, 0},\r
- { -25, 88, -199, 371, -621, 981, -1517, 2388, -4136, 10250, 29149, -5866, 3041, -1872, 1208, -776, 479, -273, 134, -50, 8, 0, 0, 0},\r
- { 8, -54, 152, -312, 554, -902, 1407, -2178, 3513, -6613, 26596, 14027, -5285, 3007, -1902, 1231, -782, 470, -255, 116, -35, 0, 0, 0},\r
- { 0, 8, -54, 150, -310, 548, -893, 1392, -2155, 3478, -6563, 26879, 13643, -5179, 2952, -1868, 1209, -767, 461, -250, 113, -34, 0, 0},\r
- { 0, 0, 6, -32, 82, -162, 280, -451, 700, -1087, 1788, -3605, 31832, 4748, -2086, 1228, -784, 507, -319, 189, -100, 42, -11, 0},\r
- { 0, 0, 8, -50, 134, -273, 479, -776, 1208, -1872, 3041, -5866, 29149, 10250, -4136, 2388, -1517, 981, -621, 371, -199, 88, -25, 0},\r
- { 0, 0, -35, 116, -255, 470, -782, 1231, -1902, 3007, -5285, 14027, 26596, -6613, 3513, -2178, 1407, -902, 554, -312, 152, -54, 8, 0},\r
- { 0, -34, 113, -250, 461, -767, 1209, -1868, 2952, -5179, 13643, 26879, -6563, 3478, -2155, 1392, -893, 548, -310, 150, -54, 8, 0, 0}\r
-};\r
-\r
-/* SYS_BF_ANGLE_P90 */\r
-Fract sysBfFltP90[][SYS_BF_FILTER_LENGTH] = {\r
- { -30, 103, -230, 426, -710, 1120, -1731, 2732, -4766, 12228, 27878, -6328, 3324, -2054, 1326, -851, 524, -297, 145, -53, 8, 0, 0, 0},\r
- { 4, -20, 50, -99, 170, -273, 423, -658, 1088, -2242, 32453, 2628, -1190, 706, -452, 292, -183, 108, -56, 24, -6, 0, 0, 0},\r
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r
- { 0, 0, -6, 24, -56, 108, -183, 292, -452, 706, -1190, 2628, 32453, -2242, 1088, -658, 423, -273, 170, -99, 50, -20, 4, 0},\r
- { 0, 0, 8, -53, 145, -297, 524, -851, 1326, -2054, 3324, -6328, 27878, 12228, -4766, 2732, -1731, 1120, -710, 426, -230, 103, -30, 0},\r
- { 0, 0, -6, 24, -56, 108, -183, 292, -452, 706, -1190, 2628, 32453, -2242, 1088, -658, 423, -273, 170, -99, 50, -20, 4, 0},\r
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r
- { 4, -20, 50, -99, 170, -273, 423, -658, 1088, -2242, 32453, 2628, -1190, 706, -452, 292, -183, 108, -56, 24, -6, 0, 0, 0}\r
-};\r
-\r
-/* SYS_BF_ANGLE_P120 */\r
-Fract sysBfFltP120[][SYS_BF_FILTER_LENGTH] = {\r
- { -11, 42, -100, 189, -319, 507, -784, 1228, -2086, 4748, 31832, -3605, 1788, -1087, 700, -451, 280, -162, 82, -32, 6, 0, 0, 0},\r
- { 0, -34, 113, -250, 461, -767, 1209, -1868, 2952, -5179, 13643, 26879, -6563, 3478, -2155, 1392, -893, 548, -310, 150, -54, 8, 0, 0},\r
- { 0, 0, -35, 116, -255, 470, -782, 1231, -1902, 3007, -5285, 14027, 26596, -6613, 3513, -2178, 1407, -902, 554, -312, 152, -54, 8, 0},\r
- { 0, 0, 8, -50, 134, -273, 479, -776, 1208, -1872, 3041, -5866, 29149, 10250, -4136, 2388, -1517, 981, -621, 371, -199, 88, -25, 0},\r
- { 0, 0, 6, -32, 82, -162, 280, -451, 700, -1087, 1788, -3605, 31832, 4748, -2086, 1228, -784, 507, -319, 189, -100, 42, -11, 0},\r
- { 0, 8, -54, 150, -310, 548, -893, 1392, -2155, 3478, -6563, 26879, 13643, -5179, 2952, -1868, 1209, -767, 461, -250, 113, -34, 0, 0},\r
- { 8, -54, 152, -312, 554, -902, 1407, -2178, 3513, -6613, 26596, 14027, -5285, 3007, -1902, 1231, -782, 470, -255, 116, -35, 0, 0, 0},\r
- { -25, 88, -199, 371, -621, 981, -1517, 2388, -4136, 10250, 29149, -5866, 3041, -1872, 1208, -776, 479, -273, 134, -50, 8, 0, 0, 0}\r
-};\r
-\r
-/* SYS_BF_ANGLE_P135 */\r
-Fract sysBfFltP135[][SYS_BF_FILTER_LENGTH] = {\r
- { 4, -20, 50, -99, 170, -273, 423, -658, 1088, -2242, 32453, 2628, -1190, 706, -452, 292, -183, 108, -56, 24, -6, 0, 0, 0},\r
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r
- { 0, 0, -6, 24, -56, 108, -183, 292, -452, 706, -1190, 2628, 32453, -2242, 1088, -658, 423, -273, 170, -99, 50, -20, 4, 0},\r
- { 0, 0, 8, -53, 145, -297, 524, -851, 1326, -2054, 3324, -6328, 27878, 12228, -4766, 2732, -1731, 1120, -710, 426, -230, 103, -30, 0},\r
- { 0, 0, -6, 24, -56, 108, -183, 292, -452, 706, -1190, 2628, 32453, -2242, 1088, -658, 423, -273, 170, -99, 50, -20, 4, 0},\r
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r
- { 4, -20, 50, -99, 170, -273, 423, -658, 1088, -2242, 32453, 2628, -1190, 706, -452, 292, -183, 108, -56, 24, -6, 0, 0, 0},\r
- { -30, 103, -230, 426, -710, 1120, -1731, 2732, -4766, 12228, 27878, -6328, 3324, -2054, 1326, -851, 524, -297, 145, -53, 8, 0, 0, 0}\r
-};\r
-\r
-/* SYS_BF_ANGLE_P150 */\r
-Fract sysBfFltP150[][SYS_BF_FILTER_LENGTH] = {\r
- { 8, -54, 152, -312, 554, -902, 1407, -2178, 3513, -6613, 26596, 14027, -5285, 3007, -1902, 1231, -782, 470, -255, 116, -35, 0, 0, 0},\r
- { 0, 8, -54, 150, -310, 548, -893, 1392, -2155, 3478, -6563, 26879, 13643, -5179, 2952, -1868, 1209, -767, 461, -250, 113, -34, 0, 0},\r
- { 0, 0, 6, -32, 82, -162, 280, -451, 700, -1087, 1788, -3605, 31832, 4748, -2086, 1228, -784, 507, -319, 189, -100, 42, -11, 0},\r
- { 0, 0, 8, -50, 134, -273, 479, -776, 1208, -1872, 3041, -5866, 29149, 10250, -4136, 2388, -1517, 981, -621, 371, -199, 88, -25, 0},\r
- { 0, 0, -35, 116, -255, 470, -782, 1231, -1902, 3007, -5285, 14027, 26596, -6613, 3513, -2178, 1407, -902, 554, -312, 152, -54, 8, 0},\r
- { 0, -34, 113, -250, 461, -767, 1209, -1868, 2952, -5179, 13643, 26879, -6563, 3478, -2155, 1392, -893, 548, -310, 150, -54, 8, 0, 0},\r
- { -11, 42, -100, 189, -319, 507, -784, 1228, -2086, 4748, 31832, -3605, 1788, -1087, 700, -451, 280, -162, 82, -32, 6, 0, 0, 0},\r
- { -25, 88, -199, 371, -621, 981, -1517, 2388, -4136, 10250, 29149, -5866, 3041, -1872, 1208, -776, 479, -273, 134, -50, 8, 0, 0, 0}\r
-};\r
-\r
-/* SYS_BF_ANGLE_P180 */\r
-Fract sysBfFltP180[][SYS_BF_FILTER_LENGTH] = {\r
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r
- { 0, 0, -6, 24, -56, 108, -183, 292, -452, 706, -1190, 2628, 32453, -2242, 1088, -658, 423, -273, 170, -99, 50, -20, 4, 0},\r
- { 0, 0, 8, -53, 145, -297, 524, -851, 1326, -2054, 3324, -6328, 27878, 12228, -4766, 2732, -1731, 1120, -710, 426, -230, 103, -30, 0},\r
- { 0, 0, -6, 24, -56, 108, -183, 292, -452, 706, -1190, 2628, 32453, -2242, 1088, -658, 423, -273, 170, -99, 50, -20, 4, 0},\r
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r
- { 4, -20, 50, -99, 170, -273, 423, -658, 1088, -2242, 32453, 2628, -1190, 706, -452, 292, -183, 108, -56, 24, -6, 0, 0, 0},\r
- { -30, 103, -230, 426, -710, 1120, -1731, 2732, -4766, 12228, 27878, -6328, 3324, -2054, 1326, -851, 524, -297, 145, -53, 8, 0, 0, 0},\r
- { 4, -20, 50, -99, 170, -273, 423, -658, 1088, -2242, 32453, 2628, -1190, 706, -452, 292, -183, 108, -56, 24, -6, 0, 0, 0}\r
-};\r
-\r
-/* SYS_BF_ANGLE_M150 */\r
-Fract sysBfFltM150[][SYS_BF_FILTER_LENGTH] = {\r
- { 0, 0, -35, 116, -255, 470, -782, 1231, -1902, 3007, -5285, 14027, 26596, -6613, 3513, -2178, 1407, -902, 554, -312, 152, -54, 8, 0},\r
- { 0, 0, 8, -50, 134, -273, 479, -776, 1208, -1872, 3041, -5866, 29149, 10250, -4136, 2388, -1517, 981, -621, 371, -199, 88, -25, 0},\r
- { 0, 0, 6, -32, 82, -162, 280, -451, 700, -1087, 1788, -3605, 31832, 4748, -2086, 1228, -784, 507, -319, 189, -100, 42, -11, 0},\r
- { 0, 8, -54, 150, -310, 548, -893, 1392, -2155, 3478, -6563, 26879, 13643, -5179, 2952, -1868, 1209, -767, 461, -250, 113, -34, 0, 0},\r
- { 8, -54, 152, -312, 554, -902, 1407, -2178, 3513, -6613, 26596, 14027, -5285, 3007, -1902, 1231, -782, 470, -255, 116, -35, 0, 0, 0},\r
- { -25, 88, -199, 371, -621, 981, -1517, 2388, -4136, 10250, 29149, -5866, 3041, -1872, 1208, -776, 479, -273, 134, -50, 8, 0, 0, 0},\r
- { -11, 42, -100, 189, -319, 507, -784, 1228, -2086, 4748, 31832, -3605, 1788, -1087, 700, -451, 280, -162, 82, -32, 6, 0, 0, 0},\r
- { 0, -34, 113, -250, 461, -767, 1209, -1868, 2952, -5179, 13643, 26879, -6563, 3478, -2155, 1392, -893, 548, -310, 150, -54, 8, 0, 0}\r
-};\r
-\r
-/* SYS_BF_ANGLE_M135 */\r
-Fract sysBfFltM135[][SYS_BF_FILTER_LENGTH] = {\r
- { 0, 0, -6, 24, -56, 108, -183, 292, -452, 706, -1190, 2628, 32453, -2242, 1088, -658, 423, -273, 170, -99, 50, -20, 4, 0},\r
- { 0, 0, 8, -53, 145, -297, 524, -851, 1326, -2054, 3324, -6328, 27878, 12228, -4766, 2732, -1731, 1120, -710, 426, -230, 103, -30, 0},\r
- { 0, 0, -6, 24, -56, 108, -183, 292, -452, 706, -1190, 2628, 32453, -2242, 1088, -658, 423, -273, 170, -99, 50, -20, 4, 0},\r
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r
- { 4, -20, 50, -99, 170, -273, 423, -658, 1088, -2242, 32453, 2628, -1190, 706, -452, 292, -183, 108, -56, 24, -6, 0, 0, 0},\r
- { -30, 103, -230, 426, -710, 1120, -1731, 2732, -4766, 12228, 27878, -6328, 3324, -2054, 1326, -851, 524, -297, 145, -53, 8, 0, 0, 0},\r
- { 4, -20, 50, -99, 170, -273, 423, -658, 1088, -2242, 32453, 2628, -1190, 706, -452, 292, -183, 108, -56, 24, -6, 0, 0, 0},\r
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}\r
-};\r
-\r
-/* SYS_BF_ANGLE_M120 */\r
-Fract sysBfFltM120[][SYS_BF_FILTER_LENGTH] = {\r
- { 0, 0, 6, -32, 82, -162, 280, -451, 700, -1087, 1788, -3605, 31832, 4748, -2086, 1228, -784, 507, -319, 189, -100, 42, -11, 0},\r
- { 0, 0, 8, -50, 134, -273, 479, -776, 1208, -1872, 3041, -5866, 29149, 10250, -4136, 2388, -1517, 981, -621, 371, -199, 88, -25, 0},\r
- { 0, 0, -35, 116, -255, 470, -782, 1231, -1902, 3007, -5285, 14027, 26596, -6613, 3513, -2178, 1407, -902, 554, -312, 152, -54, 8, 0},\r
- { 0, -34, 113, -250, 461, -767, 1209, -1868, 2952, -5179, 13643, 26879, -6563, 3478, -2155, 1392, -893, 548, -310, 150, -54, 8, 0, 0},\r
- { -11, 42, -100, 189, -319, 507, -784, 1228, -2086, 4748, 31832, -3605, 1788, -1087, 700, -451, 280, -162, 82, -32, 6, 0, 0, 0},\r
- { -25, 88, -199, 371, -621, 981, -1517, 2388, -4136, 10250, 29149, -5866, 3041, -1872, 1208, -776, 479, -273, 134, -50, 8, 0, 0, 0},\r
- { 8, -54, 152, -312, 554, -902, 1407, -2178, 3513, -6613, 26596, 14027, -5285, 3007, -1902, 1231, -782, 470, -255, 116, -35, 0, 0, 0},\r
- { 0, 8, -54, 150, -310, 548, -893, 1392, -2155, 3478, -6563, 26879, 13643, -5179, 2952, -1868, 1209, -767, 461, -250, 113, -34, 0, 0}\r
-};\r
-\r
-/* SYS_BF_ANGLE_M90 */\r
-Fract sysBfFltM90[][SYS_BF_FILTER_LENGTH] = {\r
- { 0, 0, 8, -53, 145, -297, 524, -851, 1326, -2054, 3324, -6328, 27878, 12228, -4766, 2732, -1731, 1120, -710, 426, -230, 103, -30, 0},\r
- { 0, 0, -6, 24, -56, 108, -183, 292, -452, 706, -1190, 2628, 32453, -2242, 1088, -658, 423, -273, 170, -99, 50, -20, 4, 0},\r
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r
- { 4, -20, 50, -99, 170, -273, 423, -658, 1088, -2242, 32453, 2628, -1190, 706, -452, 292, -183, 108, -56, 24, -6, 0, 0, 0},\r
- { -30, 103, -230, 426, -710, 1120, -1731, 2732, -4766, 12228, 27878, -6328, 3324, -2054, 1326, -851, 524, -297, 145, -53, 8, 0, 0, 0},\r
- { 4, -20, 50, -99, 170, -273, 423, -658, 1088, -2242, 32453, 2628, -1190, 706, -452, 292, -183, 108, -56, 24, -6, 0, 0, 0},\r
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r
- { 0, 0, -6, 24, -56, 108, -183, 292, -452, 706, -1190, 2628, 32453, -2242, 1088, -658, 423, -273, 170, -99, 50, -20, 4, 0}\r
-};\r
-\r
-/* SYS_BF_ANGLE_M60 */\r
-Fract sysBfFltM60[][SYS_BF_FILTER_LENGTH] = {\r
- { 0, 0, 6, -32, 82, -162, 280, -451, 700, -1087, 1788, -3605, 31832, 4748, -2086, 1228, -784, 507, -319, 189, -100, 42, -11, 0},\r
- { 0, 8, -54, 150, -310, 548, -893, 1392, -2155, 3478, -6563, 26879, 13643, -5179, 2952, -1868, 1209, -767, 461, -250, 113, -34, 0, 0},\r
- { 8, -54, 152, -312, 554, -902, 1407, -2178, 3513, -6613, 26596, 14027, -5285, 3007, -1902, 1231, -782, 470, -255, 116, -35, 0, 0, 0},\r
- { -25, 88, -199, 371, -621, 981, -1517, 2388, -4136, 10250, 29149, -5866, 3041, -1872, 1208, -776, 479, -273, 134, -50, 8, 0, 0, 0},\r
- { -11, 42, -100, 189, -319, 507, -784, 1228, -2086, 4748, 31832, -3605, 1788, -1087, 700, -451, 280, -162, 82, -32, 6, 0, 0, 0},\r
- { 0, -34, 113, -250, 461, -767, 1209, -1868, 2952, -5179, 13643, 26879, -6563, 3478, -2155, 1392, -893, 548, -310, 150, -54, 8, 0, 0},\r
- { 0, 0, -35, 116, -255, 470, -782, 1231, -1902, 3007, -5285, 14027, 26596, -6613, 3513, -2178, 1407, -902, 554, -312, 152, -54, 8, 0},\r
- { 0, 0, 8, -50, 134, -273, 479, -776, 1208, -1872, 3041, -5866, 29149, 10250, -4136, 2388, -1517, 981, -621, 371, -199, 88, -25, 0}\r
-};\r
-\r
-/* SYS_BF_ANGLE_M45 */\r
-Fract sysBfFltM45[][SYS_BF_FILTER_LENGTH] = {\r
- { 0, 0, -6, 24, -56, 108, -183, 292, -452, 706, -1190, 2628, 32453, -2242, 1088, -658, 423, -273, 170, -99, 50, -20, 4, 0},\r
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r
- { 4, -20, 50, -99, 170, -273, 423, -658, 1088, -2242, 32453, 2628, -1190, 706, -452, 292, -183, 108, -56, 24, -6, 0, 0, 0},\r
- { -30, 103, -230, 426, -710, 1120, -1731, 2732, -4766, 12228, 27878, -6328, 3324, -2054, 1326, -851, 524, -297, 145, -53, 8, 0, 0, 0},\r
- { 4, -20, 50, -99, 170, -273, 423, -658, 1088, -2242, 32453, 2628, -1190, 706, -452, 292, -183, 108, -56, 24, -6, 0, 0, 0},\r
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r
- { 0, 0, -6, 24, -56, 108, -183, 292, -452, 706, -1190, 2628, 32453, -2242, 1088, -658, 423, -273, 170, -99, 50, -20, 4, 0},\r
- { 0, 0, 8, -53, 145, -297, 524, -851, 1326, -2054, 3324, -6328, 27878, 12228, -4766, 2732, -1731, 1120, -710, 426, -230, 103, -30, 0}\r
-};\r
-\r
-/* SYS_BF_ANGLE_M30 */\r
-Fract sysBfFltM30[][SYS_BF_FILTER_LENGTH] = {\r
- { 0, 0, -35, 116, -255, 470, -782, 1231, -1902, 3007, -5285, 14027, 26596, -6613, 3513, -2178, 1407, -902, 554, -312, 152, -54, 8, 0},\r
- { 0, -34, 113, -250, 461, -767, 1209, -1868, 2952, -5179, 13643, 26879, -6563, 3478, -2155, 1392, -893, 548, -310, 150, -54, 8, 0, 0},\r
- { -11, 42, -100, 189, -319, 507, -784, 1228, -2086, 4748, 31832, -3605, 1788, -1087, 700, -451, 280, -162, 82, -32, 6, 0, 0, 0},\r
- { -25, 88, -199, 371, -621, 981, -1517, 2388, -4136, 10250, 29149, -5866, 3041, -1872, 1208, -776, 479, -273, 134, -50, 8, 0, 0, 0},\r
- { 8, -54, 152, -312, 554, -902, 1407, -2178, 3513, -6613, 26596, 14027, -5285, 3007, -1902, 1231, -782, 470, -255, 116, -35, 0, 0, 0},\r
- { 0, 8, -54, 150, -310, 548, -893, 1392, -2155, 3478, -6563, 26879, 13643, -5179, 2952, -1868, 1209, -767, 461, -250, 113, -34, 0, 0},\r
- { 0, 0, 6, -32, 82, -162, 280, -451, 700, -1087, 1788, -3605, 31832, 4748, -2086, 1228, -784, 507, -319, 189, -100, 42, -11, 0},\r
- { 0, 0, 8, -50, 134, -273, 479, -776, 1208, -1872, 3041, -5866, 29149, 10250, -4136, 2388, -1517, 981, -621, 371, -199, 88, -25, 0}\r
-};\r
-\r
-/* Table of all available filters */\r
-Fract *sysBfFilters[SYS_BF_ANGLES_MAX] = {\r
- &sysBfFltP0[0][0], /* SYS_BF_ANGLE_P0 */\r
- &sysBfFltP30[0][0], /* SYS_BF_ANGLE_P30 */\r
- &sysBfFltP45[0][0], /* SYS_BF_ANGLE_P45 */\r
- &sysBfFltP60[0][0], /* SYS_BF_ANGLE_P60 */\r
- &sysBfFltP90[0][0], /* SYS_BF_ANGLE_P90 */\r
- &sysBfFltP120[0][0], /* SYS_BF_ANGLE_P120 */\r
- &sysBfFltP135[0][0], /* SYS_BF_ANGLE_P130 */\r
- &sysBfFltP150[0][0], /* SYS_BF_ANGLE_P150 */\r
- &sysBfFltP180[0][0], /* SYS_BF_ANGLE_P180 */\r
- &sysBfFltM150[0][0], /* SYS_BF_ANGLE_M150 */\r
- &sysBfFltM135[0][0], /* SYS_BF_ANGLE_M135 */\r
- &sysBfFltM120[0][0], /* SYS_BF_ANGLE_M120 */\r
- &sysBfFltM90[0][0], /* SYS_BF_ANGLE_M90 */\r
- &sysBfFltM60[0][0], /* SYS_BF_ANGLE_M60 */\r
- &sysBfFltM45[0][0], /* SYS_BF_ANGLE_M45 */\r
- &sysBfFltM30[0][0] /* SYS_BF_ANGLE_M30 */\r
-};\r
-\r
-/* Table of all available filter angles */\r
-tint sysBfFilterAngles[SYS_BF_ANGLES_MAX] = {\r
- 0, /* SYS_BF_ANGLE_P0 */\r
- 30, /* SYS_BF_ANGLE_P30 */\r
- 45, /* SYS_BF_ANGLE_P45 */\r
- 60, /* SYS_BF_ANGLE_P60 */\r
- 90, /* SYS_BF_ANGLE_P90 */\r
- 120, /* SYS_BF_ANGLE_P120 */\r
- 130, /* SYS_BF_ANGLE_P130 */\r
- 150, /* SYS_BF_ANGLE_P150 */\r
- 180, /* SYS_BF_ANGLE_P180 */\r
- -150, /* SYS_BF_ANGLE_M150 */\r
- -135, /* SYS_BF_ANGLE_M135 */\r
- -120, /* SYS_BF_ANGLE_M120 */\r
- -90, /* SYS_BF_ANGLE_M90 */\r
- -60, /* SYS_BF_ANGLE_M60 */\r
- -45, /* SYS_BF_ANGLE_M45 */\r
- -30 /* SYS_BF_ANGLE_M30 */\r
-};\r
-\r
-/* nothing past this point */\r
-\r
diff --git a/file_demo_bios/am572x/components/sysbfflt.h b/file_demo_bios/am572x/components/sysbfflt.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2016, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
- * CONTRIBUTORS 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
- sysbfflt.h: BF filter definitions for all angles of intereset\r
-*/\r
-#ifndef _SYSBFFLT_H\r
-#define _SYSBFFLT_H\r
-\r
-#include <xdc/std.h> /* required for types.h */\r
-#include <ti/mas/types/types.h>\r
-\r
-/*======================================================================\r
- * Filter angles that are supported\r
- *======================================================================*/\r
-\r
-#define SYS_BF_ANGLE_P0 (0)\r
-#define SYS_BF_ANGLE_P30 (1)\r
-#define SYS_BF_ANGLE_P45 (2)\r
-#define SYS_BF_ANGLE_P60 (3)\r
-#define SYS_BF_ANGLE_P90 (4)\r
-#define SYS_BF_ANGLE_P120 (5)\r
-#define SYS_BF_ANGLE_P135 (6)\r
-#define SYS_BF_ANGLE_P150 (7)\r
-#define SYS_BF_ANGLE_P180 (8)\r
-#define SYS_BF_ANGLE_M150 (9)\r
-#define SYS_BF_ANGLE_M135 (10)\r
-#define SYS_BF_ANGLE_M120 (11)\r
-#define SYS_BF_ANGLE_M90 (12)\r
-#define SYS_BF_ANGLE_M60 (13)\r
-#define SYS_BF_ANGLE_M45 (14)\r
-#define SYS_BF_ANGLE_M30 (15)\r
-#define SYS_BF_ANGLE_LAST SYS_BF_ANGLE_M30\r
-#define SYS_BF_ANGLES_MAX (SYS_BF_ANGLE_LAST+1)\r
-\r
-#define SYS_BF_FILTER_LENGTH 24 /* must be even for optimized code */\r
-\r
-extern Fract *sysBfFilters[]; /* table of all available filters */\r
-extern tint sysBfFilterAngles[]; /* table of filter angles in degrees */\r
-#endif\r
-/* nothing past this point */\r
-\r
diff --git a/file_demo_bios/am572x/components/syseram.c b/file_demo_bios/am572x/components/syseram.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2016, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
- * CONTRIBUTORS 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
- * syseram.c: External memory heaps.\r
- *=================================================================*/\r
-\r
-#include <xdc/std.h> /* required for types.h */\r
-#include <ti/mas/types/types.h>\r
-\r
-#include "syseram.h"\r
-\r
-#pragma DATA_ALIGN(sysEramPermanent,SYS_ERAM_ALIGN);\r
-#pragma DATA_SECTION(sysEramPermanent,".bferam");\r
-tword sysEramPermanent[SYS_ERAM_PERMANENT_SIZE];\r
-\r
-#pragma DATA_ALIGN(sysEramScratch,SYS_ERAM_ALIGN);\r
-#pragma DATA_SECTION(sysEramScratch,".bferam");\r
-tword sysEramScratch[SYS_ERAM_SCRATCH_SIZE];\r
-\r
-/* nothing past this point */\r
-\r
diff --git a/file_demo_bios/am572x/components/syseram.h b/file_demo_bios/am572x/components/syseram.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2016, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
- * CONTRIBUTORS 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
- * syseram.h: External memory heaps\r
-*/\r
-#ifndef _SYSERAM_H\r
-#define _SYSERAM_H\r
-\r
-#include <xdc/std.h> /* required for types.h */\r
-#include <ti/mas/types/types.h>\r
-\r
-#define SYS_ERAM_ALIGN_LOG2 3\r
-#define SYS_ERAM_ALIGN (8*8/TYP_TWORD_SIZE) /* alignment on 8 bytes */\r
-\r
-#if SYS_ERAM_ALIGN != 8\r
-#error unsuported word size\r
-#endif\r
-\r
-#define SYS_ERAM_PERMANENT 2000L /* The number of 8-byte elements */\r
-#define SYS_ERAM_SCRATCH 500L\r
-\r
-#define SYS_ERAM_PERMANENT_SIZE (SYS_ERAM_ALIGN*SYS_ERAM_PERMANENT)\r
-#define SYS_ERAM_SCRATCH_SIZE (SYS_ERAM_ALIGN*SYS_ERAM_SCRATCH)\r
-\r
-extern __far tword sysEramPermanent[];\r
-extern __far tword sysEramScratch[];\r
-\r
-#endif\r
-/* nothing past this point */\r
-\r
diff --git a/file_demo_bios/am572x/components/sysiram.c b/file_demo_bios/am572x/components/sysiram.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2016, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
- * CONTRIBUTORS 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
- * sysiram.c: Internal memory heaps.\r
- *=================================================================*/\r
-\r
-#include <xdc/std.h> /* required for types.h */\r
-#include <ti/mas/types/types.h>\r
-\r
-#include "sysiram.h"\r
-\r
-#pragma DATA_ALIGN(sysIramPermanent,SYS_IRAM_ALIGN);\r
-#pragma DATA_SECTION(sysIramPermanent,".bfiram");\r
-tword sysIramPermanent[SYS_IRAM_PERMANENT_SIZE];\r
-\r
-#pragma DATA_ALIGN(sysIramScratch,SYS_IRAM_ALIGN);\r
-#pragma DATA_SECTION(sysIramScratch,".bfiram");\r
-tword sysIramScratch[SYS_IRAM_SCRATCH_SIZE];\r
-\r
-/* nothing past this point */\r
-\r
diff --git a/file_demo_bios/am572x/components/sysiram.h b/file_demo_bios/am572x/components/sysiram.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2016, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
- * CONTRIBUTORS 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
- * sysiram.h: Internal memory heaps\r
-*/\r
-#ifndef _SYSIRAM_H\r
-#define _SYSIRAM_H\r
-\r
-#include <xdc/std.h> /* required for types.h */\r
-#include <ti/mas/types/types.h>\r
-\r
-#define SYS_IRAM_ALIGN_LOG2 3\r
-#define SYS_IRAM_ALIGN (8*8/TYP_TWORD_SIZE) /* alignment on 8 bytes */\r
-\r
-#if SYS_IRAM_ALIGN != 8\r
-#error unsuported word size\r
-#endif\r
-\r
-#define SYS_IRAM_PERMANENT 4000L /* The number of 8-byte elements */\r
-#define SYS_IRAM_SCRATCH 1000L\r
-\r
-#define SYS_IRAM_PERMANENT_SIZE (SYS_IRAM_ALIGN*SYS_IRAM_PERMANENT)\r
-#define SYS_IRAM_SCRATCH_SIZE (SYS_IRAM_ALIGN*SYS_IRAM_SCRATCH)\r
-\r
-extern __far tword sysIramPermanent[];\r
-extern __far tword sysIramScratch[];\r
-\r
-#endif\r
-/* nothing past this point */\r
-\r
diff --git a/file_demo_bios/am572x/components/sysmss.c b/file_demo_bios/am572x/components/sysmss.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 2016, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
- * CONTRIBUTORS 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
- * sysmss.c: MSS creation routines.\r
- *=================================================================*/\r
-\r
-#include <xdc/std.h>\r
-#include <ti/sysbios/BIOS.h>\r
-#include <xdc/runtime/System.h>\r
-\r
-#include <ti/mas/types/types.h>\r
-#include <ti/mas/util/ecomem.h>\r
-//#include <ti/mas/aer/mss.h>\r
-\r
-#include "mss/mss.h"\r
-#include "sys.h"\r
-\r
-/* Configuration for getSizes */\r
-mssSizeConfig_t mssSizeConfig = {\r
- mss_SAMP_RATE_16K, /* 16kHz sampling rate */\r
- SYS_VMICS_MAX, /* Maximum # of fixed mics (will be providing virtual here! */\r
- 0, /* No remote mics */\r
- 0, /* No "clean" mics */\r
- 0 /* Beams not supported so we have to used fixed! */\r
-};\r
-\r
-/* Configuration for Open */\r
-mssConfig_t mssConfig = {\r
- mss_SAMP_RATE_16K, /* use 16kHz sampling rate */\r
- SYS_VMICS_MAX, /* use one virtual mic only by default */\r
- 0, /* No remote mics */\r
- 0, /* No "clean" mics */\r
- SYS_MICS_MAX, /* Microphone array has 8 mics */\r
- 0 /* Beams not supported so we used the fixed! */\r
-};\r
-\r
-mssControl_t mssCtl = {\r
- (mss_CTL_SWITCH_THRESH | mss_CTL_SWITCH_DURATION | mss_CTL_SWITCH_HNAGOVER),\r
- {0, 0}, /* do not use modes */\r
- {0, 0}, /* do not use source */\r
- 250, /* sw-thresh in ms */\r
- 500, /* sw-duration in ms */\r
- 500 /* sw-hangover in ms */\r
-};\r
-\r
-/*=================================================================\r
- * void sysMssCreate(void) Create beamformers\r
- *=================================================================*/\r
-void sysMssCreate(void)\r
-{\r
- int err;\r
- tint nbufs;\r
- const ecomemBuffer_t *bufs;\r
- mssNewConfig_t mssNewConfig;\r
-// bfControl_t bfCtl;\r
-\r
- System_printf("...Initializing MSS\n");\r
- System_flush();\r
-\r
- /* Configure MSS */\r
- err = mssGetSizes(&nbufs, &bufs, &mssSizeConfig);\r
- if (err != mss_NOERR) {\r
- System_printf("*** MSS getSizes error: %d\n", err);\r
- BIOS_exit(0);\r
- }\r
- if (nbufs > SYS_COMP_MAXBUFS) {\r
- System_printf("*** not enough buffer descriptors");\r
- BIOS_exit(0);\r
- }\r
-\r
- /* Allocate memory for MSS */\r
- mssNewConfig.sizeCfg = mssSizeConfig; /* Use same configuration */\r
- err = sysHeapAllocAll(nbufs, sysCompBufs, (const void*)bufs);\r
- SYS_CHECK_ERROR(err);\r
- \r
- /* Give memory to MSS */\r
- mssNewConfig.handle = (void*)0; /* Indicate instance 0 */\r
- sysContext.mssInst_p = NULL;\r
- err = mssNew(&sysContext.mssInst_p, nbufs, sysCompBufs, &mssNewConfig);\r
- if (err != mss_NOERR) {\r
- System_printf("*** MSS New error: %d\n", err);\r
- BIOS_exit(0);\r
- }\r
-\r
- /* Open MSS for business */\r
- err = mssOpen(sysContext.mssInst_p,&mssConfig);\r
- if (err != mss_NOERR) {\r
- System_printf("*** MSS open error: %d\n", err);\r
- BIOS_exit(0);\r
- }\r
- /* At this point MSS is open */\r
-\r
- /* Reconfigure hangovers, etc. */\r
- err = mssControl(sysContext.mssInst_p, &mssCtl);\r
- if (err != mss_NOERR) {\r
- System_printf("*** MSS control error: %d\n", err);\r
- BIOS_exit(0);\r
- }\r
-\r
- System_printf("Done with MSS\n");\r
- System_flush();\r
-\r
-} /* sysMssCreate */\r
-\r
-/* nothing past this point */\r
-\r
diff --git a/file_demo_bios/am572x/components/sysvau.c b/file_demo_bios/am572x/components/sysvau.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (c) 2016, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
- * CONTRIBUTORS 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
- * sysvau.c: VAU creation routines.\r
- *=================================================================*/\r
-\r
-#include <xdc/std.h>\r
-#include <ti/sysbios/BIOS.h>\r
-#include <xdc/runtime/System.h>\r
-\r
-#include <ti/mas/types/types.h>\r
-#include <ti/mas/util/ecomem.h>\r
-#include <ti/mas/vau/vau.h>\r
-\r
-#include "sys.h"\r
-\r
-vauSizeConfig_t vauSizeConfig = {\r
- SYS_FRAME_LENGTH, /* 10ms frames (160 samples) */\r
- vau_SAMP_RATE_16KHZ /* 16kHz sampling rate */\r
-};\r
-\r
-vauOpenConfig_t vauOpenConfig = {\r
- SYS_FRAME_LENGTH, /* use 160 sample frames */\r
- vau_SAMP_RATE_16KHZ, /* use 16kHz sampling rate */\r
- { 0, 0, 0, 0, 0} /* Do not reconfigure defaults */\r
-};\r
-\r
-/*=================================================================\r
- * void sysVauCreate(void) Create VAU instance\r
- *=================================================================*/\r
-void sysVauCreate(void)\r
-{\r
- int err;\r
- tint nbufs;\r
- const ecomemBuffer_t *bufs;\r
- ifvauControl_t vauCtl;\r
-\r
- System_printf("...Initializing VAU\n");\r
- System_flush();\r
-\r
- /* Configure VAU */\r
- err = vauGetSizes(&nbufs, &bufs, &vauSizeConfig);\r
- if (err != vau_NOERR) {\r
- System_printf("*** VAU getsizes error: %d\n", err);\r
- BIOS_exit(0);\r
- }\r
- /* Allocate memory for VAU */\r
- if (nbufs > SYS_COMP_MAXBUFS) {\r
- System_printf("*** not enough buffer descriptors");\r
- BIOS_exit(0);\r
- }\r
-\r
- err = sysHeapAllocAll(nbufs, sysCompBufs, (const void*)bufs);\r
- SYS_CHECK_ERROR(err);\r
- \r
- /* Give memory to VAU */\r
- sysContext.vauInst_p = NULL;\r
- err = vauNew(&sysContext.vauInst_p, nbufs, sysCompBufs);\r
- if (err != vau_NOERR) {\r
- System_printf("*** VAU #%d new error: %d\n", err);\r
- BIOS_exit(0);\r
- }\r
-\r
- /* Open VAU for business */\r
- err = vauOpen(sysContext.vauInst_p,&vauOpenConfig);\r
- if (err != vau_NOERR) {\r
- System_printf("*** VAU open error: %d\n", err);\r
- BIOS_exit(0);\r
- }\r
- /* At this point VAU is open, but may need additional configuration */\r
-\r
- /* Here we enable VAU */\r
- vauCtl.valid_params = ifvau_VALID_CONTROL;\r
- vauCtl.control = ifvau_ENABLE;\r
- err = vauControl (sysContext.vauInst_p, NULL, &vauCtl);\r
- if (err != vau_NOERR) {\r
- System_printf("*** VAU control error: %d\n", err);\r
- BIOS_exit(0);\r
- }\r
-\r
- System_printf("Done with VAU\n");\r
- System_flush();\r
-\r
-} /* sysVauCreate */\r
-\r
-/* nothing past this point */\r
-\r
diff --git a/file_demo_bios/am572x/files_io_7.gel b/file_demo_bios/am572x/files_io_7.gel
--- /dev/null
@@ -0,0 +1,136 @@
+/******************************************************************************
+ * Copyright (c) 2012-16 Texas Instruments Incorporated - http://www.ti.com
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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 THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS 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.
+ *
+ *****************************************************************************
+ *
+ * Filename: file_io.gel
+ * Description: GEL file to load microphone files
+ * EVM. This GEL has functions that handle the Main PLL
+ * initialization.
+ *
+ * More functions may be added as needed at a later date.
+ *
+ * Author: Ming Wei
+ * Revision History:
+ *
+ * Rev 1.0 - 12/26/2016
+ * - Initial file creation
+ ---------------------------------------------------------------------------*/
+
+#define MIC1PATH "$(GEL_file_dir)/../../common/t8/y16L7g3m7090_1.pcm"
+#define MIC2PATH "$(GEL_file_dir)/../../common/t8/y16L7g3m7090_2.pcm"
+#define MIC3PATH "$(GEL_file_dir)/../../common/t8/y16L7g3m7090_3.pcm"
+#define MIC4PATH "$(GEL_file_dir)/../../common/t8/y16L7g3m7090_4.pcm"
+#define MIC5PATH "$(GEL_file_dir)/../../common/t8/y16L7g3m7090_5.pcm"
+#define MIC6PATH "$(GEL_file_dir)/../../common/t8/y16L7g3m7090_6.pcm"
+#define MIC7PATH "$(GEL_file_dir)/../../common/t8/y16L7g3m7090_7.pcm"
+
+#define OUTPUTPATH "$(GEL_file_dir)/../../common/t8/fileOutput7.bin"
+
+BFLoadMic(buffer,micpath)
+{
+ GEL_MemoryLoad(buffer,0,160,micpath,32);
+}
+
+BFSaveMic(buffer,num, micpath)
+{
+ GEL_MemorySave(buffer,0,num,micpath,8,0,32);
+}
+
+menuitem "Microphone Load Functions";
+
+dialog BFLoadOneMic(buffer "Buffer Address",micpath "Microphone File Path")
+{
+ GEL_TextOut("Loading %s\n","",,,,micpath);
+ BFLoadMic(buffer,micpath);
+}
+
+hotmenu BFLoadMic1()
+{
+ GEL_TextOut("Loading %s\n","",,,,MIC1PATH);
+ BFLoadMic(filBuf0,MIC1PATH);
+}
+
+hotmenu BFLoadMic2()
+{
+ GEL_TextOut("Loading %s\n","",,,,MIC2PATH);
+ BFLoadMic(filBuf1,MIC2PATH);
+}
+
+hotmenu BFLoadMic3()
+{
+ GEL_TextOut("Loading %s\n","",,,,MIC3PATH);
+ BFLoadMic(filBuf2,MIC3PATH);
+}
+
+hotmenu BFLoadMic4()
+{
+ GEL_TextOut("Loading %s\n","",,,,MIC4PATH);
+ BFLoadMic(filBuf3,MIC4PATH);
+}
+
+hotmenu BFLoadMic5()
+{
+ GEL_TextOut("Loading %s\n","",,,,MIC5PATH);
+ BFLoadMic(filBuf4,MIC5PATH);
+}
+
+hotmenu BFLoadMic6()
+{
+ GEL_TextOut("Loading %s\n","",,,,MIC6PATH);
+ BFLoadMic(filBuf5,MIC6PATH);
+}
+
+hotmenu BFLoadMic7()
+{
+ GEL_TextOut("Loading %s\n","",,,,MIC7PATH);
+ BFLoadMic(filBuf6,MIC7PATH);
+}
+
+hotmenu BFLoadMicAll()
+{
+ BFLoadMic1();
+ BFLoadMic2();
+ BFLoadMic3();
+ BFLoadMic4();
+ BFLoadMic5();
+ BFLoadMic6();
+ BFLoadMic7();
+ GEL_TextOut("Done Loading Microphones\n");
+}
+
+menuitem "Microphone Save Functions";
+
+hotmenu BFSaveOutput()
+{
+ GEL_TextOut("Saving %s\n","",,,,OUTPUTPATH);
+ BFSaveMic(filOutBuf0,filConfig.outlen/2,OUTPUTPATH);
+}
diff --git a/file_demo_bios/am572x/files_io_8.gel b/file_demo_bios/am572x/files_io_8.gel
--- /dev/null
@@ -0,0 +1,144 @@
+/******************************************************************************
+ * Copyright (c) 2012-16 Texas Instruments Incorporated - http://www.ti.com
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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 THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS 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.
+ *
+ *****************************************************************************
+ *
+ * Filename: file_io.gel
+ * Description: GEL file to load microphone files
+ * EVM. This GEL has functions that handle the Main PLL
+ * initialization.
+ *
+ * More functions may be added as needed at a later date.
+ *
+ * Author: Nitin Sakhuja
+ * Revision History:
+ *
+ * Rev 1.0 - 02/06/2012
+ * - Initial file creation
+ ---------------------------------------------------------------------------*/
+
+#define MIC1PATH "$(GEL_file_dir)/../../common/t8/y16L8g3m7090_1.pcm"
+#define MIC2PATH "$(GEL_file_dir)/../../common/t8/y16L8g3m7090_2.pcm"
+#define MIC3PATH "$(GEL_file_dir)/../../common/t8/y16L8g3m7090_3.pcm"
+#define MIC4PATH "$(GEL_file_dir)/../../common/t8/y16L8g3m7090_4.pcm"
+#define MIC5PATH "$(GEL_file_dir)/../../common/t8/y16L8g3m7090_5.pcm"
+#define MIC6PATH "$(GEL_file_dir)/../../common/t8/y16L8g3m7090_6.pcm"
+#define MIC7PATH "$(GEL_file_dir)/../../common/t8/y16L8g3m7090_7.pcm"
+#define MIC8PATH "$(GEL_file_dir)/../../common/t8/y16L8g3m7090_8.pcm"
+
+#define OUTPUTPATH "$(GEL_file_dir)/../../common/t8/fileOutput8.bin"
+
+BFLoadMic(buffer,micpath)
+{
+ GEL_MemoryLoad(buffer,0,160,micpath,32);
+}
+
+BFSaveMic(buffer,num, micpath)
+{
+ GEL_MemorySave(buffer,0,num,micpath,8,0,32);
+}
+
+menuitem "Microphone Load Functions";
+
+dialog BFLoadOneMic(buffer "Buffer Address",micpath "Microphone File Path")
+{
+ GEL_TextOut("Loading %s\n","",,,,micpath);
+ BFLoadMic(buffer,micpath);
+}
+
+hotmenu BFLoadMic1()
+{
+ GEL_TextOut("Loading %s\n","",,,,MIC1PATH);
+ BFLoadMic(filBuf0,MIC1PATH);
+}
+
+hotmenu BFLoadMic2()
+{
+ GEL_TextOut("Loading %s\n","",,,,MIC2PATH);
+ BFLoadMic(filBuf1,MIC2PATH);
+}
+
+hotmenu BFLoadMic3()
+{
+ GEL_TextOut("Loading %s\n","",,,,MIC3PATH);
+ BFLoadMic(filBuf2,MIC3PATH);
+}
+
+hotmenu BFLoadMic4()
+{
+ GEL_TextOut("Loading %s\n","",,,,MIC4PATH);
+ BFLoadMic(filBuf3,MIC4PATH);
+}
+
+hotmenu BFLoadMic5()
+{
+ GEL_TextOut("Loading %s\n","",,,,MIC5PATH);
+ BFLoadMic(filBuf4,MIC5PATH);
+}
+
+hotmenu BFLoadMic6()
+{
+ GEL_TextOut("Loading %s\n","",,,,MIC6PATH);
+ BFLoadMic(filBuf5,MIC6PATH);
+}
+
+hotmenu BFLoadMic7()
+{
+ GEL_TextOut("Loading %s\n","",,,,MIC7PATH);
+ BFLoadMic(filBuf6,MIC7PATH);
+}
+
+hotmenu BFLoadMic8()
+{
+ GEL_TextOut("Loading %s\n","",,,,MIC8PATH);
+ BFLoadMic(filBuf7,MIC8PATH);
+}
+
+hotmenu BFLoadMicAll()
+{
+ BFLoadMic1();
+ BFLoadMic2();
+ BFLoadMic3();
+ BFLoadMic4();
+ BFLoadMic5();
+ BFLoadMic6();
+ BFLoadMic7();
+ BFLoadMic8();
+ GEL_TextOut("Done Loading Microphones\n");
+}
+
+menuitem "Microphone Save Functions";
+
+hotmenu BFSaveOutput()
+{
+ GEL_TextOut("Saving %s\n","",,,,OUTPUTPATH);
+ BFSaveMic(filOutBuf0,filConfig.outlen/2,OUTPUTPATH);
+}
diff --git a/file_demo_bios/am572x/filters/fir16L8g3m120.log b/file_demo_bios/am572x/filters/fir16L8g3m120.log
+++ /dev/null
@@ -1,8 +0,0 @@
- 0 0 6 -32 82 -162 280 -451 700 -1087 1788 -3605 31832 4748 -2086 1228 -784 507 -319 189 -100 42 -11\r
- 0 0 8 -50 134 -273 479 -776 1208 -1872 3041 -5866 29149 10250 -4136 2388 -1517 981 -621 371 -199 88 -25\r
- 0 0 -35 116 -255 470 -782 1231 -1902 3007 -5285 14027 26596 -6613 3513 -2178 1407 -902 554 -312 152 -54 8\r
- 0 -34 113 -250 461 -767 1209 -1868 2952 -5179 13643 26879 -6563 3478 -2155 1392 -893 548 -310 150 -54 8 0\r
- -11 42 -100 189 -319 507 -784 1228 -2086 4748 31832 -3605 1788 -1087 700 -451 280 -162 82 -32 6 0 0\r
- -25 88 -199 371 -621 981 -1517 2388 -4136 10250 29149 -5866 3041 -1872 1208 -776 479 -273 134 -50 8 0 0\r
- 8 -54 152 -312 554 -902 1407 -2178 3513 -6613 26596 14027 -5285 3007 -1902 1231 -782 470 -255 116 -35 0 0\r
- 0 8 -54 150 -310 548 -893 1392 -2155 3478 -6563 26879 13643 -5179 2952 -1868 1209 -767 461 -250 113 -34 0\r
diff --git a/file_demo_bios/am572x/filters/fir16L8g3m135.log b/file_demo_bios/am572x/filters/fir16L8g3m135.log
+++ /dev/null
@@ -1,8 +0,0 @@
- 0 0 -6 24 -56 108 -183 292 -452 706 -1190 2628 32453 -2242 1088 -658 423 -273 170 -99 50 -20 4\r
- 0 0 8 -53 145 -297 524 -851 1326 -2054 3324 -6328 27878 12228 -4766 2732 -1731 1120 -710 426 -230 103 -30\r
- 0 0 -6 24 -56 108 -183 292 -452 706 -1190 2628 32453 -2242 1088 -658 423 -273 170 -99 50 -20 4\r
- 0 0 0 0 0 0 0 0 0 0 0 32767 0 0 0 0 0 0 0 0 0 0 0\r
- 4 -20 50 -99 170 -273 423 -658 1088 -2242 32453 2628 -1190 706 -452 292 -183 108 -56 24 -6 0 0\r
- -30 103 -230 426 -710 1120 -1731 2732 -4766 12228 27878 -6328 3324 -2054 1326 -851 524 -297 145 -53 8 0 0\r
- 4 -20 50 -99 170 -273 423 -658 1088 -2242 32453 2628 -1190 706 -452 292 -183 108 -56 24 -6 0 0\r
- 0 0 0 0 0 0 0 0 0 0 0 32767 0 0 0 0 0 0 0 0 0 0 0\r
diff --git a/file_demo_bios/am572x/filters/fir16L8g3m150.log b/file_demo_bios/am572x/filters/fir16L8g3m150.log
+++ /dev/null
@@ -1,8 +0,0 @@
- 0 0 -35 116 -255 470 -782 1231 -1902 3007 -5285 14027 26596 -6613 3513 -2178 1407 -902 554 -312 152 -54 8\r
- 0 0 8 -50 134 -273 479 -776 1208 -1872 3041 -5866 29149 10250 -4136 2388 -1517 981 -621 371 -199 88 -25\r
- 0 0 6 -32 82 -162 280 -451 700 -1087 1788 -3605 31832 4748 -2086 1228 -784 507 -319 189 -100 42 -11\r
- 0 8 -54 150 -310 548 -893 1392 -2155 3478 -6563 26879 13643 -5179 2952 -1868 1209 -767 461 -250 113 -34 0\r
- 8 -54 152 -312 554 -902 1407 -2178 3513 -6613 26596 14027 -5285 3007 -1902 1231 -782 470 -255 116 -35 0 0\r
- -25 88 -199 371 -621 981 -1517 2388 -4136 10250 29149 -5866 3041 -1872 1208 -776 479 -273 134 -50 8 0 0\r
- -11 42 -100 189 -319 507 -784 1228 -2086 4748 31832 -3605 1788 -1087 700 -451 280 -162 82 -32 6 0 0\r
- 0 -34 113 -250 461 -767 1209 -1868 2952 -5179 13643 26879 -6563 3478 -2155 1392 -893 548 -310 150 -54 8 0\r
diff --git a/file_demo_bios/am572x/filters/fir16L8g3m30.log b/file_demo_bios/am572x/filters/fir16L8g3m30.log
+++ /dev/null
@@ -1,8 +0,0 @@
- 0 0 -35 116 -255 470 -782 1231 -1902 3007 -5285 14027 26596 -6613 3513 -2178 1407 -902 554 -312 152 -54 8\r
- 0 -34 113 -250 461 -767 1209 -1868 2952 -5179 13643 26879 -6563 3478 -2155 1392 -893 548 -310 150 -54 8 0\r
- -11 42 -100 189 -319 507 -784 1228 -2086 4748 31832 -3605 1788 -1087 700 -451 280 -162 82 -32 6 0 0\r
- -25 88 -199 371 -621 981 -1517 2388 -4136 10250 29149 -5866 3041 -1872 1208 -776 479 -273 134 -50 8 0 0\r
- 8 -54 152 -312 554 -902 1407 -2178 3513 -6613 26596 14027 -5285 3007 -1902 1231 -782 470 -255 116 -35 0 0\r
- 0 8 -54 150 -310 548 -893 1392 -2155 3478 -6563 26879 13643 -5179 2952 -1868 1209 -767 461 -250 113 -34 0\r
- 0 0 6 -32 82 -162 280 -451 700 -1087 1788 -3605 31832 4748 -2086 1228 -784 507 -319 189 -100 42 -11\r
- 0 0 8 -50 134 -273 479 -776 1208 -1872 3041 -5866 29149 10250 -4136 2388 -1517 981 -621 371 -199 88 -25\r
diff --git a/file_demo_bios/am572x/filters/fir16L8g3m45.log b/file_demo_bios/am572x/filters/fir16L8g3m45.log
+++ /dev/null
@@ -1,8 +0,0 @@
- 0 0 -6 24 -56 108 -183 292 -452 706 -1190 2628 32453 -2242 1088 -658 423 -273 170 -99 50 -20 4\r
- 0 0 0 0 0 0 0 0 0 0 0 32767 0 0 0 0 0 0 0 0 0 0 0\r
- 4 -20 50 -99 170 -273 423 -658 1088 -2242 32453 2628 -1190 706 -452 292 -183 108 -56 24 -6 0 0\r
- -30 103 -230 426 -710 1120 -1731 2732 -4766 12228 27878 -6328 3324 -2054 1326 -851 524 -297 145 -53 8 0 0\r
- 4 -20 50 -99 170 -273 423 -658 1088 -2242 32453 2628 -1190 706 -452 292 -183 108 -56 24 -6 0 0\r
- 0 0 0 0 0 0 0 0 0 0 0 32767 0 0 0 0 0 0 0 0 0 0 0\r
- 0 0 -6 24 -56 108 -183 292 -452 706 -1190 2628 32453 -2242 1088 -658 423 -273 170 -99 50 -20 4\r
- 0 0 8 -53 145 -297 524 -851 1326 -2054 3324 -6328 27878 12228 -4766 2732 -1731 1120 -710 426 -230 103 -30\r
diff --git a/file_demo_bios/am572x/filters/fir16L8g3m60.log b/file_demo_bios/am572x/filters/fir16L8g3m60.log
+++ /dev/null
@@ -1,8 +0,0 @@
- 0 0 6 -32 82 -162 280 -451 700 -1087 1788 -3605 31832 4748 -2086 1228 -784 507 -319 189 -100 42 -11\r
- 0 8 -54 150 -310 548 -893 1392 -2155 3478 -6563 26879 13643 -5179 2952 -1868 1209 -767 461 -250 113 -34 0\r
- 8 -54 152 -312 554 -902 1407 -2178 3513 -6613 26596 14027 -5285 3007 -1902 1231 -782 470 -255 116 -35 0 0\r
- -25 88 -199 371 -621 981 -1517 2388 -4136 10250 29149 -5866 3041 -1872 1208 -776 479 -273 134 -50 8 0 0\r
- -11 42 -100 189 -319 507 -784 1228 -2086 4748 31832 -3605 1788 -1087 700 -451 280 -162 82 -32 6 0 0\r
- 0 -34 113 -250 461 -767 1209 -1868 2952 -5179 13643 26879 -6563 3478 -2155 1392 -893 548 -310 150 -54 8 0\r
- 0 0 -35 116 -255 470 -782 1231 -1902 3007 -5285 14027 26596 -6613 3513 -2178 1407 -902 554 -312 152 -54 8\r
- 0 0 8 -50 134 -273 479 -776 1208 -1872 3041 -5866 29149 10250 -4136 2388 -1517 981 -621 371 -199 88 -25\r
diff --git a/file_demo_bios/am572x/filters/fir16L8g3m90.log b/file_demo_bios/am572x/filters/fir16L8g3m90.log
+++ /dev/null
@@ -1,8 +0,0 @@
- 0 0 8 -53 145 -297 524 -851 1326 -2054 3324 -6328 27878 12228 -4766 2732 -1731 1120 -710 426 -230 103 -30\r
- 0 0 -6 24 -56 108 -183 292 -452 706 -1190 2628 32453 -2242 1088 -658 423 -273 170 -99 50 -20 4\r
- 0 0 0 0 0 0 0 0 0 0 0 32767 0 0 0 0 0 0 0 0 0 0 0\r
- 4 -20 50 -99 170 -273 423 -658 1088 -2242 32453 2628 -1190 706 -452 292 -183 108 -56 24 -6 0 0\r
- -30 103 -230 426 -710 1120 -1731 2732 -4766 12228 27878 -6328 3324 -2054 1326 -851 524 -297 145 -53 8 0 0\r
- 4 -20 50 -99 170 -273 423 -658 1088 -2242 32453 2628 -1190 706 -452 292 -183 108 -56 24 -6 0 0\r
- 0 0 0 0 0 0 0 0 0 0 0 32767 0 0 0 0 0 0 0 0 0 0 0\r
- 0 0 -6 24 -56 108 -183 292 -452 706 -1190 2628 32453 -2242 1088 -658 423 -273 170 -99 50 -20 4\r
diff --git a/file_demo_bios/am572x/filters/fir16L8g3p0.log b/file_demo_bios/am572x/filters/fir16L8g3p0.log
+++ /dev/null
@@ -1,8 +0,0 @@
- 0 0 0 0 0 0 0 0 0 0 0 32767 0 0 0 0 0 0 0 0 0 0 0\r
- 4 -20 50 -99 170 -273 423 -658 1088 -2242 32453 2628 -1190 706 -452 292 -183 108 -56 24 -6 0 0\r
- -30 103 -230 426 -710 1120 -1731 2732 -4766 12228 27878 -6328 3324 -2054 1326 -851 524 -297 145 -53 8 0 0\r
- 4 -20 50 -99 170 -273 423 -658 1088 -2242 32453 2628 -1190 706 -452 292 -183 108 -56 24 -6 0 0\r
- 0 0 0 0 0 0 0 0 0 0 0 32767 0 0 0 0 0 0 0 0 0 0 0\r
- 0 0 -6 24 -56 108 -183 292 -452 706 -1190 2628 32453 -2242 1088 -658 423 -273 170 -99 50 -20 4\r
- 0 0 8 -53 145 -297 524 -851 1326 -2054 3324 -6328 27878 12228 -4766 2732 -1731 1120 -710 426 -230 103 -30\r
- 0 0 -6 24 -56 108 -183 292 -452 706 -1190 2628 32453 -2242 1088 -658 423 -273 170 -99 50 -20 4\r
diff --git a/file_demo_bios/am572x/filters/fir16L8g3p120.log b/file_demo_bios/am572x/filters/fir16L8g3p120.log
+++ /dev/null
@@ -1,8 +0,0 @@
- -11 42 -100 189 -319 507 -784 1228 -2086 4748 31832 -3605 1788 -1087 700 -451 280 -162 82 -32 6 0 0\r
- 0 -34 113 -250 461 -767 1209 -1868 2952 -5179 13643 26879 -6563 3478 -2155 1392 -893 548 -310 150 -54 8 0\r
- 0 0 -35 116 -255 470 -782 1231 -1902 3007 -5285 14027 26596 -6613 3513 -2178 1407 -902 554 -312 152 -54 8\r
- 0 0 8 -50 134 -273 479 -776 1208 -1872 3041 -5866 29149 10250 -4136 2388 -1517 981 -621 371 -199 88 -25\r
- 0 0 6 -32 82 -162 280 -451 700 -1087 1788 -3605 31832 4748 -2086 1228 -784 507 -319 189 -100 42 -11\r
- 0 8 -54 150 -310 548 -893 1392 -2155 3478 -6563 26879 13643 -5179 2952 -1868 1209 -767 461 -250 113 -34 0\r
- 8 -54 152 -312 554 -902 1407 -2178 3513 -6613 26596 14027 -5285 3007 -1902 1231 -782 470 -255 116 -35 0 0\r
- -25 88 -199 371 -621 981 -1517 2388 -4136 10250 29149 -5866 3041 -1872 1208 -776 479 -273 134 -50 8 0 0\r
diff --git a/file_demo_bios/am572x/filters/fir16L8g3p135.log b/file_demo_bios/am572x/filters/fir16L8g3p135.log
+++ /dev/null
@@ -1,8 +0,0 @@
- 4 -20 50 -99 170 -273 423 -658 1088 -2242 32453 2628 -1190 706 -452 292 -183 108 -56 24 -6 0 0\r
- 0 0 0 0 0 0 0 0 0 0 0 32767 0 0 0 0 0 0 0 0 0 0 0\r
- 0 0 -6 24 -56 108 -183 292 -452 706 -1190 2628 32453 -2242 1088 -658 423 -273 170 -99 50 -20 4\r
- 0 0 8 -53 145 -297 524 -851 1326 -2054 3324 -6328 27878 12228 -4766 2732 -1731 1120 -710 426 -230 103 -30\r
- 0 0 -6 24 -56 108 -183 292 -452 706 -1190 2628 32453 -2242 1088 -658 423 -273 170 -99 50 -20 4\r
- 0 0 0 0 0 0 0 0 0 0 0 32767 0 0 0 0 0 0 0 0 0 0 0\r
- 4 -20 50 -99 170 -273 423 -658 1088 -2242 32453 2628 -1190 706 -452 292 -183 108 -56 24 -6 0 0\r
- -30 103 -230 426 -710 1120 -1731 2732 -4766 12228 27878 -6328 3324 -2054 1326 -851 524 -297 145 -53 8 0 0\r
diff --git a/file_demo_bios/am572x/filters/fir16L8g3p150.log b/file_demo_bios/am572x/filters/fir16L8g3p150.log
+++ /dev/null
@@ -1,8 +0,0 @@
- 8 -54 152 -312 554 -902 1407 -2178 3513 -6613 26596 14027 -5285 3007 -1902 1231 -782 470 -255 116 -35 0 0\r
- 0 8 -54 150 -310 548 -893 1392 -2155 3478 -6563 26879 13643 -5179 2952 -1868 1209 -767 461 -250 113 -34 0\r
- 0 0 6 -32 82 -162 280 -451 700 -1087 1788 -3605 31832 4748 -2086 1228