SpectralMatrix.vhd
83 lines
| 2.9 KiB
| text/x-vhdl
|
VhdlLexer
martin
|
r75 | ------------------------------------------------------------------------------ | |
-- This file is a part of the LPP VHDL IP LIBRARY | |||
-- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS | |||
-- | |||
-- This program is free software; you can redistribute it and/or modify | |||
-- it under the terms of the GNU General Public License as published by | |||
-- the Free Software Foundation; either version 3 of the License, or | |||
-- (at your option) any later version. | |||
-- | |||
-- This program is distributed in the hope that it will be useful, | |||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
-- GNU General Public License for more details. | |||
-- | |||
-- You should have received a copy of the GNU General Public License | |||
-- along with this program; if not, write to the Free Software | |||
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||
------------------------------------------------------------------------------- | |||
-- Author : Martin Morlot | |||
-- Mail : martin.morlot@lpp.polytechnique.fr | |||
------------------------------------------------------------------------------- | |||
library IEEE; | |||
use IEEE.numeric_std.all; | |||
use IEEE.std_logic_1164.all; | |||
use lpp.lpp_matrix.all; | |||
entity SpectralMatrix is | |||
generic( | |||
Input_SZ : integer := 16; | |||
Result_SZ : integer := 32); | |||
port( | |||
martin
|
r94 | clk : in std_logic; | |
reset : in std_logic; | |||
Start : in std_logic; | |||
FIFO1 : in std_logic_vector(Input_SZ-1 downto 0); | |||
FIFO2 : in std_logic_vector(Input_SZ-1 downto 0); | |||
Statu : in std_logic_vector(3 downto 0); | |||
martin
|
r103 | -- FullFIFO : in std_logic; | |
martin
|
r94 | ReadFIFO : out std_logic_vector(1 downto 0); | |
WriteFIFO : out std_logic; | |||
Result : out std_logic_vector(Result_SZ-1 downto 0) | |||
martin
|
r75 | ); | |
end SpectralMatrix; | |||
architecture ar_SpectralMatrix of SpectralMatrix is | |||
martin
|
r94 | signal RaZ : std_logic; | |
martin
|
r79 | signal Read_int : std_logic; | |
signal Take_int : std_logic; | |||
signal Received_int : std_logic; | |||
signal Valid_int : std_logic; | |||
signal Conjugate_int : std_logic; | |||
martin
|
r75 | signal Resultat : std_logic_vector(Result_SZ-1 downto 0); | |
martin
|
r77 | ||
martin
|
r75 | begin | |
martin
|
r94 | RaZ <= reset and Start; | |
martin
|
r79 | ||
IN1 : DriveInputs | |||
martin
|
r94 | port map(clk,RaZ,Read_int,Conjugate_int,Take_int,ReadFIFO); | |
martin
|
r75 | ||
CALC0 : Matrix | |||
generic map(Input_SZ) | |||
martin
|
r94 | port map(clk,RaZ,FIFO1,FIFO2,Take_int,Received_int,Conjugate_int,Valid_int,Read_int,Resultat); | |
martin
|
r75 | ||
RES0 : GetResult | |||
generic map(Result_SZ) | |||
martin
|
r103 | port map(clk,RaZ,Valid_int,Conjugate_int,Resultat,WriteFIFO,Received_int,Result);--Resultat,FullFIFO,WriteFIFO | |
martin
|
r75 | ||
martin
|
r79 | With Statu select | |
Conjugate_int <= '1' when "0001", | |||
'1' when "0011", | |||
'1' when "0110", | |||
'1' when "1010", | |||
'1' when "1111", | |||
'0' when others; | |||
martin
|
r75 | end ar_SpectralMatrix; |