##// END OF EJS Templates
Data line (FFT + Matrix) first version
martin -
r96:2dfde37709a5 martin
parent child
Show More
@@ -0,0 +1,44
1 #------------------------------------------------------------------------------
2 #-- This file is a part of the LPP VHDL IP LIBRARY
3 #-- Copyright (C) 2010, Laboratory of Plasmas Physic - CNRS
4 #--
5 #-- This program is free software; you can redistribute it and/or modify
6 #-- it under the terms of the GNU General Public License as published by
7 #-- the Free Software Foundation; either version 3 of the License, or
8 #-- (at your option) any later version.
9 #--
10 #-- This program is distributed in the hope that it will be useful,
11 #-- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 #-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 #-- GNU General Public License for more details.
14 #--
15 #-- You should have received a copy of the GNU General Public License
16 #-- along with this program; if not, write to the Free Software
17 #-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 #------------------------------------------------------------------------------
19
20 include ../../rules.mk
21 LIBDIR = ../../lib
22 INCPATH = ../../includes
23 SCRIPTDIR=../../scripts/
24 LIBS=-lapb_fft_Driver -llpp_apb_functions -lapb_delay_Driver -lapb_fifo_Driver -lapb_uart_Driver -lapb_gpio_Driver
25 INPUTFILE=main.c
26 EXEC=BenchFFT+Matrix.bin
27 OUTBINDIR=bin/
28
29
30 .PHONY:bin
31
32 all:bin
33 @echo $(EXEC)" file created"
34
35 clean:
36 rm -f *.{o,a}
37
38
39
40 help:ruleshelp
41 @echo " all : makes an executable file called "$(EXEC)
42 @echo " in "$(OUTBINDIR)
43 @echo " clean : removes temporary files"
44
@@ -0,0 +1,80
1 #include <stdio.h>
2 #include "lpp_apb_functions.h"
3 #include "apb_fifo_Driver.h"
4 #include "apb_uart_Driver.h"
5 #include "apb_delay_Driver.h"
6 #include "apb_fft_Driver.h"
7
8
9 int main()
10 {
11 int i;
12 int data1,data2;
13 char temp[256];
14 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};
15 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};
16 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} ;
17
18 /* int TblSin5K[256] = {0x0000,0x080A,0x100B,0x17FC,0x1FD5,0x278E,0x2F1F,0x3680,0x3DAA,0x4496,0x4B3D,0x5197,0x579F,0x5D4F,0x62A0,0x678E,0x6C13,0x702B,0x73D1,0x7703,0x79BC,0x7BFB,0x7DBC,0x7EFE,0x7FBF,0x7FFF,0x7FBF,0x7EFE,0x7DBC,0x7BFB,0x79BC,0x7703,0x73D1,0x702B,0x6C13,0x678E,0x62A0,0x5D4F,0x579F,0x5197,0x4B3D,0x4496,0x3DAA,0x3680,0x2F1F,0x278E,0x1FD5,0x17FC,0x100B,0x080A,0x0000,0xF7F6,0xEFF5,0xE804,0xE02B,0xD872,0xD0E1,0xC980,0xC256,0xBB6A,0xB4C3,0xAE69,0xA861,0xA2B1,0x9D60,0x9872,0x93ED,0x8FD5,0x8C2F,0x88FD,0x8644,0x8405,0x8244,0x8102,0x8041,0x8000,0x8041,0x8102,0x8244,0x8405,0x8644,0x88FD,0x8C2F,0x8FD5,0x93ED,0x9872,0x9D60,0xA2B1,0xA861,0xAE69,0xB4C3,0xBB6A,0xC256,0xC980,0xD0E1,0xD872,0xE02B,0xE804,0xEFF5,0xF7F6,0x0000,0x080A,0x100B,0x17FC,0x1FD5,0x278E,0x2F1F,0x3680,0x3DAA,0x4496,0x4B3D,0x5197,0x579F,0x5D4F,0x62A0,0x678E,0x6C13,0x702B,0x73D1,0x7703,0x79BC,0x7BFB,0x7DBC,0x7EFE,0x7FBF,0x7FFF,0x7FBF,0x7EFE,0x7DBC,0x7BFB,0x79BC,0x7703,0x73D1,0x702B,0x6C13,0x678E,0x62A0,0x5D4F,0x579F,0x5197,0x4B3D,0x4496,0x3DAA,0x3680,0x2F1F,0x278E,0x1FD5,0x17FC,0x100B,0x080A,0x0000,0xF7F6,0xEFF5,0xE804,0xE02B,0xD872,0xD0E1,0xC980,0xC256,0xBB6A,0xB4C3,0xAE69,0xA861,0xA2B1,0x9D60,0x9872,0x93ED,0x8FD5,0x8C2F,0x88FD,0x8644,0x8405,0x8244,0x8102,0x8041,0x8000,0x8041,0x8102,0x8244,0x8405,0x8644,0x88FD,0x8C2F,0x8FD5,0x93ED,0x9872,0x9D60,0xA2B1,0xA861,0xAE69,0xB4C3,0xBB6A,0xC256,0xC980,0xD0E1,0xD872,0xE02B,0xE804,0xEFF5,0xF7F6,0x0000,0x080A,0x100B,0x17FC,0x1FD5,0x278E,0x2F1F,0x3680,0x3DAA,0x4496,0x4B3D,0x5197,0x579F,0x5D4F,0x62A0,0x678E,0x6C13,0x702B,0x73D1,0x7703,0x79BC,0x7BFB,0x7DBC,0x7EFE,0x7FBF,0x7FFF,0x7FBF,0x7EFE,0x7DBC,0x7BFB,0x79BC,0x7703,0x73D1,0x702B,0x6C13,0x678E,0x62A0,0x5D4F,0x579F,0x5197,0x4B3D,0x4496,0x3DAA,0x3680,0x2F1F,0x278E,0x1FD5,0x17FC,0x100B,0x080A,0x0000,0xF7F6,0xEFF5,0xE804,0xE02B,0xD872};
19 int TblSin8K[256] = {0x0000,0x0CD9,0x1990,0x2605,0x3219,0x3DAA,0x489C,0x52D3,0x5C33,0x64A5,0x6C13,0x7269,0x7798,0x7B92,0x7E4C,0x7FBF,0x7FE9,0x7EC7,0x7C5E,0x78B4,0x73D1,0x6DC3,0x669A,0x5E67,0x5540,0x4B3D,0x4077,0x350A,0x2915,0x1CB5,0x100B,0x0337,0xF65C,0xE999,0xDD10,0xD0E1,0xC52C,0xBA10,0xAFA8,0xA610,0x9D60,0x95AF,0x8F11,0x8997,0x854F,0x8244,0x807F,0x8003,0x80D1,0x82E9,0x8644,0x8AD9,0x909E,0x9782,0x9F75,0xA861,0xB22F,0xBCC7,0xC80D,0xD3E3,0xE02B,0xECC5,0xF992,0x066E,0x133B,0x1FD5,0x2C1D,0x37F3,0x4339,0x4DD1,0x579F,0x608B,0x687E,0x6F62,0x7527,0x79BC,0x7D17,0x7F2F,0x7FFD,0x7F81,0x7DBC,0x7AB1,0x7669,0x70EF,0x6A51,0x62A0,0x59F0,0x5058,0x45F0,0x3AD4,0x2F1F,0x22F0,0x1667,0x09A4,0xFCC9,0xEFF5,0xE34B,0xD6EB,0xCAF6,0xBF89,0xB4C3,0xAAC0,0xA199,0x9966,0x923D,0x8C2F,0x874C,0x83A2,0x8139,0x8017,0x8041,0x81B4,0x846E,0x8868,0x8D97,0x93ED,0x9B5B,0xA3CD,0xAD2D,0xB764,0xC256,0xCDE7,0xD9FB,0xE670,0xF327,0x0000,0x0CD9,0x1990,0x2605,0x3219,0x3DAA,0x489C,0x52D3,0x5C33,0x64A5,0x6C13,0x7269,0x7798,0x7B92,0x7E4C,0x7FBF,0x7FE9,0x7EC7,0x7C5E,0x78B4,0x73D1,0x6DC3,0x669A,0x5E67,0x5540,0x4B3D,0x4077,0x350A,0x2915,0x1CB5,0x100B,0x0337,0xF65C,0xE999,0xDD10,0xD0E1,0xC52C,0xBA10,0xAFA8,0xA610,0x9D60,0x95AF,0x8F11,0x8997,0x854F,0x8244,0x807F,0x8003,0x80D1,0x82E9,0x8644,0x8AD9,0x909E,0x9782,0x9F75,0xA861,0xB22F,0xBCC7,0xC80D,0xD3E3,0xE02B,0xECC5,0xF992,0x066E,0x133B,0x1FD5,0x2C1D,0x37F3,0x4339,0x4DD1,0x579F,0x608B,0x687E,0x6F62,0x7527,0x79BC,0x7D17,0x7F2F,0x7FFD,0x7F81,0x7DBC,0x7AB1,0x7669,0x70EF,0x6A51,0x62A0,0x59F0,0x5058,0x45F0,0x3AD4,0x2F1F,0x22F0,0x1667,0x09A4,0xFCC9,0xEFF5,0xE34B,0xD6EB,0xCAF6,0xBF89,0xB4C3,0xAAC0,0xA199,0x9966,0x923D,0x8C2F,0x874C,0x83A2,0x8139,0x8017,0x8041,0x81B4,0x846E,0x8868,0x8D97,0x93ED,0x9B5B,0xA3CD,0xAD2D,0xB764,0xC256,0xCDE7,0xD9FB,0xE670,0xF327,0x0000,0x0CD9,0x1990,0x2605,0x3219,0x3DAA};
20 int TblSin11K[256] = {0x0000,0x11A3,0x22F0,0x3392,0x4339,0x5197,0x5E67,0x696A,0x7269,0x793B,0x7DBC,0x7FD7,0x7F81,0x7CBD,0x7798,0x702B,0x669A,0x5B14,0x4DD1,0x3F12,0x2F1F,0x1E46,0x0CD9,0xFB2D,0xE999,0xD872,0xC80D,0xB8B8,0xAAC0,0x9E68,0x93ED,0x8B82,0x854F,0x8174,0x8003,0x8102,0x846E,0x8A36,0x923D,0x9C5B,0xA861,0xB612,0xC52C,0xD566,0xE670,0xF7F6,0x09A4,0x1B23,0x2C1D,0x3C40,0x4B3D,0x58CA,0x64A5,0x6E95,0x7669,0x7BFB,0x7F2F,0x7FF6,0x7E4C,0x7A39,0x73D1,0x6B34,0x608B,0x540B,0x45F0,0x3680,0x2605,0x14D1,0x0337,0xF18E,0xE02B,0xCF63,0xBF89,0xB0EA,0xA3CD,0x9872,0x8F11,0x87D8,0x82E9,0x805D,0x8041,0x8294,0x874C,0x8E52,0x9782,0xA2B1,0xAFA8,0xBE27,0xCDE7,0xDE9D,0xEFF5,0x019C,0x133B,0x247C,0x350A,0x4496,0x52D3,0x5F7B,0x6A51,0x7320,0x79BC,0x7E06,0x7FE9,0x7F5B,0x7C5E,0x7703,0x6F62,0x65A1,0x59F0,0x4C88,0x3DAA,0x2D9F,0x1CB5,0x0B3F,0xF992,0xE804,0xD6EB,0xC69B,0xB764,0xA98F,0x9D60,0x9313,0x8AD9,0x84DC,0x8139,0x8000,0x8139,0x84DC,0x8AD9,0x9313,0x9D60,0xA98F,0xB764,0xC69B,0xD6EB,0xE804,0xF992,0x0B3F,0x1CB5,0x2D9F,0x3DAA,0x4C88,0x59F0,0x65A1,0x6F62,0x7703,0x7C5E,0x7F5B,0x7FE9,0x7E06,0x79BC,0x7320,0x6A51,0x5F7B,0x52D3,0x4496,0x350A,0x247C,0x133B,0x019C,0xEFF5,0xDE9D,0xCDE7,0xBE27,0xAFA8,0xA2B1,0x9782,0x8E52,0x874C,0x8294,0x8041,0x805D,0x82E9,0x87D8,0x8F11,0x9872,0xA3CD,0xB0EA,0xBF89,0xCF63,0xE02B,0xF18E,0x0337,0x14D1,0x2605,0x3680,0x45F0,0x540B,0x608B,0x6B34,0x73D1,0x7A39,0x7E4C,0x7FF6,0x7F2F,0x7BFB,0x7669,0x6E95,0x64A5,0x58CA,0x4B3D,0x3C40,0x2C1D,0x1B23,0x09A4,0xF7F6,0xE670,0xD566,0xC52C,0xB612,0xA861,0x9C5B,0x923D,0x8A36,0x846E,0x8102,0x8003,0x8174,0x854F,0x8B82,0x93ED,0x9E68,0xAAC0,0xB8B8,0xC80D,0xD872,0xE999,0xFB2D,0x0CD9,0x1E46,0x2F1F,0x3F12,0x4DD1,0x5B14,0x669A,0x702B,0x7798,0x7CBD,0x7F81,0x7FD7,0x7DBC,0x793B,0x7269,0x696A,0x5E67,0x5197,0x4339,0x3392,0x22F0,0x11A3,0x0000,0xEE5D,0xDD10,0xCC6E,0xBCC7,0xAE69};
21 */ int TblSin15K[256] = {0x0000,0x17FC,0x2F1F,0x4496,0x579F,0x678E,0x73D1,0x7BFB,0x7FBF,0x7EFE,0x79BC,0x702B,0x62A0,0x5197,0x3DAA,0x278E,0x100B,0xF7F6,0xE02B,0xC980,0xB4C3,0xA2B1,0x93ED,0x88FD,0x8244,0x8000,0x8244,0x88FD,0x93ED,0xA2B1,0xB4C3,0xC980,0xE02B,0xF7F6,0x100B,0x278E,0x3DAA,0x5197,0x62A0,0x702B,0x79BC,0x7EFE,0x7FBF,0x7BFB,0x73D1,0x678E,0x579F,0x4496,0x2F1F,0x17FC,0x0000,0xE804,0xD0E1,0xBB6A,0xA861,0x9872,0x8C2F,0x8405,0x8041,0x8102,0x8644,0x8FD5,0x9D60,0xAE69,0xC256,0xD872,0xEFF5,0x080A,0x1FD5,0x3680,0x4B3D,0x5D4F,0x6C13,0x7703,0x7DBC,0x8000,0x7DBC,0x7703,0x6C13,0x5D4F,0x4B3D,0x3680,0x1FD5,0x080A,0xEFF5,0xD872,0xC256,0xAE69,0x9D60,0x8FD5,0x8644,0x8102,0x8041,0x8405,0x8C2F,0x9872,0xA861,0xBB6A,0xD0E1,0xE804,0x0000,0x17FC,0x2F1F,0x4496,0x579F,0x678E,0x73D1,0x7BFB,0x7FBF,0x7EFE,0x79BC,0x702B,0x62A0,0x5197,0x3DAA,0x278E,0x100B,0xF7F6,0xE02B,0xC980,0xB4C3,0xA2B1,0x93ED,0x88FD,0x8244,0x8000,0x8244,0x88FD,0x93ED,0xA2B1,0xB4C3,0xC980,0xE02B,0xF7F6,0x100B,0x278E,0x3DAA,0x5197,0x62A0,0x702B,0x79BC,0x7EFE,0x7FBF,0x7BFB,0x73D1,0x678E,0x579F,0x4496,0x2F1F,0x17FC,0x0000,0xE804,0xD0E1,0xBB6A,0xA861,0x9872,0x8C2F,0x8405,0x8041,0x8102,0x8644,0x8FD5,0x9D60,0xAE69,0xC256,0xD872,0xEFF5,0x080A,0x1FD5,0x3680,0x4B3D,0x5D4F,0x6C13,0x7703,0x7DBC,0x8000,0x7DBC,0x7703,0x6C13,0x5D4F,0x4B3D,0x3680,0x1FD5,0x080A,0xEFF5,0xD872,0xC256,0xAE69,0x9D60,0x8FD5,0x8644,0x8102,0x8041,0x8405,0x8C2F,0x9872,0xA861,0xBB6A,0xD0E1,0xE804,0x0000,0x17FC,0x2F1F,0x4496,0x579F,0x678E,0x73D1,0x7BFB,0x7FBF,0x7EFE,0x79BC,0x702B,0x62A0,0x5197,0x3DAA,0x278E,0x100B,0xF7F6,0xE02B,0xC980,0xB4C3,0xA2B1,0x93ED,0x88FD,0x8244,0x8000,0x8244,0x88FD,0x93ED,0xA2B1,0xB4C3,0xC980,0xE02B,0xF7F6,0x100B,0x278E,0x3DAA,0x5197,0x62A0,0x702B,0x79BC,0x7EFE,0x7FBF,0x7BFB,0x73D1,0x678E,0x579F,0x4496,0x2F1F,0x17FC,0x0000,0xE804,0xD0E1,0xBB6A,0xA861,0x9872};
22 int TblSin19K[256] = {0x0000,0x1E46,0x3AD4,0x540B,0x687E,0x7703,0x7EC7,0x7F5B,0x78B4,0x6B34,0x579F,0x3F12,0x22F0,0x04D3,0xE670,0xC980,0xAFA8,0x9A5F,0x8AD9,0x81FA,0x8041,0x85C7,0x923D,0xA4EC,0xBCC7,0xD872,0xF65C,0x14D1,0x3219,0x4C88,0x62A0,0x7320,0x7D17,0x7FF6,0x7B92,0x702B,0x5E67,0x4748,0x2C1D,0x0E72,0xEFF5,0xD261,0xB764,0xA085,0x8F11,0x8405,0x8003,0x8343,0x8D97,0x9E68,0xB4C3,0xCF63,0xECC5,0x0B3F,0x2915,0x4496,0x5C33,0x6E95,0x7AB1,0x7FD7,0x7DBC,0x747E,0x64A5,0x4F16,0x350A,0x17FC,0xF992,0xDB84,0xBF89,0xA736,0x93ED,0x86C5,0x807F,0x8174,0x8997,0x9872,0xAD2D,0xC69B,0xE34B,0x019C,0x1FD5,0x3C40,0x5540,0x696A,0x7798,0x7EFE,0x7F2F,0x7828,0x6A51,0x5671,0x3DAA,0x2163,0x0337,0xE4DD,0xC80D,0xAE69,0x9966,0x8A36,0x81B4,0x805D,0x8644,0x9313,0xA610,0xBE27,0xD9FB,0xF7F6,0x1667,0x3392,0x4DD1,0x63A5,0x73D1,0x7D6C,0x7FE9,0x7B24,0x6F62,0x5D4F,0x45F0,0x2A9A,0x0CD9,0xEE5D,0xD0E1,0xB612,0x9F75,0x8E52,0x83A2,0x8000,0x83A2,0x8E52,0x9F75,0xB612,0xD0E1,0xEE5D,0x0CD9,0x2A9A,0x45F0,0x5D4F,0x6F62,0x7B24,0x7FE9,0x7D6C,0x73D1,0x63A5,0x4DD1,0x3392,0x1667,0xF7F6,0xD9FB,0xBE27,0xA610,0x9313,0x8644,0x805D,0x81B4,0x8A36,0x9966,0xAE69,0xC80D,0xE4DD,0x0337,0x2163,0x3DAA,0x5671,0x6A51,0x7828,0x7F2F,0x7EFE,0x7798,0x696A,0x5540,0x3C40,0x1FD5,0x019C,0xE34B,0xC69B,0xAD2D,0x9872,0x8997,0x8174,0x807F,0x86C5,0x93ED,0xA736,0xBF89,0xDB84,0xF992,0x17FC,0x350A,0x4F16,0x64A5,0x747E,0x7DBC,0x7FD7,0x7AB1,0x6E95,0x5C33,0x4496,0x2915,0x0B3F,0xECC5,0xCF63,0xB4C3,0x9E68,0x8D97,0x8343,0x8003,0x8405,0x8F11,0xA085,0xB764,0xD261,0xEFF5,0x0E72,0x2C1D,0x4748,0x5E67,0x702B,0x7B92,0x7FF6,0x7D17,0x7320,0x62A0,0x4C88,0x3219,0x14D1,0xF65C,0xD872,0xBCC7,0xA4EC,0x923D,0x85C7,0x8041,0x81FA,0x8AD9,0x9A5F,0xAFA8,0xC980,0xE670,0x04D3,0x22F0,0x3F12,0x579F,0x6B34,0x78B4,0x7F5B,0x7EC7,0x7703,0x687E,0x540B,0x3AD4,0x1E46,0x0000,0xE1BA,0xC52C,0xABF5,0x9782,0x88FD};
23 int Table[256];
24
25 FFT_Device* fft0 = openFFT(0);
26 DELAY_Device* delay = openDELAY(0);
27 UART_Device* uart0 = openUART(0);
28 FIFO_Device* fifoIn = openFIFO(0);
29 FIFO_Device* fifoOut = openFIFO(1);
30
31 printf("\nDebut Main\n\n");
32
33 Setup(delay,30000000);
34
35 FftInput(TblSinA,fft0,delay);
36 FftOutput(Table,fft0);
37 /*for (i = 0 ; i < 256 ; i=i+2)
38 {
39 sprintf(temp,"%x\t%x\n\r",Table[i],Table[i+1]);
40 uartputs(uart0,temp);
41 }*/
42 FillFifo(fifoIn,0,Table);
43 fifoIn->FIFOreg[(2*0)+FIFO_Ctrl] = (fifoIn->FIFOreg[(2*0)+FIFO_Ctrl] | FIFO_ReUse);
44
45 FftInput(TblSinAB,fft0,delay);
46 FftOutput(Table,fft0);
47 FillFifo(fifoIn,1,Table);
48 fifoIn->FIFOreg[(2*1)+FIFO_Ctrl] = (fifoIn->FIFOreg[(2*1)+FIFO_Ctrl] | FIFO_ReUse);
49
50 FftInput(TblSinB,fft0,delay);
51 FftOutput(Table,fft0);
52 FillFifo(fifoIn,2,Table);
53 fifoIn->FIFOreg[(2*2)+FIFO_Ctrl] = (fifoIn->FIFOreg[(2*2)+FIFO_Ctrl] | FIFO_ReUse);
54
55 FftInput(TblSin15K,fft0,delay);
56 FftOutput(Table,fft0);
57 FillFifo(fifoIn,3,Table);
58 fifoIn->FIFOreg[(2*3)+FIFO_Ctrl] = (fifoIn->FIFOreg[(2*3)+FIFO_Ctrl] | FIFO_ReUse);
59
60 FftInput(TblSin19K,fft0,delay);
61 FftOutput(Table,fft0);
62 FillFifo(fifoIn,4,Table);
63 fifoIn->FIFOreg[(2*4)+FIFO_Ctrl] = (fifoIn->FIFOreg[(2*4)+FIFO_Ctrl] | FIFO_ReUse);
64 printf("ok");
65 while(1){
66
67 while((fifoOut->FIFOreg[(2*0)+FIFO_Ctrl] & FIFO_Empty) == FIFO_Empty); // TANT QUE empty a 1 RIEN
68
69 data1 = fifoOut->FIFOreg[(2*0)+FIFO_RWdata];
70 data2 = fifoOut->FIFOreg[(2*0)+FIFO_RWdata];
71
72 sprintf(temp,"%d\t%d\n\r",data1,data2);
73 uartputs(uart0,temp);
74 }
75 printf("\nFin Main\n\n");
76 return 0;
77 }
78
79
80
@@ -21,7 +21,7 include ../../rules.mk
21 LIBDIR = ../../lib
21 LIBDIR = ../../lib
22 INCPATH = ../../includes
22 INCPATH = ../../includes
23 SCRIPTDIR=../../scripts/
23 SCRIPTDIR=../../scripts/
24 LIBS=-lapb_fft_Driver -llpp_apb_functions -lapb_uart_Driver
24 LIBS=-lapb_fft_Driver -llpp_apb_functions -lapb_uart_Driver -lapb_delay_Driver
25 INPUTFILE=main.c
25 INPUTFILE=main.c
26 EXEC=BenchFFT.bin
26 EXEC=BenchFFT.bin
27 OUTBINDIR=bin/
27 OUTBINDIR=bin/
@@ -2,6 +2,7
2 #include "lpp_apb_functions.h"
2 #include "lpp_apb_functions.h"
3 #include "apb_uart_Driver.h"
3 #include "apb_uart_Driver.h"
4 #include "apb_fft_Driver.h"
4 #include "apb_fft_Driver.h"
5 #include "apb_delay_Driver.h"
5
6
6
7
7 int main()
8 int main()
@@ -16,6 +17,7 int main()
16 printf("Debut Main\n\n");
17 printf("Debut Main\n\n");
17 UART_Device* uart0 = openUART(0);
18 UART_Device* uart0 = openUART(0);
18 FFT_Device* fft0 = openFFT(0);
19 FFT_Device* fft0 = openFFT(0);
20 DELAY_Device* delay = openDELAY(0);
19
21
20 printf("addr_fft: %x\n",(unsigned int)fft0);
22 printf("addr_fft: %x\n",(unsigned int)fft0);
21 printf("addr_uart: %x\n\n",(unsigned int)uart0);
23 printf("addr_uart: %x\n\n",(unsigned int)uart0);
@@ -24,7 +26,7 int main()
24
26
25 while(1)
27 while(1)
26 {
28 {
27 FftInput(Tablo,fft0);
29 FftInput(Tablo,fft0,delay);
28 /* for (i = 0 ; i < 256 ; i++)
30 /* for (i = 0 ; i < 256 ; i++)
29 {
31 {
30 sprintf(temp,"%x/in",Tablo[i]);
32 sprintf(temp,"%x/in",Tablo[i]);
@@ -26,4 +26,5 all:
26 make all -C BenchUART
26 make all -C BenchUART
27 make all -C BenchFFT
27 make all -C BenchFFT
28 make all -C BenchGPIO
28 make all -C BenchGPIO
29 make all -C BenchMatrix No newline at end of file
29 make all -C BenchMatrix
30 make all -C BenchFFT+Matrix No newline at end of file
@@ -21,6 +21,7
21 -----------------------------------------------------------------------------*/
21 -----------------------------------------------------------------------------*/
22 #ifndef APB_FFT_DRIVER_H
22 #ifndef APB_FFT_DRIVER_H
23 #define APB_FFT_DRIVER_H
23 #define APB_FFT_DRIVER_H
24 #include "apb_delay_Driver.h"
24
25
25 /*! \file apb_fft_Driver.h
26 /*! \file apb_fft_Driver.h
26 \brief LPP FFT driver.
27 \brief LPP FFT driver.
@@ -31,8 +32,9
31 \author Martin Morlot martin.morlot@lpp.polytechnique.fr
32 \author Martin Morlot martin.morlot@lpp.polytechnique.fr
32 */
33 */
33
34
34 #define FFT_Empty 0x00100 /**< Used to know when the data can be send to the FFT module */
35 #define FFT_Fill 0x00000001
35 #define FFT_Full 0x01000 /**< Used to know when the data can be send to the FFT module */
36 #define FFT_Ready 0x00000010
37 #define Mask 0x0000FFFF
36
38
37
39
38 /*===================================================
40 /*===================================================
@@ -43,19 +45,11
43 */
45 */
44 struct FFT_Driver
46 struct FFT_Driver
45 {
47 {
46 int RWDataReg; /**< \brief Data register Write/Read */
48 int ConfigReg;
47 int ReadAddrReg; /**< \brief Address register for the reading operation */
49 int RWDataReg;
48 int ConfigReg; /**< \brief Configuration register composed of Read enable Flag [HEX 0]
49 Write enable Flag [HEX 1]
50 Empty Flag [HEX 2]
51 Full Flag [HEX 3]
52 Dummy "C" [HEX 4/5/6/7] */
53 int Dummy1; /**< \brief Unused register, aesthetic interest */
54 int Dummy0; /**< \brief Unused register, aesthetic interest */
55 int WriteAddrReg; /**< \brief Address register for the writing operation */
56 };
50 };
57
51
58 typedef volatile struct FFT_Driver FFT_Device;
52 typedef struct FFT_Driver FFT_Device;
59
53
60
54
61 /*===================================================
55 /*===================================================
@@ -71,27 +65,8 typedef volatile struct FFT_Driver FFT_D
71 \return The pointer to the device.
65 \return The pointer to the device.
72 */
66 */
73 FFT_Device* openFFT(int count);
67 FFT_Device* openFFT(int count);
74
68 int FftInput(int Tbl[],FFT_Device*,DELAY_Device*);
75 /*! \fn int FftInput(int Tbl[],FFT_Device*);
69 int FftOutput(int Tbl[],FFT_Device*);
76 \brief Fill in the Input for the FFT
77
78 This function provides the data used by the FFT
79
80 \param Tbl[] The Table which contains the Data.
81 \param dev The FFT pointer.
82 */
83 int FftInput(int Tbl[],FFT_Device* dev);
84
85 /*! \fn int FftOutput(int Tbl[],FFT_Device*);
86 \brief Save data from the FFT
87
88 This function save the data generated by the FFT
89
90 \param Tbl[] The Table which will contains the Data.
91 \param dev The FFT pointer.
92 */
93 int FftOutput(int Tbl[],FFT_Device* dev);
94
95
70
96
71
97 #endif
72 #endif
@@ -22,6 +22,7
22 #include "apb_fft_Driver.h"
22 #include "apb_fft_Driver.h"
23 #include "lpp_apb_functions.h"
23 #include "lpp_apb_functions.h"
24 #include <stdio.h>
24 #include <stdio.h>
25 #include "apb_delay_Driver.h"
25
26
26
27
27 FFT_Device* openFFT(int count)
28 FFT_Device* openFFT(int count)
@@ -32,51 +33,35 FFT_Device* openFFT(int count)
32 }
33 }
33
34
34
35
35 int FftInput(int * Tbl,FFT_Device* fft)
36 int FftInput(int * Tbl,FFT_Device* fft,DELAY_Device* delay)
36 {
37 {
37 int i;
38 int i=0;
38 printf("\nFftInput\n\n");
39
39
40 while((fft->ConfigReg & FFT_Full) != FFT_Full) // full a 0
40 while((fft->ConfigReg & FFT_Fill) == FFT_Fill) // fill a 1
41 {
42 printf("\nWrite\n\n");
43 for (i = 0 ; i < 256 ; i++)
44 {
41 {
45 fft->RWDataReg = Tbl[i];
42 fft->RWDataReg = Tbl[i];
46 if((fft->ConfigReg & FFT_Full) == FFT_Full) // full a 1
43 i++;
47 {
44 Delay_us(delay,1);
48 printf("\nBreak\n\n");
49 break;
50 }
51 }
52 }
45 }
53
46
54 printf("\nFULL\n\n");
55 return 0;
47 return 0;
56 }
48 }
57
49
58
50
59 int FftOutput(int * Tbl, FFT_Device* fft)
51 int FftOutput(int * Tbl, FFT_Device* fft)
60 {
52 {
61 int i;
53 int i=0;
62 printf("\nFftOutput\n\n");
54 int data;
63
55
64 while((fft->ConfigReg & FFT_Empty) != FFT_Empty) // empty a 0
56 while((fft->ConfigReg & FFT_Ready) == FFT_Ready) // ready a 1
65 {
66 printf("\nRead\n\n");
67 for (i = 0 ; i < 256 ; i++)
68 {
57 {
69 //printf("\noutFor%d\n\n",i);
58 data = fft->RWDataReg;
70 Tbl[i] = fft->RWDataReg;
59 Tbl[i] = (data >> 16) & Mask;
71 if((fft->ConfigReg & FFT_Empty) == FFT_Empty) // empty a 1
60 Tbl[i+1] = data & Mask;
72 {
61 i = i+2;
73 printf("\nBreak\n\n");
74 break;
75 }
62 }
76 }
63
77 }
64 return i;
78 printf("\nEMPTY\n\n");
79 return 0;
80 }
65 }
81
66
82
67
@@ -21,6 +21,7
21 -----------------------------------------------------------------------------*/
21 -----------------------------------------------------------------------------*/
22 #ifndef APB_FFT_DRIVER_H
22 #ifndef APB_FFT_DRIVER_H
23 #define APB_FFT_DRIVER_H
23 #define APB_FFT_DRIVER_H
24 #include "apb_delay_Driver.h"
24
25
25 /*! \file apb_fft_Driver.h
26 /*! \file apb_fft_Driver.h
26 \brief LPP FFT driver.
27 \brief LPP FFT driver.
@@ -31,8 +32,9
31 \author Martin Morlot martin.morlot@lpp.polytechnique.fr
32 \author Martin Morlot martin.morlot@lpp.polytechnique.fr
32 */
33 */
33
34
34 #define FFT_Empty 0x00100 /**< Used to know when the data can be send to the FFT module */
35 #define FFT_Fill 0x00000001
35 #define FFT_Full 0x01000 /**< Used to know when the data can be send to the FFT module */
36 #define FFT_Ready 0x00000010
37 #define Mask 0x0000FFFF
36
38
37
39
38 /*===================================================
40 /*===================================================
@@ -43,19 +45,11
43 */
45 */
44 struct FFT_Driver
46 struct FFT_Driver
45 {
47 {
46 int RWDataReg; /**< \brief Data register Write/Read */
48 int ConfigReg;
47 int ReadAddrReg; /**< \brief Address register for the reading operation */
49 int RWDataReg;
48 int ConfigReg; /**< \brief Configuration register composed of Read enable Flag [HEX 0]
49 Write enable Flag [HEX 1]
50 Empty Flag [HEX 2]
51 Full Flag [HEX 3]
52 Dummy "C" [HEX 4/5/6/7] */
53 int Dummy1; /**< \brief Unused register, aesthetic interest */
54 int Dummy0; /**< \brief Unused register, aesthetic interest */
55 int WriteAddrReg; /**< \brief Address register for the writing operation */
56 };
50 };
57
51
58 typedef volatile struct FFT_Driver FFT_Device;
52 typedef struct FFT_Driver FFT_Device;
59
53
60
54
61 /*===================================================
55 /*===================================================
@@ -71,27 +65,8 typedef volatile struct FFT_Driver FFT_D
71 \return The pointer to the device.
65 \return The pointer to the device.
72 */
66 */
73 FFT_Device* openFFT(int count);
67 FFT_Device* openFFT(int count);
74
68 int FftInput(int Tbl[],FFT_Device*,DELAY_Device*);
75 /*! \fn int FftInput(int Tbl[],FFT_Device*);
69 int FftOutput(int Tbl[],FFT_Device*);
76 \brief Fill in the Input for the FFT
77
78 This function provides the data used by the FFT
79
80 \param Tbl[] The Table which contains the Data.
81 \param dev The FFT pointer.
82 */
83 int FftInput(int Tbl[],FFT_Device* dev);
84
85 /*! \fn int FftOutput(int Tbl[],FFT_Device*);
86 \brief Save data from the FFT
87
88 This function save the data generated by the FFT
89
90 \param Tbl[] The Table which will contains the Data.
91 \param dev The FFT pointer.
92 */
93 int FftOutput(int Tbl[],FFT_Device* dev);
94
95
70
96
71
97 #endif
72 #endif
@@ -29,7 +29,6 library lpp;
29 use lpp.lpp_amba.all;
29 use lpp.lpp_amba.all;
30 use lpp.apb_devices_list.all;
30 use lpp.apb_devices_list.all;
31 use lpp.lpp_fft.all;
31 use lpp.lpp_fft.all;
32 use lpp.lpp_memory.all;
33 use work.fft_components.all;
32 use work.fft_components.all;
34
33
35 --! Driver APB, va faire le lien entre l'IP VHDL de la FFT et le bus Amba
34 --! Driver APB, va faire le lien entre l'IP VHDL de la FFT et le bus Amba
@@ -41,12 +40,13 entity APB_FFT is
41 pmask : integer := 16#fff#;
40 pmask : integer := 16#fff#;
42 pirq : integer := 0;
41 pirq : integer := 0;
43 abits : integer := 8;
42 abits : integer := 8;
44 Data_sz : integer := 32;
43 Data_sz : integer := 16
45 Addr_sz : integer := 8;
44 );
46 addr_max_int : integer := 256);
47 port (
45 port (
48 clk : in std_logic; --! Horloge du composant
46 clk : in std_logic; --! Horloge du composant
49 rst : in std_logic; --! Reset general du composant
47 rst : in std_logic; --! Reset general du composant
48 eload : out std_logic;
49 eready :out std_logic;
50 apbi : in apb_slv_in_type; --! Registre de gestion des entr�es du bus
50 apbi : in apb_slv_in_type; --! Registre de gestion des entr�es du bus
51 apbo : out apb_slv_out_type --! Registre de gestion des sorties du bus
51 apbo : out apb_slv_out_type --! Registre de gestion des sorties du bus
52 );
52 );
@@ -55,35 +55,48 end APB_FFT;
55
55
56 architecture ar_APB_FFT of APB_FFT is
56 architecture ar_APB_FFT of APB_FFT is
57
57
58 signal ReadEnable : std_logic;
58 constant REVISION : integer := 1;
59 signal WriteEnable : std_logic;
59
60 signal FlagEmpty : std_logic;
60 constant pconfig : apb_config_type := (
61 signal FlagFull : std_logic;
61 0 => ahb_device_reg (VENDOR_LPP, LPP_FFT, 0, REVISION, 0),
62 signal DataIn_re : std_logic_vector(gWSIZE-1 downto 0);
62 1 => apb_iobar(paddr, pmask));
63 signal DataOut_re : std_logic_vector(gWSIZE-1 downto 0);
64 signal DataIn_im : std_logic_vector(gWSIZE-1 downto 0);
65 signal DataOut_im : std_logic_vector(gWSIZE-1 downto 0);
66 signal DataIn : std_logic_vector(Data_sz-1 downto 0);
67 signal DataOut : std_logic_vector(Data_sz-1 downto 0);
68 signal AddrIn : std_logic_vector(Addr_sz-1 downto 0);
69 signal AddrOut : std_logic_vector(Addr_sz-1 downto 0);
70
63
71 signal start : std_logic;
64 signal Ren : std_logic;
65 signal Wen : std_logic;
72 signal load : std_logic;
66 signal load : std_logic;
73 signal rdy : std_logic;
67 signal d_valid : std_logic;
68 signal y_rdy : std_logic;
69 signal read_y : std_logic;
70 signal fill : std_logic;
71 signal ready : std_logic;
72 signal start : std_logic;
73 signal DataIn_re : std_logic_vector(Data_sz-1 downto 0);
74 signal DataIn_im : std_logic_vector(Data_sz-1 downto 0);
75 signal DataOut_re : std_logic_vector(Data_sz-1 downto 0);
76 signal DataOut_im : std_logic_vector(Data_sz-1 downto 0);
77
78 type FFT_ctrlr_Reg is record
79 FFT_Cfg : std_logic_vector(1 downto 0);
80 FFT_Rdata : std_logic_vector((2*Data_sz)-1 downto 0);
81 FFT_Wdata : std_logic_vector((2*Data_sz)-1 downto 0);
82 end record;
83
84 signal Rec : FFT_ctrlr_Reg;
85 signal Rdata : std_logic_vector(31 downto 0);
74
86
75 begin
87 begin
76
88
77 APB : ApbDriver
89 Rec.FFT_Cfg(0) <= fill;
78 generic map(pindex,paddr,pmask,pirq,abits,LPP_FFT,Data_sz,Addr_sz,addr_max_int)
90 Rec.FFT_Cfg(1) <= ready;
79 port map(clk,rst,ReadEnable,WriteEnable,FlagEmpty,FlagFull,DataIn,DataOut,AddrIn,AddrOut,apbi,apbo);
91 eload <= fill;
80
92 eready <= ready;
81
93
82 Extremum : Flag_Extremum
94 DataIn_im <= Rec.FFT_Wdata(Data_sz-1 downto 0);
83 port map(clk,rst,load,rdy,FlagFull,FlagEmpty);
95 DataIn_re <= Rec.FFT_Wdata((2*Data_sz)-1 downto Data_sz);
96 Rec.FFT_Rdata(Data_sz-1 downto 0) <= DataOut_im;
97 Rec.FFT_Rdata((2*Data_sz)-1 downto Data_sz) <= DataOut_re;
84
98
85
99 Actel_FFT : CoreFFT
86 DEVICE : CoreFFT
87 generic map(
100 generic map(
88 LOGPTS => gLOGPTS,
101 LOGPTS => gLOGPTS,
89 LOGLOGPTS => gLOGLOGPTS,
102 LOGLOGPTS => gLOGLOGPTS,
@@ -96,12 +109,61 begin
96 PTS => gPTS,
109 PTS => gPTS,
97 HALFPTS => gHALFPTS,
110 HALFPTS => gHALFPTS,
98 inBuf_RWDLY => gInBuf_RWDLY)
111 inBuf_RWDLY => gInBuf_RWDLY)
99 port map(clk,start,rst,WriteEnable,ReadEnable,DataIn_im,DataIn_re,load,open,DataOut_im,DataOut_re,open,rdy);
112 port map(clk,start,rst,d_valid,read_y,DataIn_im,DataIn_re,load,open,DataOut_im,DataOut_re,open,y_rdy);
113
114 Flags : Flag_Extremum
115 port map(clk,rst,load,y_rdy,fill,ready);
116
117 process(rst,clk)
118 begin
119 if(rst='0')then
120 Rec.FFT_Wdata <= (others => '0');
121 Wen <= '1';
122 Ren <= '1';
123
124 elsif(clk'event and clk='1')then
125
126 --APB Write OP
127 if (apbi.psel(pindex) and apbi.penable and apbi.pwrite) = '1' then
128 case apbi.paddr(abits-1 downto 2) is
129 when "000001" =>
130 Wen <= '0';
131 Rec.FFT_Wdata(Data_sz-1 downto 0) <= (others => '0');
132 Rec.FFT_Wdata((2*Data_sz)-1 downto Data_sz) <= apbi.pwdata(Data_sz-1 downto 0);
100
133
134 when others =>
135 null;
136 end case;
137 else
138 Wen <= '1';
139 end if;
140
141 --APB Read OP
142 if (apbi.psel(pindex) and (not apbi.pwrite)) = '1' then
143 case apbi.paddr(abits-1 downto 2) is
144 when "000000" =>
145 Rdata(3 downto 0) <= "000" & Rec.FFT_Cfg(0);
146 Rdata(7 downto 4) <= "000" & Rec.FFT_Cfg(1);
147 Rdata(31 downto 8) <= (others => '0');
148
149 when "000001" =>
150 Ren <= '0';
151 Rdata(31 downto 0) <= Rec.FFT_Rdata((2*Data_sz)-1 downto 0);
152
153 when others =>
154 Rdata <= (others => '0');
155 end case;
156 else
157 Ren <= '1';
158 end if;
159
160 end if;
161 apbo.pconfig <= pconfig;
162 end process;
163
164 apbo.prdata <= Rdata when apbi.penable = '1';
165 d_valid <= not Wen;
166 read_y <= not Ren;
101 start <= not rst;
167 start <= not rst;
102
168
103 DataIn_re <= DataIn(31 downto 16);
104 DataIn_im <= DataIn(15 downto 0);
105 DataOut <= DataOut_re & DataOut_im;
106
107 end ar_APB_FFT; No newline at end of file
169 end ar_APB_FFT;
@@ -31,8 +31,8 entity Flag_Extremum is
31 clk,raz : in std_logic; --! Horloge et Reset g�n�ral du composant
31 clk,raz : in std_logic; --! Horloge et Reset g�n�ral du composant
32 load : in std_logic; --! Signal en provenance de CoreFFT
32 load : in std_logic; --! Signal en provenance de CoreFFT
33 y_rdy : in std_logic; --! Signal en provenance de CoreFFT
33 y_rdy : in std_logic; --! Signal en provenance de CoreFFT
34 full : out std_logic; --! Flag, Va permettre d'autoriser l'�criture (Driver C)
34 fill : out std_logic; --! Flag, Va permettre d'autoriser l'�criture (Driver C)
35 empty : out std_logic --! Flag, Va permettre d'autoriser la lecture (Driver C)
35 ready : out std_logic --! Flag, Va permettre d'autoriser la lecture (Driver C)
36 );
36 );
37 end Flag_Extremum;
37 end Flag_Extremum;
38
38
@@ -44,22 +44,22 begin
44 process (clk,raz)
44 process (clk,raz)
45 begin
45 begin
46 if(raz='0')then
46 if(raz='0')then
47 full <= '1';
47 fill <= '0';
48 empty <= '1';
48 ready <= '0';
49
49
50 elsif(clk' event and clk='1')then
50 elsif(clk' event and clk='1')then
51
51
52 if(load='1' and y_rdy='0')then
52 if(load='1' and y_rdy='0')then
53 full <= '0';
53 fill <= '1';
54 empty <= '1';
54 ready <= '0';
55
55
56 elsif(y_rdy='1')then
56 elsif(y_rdy='1')then
57 full <= '1';
57 fill <= '0';
58 empty <= '0';
58 ready <= '1';
59
59
60 else
60 else
61 full <= '1';
61 fill <= '0';
62 empty <= '1';
62 ready <= '0';
63
63
64 end if;
64 end if;
65 end if;
65 end if;
@@ -45,20 +45,21 component APB_FFT is
45 addr_max_int : integer := 256);
45 addr_max_int : integer := 256);
46 port (
46 port (
47 clk : in std_logic;
47 clk : in std_logic;
48 rst : in std_logic;
48 rst : in std_logic; --! Reset general du composant
49 eload : out std_logic;
50 eready :out std_logic;
49 apbi : in apb_slv_in_type;
51 apbi : in apb_slv_in_type;
50 apbo : out apb_slv_out_type
52 apbo : out apb_slv_out_type
51 );
53 );
52 end component;
54 end component;
53
55
54
55 component Flag_Extremum is
56 component Flag_Extremum is
56 port(
57 port(
57 clk,raz : in std_logic;
58 clk,raz : in std_logic; --! Horloge et Reset g�n�ral du composant
58 load : in std_logic;
59 load : in std_logic; --! Signal en provenance de CoreFFT
59 y_rdy : in std_logic;
60 y_rdy : in std_logic; --! Signal en provenance de CoreFFT
60 full : out std_logic;
61 fill : out std_logic; --! Flag, Va permettre d'autoriser l'�criture (Driver C)
61 empty : out std_logic
62 ready : out std_logic --! Flag, Va permettre d'autoriser la lecture (Driver C)
62 );
63 );
63 end component;
64 end component;
64
65
General Comments 0
You need to be logged in to leave comments. Login now