##// END OF EJS Templates
add file
pellion -
r371:6f455bac5b99 (MINI-LFR) WFP_MS-0-1-14 JC
parent child
Show More
@@ -0,0 +1,81
1 ------------------------------------------------------------------------------
2 -- This file is a part of the LPP VHDL IP LIBRARY
3 -- Copyright (C) 2009 - 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 -- Author : Jean-christophe Pellion
20 -- Mail : jean-christophe.pellion@lpp.polytechnique.fr
21 -- jean-christophe.pellion@easii-ic.com
22 ----------------------------------------------------------------------------
23
24 LIBRARY ieee;
25 USE ieee.std_logic_1164.ALL;
26
27 ENTITY lpp_apbreg_ms_pointer IS
28
29 PORT (
30 clk : IN STD_LOGIC;
31 rstn : IN STD_LOGIC;
32
33 -- REG 0
34 reg0_status_ready_matrix : IN STD_LOGIC;
35 reg0_ready_matrix : OUT STD_LOGIC;
36 reg0_addr_matrix : IN STD_LOGIC_VECTOR(31 DOWNTO 0);
37 reg0_matrix_time : OUT STD_LOGIC_VECTOR(47 DOWNTO 0);
38
39 -- REG 1
40 reg1_status_ready_matrix : IN STD_LOGIC;
41 reg1_ready_matrix : OUT STD_LOGIC;
42 reg1_addr_matrix : IN STD_LOGIC_VECTOR(31 DOWNTO 0);
43 reg1_matrix_time : OUT STD_LOGIC_VECTOR(47 DOWNTO 0);
44
45 -- SpectralMatrix
46 ready_matrix : IN STD_LOGIC;
47 status_ready_matrix : OUT STD_LOGIC;
48 addr_matrix : OUT STD_LOGIC_VECTOR(31 DOWNTO 0);
49 matrix_time : IN STD_LOGIC_VECTOR(47 DOWNTO 0)
50 );
51
52 END lpp_apbreg_ms_pointer;
53
54 ARCHITECTURE beh OF lpp_apbreg_ms_pointer IS
55
56 SIGNAL current_reg : STD_LOGIC;
57
58 BEGIN -- beh
59
60 PROCESS (clk, rstn)
61 BEGIN -- PROCESS
62 IF rstn = '0' THEN -- asynchronous reset (active low)
63 current_reg <= '0';
64
65 ELSIF clk'EVENT AND clk = '1' THEN -- rising clock edge
66 IF ready_matrix = '1' THEN
67 current_reg <= NOT current_reg;
68 END IF;
69 END IF;
70 END PROCESS;
71
72 addr_matrix <= reg0_addr_matrix WHEN current_reg = '0' ELSE
73 reg1_addr_matrix;
74
75 status_ready_matrix <= reg0_status_ready_matrix WHEN current_reg = '0' ELSE
76 reg1_status_ready_matrix;
77
78 reg0_ready_matrix <= ready_matrix WHEN current_reg = '0' ELSE '0';
79 reg1_ready_matrix <= ready_matrix WHEN current_reg = '1' ELSE '0';
80
81 END beh; No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now