# HG changeset patch # User martin # Date 2013-03-06 15:33:29 # Node ID ec95871b78ac86516ac6a143d8eecdaf63fcc235 # Parent 043850cd1ec691cbe7dc5482f8449480581aed68 FFT sur 5 Voies Okai (cf driver C BenchFFT) diff --git a/LPP_drivers/exemples/BenchFFT/main.c b/LPP_drivers/exemples/BenchFFT/main.c --- a/LPP_drivers/exemples/BenchFFT/main.c +++ b/LPP_drivers/exemples/BenchFFT/main.c @@ -1,45 +1,51 @@ #include #include "lpp_apb_functions.h" +#include "apb_fifo_Driver.h" #include "apb_uart_Driver.h" -#include "apb_fft_Driver.h" -#include "apb_delay_Driver.h" +#include "TableTest.h" int main() { + int i=0,j=0; + int data1,data2; char temp[256]; - int i; - int Table[256]; -//Somme de 2 sinus// - //int Tablo[256] = {0x00000000,0x0DA20000,0x1B080000,0x27F70000,0x34380000,0x3F960000,0x49E10000,0x52F10000,0x5AA10000,0x60D60000,0x657D0000,0x688C0000,0x69FE0000,0x69DB0000,0x68310000,0x65170000,0x60A90000,0x5B0D0000,0x546D0000,0x4CF90000,0x44E30000,0x3C610000,0x33AA0000,0x2AF40000,0x22750000,0x1A610000,0x12E70000,0x0C310000,0x06660000,0x01A30000,0xFE010000,0xFB8E0000,0xFA520000,0xFA4D0000,0xFB770000,0xFDBE0000,0x010A0000,0x053E0000,0x0A330000,0x0FBF0000,0x15B30000,0x1BDE0000,0x220C0000,0x28080000,0x2D9D0000,0x329B0000,0x36D20000,0x3A170000,0x3C440000,0x3D390000,0x3CDE0000,0x3B210000,0x37F90000,0x33650000,0x2D6D0000,0x26210000,0x1D990000,0x13F30000,0x09570000,0xFDF10000,0xF1F20000,0xE58F0000,0xD9030000,0xCC870000,0xC0560000,0xB4AA0000,0xA9BC0000,0x9FBF0000,0x96E40000,0x8F570000,0x893A0000,0x84AB0000,0x81BF0000,0x80830000,0x80FB0000,0x83220000,0x86EC0000,0x8C430000,0x93090000,0x9B1B0000,0xA44D0000,0xAE700000,0xB9500000,0xC4B40000,0xD0630000,0xDC240000,0xE7BD0000,0xF2F60000,0xFD9A0000,0x077A0000,0x106B0000,0x18480000,0x1EF30000,0x24570000,0x28650000,0x2B160000,0x2C6F0000,0x2C790000,0x2B470000,0x28F30000,0x259E0000,0x216E0000,0x1C8F0000,0x17310000,0x11860000,0x0BC10000,0x06170000,0x00BA0000,0xFBDD0000,0xF7AC0000,0xF44F0000,0xF1EA0000,0xF09C0000,0xF0790000,0xF1900000,0xF3E80000,0xF77E0000,0xFC4A0000,0x02370000,0x092E0000,0x110E0000,0x19AF0000,0x22E40000,0x2C7C0000,0x36420000,0x3FFF0000,0x497C0000,0x52810000,0x5AD70000,0x624B0000,0x68AD0000,0x6DD40000,0x71990000,0x73E10000,0x74950000,0x73A60000,0x71100000,0x6CD60000,0x67040000,0x5FAD0000,0x56EE0000,0x4CEA0000,0x41CD0000,0x35C50000,0x29070000,0x1BCC0000,0x0E4E0000,0x00CA0000,0xF37C0000,0xE69C0000,0xDA620000,0xCF040000,0xC4AE0000,0xBB8B0000,0xB3BC0000,0xAD5C0000,0xA87D0000,0xA5290000,0xA3630000,0xA3220000,0xA4590000,0xA6EF0000,0xAAC80000,0xAFBD0000,0xB5A40000,0xBC4F0000,0xC38B0000,0xCB220000,0xD2E00000,0xDA8E0000,0xE1F70000,0xE8EC0000,0xEF3C0000,0xF4C10000,0xF9560000,0xFCDF0000,0xFF470000,0x007F0000,0x00850000,0xFF5C0000,0xFD0B0000,0xF9A80000,0xF54B0000,0xF0170000,0xEA320000,0xE3C90000,0xDD0B0000,0xD62B0000,0xCF5F0000,0xC8DA0000,0xC2D30000,0xBD7A0000,0xB8FF0000,0xB58D0000,0xB3490000,0xB2510000,0xB2BE0000,0xB49F0000,0xB7FC0000,0xBCD60000,0xC3220000,0xCAD10000,0xD3C70000,0xDDE50000,0xE9030000,0xF4F20000,0x01800000,0x0E770000,0x1B9D0000,0x28B70000,0x35880000,0x41D70000,0x4D6C0000,0x58100000,0x61950000,0x69D00000,0x709C0000,0x75DE0000,0x79800000,0x7B750000,0x7BBB0000,0x7A570000,0x77550000,0x72CB0000,0x6CD70000,0x659E0000,0x5D490000,0x54090000,0x4A110000,0x3F980000,0x34D80000,0x2A090000,0x1F630000,0x151D0000,0x0B690000,0x02760000,0xFA6F0000,0xF3730000,0xEDA10000,0xE90B0000,0xE5BF0000,0xE3C00000,0xE30A0000,0xE38F0000,0xE53D0000,0xE7F80000,0xEB9D0000,0xF0050000,0xF5030000,0xFA680000,0x00000000,0x05980000,0x0AFD0000,0x0FFB0000,0x14630000,0x18080000}; -//1 Sinus// - int Tablo[256] = {0x00000000,0x080A0000,0x100B0000,0x17FC0000,0x1FD50000,0x278E0000,0x2F1F0000,0x36800000,0x3DAA0000,0x44960000,0x4B3D0000,0x51970000,0x579F0000,0x5D4F0000,0x62A00000,0x678E0000,0x6C130000,0x702B0000,0x73D10000,0x77030000,0x79BC0000,0x7BFB0000,0x7DBC0000,0x7EFE0000,0x7FBF0000,0x80000000,0x7FBF0000,0x7EFE0000,0x7DBC0000,0x7BFB0000,0x79BC0000,0x77030000,0x73D10000,0x702B0000,0x6C130000,0x678E0000,0x62A00000,0x5D4F0000,0x579F0000,0x51970000,0x4B3D0000,0x44960000,0x3DAA0000,0x36800000,0x2F1F0000,0x278E0000,0x1FD50000,0x17FC0000,0x100B0000,0x080A0000,0x00000000,0xF7F60000,0xEFF50000,0xE8040000,0xE02B0000,0xD8720000,0xD0E10000,0xC9800000,0xC2560000,0xBB6A0000,0xB4C30000,0xAE690000,0xA8610000,0xA2B10000,0x9D600000,0x98720000,0x93ED0000,0x8FD50000,0x8C2F0000,0x88FD0000,0x86440000,0x84050000,0x82440000,0x81020000,0x80410000,0x80000000,0x80410000,0x81020000,0x82440000,0x84050000,0x86440000,0x88FD0000,0x8C2F0000,0x8FD50000,0x93ED0000,0x98720000,0x9D600000,0xA2B10000,0xA8610000,0xAE690000,0xB4C30000,0xBB6A0000,0xC2560000,0xC9800000,0xD0E10000,0xD8720000,0xE02B0000,0xE8040000,0xEFF50000,0xF7F60000,0x00000000,0x080A0000,0x100B0000,0x17FC0000,0x1FD50000,0x278E0000,0x2F1F0000,0x36800000,0x3DAA0000,0x44960000,0x4B3D0000,0x51970000,0x579F0000,0x5D4F0000,0x62A00000,0x678E0000,0x6C130000,0x702B0000,0x73D10000,0x77030000,0x79BC0000,0x7BFB0000,0x7DBC0000,0x7EFE0000,0x7FBF0000,0x80000000,0x7FBF0000,0x7EFE0000,0x7DBC0000,0x7BFB0000,0x79BC0000,0x77030000,0x73D10000,0x702B0000,0x6C130000,0x678E0000,0x62A00000,0x5D4F0000,0x579F0000,0x51970000,0x4B3D0000,0x44960000,0x3DAA0000,0x36800000,0x2F1F0000,0x278E0000,0x1FD50000,0x17FC0000,0x100B0000,0x080A0000,0x00000000,0xF7F60000,0xEFF50000,0xE8040000,0xE02B0000,0xD8720000,0xD0E10000,0xC9800000,0xC2560000,0xBB6A0000,0xB4C30000,0xAE690000,0xA8610000,0xA2B10000,0x9D600000,0x98720000,0x93ED0000,0x8FD50000,0x8C2F0000,0x88FD0000,0x86440000,0x84050000,0x82440000,0x81020000,0x80410000,0x80000000,0x80410000,0x81020000,0x82440000,0x84050000,0x86440000,0x88FD0000,0x8C2F0000,0x8FD50000,0x93ED0000,0x98720000,0x9D600000,0xA2B10000,0xA8610000,0xAE690000,0xB4C30000,0xBB6A0000,0xC2560000,0xC9800000,0xD0E10000,0xD8720000,0xE02B0000,0xE8040000,0xEFF50000,0xF7F60000,0x00000000,0x080A0000,0x100B0000,0x17FC0000,0x1FD50000,0x278E0000,0x2F1F0000,0x36800000,0x3DAA0000,0x44960000,0x4B3D0000,0x51970000,0x579F0000,0x5D4F0000,0x62A00000,0x678E0000,0x6C130000,0x702B0000,0x73D10000,0x77030000,0x79BC0000,0x7BFB0000,0x7DBC0000,0x7EFE0000,0x7FBF0000,0x80000000,0x7FBF0000,0x7EFE0000,0x7DBC0000,0x7BFB0000,0x79BC0000,0x77030000,0x73D10000,0x702B0000,0x6C130000,0x678E0000,0x62A00000,0x5D4F0000,0x579F0000,0x51970000,0x4B3D0000,0x44960000,0x3DAA0000,0x36800000,0x2F1F0000,0x278E0000,0x1FD50000,0x17FC0000,0x100B0000,0x080A0000,0x00000000,0xF7F60000,0xEFF50000,0xE8040000,0xE02B0000,0xD8720000}; - printf("Debut Main\n\n"); - UART_Device* uart0 = openUART(0); - FFT_Device* fft0 = openFFT(0); - DELAY_Device* delay = openDELAY(0); + + int TblSinA[256] = {0x0000,0x0142,0x0282,0x03C2,0x04FF,0x0638,0x076E,0x08A0,0x09CC,0x0AF2,0x0C11,0x0D29,0x0E39,0x0F40,0x103E,0x1131,0x121A,0x12F8,0x13CA,0x1490,0x1549,0x15F5,0x1694,0x1724,0x17A7,0x181B,0x187F,0x18D5,0x191C,0x1953,0x197A,0x1992,0x199A,0x1992,0x197A,0x1953,0x191C,0x18D5,0x187F,0x181B,0x17A7,0x1724,0x1694,0x15F5,0x1549,0x1490,0x13CA,0x12F8,0x121A,0x1131,0x103E,0x0F40,0x0E39,0x0D29,0x0C11,0x0AF2,0x09CC,0x08A0,0x076E,0x0638,0x04FF,0x03C2,0x0282,0x0142,0x0000,0xFEBE,0xFD7E,0xFC3E,0xFB01,0xF9C8,0xF892,0xF760,0xF634,0xF50E,0xF3EF,0xF2D7,0xF1C7,0xF0C0,0xEFC2,0xEECF,0xEDE6,0xED08,0xEC36,0xEB70,0xEAB7,0xEA0B,0xE96C,0xE8DC,0xE859,0xE7E5,0xE781,0xE72B,0xE6E4,0xE6AD,0xE686,0xE66E,0xE666,0xE66E,0xE686,0xE6AD,0xE6E4,0xE72B,0xE781,0xE7E5,0xE859,0xE8DC,0xE96C,0xEA0B,0xEAB7,0xEB70,0xEC36,0xED08,0xEDE6,0xEECF,0xEFC2,0xF0C0,0xF1C7,0xF2D7,0xF3EF,0xF50E,0xF634,0xF760,0xF892,0xF9C8,0xFB01,0xFC3E,0xFD7E,0xFEBE,0x0000,0x0142,0x0282,0x03C2,0x04FF,0x0638,0x076E,0x08A0,0x09CC,0x0AF2,0x0C11,0x0D29,0x0E39,0x0F40,0x103E,0x1131,0x121A,0x12F8,0x13CA,0x1490,0x1549,0x15F5,0x1694,0x1724,0x17A7,0x181B,0x187F,0x18D5,0x191C,0x1953,0x197A,0x1992,0x199A,0x1992,0x197A,0x1953,0x191C,0x18D5,0x187F,0x181B,0x17A7,0x1724,0x1694,0x15F5,0x1549,0x1490,0x13CA,0x12F8,0x121A,0x1131,0x103E,0x0F40,0x0E39,0x0D29,0x0C11,0x0AF2,0x09CC,0x08A0,0x076E,0x0638,0x04FF,0x03C2,0x0282,0x0142,0x0000,0xFEBE,0xFD7E,0xFC3E,0xFB01,0xF9C8,0xF892,0xF760,0xF634,0xF50E,0xF3EF,0xF2D7,0xF1C7,0xF0C0,0xEFC2,0xEECF,0xEDE6,0xED08,0xEC36,0xEB70,0xEAB7,0xEA0B,0xE96C,0xE8DC,0xE859,0xE7E5,0xE781,0xE72B,0xE6E4,0xE6AD,0xE686,0xE66E,0xE666,0xE66E,0xE686,0xE6AD,0xE6E4,0xE72B,0xE781,0xE7E5,0xE859,0xE8DC,0xE96C,0xEA0B,0xEAB7,0xEB70,0xEC36,0xED08,0xEDE6,0xEECF,0xEFC2,0xF0C0,0xF1C7,0xF2D7,0xF3EF,0xF50E,0xF634,0xF760,0xF892,0xF9C8,0xFB01,0xFC3E,0xFD7E,0xFEBE}; + int TblSinAB[256] = {0x0000,0x0D53,0x17CB,0x1D3C,0x1CA5,0x1676,0x0C6D,0x0131,0xF7B2,0xF273,0xF2F6,0xF95F,0x046D,0x11C2,0x1E77,0x27C5,0x2BB4,0x298C,0x2203,0x1712,0x0B7D,0x022B,0xFD78,0xFEA5,0x058D,0x10AC,0x1D7E,0x2913,0x30C2,0x32CD,0x2EC3,0x25A3,0x199A,0x0D80,0x0431,0xFFD9,0x0175,0x0898,0x1381,0x1F89,0x29C1,0x2FA4,0x2FAF,0x29BF,0x1F15,0x120E,0x0591,0xFC64,0xF880,0xFA9D,0x0205,0x0CBE,0x1805,0x20F3,0x252D,0x2371,0x1BE6,0x100E,0x0270,0xF5FB,0xED58,0xEA48,0xED39,0xF530,0x0000,0x0AD0,0x12C7,0x15B8,0x12A8,0x0A05,0xFD90,0xEFF2,0xE41A,0xDC8F,0xDAD3,0xDF0D,0xE7FB,0xF342,0xFDFB,0x0563,0x0780,0x039C,0xFA6F,0xEDF2,0xE0EB,0xD641,0xD051,0xD05C,0xD63F,0xE077,0xEC7F,0xF768,0xFE8B,0x0027,0xFBCF,0xF280,0xE666,0xDA5D,0xD13D,0xCD33,0xCF3E,0xD6ED,0xE282,0xEF54,0xFA73,0x015B,0x0288,0xFDD5,0xF483,0xE8EE,0xDDFD,0xD674,0xD44C,0xD83B,0xE189,0xEE3E,0xFB93,0x06A1,0x0D0A,0x0D8D,0x084E,0xFECF,0xF393,0xE98A,0xE35B,0xE2C4,0xE835,0xF2AD,0x0000,0x0D53,0x17CB,0x1D3C,0x1CA5,0x1676,0x0C6D,0x0131,0xF7B2,0xF273,0xF2F6,0xF95F,0x046D,0x11C2,0x1E77,0x27C5,0x2BB4,0x298C,0x2203,0x1712,0x0B7D,0x022B,0xFD78,0xFEA5,0x058D,0x10AC,0x1D7E,0x2913,0x30C2,0x32CD,0x2EC3,0x25A3,0x199A,0x0D80,0x0431,0xFFD9,0x0175,0x0898,0x1381,0x1F89,0x29C1,0x2FA4,0x2FAF,0x29BF,0x1F15,0x120E,0x0591,0xFC64,0xF880,0xFA9D,0x0205,0x0CBE,0x1805,0x20F3,0x252D,0x2371,0x1BE6,0x100E,0x0270,0xF5FB,0xED58,0xEA48,0xED39,0xF530,0x0000,0x0AD0,0x12C7,0x15B8,0x12A8,0x0A05,0xFD90,0xEFF2,0xE41A,0xDC8F,0xDAD3,0xDF0D,0xE7FB,0xF342,0xFDFB,0x0563,0x0780,0x039C,0xFA6F,0xEDF2,0xE0EB,0xD641,0xD051,0xD05C,0xD63F,0xE077,0xEC7F,0xF768,0xFE8B,0x0027,0xFBCF,0xF280,0xE666,0xDA5D,0xD13D,0xCD33,0xCF3E,0xD6ED,0xE282,0xEF54,0xFA73,0x015B,0x0288,0xFDD5,0xF483,0xE8EE,0xDDFD,0xD674,0xD44C,0xD83B,0xE189,0xEE3E,0xFB93,0x06A1,0x0D0A,0x0D8D,0x084E,0xFECF,0xF393,0xE98A,0xE35B,0xE2C4,0xE835,0xF2AD}; + int TblSinB[256] = {0x0000,0x0C11,0x1549,0x197A,0x17A7,0x103E,0x04FF,0xF892,0xEDE6,0xE781,0xE6E4,0xEC36,0xF634,0x0282,0x0E39,0x1694,0x199A,0x1694,0x0E39,0x0282,0xF634,0xEC36,0xE6E4,0xE781,0xEDE6,0xF892,0x04FF,0x103E,0x17A7,0x197A,0x1549,0x0C11,0x0000,0xF3EF,0xEAB7,0xE686,0xE859,0xEFC2,0xFB01,0x076E,0x121A,0x187F,0x191C,0x13CA,0x09CC,0xFD7E,0xF1C7,0xE96C,0xE666,0xE96C,0xF1C7,0xFD7E,0x09CC,0x13CA,0x191C,0x187F,0x121A,0x076E,0xFB01,0xEFC2,0xE859,0xE686,0xEAB7,0xF3EF,0x0000,0x0C11,0x1549,0x197A,0x17A7,0x103E,0x04FF,0xF892,0xEDE6,0xE781,0xE6E4,0xEC36,0xF634,0x0282,0x0E39,0x1694,0x199A,0x1694,0x0E39,0x0282,0xF634,0xEC36,0xE6E4,0xE781,0xEDE6,0xF892,0x04FF,0x103E,0x17A7,0x197A,0x1549,0x0C11,0x0000,0xF3EF,0xEAB7,0xE686,0xE859,0xEFC2,0xFB01,0x076E,0x121A,0x187F,0x191C,0x13CA,0x09CC,0xFD7E,0xF1C7,0xE96C,0xE666,0xE96C,0xF1C7,0xFD7E,0x09CC,0x13CA,0x191C,0x187F,0x121A,0x076E,0xFB01,0xEFC2,0xE859,0xE686,0xEAB7,0xF3EF,0x0000,0x0C11,0x1549,0x197A,0x17A7,0x103E,0x04FF,0xF892,0xEDE6,0xE781,0xE6E4,0xEC36,0xF634,0x0282,0x0E39,0x1694,0x199A,0x1694,0x0E39,0x0282,0xF634,0xEC36,0xE6E4,0xE781,0xEDE6,0xF892,0x04FF,0x103E,0x17A7,0x197A,0x1549,0x0C11,0x0000,0xF3EF,0xEAB7,0xE686,0xE859,0xEFC2,0xFB01,0x076E,0x121A,0x187F,0x191C,0x13CA,0x09CC,0xFD7E,0xF1C7,0xE96C,0xE666,0xE96C,0xF1C7,0xFD7E,0x09CC,0x13CA,0x191C,0x187F,0x121A,0x076E,0xFB01,0xEFC2,0xE859,0xE686,0xEAB7,0xF3EF,0x0000,0x0C11,0x1549,0x197A,0x17A7,0x103E,0x04FF,0xF892,0xEDE6,0xE781,0xE6E4,0xEC36,0xF634,0x0282,0x0E39,0x1694,0x199A,0x1694,0x0E39,0x0282,0xF634,0xEC36,0xE6E4,0xE781,0xEDE6,0xF892,0x04FF,0x103E,0x17A7,0x197A,0x1549,0x0C11,0x0000,0xF3EF,0xEAB7,0xE686,0xE859,0xEFC2,0xFB01,0x076E,0x121A,0x187F,0x191C,0x13CA,0x09CC,0xFD7E,0xF1C7,0xE96C,0xE666,0xE96C,0xF1C7,0xFD7E,0x09CC,0x13CA,0x191C,0x187F,0x121A,0x076E,0xFB01,0xEFC2,0xE859,0xE686,0xEAB7,0xF3EF}; + int TblSinBC[256] = {0x0000,0x0E94,0x1A48,0x20E8,0x2173,0x1C4F,0x1338,0x08CF,0x0000,0xFB4B,0xFC2D,0x02CA,0x0DDB,0x1B02,0x2755,0x300E,0x3333,0x300E,0x2755,0x1B02,0x0DDB,0x02CA,0xFC2D,0xFB4B,0x0000,0x08CF,0x1338,0x1C4F,0x2173,0x20E8,0x1A48,0x0E94,0x0000,0xF16C,0xE5B8,0xDF18,0xDE8D,0xE3B1,0xECC8,0xF731,0x0000,0x04B5,0x03D3,0xFD36,0xF225,0xE4FE,0xD8AB,0xCFF2,0xCCCD,0xCFF2,0xD8AB,0xE4FE,0xF225,0xFD36,0x03D3,0x04B5,0x0000,0xF731,0xECC8,0xE3B1,0xDE8D,0xDF18,0xE5B8,0xF16C,0x0000,0x0E94,0x1A48,0x20E8,0x2173,0x1C4F,0x1338,0x08CF,0x0000,0xFB4B,0xFC2D,0x02CA,0x0DDB,0x1B02,0x2755,0x300E,0x3333,0x300E,0x2755,0x1B02,0x0DDB,0x02CA,0xFC2D,0xFB4B,0x0000,0x08CF,0x1338,0x1C4F,0x2173,0x20E8,0x1A48,0x0E94,0x0000,0xF16C,0xE5B8,0xDF18,0xDE8D,0xE3B1,0xECC8,0xF731,0x0000,0x04B5,0x03D3,0xFD36,0xF225,0xE4FE,0xD8AB,0xCFF2,0xCCCD,0xCFF2,0xD8AB,0xE4FE,0xF225,0xFD36,0x03D3,0x04B5,0x0000,0xF731,0xECC8,0xE3B1,0xDE8D,0xDF18,0xE5B8,0xF16C,0x0000,0x0E94,0x1A48,0x20E8,0x2173,0x1C4F,0x1338,0x08CF,0x0000,0xFB4B,0xFC2D,0x02CA,0x0DDB,0x1B02,0x2755,0x300E,0x3333,0x300E,0x2755,0x1B02,0x0DDB,0x02CA,0xFC2D,0xFB4B,0x0000,0x08CF,0x1338,0x1C4F,0x2173,0x20E8,0x1A48,0x0E94,0x0000,0xF16C,0xE5B8,0xDF18,0xDE8D,0xE3B1,0xECC8,0xF731,0x0000,0x04B5,0x03D3,0xFD36,0xF225,0xE4FE,0xD8AB,0xCFF2,0xCCCD,0xCFF2,0xD8AB,0xE4FE,0xF225,0xFD36,0x03D3,0x04B5,0x0000,0xF731,0xECC8,0xE3B1,0xDE8D,0xDF18,0xE5B8,0xF16C,0x0000,0x0E94,0x1A48,0x20E8,0x2173,0x1C4F,0x1338,0x08CF,0x0000,0xFB4B,0xFC2D,0x02CA,0x0DDB,0x1B02,0x2755,0x300E,0x3333,0x300E,0x2755,0x1B02,0x0DDB,0x02CA,0xFC2D,0xFB4B,0x0000,0x08CF,0x1338,0x1C4F,0x2173,0x20E8,0x1A48,0x0E94,0x0000,0xF16C,0xE5B8,0xDF18,0xDE8D,0xE3B1,0xECC8,0xF731,0x0000,0x04B5,0x03D3,0xFD36,0xF225,0xE4FE,0xD8AB,0xCFF2,0xCCCD,0xCFF2,0xD8AB,0xE4FE,0xF225,0xFD36,0x03D3,0x04B5,0x0000,0xF731,0xECC8,0xE3B1,0xDE8D,0xDF18,0xE5B8,0xF16C}; + int TblSinC[256] = {0x0000,0x0282,0x04FF,0x076E,0x09CC,0x0C11,0x0E39,0x103E,0x121A,0x13CA,0x1549,0x1694,0x17A7,0x187F,0x191C,0x197A,0x199A,0x197A,0x191C,0x187F,0x17A7,0x1694,0x1549,0x13CA,0x121A,0x103E,0x0E39,0x0C11,0x09CC,0x076E,0x04FF,0x0282,0x0000,0xFD7E,0xFB01,0xF892,0xF634,0xF3EF,0xF1C7,0xEFC2,0xEDE6,0xEC36,0xEAB7,0xE96C,0xE859,0xE781,0xE6E4,0xE686,0xE666,0xE686,0xE6E4,0xE781,0xE859,0xE96C,0xEAB7,0xEC36,0xEDE6,0xEFC2,0xF1C7,0xF3EF,0xF634,0xF892,0xFB01,0xFD7E,0x0000,0x0282,0x04FF,0x076E,0x09CC,0x0C11,0x0E39,0x103E,0x121A,0x13CA,0x1549,0x1694,0x17A7,0x187F,0x191C,0x197A,0x199A,0x197A,0x191C,0x187F,0x17A7,0x1694,0x1549,0x13CA,0x121A,0x103E,0x0E39,0x0C11,0x09CC,0x076E,0x04FF,0x0282,0x0000,0xFD7E,0xFB01,0xF892,0xF634,0xF3EF,0xF1C7,0xEFC2,0xEDE6,0xEC36,0xEAB7,0xE96C,0xE859,0xE781,0xE6E4,0xE686,0xE666,0xE686,0xE6E4,0xE781,0xE859,0xE96C,0xEAB7,0xEC36,0xEDE6,0xEFC2,0xF1C7,0xF3EF,0xF634,0xF892,0xFB01,0xFD7E,0x0000,0x0282,0x04FF,0x076E,0x09CC,0x0C11,0x0E39,0x103E,0x121A,0x13CA,0x1549,0x1694,0x17A7,0x187F,0x191C,0x197A,0x199A,0x197A,0x191C,0x187F,0x17A7,0x1694,0x1549,0x13CA,0x121A,0x103E,0x0E39,0x0C11,0x09CC,0x076E,0x04FF,0x0282,0x0000,0xFD7E,0xFB01,0xF892,0xF634,0xF3EF,0xF1C7,0xEFC2,0xEDE6,0xEC36,0xEAB7,0xE96C,0xE859,0xE781,0xE6E4,0xE686,0xE666,0xE686,0xE6E4,0xE781,0xE859,0xE96C,0xEAB7,0xEC36,0xEDE6,0xEFC2,0xF1C7,0xF3EF,0xF634,0xF892,0xFB01,0xFD7E,0x0000,0x0282,0x04FF,0x076E,0x09CC,0x0C11,0x0E39,0x103E,0x121A,0x13CA,0x1549,0x1694,0x17A7,0x187F,0x191C,0x197A,0x199A,0x197A,0x191C,0x187F,0x17A7,0x1694,0x1549,0x13CA,0x121A,0x103E,0x0E39,0x0C11,0x09CC,0x076E,0x04FF,0x0282,0x0000,0xFD7E,0xFB01,0xF892,0xF634,0xF3EF,0xF1C7,0xEFC2,0xEDE6,0xEC36,0xEAB7,0xE96C,0xE859,0xE781,0xE6E4,0xE686,0xE666,0xE686,0xE6E4,0xE781,0xE859,0xE96C,0xEAB7,0xEC36,0xEDE6,0xEFC2,0xF1C7,0xF3EF,0xF634,0xF892,0xFB01,0xFD7E}; + + UART_Device* uart0 = openUART(0); + FIFO_Device* fifotry = openFIFO(0); + FIFO_Device* fifoIn = openFIFO(1); + FIFO_Device* fifoOut = openFIFO(2); + + printf("\nDebut Main\n\n"); - printf("addr_fft: %x\n",(unsigned int)fft0); - printf("addr_uart: %x\n\n",(unsigned int)uart0); - printf("cfg_fft: %x\n",fft0->ConfigReg); - printf("cfg_uart: %x\n\n",uart0->ConfigReg); + FillFifo(fifoIn,0,TblSinA,256); + FillFifo(fifoIn,1,TblSinAB,256); + FillFifo(fifoIn,2,TblSinB,256); + FillFifo(fifoIn,3,TblSinBC,256); + FillFifo(fifoIn,4,TblSinC,256); + + while(j<5){ + while((fifoOut->FIFOreg[(2*j)+FIFO_Ctrl] & FIFO_Full) != FIFO_Full); // TANT QUE full a 0 RIEN - while(1) - { - FftInput(Tablo,fft0,delay); - /* for (i = 0 ; i < 256 ; i++) - { - sprintf(temp,"%x/in",Tablo[i]); - uartputs(uart0,temp); - }*/ - - FftOutput(Table,fft0); - for (i = 0 ; i < 128 ; i++) - { - sprintf(temp,"%x/out",Table[i]); + sprintf(temp,"FIFO %d\n\r",j); + uartputs(uart0,temp); + //while((fifoOut->FIFOreg[(2*0)+FIFO_Ctrl] & FIFO_Empty) != FIFO_Empty){ // TANT QUE empty a 0 ALORS + while(i < 128){ + data1 = (fifoOut->FIFOreg[(2*j)+FIFO_RWdata]) & Mask_4hex; + data2 = (fifoOut->FIFOreg[(2*j)+FIFO_RWdata]) & Mask_4hex; + i++; + sprintf(temp,"%d\t%d\n\r",data1,data2); uartputs(uart0,temp); } + i=0; + j++; } + printf("\nFin Main\n\n"); return 0; } - diff --git a/lib/lpp/dsp/lpp_fft/Driver_FFT.vhd b/lib/lpp/dsp/lpp_fft/Driver_FFT.vhd --- a/lib/lpp/dsp/lpp_fft/Driver_FFT.vhd +++ b/lib/lpp/dsp/lpp_fft/Driver_FFT.vhd @@ -25,14 +25,14 @@ use IEEE.numeric_std.all; entity Driver_FFT is generic( - Data_sz : integer range 1 to 32 := 16 + Data_sz : integer range 1 to 32 := 16; + NbData : integer range 1 to 512 := 256 ); port( clk : in std_logic; rstn : in std_logic; Load : in std_logic; Empty : in std_logic_vector(4 downto 0); - Full : in std_logic_vector(4 downto 0); DATA : in std_logic_vector((5*Data_sz)-1 downto 0); Valid : out std_logic; Read : out std_logic_vector(4 downto 0); @@ -47,111 +47,75 @@ architecture ar_Driver of Driver_FFT is type etat is (eX,e0,e1,e2); signal ect : etat; -signal FifoCpt : integer; ---signal DataTmp : std_logic_vector(Data_sz-1 downto 0); +signal DataCount : integer range 0 to 255 := 0; +signal FifoCpt : integer range 0 to 4 := 0; -signal sEmpty : std_logic; -signal sFull : std_logic; -signal sData : std_logic_vector(Data_sz-1 downto 0); +signal sLoad : std_logic; begin process(clk,rstn) begin if(rstn='0')then - ect <= eX; + ect <= e0; Read <= (others => '1'); Valid <= '0'; - FifoCpt <= 1; Data_re <= (others => '0'); Data_im <= (others => '0'); + DataCount <= 0; + FifoCpt <= 0; + sLoad <= '0'; elsif(clk'event and clk='1')then + sLoad <= Load; + if(sLoad='1' and Load='0')then + if(FifoCpt=4)then + FifoCpt <= 0; + else + FifoCpt <= FifoCpt + 1; + end if; + end if; + case ect is - when eX => - if(sFull='1')then - ect <= e0; - end if; - when e0 => - Valid <= '0'; - if(Load='1' and sEmpty='0')then - Read(FifoCpt-1) <= '0'; - ect <= e2; --- ect <= e1; - elsif(sEmpty='1')then - if(FifoCpt=6)then - FifoCpt <= 1; - else - FifoCpt <= FifoCpt+1; - end if; - ect <= eX; + if(Load='1' and Empty(FifoCpt)='0')then + Read(FifoCpt) <= '0'; + ect <= e1; end if; when e1 => - null; --- DataTmp <= sData; --- ect <= e2; - + Valid <= '0'; + Read(FifoCpt) <= '1'; + ect <= e2; + when e2 => - Read(FifoCpt-1) <= '1'; - Data_re <= sData; + Data_re <= DATA(((FifoCpt+1)*Data_sz)-1 downto (FifoCpt*Data_sz)); Data_im <= (others => '0'); --- Data_re <= DataTmp; --- Data_im <= sData; Valid <= '1'; + if(DataCount=NbData-1)then + DataCount <= 0; + ect <= eX; + else + DataCount <= DataCount + 1; + if(Load='1' and Empty(FifoCpt)='0')then + Read(FifoCpt) <= '0'; + ect <= e1; + else + ect <= eX; + end if; + end if; + + when eX => + Valid <= '0'; ect <= e0; - + + when others => + null; end case; end if; end process; -with FifoCpt select - sFull <= Full(0) when 1, - Full(1) when 2, - Full(2) when 3, - Full(3) when 4, - Full(4) when 5, - '1' when others; - -with FifoCpt select - sEmpty <= Empty(0) when 1, - Empty(1) when 2, - Empty(2) when 3, - Empty(3) when 4, - Empty(4) when 5, - '1' when others; - -with FifoCpt select - sData <= DATA(Data_sz-1 downto 0) when 1, - DATA((2*Data_sz)-1 downto Data_sz) when 2, - DATA((3*Data_sz)-1 downto (2*Data_sz)) when 3, - DATA((4*Data_sz)-1 downto (3*Data_sz)) when 4, - DATA((5*Data_sz)-1 downto (4*Data_sz)) when 5, - (others => '0') when others; - -end architecture; - - - - - - - - - - - - - - - - - - - - - +end architecture; \ No newline at end of file diff --git a/lib/lpp/dsp/lpp_fft/Linker_FFT.vhd b/lib/lpp/dsp/lpp_fft/Linker_FFT.vhd --- a/lib/lpp/dsp/lpp_fft/Linker_FFT.vhd +++ b/lib/lpp/dsp/lpp_fft/Linker_FFT.vhd @@ -25,7 +25,8 @@ use IEEE.numeric_std.all; entity Linker_FFT is generic( - Data_sz : integer range 1 to 32 := 8 + Data_sz : integer range 1 to 32 := 16; + NbData : integer range 1 to 512 := 256 ); port( clk : in std_logic; @@ -45,15 +46,15 @@ end entity; architecture ar_Linker of Linker_FFT is -type etat is (eX,e0,e1,e2,e3); +type etat is (eX,e0,e1,e2); signal ect : etat; -signal FifoCpt : integer; signal DataTmp : std_logic_vector(Data_sz-1 downto 0); -signal sFull : std_logic; -signal sData : std_logic_vector(Data_sz-1 downto 0); -signal sReady : std_logic; +signal sRead : std_logic; +signal sReady : std_logic; + +signal FifoCpt : integer range 0 to 4 := 0; begin @@ -61,69 +62,51 @@ begin begin if(rstn='0')then ect <= e0; - Read <= '0'; + sRead <= '0'; + sReady <= '0'; Write <= (others => '1'); Reuse <= (others => '0'); - FifoCpt <= 1; - sDATA <= (others => '0'); + FifoCpt <= 0; elsif(clk'event and clk='1')then sReady <= Ready; + if(sReady='1' and Ready='0')then + if(FifoCpt=4)then + FifoCpt <= 0; + else + FifoCpt <= FifoCpt + 1; + end if; + elsif(Ready='1')then + sRead <= not sRead; + else + sRead <= '0'; + end if; + case ect is when e0 => - Write(FifoCpt-1) <= '1'; - if(sReady='0' and Ready='1' and sfull='0')then - Read <= '1'; + Write(FifoCpt) <= '1'; + if(Valid='1' and Full(FifoCpt)='0')then + DataTmp <= Data_im; + DATA(((FifoCpt+1)*Data_sz)-1 downto (FifoCpt*Data_sz)) <= Data_re; + Write(FifoCpt) <= '0'; ect <= e1; - end if; - - when e1 => - Read <= '0'; - if(Valid='1' and sfull='0')then - DataTmp <= Data_im; - sDATA <= Data_re; - Write(FifoCpt-1) <= '0'; - ect <= e2; - elsif(sfull='1')then - ReUse(FifoCpt-1) <= '1'; - ect <= eX; + elsif(Full(FifoCpt)='1')then + ReUse(FifoCpt) <= '1'; end if; - when e2 => - sDATA <= DataTmp; - ect <= e3; - - when e3 => - Write(FifoCpt-1) <= '1'; - if(Ready='1' and sfull='0')then - Read <= '1'; - ect <= e1; - end if; + when e1 => + DATA(((FifoCpt+1)*Data_sz)-1 downto (FifoCpt*Data_sz)) <= DataTmp; + ect <= e0; - when eX => - if(FifoCpt=5)then - FifoCpt <= 1; - else - FifoCpt <= FifoCpt+1; - end if; - ect <= e0; + when others => + null; end case; end if; end process; -DATA <= sData & sData & sData & sData & sData; +Read <= sRead; -with FifoCpt select - sFull <= Full(0) when 1, - Full(1) when 2, - Full(2) when 3, - Full(3) when 4, - Full(4) when 5, - '1' when others; - - -end architecture; - +end architecture; \ No newline at end of file diff --git a/lib/lpp/dsp/lpp_fft/lpp_fft.vhd b/lib/lpp/dsp/lpp_fft/lpp_fft.vhd --- a/lib/lpp/dsp/lpp_fft/lpp_fft.vhd +++ b/lib/lpp/dsp/lpp_fft/lpp_fft.vhd @@ -89,7 +89,8 @@ end component; component Linker_FFT is generic( - Data_sz : integer range 1 to 32 := 16 + Data_sz : integer range 1 to 32 := 16; + NbData : integer range 1 to 512 := 256 ); port( clk : in std_logic; @@ -109,14 +110,14 @@ end component; component Driver_FFT is generic( - Data_sz : integer range 1 to 32 := 16 + Data_sz : integer range 1 to 32 := 16; + NbData : integer range 1 to 512 := 256 ); port( clk : in std_logic; rstn : in std_logic; Load : in std_logic; Empty : in std_logic_vector(4 downto 0); - Full : in std_logic_vector(4 downto 0); DATA : in std_logic_vector((5*Data_sz)-1 downto 0); Valid : out std_logic; Read : out std_logic_vector(4 downto 0); diff --git a/lib/lpp/leon3mp.vhd b/lib/lpp/leon3mp.vhd --- a/lib/lpp/leon3mp.vhd +++ b/lib/lpp/leon3mp.vhd @@ -170,15 +170,15 @@ signal dsuo : dsu_out_type; --- AJOUT TEST ------------------------Signaux---------------------- --------------------------------------------------------------------- -- FIFOs -signal FifoIN_Full : std_logic_vector(0 downto 0);-- -signal FifoIN_Empty : std_logic_vector(0 downto 0);-- -signal FifoIN_Data : std_logic_vector(15 downto 0);-- +signal FifoIN_Full : std_logic_vector(4 downto 0);-- +signal FifoIN_Empty : std_logic_vector(4 downto 0);-- +signal FifoIN_Data : std_logic_vector(79 downto 0);-- signal FifoINT_Full : std_logic_vector(4 downto 0); signal FifoINT_Data : std_logic_vector(79 downto 0); signal FifoOUT_FullV : std_logic; -signal FifoOUT_Full : std_logic_vector(0 downto 0);-- +signal FifoOUT_Full : std_logic_vector(4 downto 0);-- signal Matrix_WriteV : std_logic_vector(0 downto 0); -- MATRICE SPECTRALE @@ -200,7 +200,7 @@ signal Dma_acq : std_logic; -- FFT signal Drive_Write : std_logic; -signal Drive_Read : std_logic_vector(0 downto 0);-- +signal Drive_Read : std_logic_vector(4 downto 0);-- signal Drive_DataRE : std_logic_vector(15 downto 0); signal Drive_DataIM : std_logic_vector(15 downto 0); @@ -213,9 +213,9 @@ signal FFT_DataRE : std_logic_vect signal FFT_DataIM : std_logic_vector(15 downto 0); signal Link_Read : std_logic; -signal Link_Write : std_logic_vector(0 downto 0);-- -signal Link_ReUse : std_logic_vector(0 downto 0);-- -signal Link_Data : std_logic_vector(15 downto 0);-- +signal Link_Write : std_logic_vector(4 downto 0);-- +signal Link_ReUse : std_logic_vector(4 downto 0);-- +signal Link_Data : std_logic_vector(79 downto 0);-- -- ADC signal SmplClk : std_logic; @@ -237,7 +237,7 @@ signal TXDint : std_logic; signal sample_clk_out : std_logic; signal Rd : std_logic_vector(0 downto 0);-- -signal Ept : std_logic_vector(0 downto 0);-- +signal Ept : std_logic_vector(4 downto 0);-- signal Bwr : std_logic_vector(0 downto 0); signal Bre : std_logic_vector(0 downto 0); @@ -313,7 +313,7 @@ SPW2_EN <= '0'; --- FFT ------------------------------------------------------------- MemIn : APB_FIFO - generic map (pindex => 8, paddr => 8, FifoCnt => 1, Data_sz => 16, Addr_sz => 8, Enable_ReUse => '1', R => 0, W => 1) + generic map (pindex => 8, paddr => 8, FifoCnt => 5, Data_sz => 16, Addr_sz => 8, Enable_ReUse => '0', R => 0, W => 1) port map (clkm,rstn,clkm,clkm,(others => '0'),Drive_Read,(others => '1'),FifoIN_Empty,FifoIN_Full,FifoIN_Data,(others => '0'),open,open,apbi,apbo(8)); -- MemIn : APB_FIFO -- generic map (pindex => 8, paddr => 8, FifoCnt => 1, Data_sz => 16, Addr_sz => 8, Enable_ReUse => '0', R => 0, W => 1) @@ -322,12 +322,12 @@ SPW2_EN <= '0'; Start <= '0'; - DRIVE : FFTamont - generic map(Data_sz => 16,NbData => 256) - port map(clkm,rstn,FFT_Load,FifoIN_Empty(0),FifoIN_Data,Drive_Write,Drive_Read(0),Drive_DataRE,Drive_DataIM); --- DRIVE : Driver_FFT --- generic map(Data_sz => 16) --- port map(clkm,rstn,FFT_Load,FifoIN_Empty,FifoIN_Full,FifoIN_Data,Drive_Write,Drive_Read,Drive_DataRE,Drive_DataIM); +-- DRIVE : FFTamont +-- generic map(Data_sz => 16,NbData => 256) +-- port map(clkm,rstn,FFT_Load,FifoIN_Empty(0),FifoIN_Data,Drive_Write,Drive_Read(0),Drive_DataRE,Drive_DataIM); + DRIVE : Driver_FFT + generic map(Data_sz => 16) + port map(clkm,rstn,FFT_Load,FifoIN_Empty,FifoIN_Data,Drive_Write,Drive_Read,Drive_DataRE,Drive_DataIM); -- FFT : CoreFFT generic map( @@ -344,17 +344,17 @@ Start <= '0'; inBuf_RWDLY => gInBuf_RWDLY) port map(clkm,start,rstn,Drive_Write,Link_Read,Drive_DataIM,Drive_DataRE,FFT_Load,open,FFT_DataIM,FFT_DataRE,FFT_Valid,FFT_Ready); -- --- LINK : Linker_FFT --- generic map(Data_sz => 16) --- port map(clkm,rstn,FFT_Ready,FFT_Valid,FifoOUT_Full,FFT_DataRE,FFT_DataIM,Link_Read,Link_Write,Link_ReUse,Link_Data);--FifoOUT_Full/FifoINT_Full - LINK : FFTaval - generic map(Data_sz => 16,NbData => 256) - port map(clkm,rstn,FFT_Ready,FFT_Valid,FifoOUT_Full(0),FFT_DataRE,FFT_DataIM,Link_Read,Link_Write(0),Link_ReUse(0),Link_Data); + LINK : Linker_FFT + generic map(Data_sz => 16) + port map(clkm,rstn,FFT_Ready,FFT_Valid,FifoOUT_Full,FFT_DataRE,FFT_DataIM,Link_Read,Link_Write,Link_ReUse,Link_Data);--FifoOUT_Full/FifoINT_Full +-- LINK : FFTaval +-- generic map(Data_sz => 16,NbData => 256) +-- port map(clkm,rstn,FFT_Ready,FFT_Valid,FifoOUT_Full(0),FFT_DataRE,FFT_DataIM,Link_Read,Link_Write(0),Link_ReUse(0),Link_Data); -- ----- MATRICE SPECTRALE ---------------------5 FIFO Input--------------- -- MemOut : APB_FIFO - generic map (pindex => 9, paddr => 9, FifoCnt => 1, Data_sz => 16, Addr_sz => 8, Enable_ReUse => '0', R => 1, W => 0) + generic map (pindex => 9, paddr => 9, FifoCnt => 5, Data_sz => 16, Addr_sz => 8, Enable_ReUse => '1', R => 1, W => 0) port map (clkm,rstn,clkm,clkm,Link_ReUse,(others =>'1'),Link_Write,Ept,FifoOUT_Full,open,Link_Data,open,open,apbi,apbo(9));