##// 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
@@ -1,44 +1,44
1 1 #------------------------------------------------------------------------------
2 2 #-- This file is a part of the LPP VHDL IP LIBRARY
3 3 #-- Copyright (C) 2010, Laboratory of Plasmas Physic - CNRS
4 4 #--
5 5 #-- This program is free software; you can redistribute it and/or modify
6 6 #-- it under the terms of the GNU General Public License as published by
7 7 #-- the Free Software Foundation; either version 3 of the License, or
8 8 #-- (at your option) any later version.
9 9 #--
10 10 #-- This program is distributed in the hope that it will be useful,
11 11 #-- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 #-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 13 #-- GNU General Public License for more details.
14 14 #--
15 15 #-- You should have received a copy of the GNU General Public License
16 16 #-- along with this program; if not, write to the Free Software
17 17 #-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 #------------------------------------------------------------------------------
19 19
20 20 include ../../rules.mk
21 21 LIBDIR = ../../lib
22 22 INCPATH = ../../includes
23 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 25 INPUTFILE=main.c
26 26 EXEC=BenchFFT.bin
27 27 OUTBINDIR=bin/
28 28
29 29
30 30 .PHONY:bin
31 31
32 32 all:bin
33 33 @echo $(EXEC)" file created"
34 34
35 35 clean:
36 36 rm -f *.{o,a}
37 37
38 38
39 39
40 40 help:ruleshelp
41 41 @echo " all : makes an executable file called "$(EXEC)
42 42 @echo " in "$(OUTBINDIR)
43 43 @echo " clean : removes temporary files"
44 44
@@ -1,43 +1,45
1 1 #include <stdio.h>
2 2 #include "lpp_apb_functions.h"
3 3 #include "apb_uart_Driver.h"
4 4 #include "apb_fft_Driver.h"
5 #include "apb_delay_Driver.h"
5 6
6 7
7 8 int main()
8 9 {
9 10 char temp[256];
10 11 int i;
11 12 int Table[256];
12 13 //Somme de 2 sinus//
13 14 //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};
14 15 //1 Sinus//
15 16 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};
16 17 printf("Debut Main\n\n");
17 18 UART_Device* uart0 = openUART(0);
18 19 FFT_Device* fft0 = openFFT(0);
20 DELAY_Device* delay = openDELAY(0);
19 21
20 22 printf("addr_fft: %x\n",(unsigned int)fft0);
21 23 printf("addr_uart: %x\n\n",(unsigned int)uart0);
22 24 printf("cfg_fft: %x\n",fft0->ConfigReg);
23 25 printf("cfg_uart: %x\n\n",uart0->ConfigReg);
24 26
25 27 while(1)
26 28 {
27 FftInput(Tablo,fft0);
29 FftInput(Tablo,fft0,delay);
28 30 /* for (i = 0 ; i < 256 ; i++)
29 31 {
30 32 sprintf(temp,"%x/in",Tablo[i]);
31 33 uartputs(uart0,temp);
32 34 }*/
33 35
34 36 FftOutput(Table,fft0);
35 37 for (i = 0 ; i < 128 ; i++)
36 38 {
37 39 sprintf(temp,"%x/out",Table[i]);
38 40 uartputs(uart0,temp);
39 41 }
40 42 }
41 43 return 0;
42 44 }
43 45
@@ -1,29 +1,30
1 1 #------------------------------------------------------------------------------
2 2 #-- This file is a part of the LPP VHDL IP LIBRARY
3 3 #-- Copyright (C) 2010, Laboratory of Plasmas Physic - CNRS
4 4 #--
5 5 #-- This program is free software; you can redistribute it and/or modify
6 6 #-- it under the terms of the GNU General Public License as published by
7 7 #-- the Free Software Foundation; either version 3 of the License, or
8 8 #-- (at your option) any later version.
9 9 #--
10 10 #-- This program is distributed in the hope that it will be useful,
11 11 #-- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 #-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 13 #-- GNU General Public License for more details.
14 14 #--
15 15 #-- You should have received a copy of the GNU General Public License
16 16 #-- along with this program; if not, write to the Free Software
17 17 #-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 #------------------------------------------------------------------------------
19 19
20 20
21 21
22 22 all:
23 23 make all -C ScanAPB
24 24 make all -C APB_lcd_ctrlr
25 25 make all -C BenchFIFO
26 26 make all -C BenchUART
27 27 make all -C BenchFFT
28 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
@@ -1,97 +1,72
1 1 /*------------------------------------------------------------------------------
2 2 -- This file is a part of the LPP VHDL IP LIBRARY
3 3 -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS
4 4 --
5 5 -- This program is free software; you can redistribute it and/or modify
6 6 -- it under the terms of the GNU General Public License as published by
7 7 -- the Free Software Foundation; either version 3 of the License, or
8 8 -- (at your option) any later version.
9 9 --
10 10 -- This program is distributed in the hope that it will be useful,
11 11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 13 -- GNU General Public License for more details.
14 14 --
15 15 -- You should have received a copy of the GNU General Public License
16 16 -- along with this program; if not, write to the Free Software
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Martin Morlot
20 20 -- Mail : martin.morlot@lpp.polytechnique.fr
21 21 -----------------------------------------------------------------------------*/
22 22 #ifndef APB_FFT_DRIVER_H
23 23 #define APB_FFT_DRIVER_H
24 #include "apb_delay_Driver.h"
24 25
25 26 /*! \file apb_fft_Driver.h
26 27 \brief LPP FFT driver.
27 28
28 29 This library is written to work with LPP_APB_FFT VHDL module from LPP's FreeVHDLIB. It calculate a fast fourier transforms,
29 30 from an input data table.
30 31
31 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_Full 0x01000 /**< Used to know when the data can be send to the FFT module */
35 #define FFT_Fill 0x00000001
36 #define FFT_Ready 0x00000010
37 #define Mask 0x0000FFFF
36 38
37 39
38 40 /*===================================================
39 41 T Y P E S D E F
40 42 ====================================================*/
41 43 /*! \struct FFT_Driver
42 44 \brief Sturcture representing the fft registers
43 45 */
44 46 struct FFT_Driver
45 47 {
46 int RWDataReg; /**< \brief Data register Write/Read */
47 int ReadAddrReg; /**< \brief Address register for the reading operation */
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 */
48 int ConfigReg;
49 int RWDataReg;
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 /*===================================================
62 56 F U N C T I O N S
63 57 ====================================================*/
64 58 /*! \fn FFT_Device* openFFT(int count);
65 59 \brief Return count FFT.
66 60
67 61 This Function scans APB devices table and returns count FFT.
68 62
69 63 \param count The number of the FFT you whant to get. For example if you have 3 FFTS on your SOC you want
70 64 to use FFT1 so count = 1.
71 65 \return The pointer to the device.
72 66 */
73 67 FFT_Device* openFFT(int count);
74
75 /*! \fn int FftInput(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
68 int FftInput(int Tbl[],FFT_Device*,DELAY_Device*);
69 int FftOutput(int Tbl[],FFT_Device*);
95 70
96 71
97 72 #endif
@@ -1,90 +1,75
1 1 /*------------------------------------------------------------------------------
2 2 -- This file is a part of the LPP VHDL IP LIBRARY
3 3 -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS
4 4 --
5 5 -- This program is free software; you can redistribute it and/or modify
6 6 -- it under the terms of the GNU General Public License as published by
7 7 -- the Free Software Foundation; either version 3 of the License, or
8 8 -- (at your option) any later version.
9 9 --
10 10 -- This program is distributed in the hope that it will be useful,
11 11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 13 -- GNU General Public License for more details.
14 14 --
15 15 -- You should have received a copy of the GNU General Public License
16 16 -- along with this program; if not, write to the Free Software
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Martin Morlot
20 20 -- Mail : martin.morlot@lpp.polytechnique.fr
21 21 -----------------------------------------------------------------------------*/
22 22 #include "apb_fft_Driver.h"
23 23 #include "lpp_apb_functions.h"
24 24 #include <stdio.h>
25 #include "apb_delay_Driver.h"
25 26
26 27
27 28 FFT_Device* openFFT(int count)
28 29 {
29 30 FFT_Device* FFT0;
30 31 FFT0 = (FFT_Device*) apbgetdevice(LPP_FFT,VENDOR_LPP,count);
31 32 return FFT0;
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 printf("\nFftInput\n\n");
38 int i=0;
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 41 {
42 printf("\nWrite\n\n");
43 for (i = 0 ; i < 256 ; i++)
44 {
45 fft->RWDataReg = Tbl[i];
46 if((fft->ConfigReg & FFT_Full) == FFT_Full) // full a 1
47 {
48 printf("\nBreak\n\n");
49 break;
50 }
51 }
42 fft->RWDataReg = Tbl[i];
43 i++;
44 Delay_us(delay,1);
52 45 }
53
54 printf("\nFULL\n\n");
46
55 47 return 0;
56 48 }
57 49
58 50
59 51 int FftOutput(int * Tbl, FFT_Device* fft)
60 52 {
61 int i;
62 printf("\nFftOutput\n\n");
53 int i=0;
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 57 {
66 printf("\nRead\n\n");
67 for (i = 0 ; i < 256 ; i++)
68 {
69 //printf("\noutFor%d\n\n",i);
70 Tbl[i] = fft->RWDataReg;
71 if((fft->ConfigReg & FFT_Empty) == FFT_Empty) // empty a 1
72 {
73 printf("\nBreak\n\n");
74 break;
75 }
76 }
58 data = fft->RWDataReg;
59 Tbl[i] = (data >> 16) & Mask;
60 Tbl[i+1] = data & Mask;
61 i = i+2;
77 62 }
78 printf("\nEMPTY\n\n");
79 return 0;
63
64 return i;
80 65 }
81 66
82 67
83 68
84 69
85 70
86 71
87 72
88 73
89 74
90 75
@@ -1,97 +1,72
1 1 /*------------------------------------------------------------------------------
2 2 -- This file is a part of the LPP VHDL IP LIBRARY
3 3 -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS
4 4 --
5 5 -- This program is free software; you can redistribute it and/or modify
6 6 -- it under the terms of the GNU General Public License as published by
7 7 -- the Free Software Foundation; either version 3 of the License, or
8 8 -- (at your option) any later version.
9 9 --
10 10 -- This program is distributed in the hope that it will be useful,
11 11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 13 -- GNU General Public License for more details.
14 14 --
15 15 -- You should have received a copy of the GNU General Public License
16 16 -- along with this program; if not, write to the Free Software
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------
19 19 -- Author : Martin Morlot
20 20 -- Mail : martin.morlot@lpp.polytechnique.fr
21 21 -----------------------------------------------------------------------------*/
22 22 #ifndef APB_FFT_DRIVER_H
23 23 #define APB_FFT_DRIVER_H
24 #include "apb_delay_Driver.h"
24 25
25 26 /*! \file apb_fft_Driver.h
26 27 \brief LPP FFT driver.
27 28
28 29 This library is written to work with LPP_APB_FFT VHDL module from LPP's FreeVHDLIB. It calculate a fast fourier transforms,
29 30 from an input data table.
30 31
31 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_Full 0x01000 /**< Used to know when the data can be send to the FFT module */
35 #define FFT_Fill 0x00000001
36 #define FFT_Ready 0x00000010
37 #define Mask 0x0000FFFF
36 38
37 39
38 40 /*===================================================
39 41 T Y P E S D E F
40 42 ====================================================*/
41 43 /*! \struct FFT_Driver
42 44 \brief Sturcture representing the fft registers
43 45 */
44 46 struct FFT_Driver
45 47 {
46 int RWDataReg; /**< \brief Data register Write/Read */
47 int ReadAddrReg; /**< \brief Address register for the reading operation */
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 */
48 int ConfigReg;
49 int RWDataReg;
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 /*===================================================
62 56 F U N C T I O N S
63 57 ====================================================*/
64 58 /*! \fn FFT_Device* openFFT(int count);
65 59 \brief Return count FFT.
66 60
67 61 This Function scans APB devices table and returns count FFT.
68 62
69 63 \param count The number of the FFT you whant to get. For example if you have 3 FFTS on your SOC you want
70 64 to use FFT1 so count = 1.
71 65 \return The pointer to the device.
72 66 */
73 67 FFT_Device* openFFT(int count);
74
75 /*! \fn int FftInput(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
68 int FftInput(int Tbl[],FFT_Device*,DELAY_Device*);
69 int FftOutput(int Tbl[],FFT_Device*);
95 70
96 71
97 72 #endif
@@ -1,107 +1,169
1 1 ------------------------------------------------------------------------------
2 2 -- This file is a part of the LPP VHDL IP LIBRARY
3 3 -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS
4 4 --
5 5 -- This program is free software; you can redistribute it and/or modify
6 6 -- it under the terms of the GNU General Public License as published by
7 7 -- the Free Software Foundation; either version 3 of the License, or
8 8 -- (at your option) any later version.
9 9 --
10 10 -- This program is distributed in the hope that it will be useful,
11 11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 13 -- GNU General Public License for more details.
14 14 --
15 15 -- You should have received a copy of the GNU General Public License
16 16 -- along with this program; if not, write to the Free Software
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 ------------------------------------------------------------------------------
19 19 -- Author : Martin Morlot
20 20 -- Mail : martin.morlot@lpp.polytechnique.fr
21 21 ------------------------------------------------------------------------------
22 22 library ieee;
23 23 use ieee.std_logic_1164.all;
24 24 library grlib;
25 25 use grlib.amba.all;
26 26 use grlib.stdlib.all;
27 27 use grlib.devices.all;
28 28 library lpp;
29 29 use lpp.lpp_amba.all;
30 30 use lpp.apb_devices_list.all;
31 31 use lpp.lpp_fft.all;
32 use lpp.lpp_memory.all;
33 32 use work.fft_components.all;
34 33
35 34 --! Driver APB, va faire le lien entre l'IP VHDL de la FFT et le bus Amba
36 35
37 36 entity APB_FFT is
38 37 generic (
39 38 pindex : integer := 0;
40 39 paddr : integer := 0;
41 40 pmask : integer := 16#fff#;
42 41 pirq : integer := 0;
43 42 abits : integer := 8;
44 Data_sz : integer := 32;
45 Addr_sz : integer := 8;
46 addr_max_int : integer := 256);
43 Data_sz : integer := 16
44 );
47 45 port (
48 46 clk : in std_logic; --! Horloge du composant
49 47 rst : in std_logic; --! Reset general du composant
48 eload : out std_logic;
49 eready :out std_logic;
50 50 apbi : in apb_slv_in_type; --! Registre de gestion des entrοΏ½es du bus
51 51 apbo : out apb_slv_out_type --! Registre de gestion des sorties du bus
52 52 );
53 53 end APB_FFT;
54 54
55 55
56 56 architecture ar_APB_FFT of APB_FFT is
57 57
58 signal ReadEnable : std_logic;
59 signal WriteEnable : std_logic;
60 signal FlagEmpty : std_logic;
61 signal FlagFull : std_logic;
62 signal DataIn_re : std_logic_vector(gWSIZE-1 downto 0);
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);
58 constant REVISION : integer := 1;
59
60 constant pconfig : apb_config_type := (
61 0 => ahb_device_reg (VENDOR_LPP, LPP_FFT, 0, REVISION, 0),
62 1 => apb_iobar(paddr, pmask));
70 63
71 signal start : std_logic;
72 signal load : std_logic;
73 signal rdy : std_logic;
64 signal Ren : std_logic;
65 signal Wen : std_logic;
66 signal load : 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);
74 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);
86
75 87 begin
76 88
77 APB : ApbDriver
78 generic map(pindex,paddr,pmask,pirq,abits,LPP_FFT,Data_sz,Addr_sz,addr_max_int)
79 port map(clk,rst,ReadEnable,WriteEnable,FlagEmpty,FlagFull,DataIn,DataOut,AddrIn,AddrOut,apbi,apbo);
80
89 Rec.FFT_Cfg(0) <= fill;
90 Rec.FFT_Cfg(1) <= ready;
91 eload <= fill;
92 eready <= ready;
81 93
82 Extremum : Flag_Extremum
83 port map(clk,rst,load,rdy,FlagFull,FlagEmpty);
84
85
86 DEVICE : CoreFFT
94 DataIn_im <= Rec.FFT_Wdata(Data_sz-1 downto 0);
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;
98
99 Actel_FFT : CoreFFT
87 100 generic map(
88 101 LOGPTS => gLOGPTS,
89 102 LOGLOGPTS => gLOGLOGPTS,
90 103 WSIZE => gWSIZE,
91 104 TWIDTH => gTWIDTH,
92 105 DWIDTH => gDWIDTH,
93 106 TDWIDTH => gTDWIDTH,
94 107 RND_MODE => gRND_MODE,
95 108 SCALE_MODE => gSCALE_MODE,
96 109 PTS => gPTS,
97 110 HALFPTS => gHALFPTS,
98 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);
100 116
101 start <= not rst;
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);
102 133
103 DataIn_re <= DataIn(31 downto 16);
104 DataIn_im <= DataIn(15 downto 0);
105 DataOut <= DataOut_re & DataOut_im;
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;
167 start <= not rst;
106 168
107 169 end ar_APB_FFT; No newline at end of file
@@ -1,72 +1,72
1 1 ------------------------------------------------------------------------------
2 2 -- This file is a part of the LPP VHDL IP LIBRARY
3 3 -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS
4 4 --
5 5 -- This program is free software; you can redistribute it and/or modify
6 6 -- it under the terms of the GNU General Public License as published by
7 7 -- the Free Software Foundation; either version 3 of the License, or
8 8 -- (at your option) any later version.
9 9 --
10 10 -- This program is distributed in the hope that it will be useful,
11 11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 13 -- GNU General Public License for more details.
14 14 --
15 15 -- You should have received a copy of the GNU General Public License
16 16 -- along with this program; if not, write to the Free Software
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 ------------------------------------------------------------------------------
19 19 -- Author : Martin Morlot
20 20 -- Mail : martin.morlot@lpp.polytechnique.fr
21 21 ------------------------------------------------------------------------------
22 22 library IEEE;
23 23 use IEEE.std_logic_1164.all;
24 24 use IEEE.numeric_std.all;
25 25 use work.FFT_config.all;
26 26
27 27 --! Programme qui va permettre de gοΏ½nοΏ½rer des flags utilisοΏ½s au niveau du driver C
28 28
29 29 entity Flag_Extremum is
30 30 port(
31 31 clk,raz : in std_logic; --! Horloge et Reset gοΏ½nοΏ½ral du composant
32 32 load : in std_logic; --! Signal en provenance de CoreFFT
33 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)
35 empty : out std_logic --! Flag, Va permettre d'autoriser la lecture (Driver C)
34 fill : out std_logic; --! Flag, Va permettre d'autoriser l'οΏ½criture (Driver C)
35 ready : out std_logic --! Flag, Va permettre d'autoriser la lecture (Driver C)
36 36 );
37 37 end Flag_Extremum;
38 38
39 39 --! @details Flags gοΏ½nοΏ½rοΏ½s a partir de signaux fourni par l'IP FFT d'actel
40 40
41 41 architecture ar_Flag_Extremum of Flag_Extremum is
42 42
43 43 begin
44 44 process (clk,raz)
45 45 begin
46 46 if(raz='0')then
47 full <= '1';
48 empty <= '1';
47 fill <= '0';
48 ready <= '0';
49 49
50 50 elsif(clk' event and clk='1')then
51 51
52 52 if(load='1' and y_rdy='0')then
53 full <= '0';
54 empty <= '1';
53 fill <= '1';
54 ready <= '0';
55 55
56 56 elsif(y_rdy='1')then
57 full <= '1';
58 empty <= '0';
57 fill <= '0';
58 ready <= '1';
59 59
60 60 else
61 full <= '1';
62 empty <= '1';
61 fill <= '0';
62 ready <= '0';
63 63
64 64 end if;
65 65 end if;
66 66 end process;
67 67
68 68 end ar_Flag_Extremum;
69 69
70 70
71 71
72 72
@@ -1,143 +1,144
1 1 ------------------------------------------------------------------------------
2 2 -- This file is a part of the LPP VHDL IP LIBRARY
3 3 -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS
4 4 --
5 5 -- This program is free software; you can redistribute it and/or modify
6 6 -- it under the terms of the GNU General Public License as published by
7 7 -- the Free Software Foundation; either version 3 of the License, or
8 8 -- (at your option) any later version.
9 9 --
10 10 -- This program is distributed in the hope that it will be useful,
11 11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 13 -- GNU General Public License for more details.
14 14 --
15 15 -- You should have received a copy of the GNU General Public License
16 16 -- along with this program; if not, write to the Free Software
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 ------------------------------------------------------------------------------
19 19 -- Author : Martin Morlot
20 20 -- Mail : martin.morlot@lpp.polytechnique.fr
21 21 ------------------------------------------------------------------------------
22 22 library ieee;
23 23 use ieee.std_logic_1164.all;
24 24 library grlib;
25 25 use grlib.amba.all;
26 26 use std.textio.all;
27 27 library lpp;
28 28 use lpp.lpp_amba.all;
29 29 use lpp.lpp_memory.all;
30 30 use work.fft_components.all;
31 31
32 32 --! Package contenant tous les programmes qui forment le composant intοΏ½grοΏ½ dans le lοΏ½on
33 33
34 34 package lpp_fft is
35 35
36 36 component APB_FFT is
37 37 generic (
38 38 pindex : integer := 0;
39 39 paddr : integer := 0;
40 40 pmask : integer := 16#fff#;
41 41 pirq : integer := 0;
42 42 abits : integer := 8;
43 43 Data_sz : integer := 32;
44 44 Addr_sz : integer := 8;
45 45 addr_max_int : integer := 256);
46 46 port (
47 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 51 apbi : in apb_slv_in_type;
50 52 apbo : out apb_slv_out_type
51 53 );
52 54 end component;
53 55
54
55 56 component Flag_Extremum is
56 57 port(
57 clk,raz : in std_logic;
58 load : in std_logic;
59 y_rdy : in std_logic;
60 full : out std_logic;
61 empty : out std_logic
58 clk,raz : in std_logic; --! Horloge et Reset gοΏ½nοΏ½ral du composant
59 load : in std_logic; --! Signal en provenance de CoreFFT
60 y_rdy : in std_logic; --! Signal en provenance de CoreFFT
61 fill : out std_logic; --! Flag, Va permettre d'autoriser l'οΏ½criture (Driver C)
62 ready : out std_logic --! Flag, Va permettre d'autoriser la lecture (Driver C)
62 63 );
63 64 end component;
64 65
65 66 --==============================================================|
66 67 --================== IP VHDL de la FFT actel ===================|
67 68 --================ non partagοΏ½ dans la VHD_Lib =================|
68 69 --==============================================================|
69 70
70 71 component CoreFFT IS
71 72 GENERIC (
72 73 LOGPTS : integer := gLOGPTS;
73 74 LOGLOGPTS : integer := gLOGLOGPTS;
74 75 WSIZE : integer := gWSIZE;
75 76 TWIDTH : integer := gTWIDTH;
76 77 DWIDTH : integer := gDWIDTH;
77 78 TDWIDTH : integer := gTDWIDTH;
78 79 RND_MODE : integer := gRND_MODE;
79 80 SCALE_MODE : integer := gSCALE_MODE;
80 81 PTS : integer := gPTS;
81 82 HALFPTS : integer := gHALFPTS;
82 83 inBuf_RWDLY : integer := gInBuf_RWDLY );
83 84 PORT (
84 85 clk,ifiStart,ifiNreset : IN std_logic;
85 86 ifiD_valid, ifiRead_y : IN std_logic;
86 87 ifiD_im, ifiD_re : IN std_logic_vector(WSIZE-1 DOWNTO 0);
87 88 ifoLoad, ifoPong : OUT std_logic;
88 89 ifoY_im, ifoY_re : OUT std_logic_vector(WSIZE-1 DOWNTO 0);
89 90 ifoY_valid, ifoY_rdy : OUT std_logic);
90 91 END component;
91 92
92 93
93 94 component actar is
94 95 port( DataA : in std_logic_vector(15 downto 0); DataB : in
95 96 std_logic_vector(15 downto 0); Mult : out
96 97 std_logic_vector(31 downto 0);Clock : in std_logic) ;
97 98 end component;
98 99
99 100 component actram is
100 101 port( DI : in std_logic_vector(31 downto 0); DO : out
101 102 std_logic_vector(31 downto 0);WRB, RDB : in std_logic;
102 WADDR : in std_logic_vector(6 downto 0); RADDR : in
103 WADDR : in std_logic_vector(6 downto 0); RADDR : in
103 104 std_logic_vector(6 downto 0);WCLOCK, RCLOCK : in
104 105 std_logic) ;
105 106 end component;
106 107
107 108 component switch IS
108 109 GENERIC ( DWIDTH : integer := 32 );
109 110 PORT (
110 111 clk, sel, validIn : IN std_logic;
111 112 inP, inQ : IN std_logic_vector(DWIDTH-1 DOWNTO 0);
112 113 outP, outQ : OUT std_logic_vector(DWIDTH-1 DOWNTO 0);
113 114 validOut : OUT std_logic);
114 115 END component;
115 116
116 117 component twid_rA IS
117 118 GENERIC (LOGPTS : integer := 8;
118 119 LOGLOGPTS : integer := 3 );
119 120 PORT (clk : IN std_logic;
120 121 timer : IN std_logic_vector(LOGPTS-2 DOWNTO 0);
121 122 stage : IN std_logic_vector(LOGLOGPTS-1 DOWNTO 0);
122 123 tA : OUT std_logic_vector(LOGPTS-2 DOWNTO 0));
123 124 END component;
124 125
125 126 component counter IS
126 127 GENERIC (
127 128 WIDTH : integer := 7;
128 129 TERMCOUNT : integer := 127 );
129 130 PORT (
130 131 clk, nGrst, rst, cntEn : IN std_logic;
131 132 tc : OUT std_logic;
132 133 Q : OUT std_logic_vector(WIDTH-1 DOWNTO 0) );
133 134 END component;
134 135
135 136
136 137 component twiddle IS
137 138 PORT (
138 139 A : IN std_logic_vector(gLOGPTS-2 DOWNTO 0);
139 140 T : OUT std_logic_vector(gTDWIDTH-1 DOWNTO 0));
140 141 END component;
141 142
142 143
143 144 end; No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now